• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Port
  6. Update port

Update port

Function Description

This interface is used to update port information.

Interface Format

Method

URI

Description

PUT

/v2.0/ports/{port_id}

Updates port information.

Restrictions

N/A

Extension Description

N/A

Request Parameter

Parameter

Type

Mandatory

Description

ports

Dict

Yes

Specifies the port information. For details, see the Ports object model.

This parameter has no mandatory fields. You must specify at least one attribute when updating the subnet.

Response Parameter

Parameter

Type

Mandatory

Description

ports

Dict

Yes

Specifies the port information. For details, see the Ports object model.

Request Example

PUT /v2.0/ports/ 7a9a954a-eb41-4954-a300-11ab17a361a2
{
    "port": {
        "name": "test2"
    }
}

Response Example

{
    "port": {
        "admin_state_up": false, 
        "allowed_address_pairs": [], 
        "binding:vnic_type": "normal", 
        "device_id": "6c9298ec8c874f7f99688489ab65f903", 
        "device_owner": "test", 
        "port_security_enabled":true,
        "extra_dhcp_opts": [], 
        "fixed_ips": [
            {
                "ip_address": "10.1.0.198", 
                "subnet_id": "b3ac1347-63f2-4e82-b853-3d86416a0db5"
            }
        ], 
        "id": "7a9a954a-eb41-4954-a300-11ab17a361a2", 
        "mac_address": "fa:16:3e:7f:60:cb", 
        "name": "test2", 
        "network_id": "a54e1b19-ce78-4b7e-b28b-d2d716cdc161", 
        "security_groups": [
            "ef69bc60-2f4b-4f97-b95b-e3b68df0c0b2"
        ], 
        "status": "BUILD", 
        "tenant_id": "6c9298ec8c874f7f99688489ab65f90e"
    }
}

Error Code

See section Return Code Processing.