Show subnet

Summary

Show subnet resource used by network.

Type

  • Show

Target object of API

  • subnet

Synchronous/Asynchronous

  • Synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2.0/tenant_connection_requests/{tenant_connection_request_id}/subnets/{subnet_id}

HTTP Request Header

Content-Type: application/json
Accept: application/json
X-Auth-Token: <token_id>

HTTP Request Body

Format

No items.

Parameters

Input Parameters

name

style

format

description

required/optional

default value

action for invalid parameter

response code for invalid parameter

token_id

Header

authentication token string(varchar)

keystone authentication token

required

Terminate

401

tenant_connection_request_id

URL

String(UUID)

required

Terminate

404

subnet_id

URL

String(UUID)

required

Terminate

404

Response

Response Header

Format

HTTP/1.1 <response_code> <message>       (ex. 200 OK)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

Response Code

Response Codes

response code

condition

200

OK

401

Unauthorized

404

Not found

500

Internal server error

Response Body

Format

{
  "subnet": {
    {
      "allocation_pools": [
        {
          "end": "",
          "start": ""
        }
      ],
      "cidr": "<cidr>",
      "description": "",
      "dns_nameservers": [],
      "enable_dhcp": ,
      "gateway_ip": "",
      "host_routes": [],
      "id": "<id>",
      "ip_version": <4|6>,
      "ipv6_address_mode": ,
      "ipv6_ra_mode": ,
      "name": "",
      "network_id": "",
      "ntp_servers": [],
      "status": "",
      "tags": {},
      "tenant_id": ""
    }
  }
}

Parameters

Response Parameters

item

format

description

subnet

Object

allocation_pools

Array(Object)

List of subnet allocation pools

end

String(ipv4)

start

String(ipv4)

cidr

String(cidr)

Subnet CIDR.

description

String()

Subnet description.

dns_nameservers

Array(String)

List of subnet dns name servers.

enable_dhcp

Boolean

Set to true if DHCP is enabled and false if DHCP is disabled.

gateway_ip

String(ipv4)

Subnet default gateway ip.

host_routes

Array(Object)

A list of host route dictionaries for the subnet.

destination

String(cidr)

nexthop

String(ipv4)

id

String(UUID)

Subnet unique id.

ip_version

integer

The IP version used. (supports only 4)

ipv6_address_mode

String()

Address mode for IPv6 (not supported)

ipv6_ra_mode

String()

IPv6 router advertisement mode (not supported)

name

String()

Subnet name.

network_id

String(UUID)

The ID of network this subnet belongs to.

ntp_servers

Array(String)

List of ntp servers.

status

String()

Hidden Subnet status.

tags

Object

Subnet tags.

tenant_id

String(UUID)

The owner name of subnet.

Sample Request and Response

Sample API request

Request URI

https://{api_endpoint}/v2.0/tenant_connection_requests/{tenant_connection_request_id}/subnets/{subnet_id}

Request Header

Content-Type: application/json
Accept: application/json
X-Auth-Token: 69105c889f824efdafb56af224208ad4

Request Body

No items.

Sample API response

Response Header

HTTP/1.1 200 OK

Response Body

{
  "subnet": {
    {
      "allocation_pools": [
        {
          "end": "192.168.10.254",
          "start": "192.168.10.2"
        }
      ],
      "cidr": "192.168.10.0/24",
      "description": "",
      "dns_nameservers": [],
      "enable_dhcp": true,
      "gateway_ip": "192.168.10.1",
      "host_routes": [],
      "id": "xxxxxx",
      "ip_version": 4,
      "ipv6_address_mode": null,
      "ipv6_ra_mode": null,
      "name": "tc-subnet-tenant-a1",
      "network_id": "c06946e2-c6e9-4ff0-881f-bb32751e1685",
      "ntp_servers": [],
      "status": "ACTIVE",
      "tags": {},
      "tenant_id": "c7f3a68a73e845d4ba6a42fb80fce03f"
    }
  }
}

Example error message

HTTP request

GET /v2.0/tenant_connection_requests/{tenant_connection_request_id}/subnets/{subnet_id} HTTP/1.1
User-Agent: curl/7.37.1
Host: 10.1.131.140
Content_type:application/json
Accept:application/json
X-Auth-Token:4e54395a12b740d585d74190ba4eb14b
Content-Length: 73
Content-Type: application/x-www-form-urlencoded

HTTP Response

HTTP/1.1 400 Bad Request
Server: nginx/1.8.0
Date: Mon, 28 Sep 2015 10:32:56 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 39
Connection: keep-alive

{
    "cause": "Invalid request body"
}