#NEWLINE# @ cliutils . arg ( '--detail' , dest = 'detail' , action = 'store_true' , default = False , help = 'Show detailed information about the ports.' ) #NEWLINE# @ cliutils . arg ( '--limit' , metavar = '<limit>' , type = int , help = 'Maximum number of ports to return per request, 0 for no limit. Default is the maximum number used by the Ironic API Service.' ) #NEWLINE# @ cliutils . arg ( '--marker' , metavar = '<port>' , help = 'Port UUID (for example, of the last port in the list from a previous request). Returns the list of ports after this UUID.' ) #NEWLINE# @ cliutils . arg ( '--sort-key' , metavar = '<field>' , help = 'Port field that will be used for sorting.' ) #NEWLINE# @ cliutils . arg ( '--sort-dir' , metavar = '<direction>' , choices = [ 'asc' , 'desc' ] , help = 'Sort direction: "asc" (the default) or "desc".' ) #NEWLINE# @ cliutils . arg ( 'node' , metavar = '<node>' , help = 'Name or UUID of the node.' ) #NEWLINE# @ cliutils . arg ( '--fields' , nargs = '+' , dest = 'fields' , metavar = '<field>' , action = 'append' , default = [ ] , help = "One or more port fields. Only these fields will be fetched from the server. Can not be used when '--detail' is specified." ) #NEWLINE# def do_node_port_list( cc , args ) : #NEWLINE# #INDENT# 'List the ports associated with a node.' #NEWLINE# if args . detail : #NEWLINE# #INDENT# fields = res_fields . PORT_DETAILED_RESOURCE . fields #NEWLINE# field_labels = res_fields . PORT_DETAILED_RESOURCE . labels #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if args . fields : #NEWLINE# #INDENT# utils . check_for_invalid_fields ( args . fields [ 0 ] , res_fields . PORT_DETAILED_RESOURCE . fields ) #NEWLINE# resource = res_fields . Resource ( args . fields [ 0 ] ) #NEWLINE# fields = resource . fields #NEWLINE# field_labels = resource . labels #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fields = res_fields . PORT_RESOURCE . fields #NEWLINE# field_labels = res_fields . PORT_RESOURCE . labels #NEWLINE# #UNINDENT# #UNINDENT# sort_fields = res_fields . PORT_DETAILED_RESOURCE . sort_fields #NEWLINE# sort_field_labels = res_fields . PORT_DETAILED_RESOURCE . sort_labels #NEWLINE# params = utils . common_params_for_list ( args , sort_fields , sort_field_labels ) #NEWLINE# ports = cc . node . list_ports ( args . node , ** params ) #NEWLINE# cliutils . print_list ( ports , fields , field_labels = cc , sortby_index = None , json_flag = args . json )