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?expanded=show-subnet-details-detail#show-subnet-details

Request

Parameters

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

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

Response

Parameters

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.
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.
created_at body string

The date and time when the resource was created.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

description body string A human-readable description for the subnet.
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 subnet.
segment_id body string The ID of a network segment the subnet is associated with. It is available when segment extension is enabled.
subnetpool_id body string The ID of the subnet pool associated with the subnet.
service_types body array The service types associated with the subnet.
updated_at body string

The date and time when the resource was updated. If the resource has not been updated, this field will be null.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

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.

Status codes

Success

Code Reason
200 - OK Request was successful.

Error

Code Reason
401 - Unauthorized

User must authenticate before making a request.

404 - Not Found

The requested resource could not be found.

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": ""
  }
}