# DescribeNatGateways

## 1. API Description

This API is used to query the NAT gateway list.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="157.98748779296875">Parameter Name</th><th width="105.03741455078125">Required</th><th width="109.08746337890625">Type</th><th>Description</th></tr></thead><tbody><tr><td>regionId</td><td>No</td><td>String</td><td>Region ID.</td></tr><tr><td>vpcId</td><td>No</td><td>String</td><td>Filter by VPC network ID to which the NAT gateway belongs.</td></tr><tr><td>natGatewayIds</td><td>No</td><td>Array of String</td><td><p>NAT gateway ID list.</p><p>The maximum number of instance IDs is <code>100</code>.</p></td></tr><tr><td>name</td><td>No</td><td>String</td><td>NAT gateway name.</td></tr><tr><td>status</td><td>No</td><td><a href="../../datastructure#natstatus">NatStatus</a></td><td>NAT gateway state.</td></tr><tr><td>pageSize</td><td>No</td><td>Integer</td><td><p>Number of items in the current page result.</p><p>Default value: <code>20</code>;<br>Maximum value: <code>1000</code>.</p></td></tr><tr><td>pageNum</td><td>No</td><td>Integer</td><td><p>Page number of the current page result.</p><p>Default value: <code>1</code>.</p></td></tr><tr><td>resourceGroupId</td><td>No</td><td>String</td><td>Resource Group ID.</td></tr><tr><td>tagKeys</td><td>No</td><td>Array of String</td><td><p>Query using tag keys.</p><p>A maximum of 20 tag keys can be used.</p></td></tr><tr><td>tags</td><td>No</td><td>Array of <a href="../../datastructure#tag">Tag</a></td><td><p>Query using tags.</p><p>A maximum of 20 tags can be used.</p></td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="163.9312744140625">Parameter Name</th><th width="185.47186279296875">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required to locate a problem.</td></tr><tr><td>totalCount</td><td>Integer</td><td>The total number of NAT gateways that meet the filtering conditions.</td></tr><tr><td>dataSet</td><td>Array of <a href="../../datastructure#natgateway">NatGateway</a></td><td>The returned NAT gateway list.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the NAT gateway list.**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeNatGateways
<Common Request Params>

Request：
{
}

Response：
{
  "requestId": "T20F6B319-E8DD-4B1F-B038-DC79E4EA57F7",
  "response": {
      "requestId": "T20F6B319-E8DD-4B1F-B038-DC79E4EA57F7",
      "totalCount": 1,
      "dataSet": [
          {
              "resourceGroupName": "Default Resource Group",
              "natGatewayId": "<natGatewayId>",
              "expiredTime": null,
              "securityGroupId": "<securityGroupId>",
              "icmpReplyEnabled": true,
              "regionId": "asia-east-1",
              "createTime": "2025-04-01T01:01:01Z",
              "vpcId": "<vpcId>",
              "name": "<name>",
              "eipIds": ["<eipId>"],
              "resourceGroupId": "<resourceGroupId>",
              "isAllSubnets": false,
              "status": "RUNNING",
              "subnetIds": ["<subnetId>"],
              "zbgId": "<zbgId>",
              "tags":null
          }
      ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 [SDKs](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/software-toolkit/sdk/introduction) to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

No error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/instruction/commonerrorcode).​
