@utils.arg('<STR_LIT:id>', metavar='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>@utils.arg('<STR_LIT:state>', metavar='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>@utils.arg('<STR_LIT>', metavar='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>@utils.arg('<STR_LIT>', metavar='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>def do_alarm_update(mc, args):
fields = {}<EOL>fields['<STR_LIT>'] = args.id<EOL>if args.state.upper() not in state_types:<EOL><INDENT>errmsg = ('<STR_LIT>' +<EOL>'<STR_LIT:U+002CU+0020>'.join(state_types) + '<STR_LIT:]>')<EOL>print(errmsg)<EOL>return<EOL><DEDENT>fields['<STR_LIT:state>'] = args.state<EOL>fields['<STR_LIT>'] = args.lifecycle_state<EOL>fields['<STR_LIT>'] = args.link<EOL>try:<EOL><INDENT>alarm = mc.alarms.update(**fields)<EOL><DEDENT>except (osc_exc.ClientException, k_exc.HttpError) as he:<EOL><INDENT>raise osc_exc.CommandError('<STR_LIT>' % (he.message, he.details))<EOL><DEDENT>else:<EOL><INDENT>print(jsonutils.dumps(alarm, indent=<NUM_LIT:2>))<EOL><DEDENT>
Update the alarm state.