@utils.arg('<STR_LIT:id>', metavar='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>@utils.arg('<STR_LIT:name>', metavar='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>@utils.arg('<STR_LIT:description>', 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>'<STR_LIT>')<EOL>@utils.arg('<STR_LIT>', metavar='<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>')<EOL>@utils.arg('<STR_LIT>',<EOL>metavar='<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>'<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>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>@utils.arg('<STR_LIT>', metavar='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>def do_alarm_definition_update(mc, args):
fields = {}<EOL>fields['<STR_LIT>'] = args.id<EOL>fields['<STR_LIT:name>'] = args.name<EOL>fields['<STR_LIT:description>'] = args.description<EOL>fields['<STR_LIT>'] = args.expression<EOL>fields['<STR_LIT>'] = _arg_split_patch_update(args.alarm_actions)<EOL>fields['<STR_LIT>'] = _arg_split_patch_update(args.ok_actions)<EOL>fields['<STR_LIT>'] = _arg_split_patch_update(args.undetermined_actions)<EOL>if args.actions_enabled not in enabled_types:<EOL><INDENT>errmsg = ('<STR_LIT>' +<EOL>'<STR_LIT:U+002CU+0020>'.join(enabled_types) + '<STR_LIT:]>')<EOL>print(errmsg)<EOL>return<EOL><DEDENT>fields['<STR_LIT>'] = args.actions_enabled in ['<STR_LIT:true>', '<STR_LIT:True>']<EOL>fields['<STR_LIT>'] = _arg_split_patch_update(args.match_by)<EOL>if not _validate_severity(args.severity):<EOL><INDENT>return<EOL><DEDENT>fields['<STR_LIT>'] = args.severity<EOL>try:<EOL><INDENT>alarm = mc.alarm_definitions.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 definition.