List subnet¶
Summary¶
List subnet resource used by network.
Type¶
- List
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
HTTP Request Header¶
Content-Type: application/json
Accept: application/json
X-Auth-Token: <token_id>
HTTP Request Body¶
Format¶
No items.
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 | ||
cidr | Query | String(cidr) | Subnet CIDR. | optional | Ignore | 200 | |
description | Query | String() | Subnet description. | optional | Ignore | 200 | |
gateway_ip | Query | String(ipv4) | Subnet default gateway ip. | optional | Ignore | 200 | |
id | Query | String(UUID) | Subnet unique id. | optional | Ignore | 200 | |
ip_version | Query | integer | The IP version used. (supports only 4) | optional | Ignore | 200 | |
ipv6_address_mode | Query | String() | Address mode for IPv6 (not supported) | optional | Ignore | 200 | |
ipv6_ra_mode | Query | String() | IPv6 router advertisement mode (not supported) | optional | Ignore | 200 | |
name | Query | String() | Subnet name. | optional | Ignore | 200 | |
network_id | Query | String(UUID) | The ID of network this subnet belongs to. | optional | Ignore | 200 | |
status | Query | String() | Hidden Subnet status. | optional | Ignore | 200 | |
tenant_id | Query | String(UUID) | The owner name of subnet. | optional | Ignore | 200 |
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 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¶
item | format | description |
subnets | Array(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
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¶
{
"subnest": [
{
"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 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"
}