• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. OpenStack Neutron APIs
  5. Port
  6. Port API Overview

Port API Overview

Object Introduction

This interface is used to manage and perform operations on ports, including querying ports, creating a port, querying a specified port, deleting a port, and updating a port.

Object Model

Table 1 port object

Attribute

Mandatory

Type

CRUD

Default Value

Constraint

Description

id

Yes

Uuid-Str

R

Automatically generated

N/A

Specifies the port ID. A maximum of 255 characters are allowed.

This parameter is not mandatory when you query ports.

name

No

String(255)

CRU

None

N/A

Specifies the port name.

network_id

No

Uuid-Str

CR

N/A

The value must be an existing network ID.

Specifies the ID of the network to which the port belongs.

admin_state_up

No

Bool

CRU

true

The value can only be true or false.

Specifies the administrative status.

The value can only be true.

mac_address

No

String(32)

R

Automatically generated

The value must be a valid MAC address. The value range is fa:16:3e:xx:xx:xx.

Specifies the port MAC address. For example, "mac_address": "fa:16:3e:9e:ff:55".

This value can only be dynamically assigned by the system.

fixed_ips

No

List(fixed_ips)

CRU

Automatically generated from the address pool

When device_owner is neutron: VIP_PORT, you can specify only one fixed IP address or do not specify this parameter.

Specifies the port IP address. For details, see the fixed_ips object. For example, the value is "fixed_ips": [{"subnet_id": "4dc70db6-cb7f-4200-9790-a6a910776bba", "ip_address": "192.169.25.79"}].

device_id

No

String(255)

CRUD

None

N/A

Specifies the device ID.

This value is automatically maintained by the system and cannot be set or updated manually. The port with this field specified cannot be deleted.

device_owner

No

String(255)

CRD

None

N/A

Specifies the DHCP, router or Nova to which a device belongs.

This parameter value cannot be updated. You can only set device_owner to neutron:VIP_PORT for a virtual IP address port during port creation. If this parameter of a port is not left blank, the port can only be deleted when this parameter value is neutron:VIP_PORT.

The port with this field specified cannot be deleted.

tenant_id

No

String(255)

R

N/A

N/A

Specifies the project ID.

status

No

String(16)

R

N/A

The value can only be ACTIVE, BUILD, or DOWN.

Specifies the port status. The value can be ACTIVE, BUILD, or DOWN.

The status of a HANA SR-IOV VM port is always DOWN.

security_groups

No

List(String)

CRUD

N/A

Security group UUID or left blank

Specifies the UUID of the security group, for example, "security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"]. This is an extended attribute.

This parameter cannot be left blank.

allowed_address_pairs

No

List(allow_address_pair)

CRU

N/A

N/A

Specifies the IP and MAC address pair. For details, see the allow_address_pair parameters table. This is an extended attribute.

Instructions:

  • The IP address cannot be 0.0.0.0.
  • Configure an independent security group for the port if a large CIDR block (subnet mask less than 24) is configured for parameter allowed_address_pairs.
  • In the hardware SDN networking plan, the ip_address attribute value cannot be in CIDR format.
  • To assign a virtual IP address to an ECS, the IP address configured in allowed_address_pairs must be an existing ECS NIC IP address. Otherwise, the virtual IP address cannot be used for communication.

extra_dhcp_opts

No

List(extra_dhcp_opt)

CRU

N/A

N/A

Specifies the extended DHCP option. This is an extended attribute.

binding:vif_details

No

Dict

R

N/A

N/A

Specifies the VIF details. Parameter ovs_hybrid_plug specifies whether the OVS/bridge hybrid mode is used.

binding:profile

No

Dict

CR

None

N/A

Specifies the user-defined settings. This is an extended attribute.

Instructions:

  • The internal_elb field is in boolean type and is available to common tenants. Set the value of this parameter to true only when you assign a virtual IP address to an internal network load balancer. Common tenants do not have the permission to change the value of this field, which is maintained by the system.

    Example:

    {"internal_elb": true}

  • The disable_security_groups field is in boolean type and is available to common tenants. The default value is false. In high-performance communication scenarios, you can set the parameter value to true, which makes this parameter to be available to common tenants. You can specify this parameter when creating a port. Currently, the value of this parameter can only be set to true.

    Example:

    {"disable_security_groups": true },

    Currently, the value can only be set to true. When the value is set to true, the FWaaS function does not take effect.

binding:vnic_type

No

String(64)

R

normal

normal

Specifies the type of the bound vNIC.

normal: Softswitch

project_id

No

String(64)

R

N/A

N/A

Specifies the project ID of a resource.

created_at

No

String(64)

R

Automatically generated

N/A

Specifies the time when the resource was created.

updated_at

No

String(64)

R

Automatically generated

N/A

Specifies the time when the resource was updated.

Table 2 fixed_ip object

Attribute

Type

CRUD

Default Value

Constraint

Description

subnet_id

Uuid-Str

CRU

Automatically generated

The value must be an existing subnet ID.

Specifies the ID of the subnet to which the port belongs.

This parameter cannot be updated.

ip_address

String(64)

CRU

Automatically generated

The value must be a valid IP address.

Specifies the port IP address.

This parameter cannot be updated.

Table 3 allow_address_pair object

Attribute

Type

CRUD

Default Value

Constraint

Description

ip_address

String(64)

CRU

None

This parameter cannot be left blank.

Specifies the IP address.

This parameter cannot be 0.0.0.0.

mac_address

String(32)

CRU

None

N/A

Specifies the MAC address.

Table 4 extra_dhcp_opt object

Attribute

Type

CRUD

Default Value

Constraint

Description

opt_name

String(64)

CRU

None

N/A

Specifies the option name.

opt_value

String(255)

CRU

None

N/A

Specifies the option value.