Update port

 
MethodURIDescription
PUT/v2.0/ports/{port_id}

Updates a specified port.

You can update information for a port, such as its symbolic name and associated IPs. When you update IPs for a port, any previously associated IPs are removed, returned to the respective subnets allocation pools, and replaced by the IPs specified in the body for the update request. Therefore, this operation replaces the fixed_ip attribute when it is specified in the request body. If the updated IP addresses are not valid or are already in use, the operation fails and the existing IP addresses are not removed from the port.

When you update security groups for a port and the operation succeeds, any associated security groups are removed and replaced by the security groups specified in the body for the update request. Therefore, this operation replaces the security_groups attribute when you specify it in the request body. However, if the specified security groups are not valid, the operation fails and the existing security groups are not removed from the port.

Normal response codes: 200

Error response codes: badRequest (400), unauthorized (401), forbidden (403), itemNotFound (404), conflict (409)

 Request

This table shows the URI parameters for the update port request:

NameTypeDescription

{port_id}

​U​U​ID

The UUID for the port of interest to you.

 

Example 3.44. Update port: JSON request

{
   "port":{
      "network_id":"ee2d3158-3e80-4fb3-ba87-c99f515d85e7",
      "admin_state_up":true
   }
}

 Response

 

Example 3.45. Update port: JSON response

{
   "port":{
      "status":"DOWN",
      "binding:host_id":"",
      "name":"",
      "allowed_address_pairs":[

      ],
      "admin_state_up":true,
      "network_id":"ee2d3158-3e80-4fb3-ba87-c99f515d85e7",
      "tenant_id":"4fd44f30292945e481c7b8a0c8908869",
      "binding:vif_type":"unbound",
      "device_owner":"",
      "binding:capabilities":{
         "port_filter":false
      },
      "mac_address":"fa:16:3e:80:14:5b",
      "fixed_ips":[

      ],
      "id":"6f9f6319-ce4b-4267-a5f8-558d6795632d",
      "security_groups":[
         "d30c3c54-5dba-49cf-a323-48a86f078d2d"
      ],
      "device_id":""
   }
}

 

Example 3.46. Update port: XML response

<?xml version="1.0" encoding="UTF-8"?>
<port xmlns="http://openstack.org/quantum/api/v2.0"
    xmlns:binding="http://docs.openstack.org/ext/binding/api/v1.0"
    xmlns:quantum="http://openstack.org/quantum/api/v2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <status>DOWN</status>
    <binding:host_id xsi:nil="true"/>
    <name>test_port_1</name>
    <admin_state_up quantum:type="bool">True</admin_state_up>
    <network_id>a3775a7d-9f8b-4148-be81-c84bbd0837ce</network_id>
    <tenant_id>60cd4f6dbc2f491982a284e7b83b5be3</tenant_id>
    <binding:vif_type>ovs</binding:vif_type>
    <device_owner/>
    <binding:capabilities>
        <port_filter quantum:type="bool">True</port_filter>
    </binding:capabilities>
    <mac_address>fa:16:3e:c9:8d:cf</mac_address>
    <fixed_ips quantum:type="list"/>
    <id>7f0aa3f1-883a-43b2-8d1b-e85fac52b417</id>
    <security_groups>
        <security_group>99f465bc-0d7c-4142-8829-7ae0179f2fa8</security_group>
    </security_groups>
    <device_id/>
</port>

This operation does not return a response body.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...