Subnets
Network subnet management operations
Lists subnets to which the project has access.
OpenStack Keystone token authentication
Filter the list result by the network ID.
Filter the list result by the ID of the resource.
Filter the list result by the human-readable name of the resource.
Filter the list result by the ID of the project that owns the resource.
Filter the list result by the ID of the project that owns the resource.
The fields that you want the server to return. If no fields are specified, all fields are returned.
Sort direction. A valid value is asc (ascending) or desc (descending).
Sorts by a resource attribute.
A list of tags to filter the list result by. Resources that match all tags in this list will be returned.
A list of tags to filter the list result by. Resources that match any tag in this list will be returned.
A list of tags to filter the list result by. Resources that match all tags in this list will be excluded.
A list of tags to filter the list result by. Resources that match any tag in this list will be excluded.
Successful operation
Unauthorized
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"
}
]
}Creates a subnet.
OpenStack Keystone token authentication
Subnet created successfully
Bad Request
Unauthorized
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"
}
}Shows details for a subnet.
OpenStack Keystone token authentication
The ID of the subnet.
The fields that you want the server to return. If no fields are specified, all fields are returned.
Successful operation
Unauthorized
Not Found
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"
}
}Updates a subnet.
OpenStack Keystone token authentication
The ID of the subnet.
Subnet updated successfully
Bad Request
Unauthorized
Forbidden
Not Found
Precondition Failed
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"
}
}Deletes a subnet.
OpenStack Keystone token authentication
The ID of the subnet.
Subnet deleted successfully
Unauthorized
Not Found
Conflict
Precondition Failed
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?
