Bulk create networks

 
MethodURIDescription
POST/v2.0/networks

Creates multiple networks in a single request.

In the request body, specify a list of networks.

The bulk create operation is always atomic. Either all or no networks in the request body are created.

Normal response codes: 201

Error response codes: badRequest (400), unauthorized (401)

 Request

 

Example 3.7. Bulk create networks: JSON request

{
   "networks":[
      {
         "name":"sample_network3",
         "admin_state_up":true
      },
      {
         "name":"sample_network4",
         "admin_state_up":true
      }
   ]
}

 

Example 3.8. Bulk create networks: XML request

<?xml version="1.0" encoding="UTF-8"?>
<networks>
    <network>
        <name>sample_network_5</name>
    </network>
    <network>
        <name>sample_network_6</name>
    </network>
</networks>

 Response

 

Example 3.9. Bulk create networks: JSON response

{
   "networks":[
      {
         "status":"ACTIVE",
         "subnets":[

         ],
         "name":"sample_network3",
         "provider:physical_network":null,
         "admin_state_up":true,
         "tenant_id":"4fd44f30292945e481c7b8a0c8908869",
         "provider:network_type":"local",
         "shared":false,
         "id":"bc1a76cb-8767-4c3a-bb95-018b822f2130",
         "provider:segmentation_id":null
      },
      {
         "status":"ACTIVE",
         "subnets":[

         ],
         "name":"sample_network4",
         "provider:physical_network":null,
         "admin_state_up":true,
         "tenant_id":"4fd44f30292945e481c7b8a0c8908869",
         "provider:network_type":"local",
         "shared":false,
         "id":"af374017-c9ae-4a1d-b799-ab73111476e2",
         "provider:segmentation_id":null
      }
   ]
}

 

Example 3.10. Bulk create networks: XML response

<?xml version='1.0' encoding='UTF-8'?>
<networks xmlns="http://openstack.org/quantum/api/v2.0"
    xmlns:provider="http://docs.openstack.org/ext/provider/api/v1.0"
    xmlns:quantum="http://openstack.org/quantum/api/v2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <network>
        <status>ACTIVE</status>
        <subnets quantum:type="list"/>
        <name>sample_network_5</name>
        <provider:physical_network xsi:nil="true"/>
        <admin_state_up quantum:type="bool">True</admin_state_up>
        <tenant_id>4fd44f30292945e481c7b8a0c8908869</tenant_id>
        <provider:network_type>local</provider:network_type>
        <shared quantum:type="bool">False</shared>
        <id>1f370095-98f6-4079-be64-6d3d4a6adcc6</id>
        <provider:segmentation_id xsi:nil="true"/>
    </network>
    <network>
        <status>ACTIVE</status>
        <subnets quantum:type="list"/>
        <name>sample_network_6</name>
        <provider:physical_network xsi:nil="true"/>
        <admin_state_up quantum:type="bool">True</admin_state_up>
        <tenant_id>4fd44f30292945e481c7b8a0c8908869</tenant_id>
        <provider:network_type>local</provider:network_type>
        <shared quantum:type="bool">False</shared>
        <id>ee2d3158-3e80-4fb3-ba87-c99f515d85e7</id>
        <provider:segmentation_id xsi:nil="true"/>
    </network>
</networks>

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


loading table of contents...