# DescribeNatGatewayDetail

## 1. API Description

This API is used to query the NAT rule details of a NAT gateway.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="163.6968994140625">Parameter Name</th><th width="114.75">Required</th><th width="110.75628662109375">Type</th><th>Description</th></tr></thead><tbody><tr><td>natGatewayId</td><td>Yes</td><td>String</td><td>NAT gateway ID.</td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="161.79998779296875">Parameter Name</th><th width="179.35931396484375">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>natGatewayId</td><td>String</td><td>The unique ID of the NAT gateway.</td></tr><tr><td>name</td><td>String</td><td>NAT gateway name.</td></tr><tr><td>snats</td><td>Array of <a href="../../datastructure#snatentry">SnatEntry</a></td><td>SNAT rule list.</td></tr><tr><td>dnats</td><td>Array of <a href="../../datastructure#dnatentry">DnatEntry</a></td><td>DNAT rule list.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query NAT rule details.**

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

Request：
{
    "natGatewayId": "<natGatewayId>"
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "natGatewayId": "<natGatewayId>",
    "name": "name",
    "snats": [
      {
        "snatEntryId": "<snatEntryId>",
        "eipIds": ["<eipId>"],
        "cidrs": ["0.0.0.0/0"],
        "eipIds": ["<eipId>"],
        "snatSubnets": null
      }
    ],
    "dnats": [
      {
        "dnatEntryId": "<dnatEntryId>",
        "status": "ACTIVE",
        "privateIp": "<privateIp>",
        "eipId": "<eipId>",
        "protocol": "TCP",
        "listenerPort": "1-30",
        "internalPort": "1-30"
      }
    ]
  }
}
```

{% 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

The following only lists the 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).

<table><thead><tr><th width="167.171875">HTTP Status Code</th><th width="251.25634765625">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>404</td><td>INVALID_NAT_NOT_FOUND</td><td>NAT gateway does not exist.</td></tr><tr><td>400</td><td>UNSUPPORTED_OPERATION_NAT_STATUS</td><td>NAT gateway state is not supported.</td></tr></tbody></table>
