Update port

Updates a specified port.

URI

/v2.0/ports/{port_id}

Description of the URI:

{port_id} UUID The UUID for the port.

HTTP method

PUT

Request parameter

Key Description Type Required/optional
name A symbolic name for the port. xsd:string Optional
allowed_address_pairs Allowed address pairs.

It is not possible to specify "0.0.0.0/0", which allows all communication, for ip_address.

xsd:dict Optional
admin_state_up The administrative status of the port, which is up (true) or down (false). xsd:bool Optional
fixed_ips If you specify only a subnet ID, OpenStack Networking allocates an available IP from that subnet to the port. If you specify both a subnet ID and an IP address, OpenStack Networking tries to allocate the specified address to the port.

CAUTION:
  • Do not specify this parameter when the port is associated with floating IP.
  • Do not change ports that have "network:dhcp" or "network:router_interface" as the "device_owner".

xsd:dict Optional
security_groups Security groups. Specify one or more security group IDs. csapi:uuid Optional
CAUTION:
For a port for use with the Windows virtual server for SAP service or the physical server for SAP HANA service, it is possible to specify the IP address specified in gateway_ip and allocation_pools of the subnet related to the network ID for fixed_ips.

Example request


{
    "port": {
        "name": "private-port",
        "admin_state_up": true
    }
}
     

Response status

Status code Description
200 Normal response codes
badRequest (400) Error response codes
unauthorized (401) Error response codes
forbidden (403) Error response codes
itemNotFound (404) Error response codes
conflict (409) Error response codes

Response body (normal status)


{
    "port": {
        "status": "DOWN",
        "name": "private-port",
        "allowed_address_pairs": [],
        "admin_state_up": true,
        "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7",
        "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa",
        "binding:vnic_type": "normal",
        "device_owner": "",
        "mac_address": "fa:16:3e:c9:cb:f0",
        "fixed_ips": [
            {
                "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2",
                "ip_address": "10.0.0.2"
            }
        ],
        "id": "65c0ee9f-d634-4522-8954-51021b570b0d",
        "security_groups": [
            "f0ac4394-7e4a-4409-9701-ba8be283dbc3"
        ],
        "device_id": "",
        "availability_zone": "AZ1"
    }
}
     

Description of response body (normal status)

Item Description
status The port status. Value is ACTIVE or DOWN.
name The port name.
allowed_address_pairs Allowed address pairs.
admin_state_up The administrative state of the router, which is up (true) or down (false).
network_id The ID of the attached network.
tenant_id The ID of the project who owns the network.
extra_dhcp_opts Extra DHCP options.
device_owner The ID of the entity that uses this port. For example, a dhcp agent.
mac_address The MAC address of the port.
fixed_ips IP addresses for the port. Includes the IP address and subnet ID.
id The ID of the port.
security_groups The IDs of any attached security groups.
device_id The ID of the device that uses this port. For example, a virtual server.
binding:vnic_type This value is one of the following:
  • normal(virtual nic)
  • direct(pci passthrough)
  • macvtap(virtual interface with a tap-like software interface)
availability_zone The Availability Zone name