Query NAT gateway list
Updated at:2025-10-16
Description
Query the list of NAT gateways.
- Queries can be performed using NAT gateway ID, NAT gateway name, or the EIP associated with the NAT gateway.
- If no conditions are provided, all NAT gateways are included by default
Request structure
Plain Text
1GET /v{version}/nat?vpcId={vpcId}&natId={natId}&name={name}&ip={ip}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| vpcId | String | Yes | Query | VPC ID |
| natId | String | No | Query | Specify the ID of the NAT to be queried |
| name | String | No | Query | Specify the name of the NAT to be queried |
| ip | String | No | Query | Specify the EIP bound to the NAT to be queried |
| marker | String | No | Query | The starting position of the batch list query is a system-generated string |
| maxKeys | int | No | Query | Maximum number of items per page is 1,000, with a default value of 1000. |
Response headers
No additional headers beyond standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| nats | List<[NAT](VPC/API Reference/Appendix.md#NAT)> | List containing query results |
| marker | string | Marker indicating the starting position of the query. If the result list is empty, this field does not exist. |
| isTruncated | boolean | true indicates there is more data later, false indicates it is the last page |
| nextMarker | String | The marker value needed to fetch the next page. This field is absent when isTruncated is false. |
| maxKeys | int | Maximum number of items included per page |
Request example
Plain Text
1GET /v1/nat?vpcId=vpc-13vuxu016dew&name=mynat&maxKeys=2 HTTP/1.1
2Host: bcc.bj.baidubce.com
3authorization: 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
Response example
Plain Text
1HTTP/1.1 200 OK
2Date: Fri, 06 Jul 2018 11:12:34 GMT
3Content-Type: application/json;charset=UTF-8
4Server: BWS
5{
6 "nats":[
7 {
8 "id":"nat-bir8biqwr45e",
9 "name":"mynat",
10 "vpcId":"vpc-13vuxu016dew",
11 "spec":"small",
12 "status":"unconfigured",
13 "eips":[
14
15 ],
16 "paymentTiming":"Prepaid",
17 "expiredTime":"2018-08-13T08:10:59Z",
18 "createTime": "2021-04-25 17:22:34"
19 },
20 {
21 "id":"nat-b9q8n98mdxwc",
22 "name":"mynat",
23 "vpcId":"vpc-13vuxu016dew",
24 "spec":"small",
25 "status":"unconfigured",
26 "eips":[
27
28 ],
29 "paymentTiming":"Prepaid",
30 "expiredTime":"2018-07-27T13:18:00Z",
31 "createTime": "2021-04-25 17:22:34"
32 }
33 ]
34}
35"marker":"nat-b58rnkn1g98h",
36"isTruncated": true,
37"nextMarker": "nat-bi72s924x5xu",
38"maxKeys": 2
39}
