@utils.arg('monitor', metavar='<monitor>', help='ID of the monitor to update metadata on.')
@utils.arg('action', metavar='<action>', choices=['set', 'unset'], help="Actions: 'set' or 'unset'")
@utils.arg('metadata', metavar='<key=value>', nargs='+', default=[], help='Metadata to set/unset (only key is necessary on unset)')
@utils.service_type('monitor')
def do_metadata(cs, args):
 monitor = _find_monitor(cs, args.monitor)
 metadata = _extract_metadata(args)
 if (args.action == 'set'):
  cs.monitors.set_metadata(monitor, metadata)
 elif (args.action == 'unset'):
  cs.monitors.delete_metadata(monitor, metadata.keys())

@ utils . arg ( 'monitor' , metavar = '<monitor>' , help = 'ID of the monitor to update metadata on.' ) @ utils . arg ( 'action' , metavar = '<action>' , choices = [ 'set' , 'unset' ] , help = "Actions: 'set' or 'unset'" ) @ utils . arg ( 'metadata' , metavar = '<key=value>' , nargs = '+' , default = [ ] , help = 'Metadata to set/unset (only key is necessary on unset)' ) @ utils . service_type ( 'monitor' ) def do_metadata ( cs , args ) : monitor = _find_monitor ( cs , args . monitor ) metadata = _extract_metadata ( args ) if ( args . action == 'set' ) : cs . monitors . set_metadata ( monitor , metadata ) elif ( args . action == 'unset' ) : cs . monitors . delete_metadata ( monitor , metadata . keys ( ) )
set or delete metadata on a monitor .