This operation requires a request body.
This operation returns a response body.
This operation enables you to create several subnets in a single request. Specify a list of subnets in the request body, as shown in the following example:
Example 4.21. Bulk Create Subnets: JSON Request
POST /v2.0/subnets Content-Type: application/json Accept: application/json
{ "subnets": [ { "cidr": "192.168.199.0/24", "ip_version": 4, "network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406" }, { "cidr": "10.56.4.0/22", "ip_version": 4, "network_id": "64239a54-dcc4-4b39-920b-b37c2144effa" } ] }
Example 4.22. Bulk Create Subnets: JSON Response
HTTP/1.1 201 OK Content-Type: application/json; charset=UTF-8
{ "subnets": [ { "allocation_pools": [ { "end": "192.168.199.254", "start": "192.168.199.2" } ], "cidr": "192.168.199.0/24", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "192.168.199.1", "host_routes": [], "id": "0468a7a7-290d-4127-aedd-6c9449775a24", "ip_version": 4, "name": "", "network_id": "e6031bc2-901a-4c66-82da-f4c32ed89406", "tenant_id": "d19231fc08ec4bc4829b668040d34512" }, { "allocation_pools": [ { "end": "10.56.7.254", "start": "10.56.4.2" } ], "cidr": "10.56.4.0/22", "dns_nameservers": [], "enable_dhcp": true, "gateway_ip": "10.56.4.1", "host_routes": [], "id": "b0e7435c-1512-45fb-aa9e-9a7c5932fb30", "ip_version": 4, "name": "", "network_id": "64239a54-dcc4-4b39-920b-b37c2144effa", "tenant_id": "d19231fc08ec4bc4829b668040d34512" } ] }
The bulk create operation is always atomic. Either all subnets or no subnets in the request body are created.