Show subnet

Shows information for a specified subnet.

URI

/v2.0/subnets/{subnet_id}

Description of the URI:

{subnet_id} UUID The UUID for the subnet of interest to you.

HTTP method

GET

Response status

Status code Description
200 Normal response codes
unauthorized (401) Error response codes
itemNotFound (404) Error response codes

Response body (normal status)


{
    "subnet": {
        "name": "my_subnet",
        "enable_dhcp": true,
        "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
        "tenant_id": "4fd44f30292945e481c7b8a0c8908869",
        "dns_nameservers": [],
        "allocation_pools": [
            {
                "start": "192.0.0.2",
                "end": "192.255.255.254"
            }
        ],
        "host_routes": [],
        "ip_version": 4,
        "gateway_ip": "192.0.0.1",
        "cidr": "192.0.0.0/8",
        "id": "54d6f61d-db07-451c-9ab3-b9609b6b6f0b",
        "availability_zone": "AZ1"
    }
}
     

Description of response body (normal status)

Item Description
name The subnet name.
network_id The ID of the attached network.
tenant_id The ID of the project who owns the network.
dns_nameservers A list of DNS name servers for the subnet.

For example ["8.8.8.7", "8.8.8.8"].

The specified IP addresses are displayed in sorted order in ascending order.

The lowest IP address will be the primary DNS address.

allocation_pools The start and end addresses for the allocation pools.
host_routes A list of host route dictionaries for the subnet. For example:

"host_routes":[
	{
		"destination":"0.0.0.0/0",
		"nexthop":"172.16.1.254"
	},
	{
		"destination":"192.168.0.0/24",
		"nexthop":"192.168.0.1"
	}
]                      
               
gateway_ip The gateway IP address.
ip_version The IP version, which can be 4 or 6.
cidr The CIDR.
id The ID of the subnet.
enable_dhcp Set to "true" if DHCP is enabled, or "false" otherwise.
availability_zone The Availability Zone name.