<s> from cloudkittyclient . common import utils <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> required = False , <EOL> default = None ) <EOL> def do_collector_mapping_list ( cc , args ) : <EOL> """<STR_LIT>""" <EOL> data = cc . collector . mappings . list ( collector = args . collector ) <EOL> fields = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> fields_labels = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> utils . print_list ( data , fields , fields_labels , sortby = <NUM_LIT:0> ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> required = True ) <EOL> def do_collector_mapping_get ( cc , args ) : <EOL> """<STR_LIT>""" <EOL> data = cc . collector . mappings . get ( mapping_id = args . service ) <EOL> utils . print_dict ( data . to_dict ( ) ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> required = True ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> required = True ) <EOL> def do_collector_mapping_create ( cc , args ) : <EOL> """<STR_LIT>""" <EOL> out = cc . collector . mappings . create ( service = args . service , <EOL> collector = args . collector ) <EOL> utils . print_dict ( out . to_dict ( ) ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> required = True ) <EOL> def do_collector_mapping_delete ( cc , args ) : <EOL> """<STR_LIT>""" <EOL> cc . collector . mappings . delete ( mapping_id = args . service ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> required = True ) <EOL> def do_collector_state_get ( cc , args ) : <EOL> """<STR_LIT>""" <EOL> data = cc . collector . states . get ( state_id = args . name ) <EOL> utils . print_dict ( data . to_dict ( ) ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> required = True ) <EOL> def do_collector_state_enable ( cc , args ) : <EOL> """<STR_LIT>""" <EOL> new_state = cc . collector . states . update ( name = args . name , enabled = True ) <EOL> utils . print_dict ( new_state . to_dict ( ) ) <EOL> @ utils . arg ( '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> required = True ) <EOL> def do_collector_state_disable ( cc , args ) : <EOL> """<STR_LIT>""" <EOL> new_state = cc . collector . states . update ( name = args . name , enabled = False ) <EOL> utils . print_dict ( new_state . to_dict ( ) ) </s>
