Description

Request URL

Network API v2.0

POST /v2.0/subnets

Request Paramters

Parameter Value Style Description
X-Auth-Token User Token header
network_id Network ID plain Specify network_id for local network
cidr The CIDR plain Only private address is allowed. Bitmask can be specified from 21 to 27.

Request Json (when creating singular subnet)

{
    "subnet": {
        "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
        "cidr": "192.168.199.0/24"
    }
}

Normal response codes

201

Example

curl -i -X POST \
-H "Accept: application/json" \
-H "X-Auth-Token: 0925897a3d4543218ff0dcd2bb378a8e" \
-d '{"subnet": {"network_id": "df980e5d-dc69-4744-a13b-98731565b4ab", "cidr": "192.168.1.0/24"}}' \
https://networking.tyo1.cloud.z.com/v2.0/subnets
HTTP/1.1 201 Created
Server: openresty/1.7.10.1
Date: Fri, 08 May 2015 12:02:33 GMT
Content-Type: application/json
Content-Length: 412
Connection: keep-alive

{
  "subnet": {
    "name": "local-192-168-1-0-24",
    "enable_dhcp": false,
    "network_id": "df980e5d-dc69-4744-a13b-98731565b4ab",
    "tenant_id": "22394afc818d471ca2f0308c06ae7460",
    "dns_nameservers": [],
    "gateway_ip": null,
    "ipv6_ra_mode": null,
    "allocation_pools": [
      {
        "start": "192.168.1.1",
        "end": "192.168.1.254"
      }
    ],
    "host_routes": [],
    "ip_version": 4,
    "ipv6_address_mode": null,
    "cidr": "192.168.1.0/24",
    "id": "96a34090-39fc-4a13-8a6b-e85644288039"
  }
}