Update Network

Verb URI Description
PUT /networks/network_id Updates a network, including its mapping with the underlying infrastructure using the provider network extension attributes.

Normal Response Code: 200 OK

Error Response Code: 400 Bad Request, 401 Unauthorized, 404 Not Found, 403 Forbidden

When the provider networks extension is enabled, and the user submitting the request is authorized to see provider networks mapping, this operation allows for specifying how an existing network should be mapped on the underlying network infrastructure.

If the user submitting the request is not allowed to set provider networks attributes, a 403 Forbidden response will be returned.

As stated earlier in this chapter, the semantics of the various provider networks attribute vary with the particular plug-in employed. The following example shows how to update a network in order to map it to a flat network (such as, no vlan tag); the example refers to an OpenStack Networking deployment that uses the Open vSwitch plug-in.

 

Example 4.7. Update provider attributes for a network: JSON Request

{
 "network":
    {
      "provider:network_type": "flat",
      "provider:physical_network": "physnet_1",
      "provider:segmentation_id": null
    }
}

 

Example 4.8. Update provider attributes for a network: XML Request

<?xml version='1.0' encoding='UTF-8'?>
<network xmlns="http://openstack.org/neutron/api/v2.0"
    xmlns:neutron="http://openstack.org/neutron/api/v2.0"
    xmlns:provider="http://docs.openstack.org/ext/provider/api/v1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <provider:network_type>flat</provider:network_type>
    <provider:physical_network>physnet_1</provider:physical_network>
    <provider:segmentation_id xsi:nil="true"/>
</network>

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


loading table of contents...