Subnets

Network subnet management operations

List subnets

get
/v2.0/subnets

Lists subnets to which the project has access.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Query parameters
network_idstringOptional

Filter the list result by the network ID.

idstringOptional

Filter the list result by the ID of the resource.

namestringOptional

Filter the list result by the human-readable name of the resource.

project_idstringOptional

Filter the list result by the ID of the project that owns the resource.

tenant_idstringOptional

Filter the list result by the ID of the project that owns the resource.

fieldsstringOptional

The fields that you want the server to return. If no fields are specified, all fields are returned.

sort_dirstring · enumOptional

Sort direction. A valid value is asc (ascending) or desc (descending).

Possible values:
sort_keystringOptional

Sorts by a resource attribute.

tagsstringOptional

A list of tags to filter the list result by. Resources that match all tags in this list will be returned.

tags-anystringOptional

A list of tags to filter the list result by. Resources that match any tag in this list will be returned.

not-tagsstringOptional

A list of tags to filter the list result by. Resources that match all tags in this list will be excluded.

not-tags-anystringOptional

A list of tags to filter the list result by. Resources that match any tag in this list will be excluded.

Responses
200

Successful operation

application/json
get
/v2.0/subnets
GET /v2.0/v2.0/subnets HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "subnets": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "network_id": "123e4567-e89b-12d3-a456-426614174000",
      "ip_version": 4,
      "cidr": "text",
      "gateway_ip": "text",
      "dhcp_enabled": true,
      "dns_nameservers": [
        "text"
      ],
      "allocation_pools": [
        {
          "start": "text",
          "end": "text"
        }
      ],
      "host_routes": [
        {
          "destination": "text",
          "nexthop": "text"
        }
      ],
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
      "ipv6_address_mode": "slaac",
      "ipv6_ra_mode": "slaac",
      "subnetpool_id": "123e4567-e89b-12d3-a456-426614174000",
      "tags": [
        "text"
      ],
      "revision_number": 1,
      "created_at": "2025-11-28T20:22:24.128Z",
      "updated_at": "2025-11-28T20:22:24.128Z"
    }
  ]
}

Create subnet

post
/v2.0/subnets

Creates a subnet.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Body
Responses
post
/v2.0/subnets
POST /v2.0/v2.0/subnets HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 511

{
  "subnet": {
    "name": "text",
    "description": "text",
    "network_id": "123e4567-e89b-12d3-a456-426614174000",
    "ip_version": 4,
    "cidr": "text",
    "gateway_ip": "text",
    "dhcp_enabled": true,
    "dns_nameservers": [
      "text"
    ],
    "allocation_pools": [
      {
        "start": "text",
        "end": "text"
      }
    ],
    "host_routes": [
      {
        "destination": "text",
        "nexthop": "text"
      }
    ],
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
    "ipv6_address_mode": "slaac",
    "ipv6_ra_mode": "slaac",
    "subnetpool_id": "123e4567-e89b-12d3-a456-426614174000"
  }
}
{
  "subnet": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "description": "text",
    "network_id": "123e4567-e89b-12d3-a456-426614174000",
    "ip_version": 4,
    "cidr": "text",
    "gateway_ip": "text",
    "dhcp_enabled": true,
    "dns_nameservers": [
      "text"
    ],
    "allocation_pools": [
      {
        "start": "text",
        "end": "text"
      }
    ],
    "host_routes": [
      {
        "destination": "text",
        "nexthop": "text"
      }
    ],
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
    "ipv6_address_mode": "slaac",
    "ipv6_ra_mode": "slaac",
    "subnetpool_id": "123e4567-e89b-12d3-a456-426614174000",
    "tags": [
      "text"
    ],
    "revision_number": 1,
    "created_at": "2025-11-28T20:22:24.128Z",
    "updated_at": "2025-11-28T20:22:24.128Z"
  }
}

Show subnet details

get
/v2.0/subnets/{subnet_id}

Shows details for a subnet.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Path parameters
subnet_idstring · uuidRequired

The ID of the subnet.

Query parameters
fieldsstringOptional

The fields that you want the server to return. If no fields are specified, all fields are returned.

Responses
200

Successful operation

application/json
get
/v2.0/subnets/{subnet_id}
GET /v2.0/v2.0/subnets/{subnet_id} HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "subnet": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "description": "text",
    "network_id": "123e4567-e89b-12d3-a456-426614174000",
    "ip_version": 4,
    "cidr": "text",
    "gateway_ip": "text",
    "dhcp_enabled": true,
    "dns_nameservers": [
      "text"
    ],
    "allocation_pools": [
      {
        "start": "text",
        "end": "text"
      }
    ],
    "host_routes": [
      {
        "destination": "text",
        "nexthop": "text"
      }
    ],
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
    "ipv6_address_mode": "slaac",
    "ipv6_ra_mode": "slaac",
    "subnetpool_id": "123e4567-e89b-12d3-a456-426614174000",
    "tags": [
      "text"
    ],
    "revision_number": 1,
    "created_at": "2025-11-28T20:22:24.128Z",
    "updated_at": "2025-11-28T20:22:24.128Z"
  }
}

Update subnet

put
/v2.0/subnets/{subnet_id}

Updates a subnet.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Path parameters
subnet_idstring · uuidRequired

The ID of the subnet.

Body
Responses
200

Subnet updated successfully

application/json
put
/v2.0/subnets/{subnet_id}
PUT /v2.0/v2.0/subnets/{subnet_id} HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 221

{
  "subnet": {
    "name": "text",
    "description": "text",
    "gateway_ip": "text",
    "dhcp_enabled": true,
    "dns_nameservers": [
      "text"
    ],
    "allocation_pools": [
      {
        "start": "text",
        "end": "text"
      }
    ],
    "host_routes": [
      {
        "destination": "text",
        "nexthop": "text"
      }
    ]
  }
}
{
  "subnet": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "description": "text",
    "network_id": "123e4567-e89b-12d3-a456-426614174000",
    "ip_version": 4,
    "cidr": "text",
    "gateway_ip": "text",
    "dhcp_enabled": true,
    "dns_nameservers": [
      "text"
    ],
    "allocation_pools": [
      {
        "start": "text",
        "end": "text"
      }
    ],
    "host_routes": [
      {
        "destination": "text",
        "nexthop": "text"
      }
    ],
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174000",
    "ipv6_address_mode": "slaac",
    "ipv6_ra_mode": "slaac",
    "subnetpool_id": "123e4567-e89b-12d3-a456-426614174000",
    "tags": [
      "text"
    ],
    "revision_number": 1,
    "created_at": "2025-11-28T20:22:24.128Z",
    "updated_at": "2025-11-28T20:22:24.128Z"
  }
}

Delete subnet

delete
/v2.0/subnets/{subnet_id}

Deletes a subnet.

Authorizations
AuthorizationstringRequired

OpenStack Keystone token authentication

Path parameters
subnet_idstring · uuidRequired

The ID of the subnet.

Responses
delete
/v2.0/subnets/{subnet_id}
DELETE /v2.0/v2.0/subnets/{subnet_id} HTTP/1.1
Host: 23.253.228.211:9696
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated

Was this helpful?