9.5. Showing virtual subnet details

GET /v2.0/subnets/{subnet_id}

Shows the details of a subnet with the specified ID.

Source: https://docs.openstack.org/api-ref/network/v2/index.html#show-subnet-details

9.5.1. Request

Name In Type Description
subnet_id path string The ID of the subnet.

9.5.1.1. Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:9696/v2.0/subnets/aa29d149-b2a4-45a0-8066-dc63fa9c9b77

9.5.2. Response

Name In Type Description
subnet body object A subnet object.
id body string The ID of the subnet.
tenant_id body string The ID of the project.
project_id body string The ID of the project.
created_at body string Time at which the resource has been created (in UTC ISO8601 format).
name body string Human-readable name of the resource.
enable_dhcp body boolean Indicates whether dhcp is enabled or disabled for the subnet.
network_id body string The ID of the network to which the subnet belongs.
dns_nameservers body array List of dns name servers associated with the subnet.
allocation_pools body array Allocation pools with start and end IP addresses for this subnet.
host_routes body array Additional routes for the subnet. A list of dictionaries with destination and nexthop parameters.
ip_version body integer The IP protocol version. Value is 4 or 6.
gateway_ip body string Gateway IP of this subnet. If the value is null that implies no gateway is associated with the subnet.
cidr body string The CIDR of the subnet.
updated_at body string Time at which the resource has been updated (in UTC ISO8601 format).
description body string A human-readable description for the resource.
ipv6_address_mode body string The IPv6 address modes specifies mechanisms for assigning IP addresses. Value is slaac, dhcpv6-stateful, dhcpv6-stateless or null.
ipv6_ra_mode body string The IPv6 router advertisement specifies whether the networking service should transmit ICMPv6 packets, for a subnet. Value is slaac, dhcpv6-stateful, dhcpv6-stateless or null.
revision_number body integer The revision number of the resource.
segment_id body string The ID of a network segment the subnet is associated with. It is available when segment extension is enabled.
service_types body array The service types associated with the subnet.
subnetpool_id body string The ID of the subnet pool associated with the subnet.
tags body array The list of tags on the resource.
dns_publish_fixed_ip body boolean Whether to publish DNS records for IPs from this subnet.

9.5.2.1. Status codes

9.5.2.1.1. Success

Code Reason
200 - OK Request was successful.

9.5.2.1.2. Error

Code Reason
401 - Unauthorized User must authenticate before making a request.
404 - Not Found The requested resource could not be found.

9.5.2.2. Example

{
  "subnet": {
    "service_types": [],
    "description": "",
    "enable_dhcp": true,
    "tags": [],
    "network_id": "c5252a20-9206-4b8e-9a0f-45bd22ee7bc8",
    "tenant_id": "f5d834d636c642c7bfe8af86139c6f26",
    "created_at": "2020-02-14T13:42:56Z",
    "dns_nameservers": [
      "10.30.0.27",
      "10.30.0.28"
    ],
    "updated_at": "2020-02-14T13:42:56Z",
    "gateway_ip": "192.168.10.1",
    "ipv6_ra_mode": null,
    "allocation_pools": [
      {
        "start": "192.168.10.2",
        "end": "192.168.10.254"
      }
    ],
    "host_routes": [],
    "revision_number": 0,
    "ip_version": 4,
    "ipv6_address_mode": null,
    "cidr": "192.168.10.0/24",
    "project_id": "f5d834d636c642c7bfe8af86139c6f26",
    "id": "aa29d149-b2a4-45a0-8066-dc63fa9c9b77",
    "subnetpool_id": null,
    "name": ""
  }
}