#NEWLINE# @ utils . arg ( '--dimensions' , metavar = '<KEY1=VALUE1,KEY2=VALUE2...>' , help = 'key value pair used to specify a metric dimension. This can be specified multiple times, or once with parameters separated by a comma. Dimensions need quoting when they contain special chars [&,(,),{,},>,<] that confuse the CLI parser.' , action = 'append' ) #NEWLINE# @ utils . arg ( '--starttime' , metavar = '<UTC_START_TIME>' , help = 'measurements >= UTC time. format: 2014-01-01T00:00:00Z. OR format: -120 (previous 120 minutes).' ) #NEWLINE# @ utils . arg ( '--endtime' , metavar = '<UTC_END_TIME>' , help = 'measurements <= UTC time. format: 2014-01-01T00:00:00Z.' ) #NEWLINE# @ utils . arg ( '--offset' , metavar = '<OFFSET LOCATION>' , help = 'The offset used to paginate the return data.' ) #NEWLINE# @ utils . arg ( '--limit' , metavar = '<RETURN LIMIT>' , help = 'The amount of data to be returned up to the API maximum limit.' ) #NEWLINE# def do_alarm_history_list( mc , args ) : #NEWLINE# #INDENT# 'List alarms state history.' #NEWLINE# fields = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if args . dimensions : #NEWLINE# #INDENT# fields [ 'dimensions' ] = utils . format_parameters ( he . dimensions ) #NEWLINE# #UNINDENT# if args . starttime : #NEWLINE# #INDENT# _translate_starttime ( args ) #NEWLINE# fields [ 'start_time' ] = args . starttime #NEWLINE# #UNINDENT# if args . endtime : #NEWLINE# #INDENT# fields [ 'end_time' ] = args . endtime #NEWLINE# #UNINDENT# if args . limit : #NEWLINE# #INDENT# fields [ 'limit' ] = args . limit #NEWLINE# #UNINDENT# if args . offset : #NEWLINE# #INDENT# fields [ 'offset' ] = args . offset #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# alarm = mc . alarms . history_list ( ** fields ) #NEWLINE# #UNINDENT# except exc . HTTPException as he : #NEWLINE# #INDENT# raise exc . CommandError ( ( 'HTTPException code=%s message=%s' % ( he . code , he . message ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# output_alarm_history ( args , alarm )