diff --git a/nuage_neutronclient/net_topology.py b/nuage_neutronclient/net_topology.py index cc994f0..db8035c 100644 --- a/nuage_neutronclient/net_topology.py +++ b/nuage_neutronclient/net_topology.py @@ -41,23 +41,31 @@ def add_known_arguments(self, parser): dest='switch_info', help=_('Name of the switch device')) parser.add_argument( - '--port-id', - dest='port_id', - help=_('Port mnemonic of phys port of the switch')) + '--port-name', + dest='port_name', + help=_('Physical port name of port on the switch')) + parser.add_argument( + '--port-desc', + dest='port_desc', + help=_('Port description to put in VSD')) parser.add_argument( '--host-id', help=_('Nova compute host id. hypervisor_hostname')) parser.add_argument( '--pci-slot', dest='pci_slot', - help=_('PCI id of the VF device.')) + help=_('Optional PCI id of a VF device on the given host')) + parser.add_argument( + '--physnet', + dest='physnet', + help=_('Physical network to which the NIC is connected')) return parser def args2body(self, args): body = {} - attributes = ['switch_id', 'switch_info', 'port_id', - 'host_id', 'pci_slot'] + attributes = ['switch_id', 'switch_info', 'port_name', 'port_desc', + 'host_id', 'pci_slot', 'physnet'] gw_mappingV20.update_dict(args, body, attributes) return {'switchport_mapping': body} @@ -67,7 +75,7 @@ class SwitchportMappingList(extension.ClientExtensionList, SwitchportMapping): """List switchport mappings.""" shell_command = 'nuage-switchport-mapping-list' - list_columns = ['id', 'switch_id', 'port_id', 'host_id', 'pci_slot'] + list_columns = ['id', 'switch_id', 'port_uuid', 'host_id', 'physnet'] pagination_support = True sorting_support = True @@ -101,21 +109,28 @@ def add_known_arguments(self, parser): dest='switch_info', help=_('Name of the gateway device')) parser.add_argument( - '--port_id', - dest='port_id', - help=_('Port mnemoniq of phys port of gateway')) + '--port-name', + dest='port_name', + help=_('Physical port name of gateway port')) + parser.add_argument( + '--port-desc', + dest='port_desc', + help=_('Port description to put in VSD')) parser.add_argument( '--host-id', help=_('Nova compute host id. hypervisor_hostname')) parser.add_argument( '--pci-slot', - dest='pci_slot', - help=_('PCI id of the device.')) + help=_('Optional PCI slot of a VF on the given host')) + parser.add_argument( + '--physnet', + dest='physnet', + help=_('Physical network to which the NIC is connected.')) def args2body(self, args): body = {} - attributes = ['switch_id', 'switch_info', 'port_id', - 'host_id', 'pci_slot'] + attributes = ['switch_id', 'switch_info', 'port_name', 'port_desc', + 'host_id', 'pci_slot', 'physnet'] gw_mappingV20.update_dict(args, body, attributes) return {'switchport_mapping': body} diff --git a/nuage_neutronclient/osc/v2/nuage_switchport_mapping.py b/nuage_neutronclient/osc/v2/nuage_switchport_mapping.py index 0e2736e..b8327bf 100644 --- a/nuage_neutronclient/osc/v2/nuage_switchport_mapping.py +++ b/nuage_neutronclient/osc/v2/nuage_switchport_mapping.py @@ -27,16 +27,14 @@ RESOURCE_NAME = 'switchport_mapping' RESOURCE_NAME_PLURAL = 'switchport_mappings' - _attr_map = (('id', 'ID', column_util.LIST_BOTH), ('switch_id', 'Switch ID', column_util.LIST_BOTH), ('switch_info', 'Switch Info', column_util.LIST_BOTH), - ('port_id', 'Port ID', column_util.LIST_BOTH), - ('host_id', 'Host ID', column_util.LIST_BOTH), - ('pci_slot', 'PCI slot', column_util.LIST_BOTH), + # ('port_name', 'Port Name', column_util.LIST_BOTH), + ('physnet', 'Physical Network', column_util.LIST_BOTH), + ('host_id', 'Host ID[:PCI slot]', column_util.LIST_BOTH), ('port_uuid', 'Port UUID', column_util.LIST_BOTH)) - def add_arguments_for_create_update(parser, is_create): parser.add_argument( '--switch-id', @@ -49,26 +47,35 @@ def add_arguments_for_create_update(parser, is_create): help=_('Name of the switch device'), required=False) parser.add_argument( - '--port-id', - dest='port_id', - help=_('Name of the port of the switch'), + '--port-name', + dest='port_name', + help=_('Physical port name of the switch port'), required=is_create) + parser.add_argument( + '--port-desc', + dest='port_desc', + help=_('Port description to put in VSD'), + required=False) parser.add_argument( '--host-id', help=_('Nova compute host id, hypervisor_hostname'), required=is_create) parser.add_argument( '--pci-slot', - dest='pci_slot', - help=_('PCI id of the VF device.'), + help=_('Optional PCI slot of a VF on given host'), + required=False) + parser.add_argument( + '--physnet', + dest='physnet', + help=_('Physical network for the given NIC.'), required=is_create) def get_body_update_create(parsed_args): body = {RESOURCE_NAME: {}} update_dict(parsed_args, body[RESOURCE_NAME], - ('switch_id', 'switch_info', 'port_id', - 'host_id', 'pci_slot')) + ('switch_id', 'switch_info', 'port_name', 'port_desc', + 'host_id', 'pci_slot', 'physnet')) return body