Ports
1. ports()
Get the list of Port
Parameters:
| Name | Type | Description |
|---|---|---|
| id | string | could be None if you need the whole list |
Return value: Port List
Return value example::
istack/network/v2/port Port
status : DOWN
binding:host_id :
allowed_address_pairs : []
extra_dhcp_opts : []
dns_assignment : [{u'hostname': u'host-10-10-10-10', u'ip_address': u'10.10.10.10', u'fqdn': u'host-10-10-10-10.openstacklocal.'}]
device_owner :
binding:profile : {}
fixed_ips : [{u'subnet_id': u'687b4768-378d-48e1-a479-7de28ff12963', u'ip_address': u'10.10.10.10'}]
id : f66e2d87-99e0-437a-b1fd-59c45071b3fb
security_groups : [u'80756594-8e78-4155-8f3a-492468ee0392']
device_id :
name : 1471874647050
admin_state_up : True
network_id : 0a5cb1b7-3d0f-46e0-8744-d805c8f271e2
dns_name :
binding:vif_details : {}
binding:vnic_type : normal
binding:vif_type : unbound
tenant_id : cde9cbf5a7f1401a9389c84ba98bdcf6
mac_address : fa:16:3e:f5:94:a4
2. create_port(**attrs)
Create a port instance
Parameters:
| Name | Type | Description |
|---|---|---|
| network_id | string | uuid of the network |
| name | string | name of the port |
| admin_state_up | Boolean | The administrative state of the resource, which is up (true) or down (false). |
| tenant_id | string | the ID of the tenant who owns the resource |
Parameter Example:
port = self.cloud.network.create_port(
network_id="50ff7951-38a8-4b93-bda1-173d621d7317",
name="Test007",
admin_state_up=True
)
Return value: Port Object
Return value example::
istack/network/v2/port Port
status : DOWN
binding:host_id :
allowed_address_pairs : []
extra_dhcp_opts : []
dns_assignment : [{u'hostname': u'host-10-10-10-10', u'ip_address': u'10.10.10.10', u'fqdn': u'host-10-10-10-10.openstacklocal.'}]
device_owner :
binding:profile : {}
fixed_ips : [{u'subnet_id': u'687b4768-378d-48e1-a479-7de28ff12963', u'ip_address': u'10.10.10.10'}]
id : f66e2d87-99e0-437a-b1fd-59c45071b3fb
security_groups : [u'80756594-8e78-4155-8f3a-492468ee0392']
device_id :
name : 1471874647050
admin_state_up : True
network_id : 0a5cb1b7-3d0f-46e0-8744-d805c8f271e2
dns_name :
binding:vif_details : {}
binding:vnic_type : normal
binding:vif_type : unbound
tenant_id : cde9cbf5a7f1401a9389c84ba98bdcf6
mac_address : fa:16:3e:f5:94:a4
3. update_port(port, **attrs)
Update a port instance
Parameters: Port Instance must contains at least the id of the port
| Name | Type | Description |
|---|---|---|
| opt_value (Optional) | string | The extra DHCP option value. |
| name | string | Human-readable name of the resource. |
| allowed_address_pairs (Optional) | array | A set of zero or more allowed address pairs. An address pair contains an IP address and MAC address. |
| admin_state_up | boolean | The administrative state of the resource, which is up (true) or down (false). |
| network_id | string | The UUID of the network. |
| fixed_ips (Optional) | array | If you specify only a subnet UUID, OpenStack Networking allocates an available IP from that subnet to the port. If you specify both a subnet UUID and an IP address, OpenStack Networking tries to allocate the address to the port. |
| opt_name (Optional) | string | The extra DHCP option name. |
| subnet_id (Optional) | string | If you specify only a subnet UUID, OpenStack Networking allocates an available IP from that subnet to the port. If you specify both a subnet UUID and an IP address, OpenStack Networking tries to allocate the address to the port. |
| device_owner (Optional) | string | The UUID of the entity that uses this port. For example, a DHCP agent. |
| tenant_id | string | The ID of the tenant who owns the resource. |
| mac_address (Optional) | string | The MAC address of an allowed address pair. |
| ip_address (Optional) | string | The IP address of an allowed address pair. |
Return value: Port Object
Return value example::
istack/network/v2/port Port
status : DOWN
binding:host_id :
allowed_address_pairs : []
extra_dhcp_opts : []
dns_assignment : [{u'hostname': u'host-10-10-10-10', u'ip_address': u'10.10.10.10', u'fqdn': u'host-10-10-10-10.openstacklocal.'}]
device_owner :
binding:profile : {}
fixed_ips : [{u'subnet_id': u'687b4768-378d-48e1-a479-7de28ff12963', u'ip_address': u'10.10.10.10'}]
id : f66e2d87-99e0-437a-b1fd-59c45071b3fb
security_groups : [u'80756594-8e78-4155-8f3a-492468ee0392']
device_id :
name : 1471874647050
admin_state_up : True
network_id : 0a5cb1b7-3d0f-46e0-8744-d805c8f271e2
dns_name :
binding:vif_details : {}
binding:vnic_type : normal
binding:vif_type : unbound
tenant_id : cde9cbf5a7f1401a9389c84ba98bdcf6
mac_address : fa:16:3e:f5:94:a4
4. delete_port(port, **attrs)
Delete a port instance
Parameters:
| Name | Type | Description |
|---|---|---|
| id | String | specified in the port instance |
Return value: None