@@ -267,11 +267,6 @@ def _wrapper(func):
267
267
metavar = '<Webhook URL>' , action = 'append' , default = None ,
268
268
help = ('URL to invoke when state transitions to unkown. '
269
269
'May be used multiple times.' ))
270
- @utils .arg ('--repeat-actions' , dest = 'repeat_actions' ,
271
- metavar = '{True|False}' , type = utils .string_to_bool ,
272
- default = False ,
273
- help = ('True if actions should be repeatedly notified '
274
- 'while alarm remains in target state' ))
275
270
@functools .wraps (func )
276
271
def _wrapped (* args , ** kwargs ):
277
272
return func (* args , ** kwargs )
@@ -296,6 +291,11 @@ def _wrapped(*args, **kwargs):
296
291
metavar = '<Matching Metadata>' , action = 'append' , default = None ,
297
292
help = ('A meter should match this resource metadata (key=value) '
298
293
'additionally to the meter_name' ))
294
+ @utils .arg ('--repeat-actions' , dest = 'repeat_actions' ,
295
+ metavar = '{True|False}' , type = utils .string_to_bool ,
296
+ default = False ,
297
+ help = ('True if actions should be repeatedly notified '
298
+ 'while alarm remains in target state' ))
299
299
def do_alarm_create (cc , args = {}):
300
300
'''Create a new alarm (Deprecated).'''
301
301
fields = dict (filter (lambda x : not (x [1 ] is None ), vars (args ).items ()))
@@ -327,6 +327,11 @@ def do_alarm_create(cc, args={}):
327
327
dest = 'threshold_rule/query' ,
328
328
help = 'The query to find the data for computing statistics '
329
329
'(key[op]value; list.)' )
330
+ @utils .arg ('--repeat-actions' , dest = 'repeat_actions' ,
331
+ metavar = '{True|False}' , type = utils .string_to_bool ,
332
+ default = False ,
333
+ help = ('True if actions should be repeatedly notified '
334
+ 'while alarm remains in target state' ))
330
335
def do_alarm_threshold_create (cc , args = {}):
331
336
'''Create a new alarm based on computed statistics.'''
332
337
fields = dict (filter (lambda x : not (x [1 ] is None ), vars (args ).items ()))
@@ -347,6 +352,11 @@ def do_alarm_threshold_create(cc, args={}):
347
352
dest = 'combination_rule/operator' ,
348
353
help = 'Operator to compare with, one of: ' + str (
349
354
ALARM_COMBINATION_OPERATORS ))
355
+ @utils .arg ('--repeat-actions' , dest = 'repeat_actions' ,
356
+ metavar = '{True|False}' , type = utils .string_to_bool ,
357
+ default = False ,
358
+ help = ('True if actions should be repeatedly notified '
359
+ 'while alarm remains in target state' ))
350
360
def do_alarm_combination_create (cc , args = {}):
351
361
'''Create a new alarm based on state of other alarms.'''
352
362
fields = dict (filter (lambda x : not (x [1 ] is None ), vars (args ).items ()))
@@ -375,6 +385,10 @@ def do_alarm_combination_create(cc, args={}):
375
385
metavar = '<Matching Metadata>' , action = 'append' , default = None ,
376
386
help = ('A meter should match this resource metadata (key=value) '
377
387
'additionally to the meter_name' ))
388
+ @utils .arg ('--repeat-actions' , dest = 'repeat_actions' ,
389
+ metavar = '{True|False}' , type = utils .string_to_bool ,
390
+ help = ('True if actions should be repeatedly notified '
391
+ 'while alarm remains in target state' ))
378
392
def do_alarm_update (cc , args = {}):
379
393
'''Update an existing alarm.'''
380
394
fields = dict (filter (lambda x : not (x [1 ] is None ), vars (args ).items ()))
@@ -412,6 +426,10 @@ def do_alarm_update(cc, args={}):
412
426
dest = 'threshold_rule/query' ,
413
427
help = 'The query to find the data for computing statistics '
414
428
'(key[op]value; list.)' )
429
+ @utils .arg ('--repeat-actions' , dest = 'repeat_actions' ,
430
+ metavar = '{True|False}' , type = utils .string_to_bool ,
431
+ help = ('True if actions should be repeatedly notified '
432
+ 'while alarm remains in target state' ))
415
433
def do_alarm_threshold_update (cc , args = {}):
416
434
'''Update an existing alarm based on computed statistics.'''
417
435
fields = dict (filter (lambda x : not (x [1 ] is None ), vars (args ).items ()))
@@ -438,6 +456,10 @@ def do_alarm_threshold_update(cc, args={}):
438
456
dest = 'combination_rule/operator' ,
439
457
help = 'Operator to compare with, one of: ' + str (
440
458
ALARM_COMBINATION_OPERATORS ))
459
+ @utils .arg ('--repeat-actions' , dest = 'repeat_actions' ,
460
+ metavar = '{True|False}' , type = utils .string_to_bool ,
461
+ help = ('True if actions should be repeatedly notified '
462
+ 'while alarm remains in target state' ))
441
463
def do_alarm_combination_update (cc , args = {}):
442
464
'''Update an existing alarm based on state of other alarms.'''
443
465
fields = dict (filter (lambda x : not (x [1 ] is None ), vars (args ).items ()))
0 commit comments