• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. OpenStack Neutron APIs
  5. Subnet Pool
  6. Creating a Subnet Pool

Creating a Subnet Pool

Function

This interface is used to create a subnet pool.

URI

POST /v2.0/subnetpools

Request Message

Table 1 Request parameter

Parameter

Type

Mandatory

Description

subnetpool

dict

Yes

Specifies the subnet pool object list. For details, see Table 1.

Mandatory fields: name and prefixes

Response Message

Table 2 Response parameter

Parameter

Type

Description

subnetpool

dict

Specifies the subnet pool object list. For details, see Table 1.

Example:

Example request
POST /v2.0/subnetpools
{
    "subnetpool": {
        "name": "my-subnet-pool",
        "prefixes": [
            "192.168.0.0/16",
            "10.10.0.0/21"
        ],
        "default_prefixlen": 25,
        "min_prefixlen": 24,
        "max_prefixlen": 30,
        "shared": false
    }
}

Example response

{
    "subnetpool": {
        "address_scope_id": null,
        "default_prefixlen": 25,
        "default_quota": null,
        "description": "",
        "id": "f49a1319-423a-4ee6-ba54-1d95a4f6cc68",
        "ip_version": 4,
        "is_default": false,
        "max_prefixlen": 30,
        "min_prefixlen": 24,
        "name": "my-subnet-pool",
        "prefixes": [
            "10.10.0.0/21",
            "192.168.0.0/16"
        ],
        "project_id": "9fadcee8aa7c40cdb2114fff7d569c08",
        "revision_number": 1,
        "shared": false,
        "tenant_id": "9fadcee8aa7c40cdb2114fff7d569c08",
        "created_at": "2018-09-20T02:15:34",
        "updated_at": "2018-09-20T02:15:34"
    }
}

Status Codes

For details, see section Status Codes.