Create Network

Verb URI Description
POST /networks Creates a new network and explicitly specify attributes with the underlying infrastructure using the provider network extension attributes.

Normal Response Code: 200 OK

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

When the provider networks extension is enabled, and the user submitting the request is authorized to set provider networks mapping, this operation allows for specifying how a new 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 create a network mapped to a specific vlan tag (the example refers to an OpenStack Networking deployment which uses the Open vSwitch plug-in).

 

Example 4.5. Create Network with provider attributes: JSON Request

{
 "network":
    {
      "name": "net-name",
      "admin_state_up": true,
      "provider:network_type": "vlan",
      "provider:physical_network": "physnet_1",
      "provider:segmentation_id": 201
    }
}

 

Example 4.6. Create Network with provider attributes: 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">
    <name>net-name</name>
    <admin_state_up neutron:type="bool">True</admin_state_up>
    <provider:network_type>vlan</provider:network_type>
    <provider:physical_network>physnet_1</provider:physical_network>
    <provider:segmentation_id neutron:type="int">201</provider:segmentation_id>
</network>

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


loading table of contents...