Query NAT Gateway List
Last Updated:2020-07-20
Description
Query the NAT gateway list.
- It can be queried according to the NAT gateway ID, the NAT gateway name, and EIP bound to the NAT gateway.
- If you do not provide the query conditions, all NAT Gateway is overwritten by default.
Request Structure
GET /v{version}/nat?vpcId={vpcId}&natId={natId}&name={name}&ip={ip}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: authorization string
Request Parameter
Parameter name | Type | Required or not | Parameter position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number (the current value is 1) |
vpcId | String | Yes | Query parameter | vpc ID |
natId | String | No | Query parameter | Specify the Id of NAT to be queried. |
name | String | No | Query parameter | Specify the name of NAT to be queried. |
ip | String | No | Query parameter | Specify the EIP bound to NAT to be queried. |
marker | String | No | Query parameter | The starting location of query for batch acquisition of lists, and is one string generated by the system. |
maxKeys | int | No | Query parameter | Maximum number contained in each page, generally not exceeding 1000. The default value is 1000. |
Return Header
There are no other special headers except the public headers.
Return Parameter
Parameter name | Type | Description |
---|---|---|
nats | List<NAT> | List containing query results |
marker | string | Mark the starting position of the query. The item does not exist if the result list is empty |
isTruncated | boolean | True means there are additional data in the following pages and false means the current page is the last page. |
nextMarker | String | The marker value requiring to be passed in order to acquire the next page. The domain doesn't appear when isTruncated is false. |
maxKeys | int | Maximum number contained in each page. |
Request Example
GET /v1/nat?vpcId=vpc-13vuxu016dew&name=mynat&maxKeys=2 HTTP/1.1
Host: bcc.bj.baidubce.com
authorization: bce-auth-v1/bf427691810a11e8a106475a8496ca04/2018-07-06T11:02:49Z/3600/host;x-bce-account;x-bce-client-ip;x -bce-date;x-bce-request-id;x-bce-security-token/e84ee938f6466428ff5c16b3562a1cbf3db5928e7f863cedec8820b5d98aa474
Return Example
HTTP/1.1 200 OK
Date: Fri, 06 Jul 2018 11:12:34 GMT
Content-Type: application/json;charset=UTF-8
Server: BWS
{
"nats":[
{
"id":"nat-bir8biqwr45e",
"name":"mynat",
"vpcId":"vpc-13vuxu016dew",
"spec":"small",
"status":"unconfigured",
"eips":[
],
"paymentTiming":"Prepaid",
"expiredTime":"2018-08-13T08:10:59Z"
},
{
"id":"nat-b9q8n98mdxwc",
"name":"mynat",
"vpcId":"vpc-13vuxu016dew",
"spec":"small",
"status":"unconfigured",
"eips":[
],
"paymentTiming":"Prepaid",
"expiredTime":"2018-07-27T13:18:00Z"
}
]
}
"marker":"nat-b58rnkn1g98h",
"isTruncated": true,
"nextMarker": "nat-bi72s924x5xu",
"maxKeys": 2
}