All Products
Search
Document Center

ENS:DescribeNatGateways

Last Updated:Mar 27, 2026

Invoke DescribeNatGateways to query created NAT Gateways.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ens:DescribeNatGateways

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

EnsRegionId

string

No

The ID of the Edge Node Service (ENS) node.

cn-wuxi-9

NatGatewayId

string

No

The ID of the NAT gateway.

nat-5t7nh1cfm6kxiszlttr38****

NetworkId

string

No

The ID of the network.

n-2zeuphj08tt7q3brd****

VSwitchId

string

No

The ID of the vSwitch.

vsw-5rllcjb3ol6duzjdnbm1o****

Name

string

No

The name of the NAT gateway.

test0

NatGatewayIds

array

No

The IDs of the NAT gateways. You can specify 1 to 100 IDs.

string

No

The ID of the NAT gateway.

nat-5****4ik

EnsRegionIds

array

No

The IDs of edge nodes. You can specify 1 to 100 IDs.

string

No

The ID of the edge node.

cn-chengdu-telecom-4

PageNumber

integer

No

The page number. Pages start from page 1.

Default value: 1.

1

PageSize

integer

No

The number of entries per page. The maximum value is 100.

Default value: 10.

10

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

2818A8F4-5E2B-5611-8732-5ACF7B677059

PageNumber

integer

The page number.

1

TotalCount

integer

The number of NAT gateways that are returned.

49

PageSize

integer

The number of entries per page.

10

NatGateways

array<object>

The details of the NAT gateways.

array<object>

The details of the NAT gateway.

EnsRegionId

string

The ID of the ENS node.

cn-xiangyang-5

NatGatewayId

string

The ID of the NAT gateway.

nat-5t7nh1cfm6kxiszlttr38****

NetworkId

string

The ID of the network.

n-5s2ml1olj0kzaws9n1yrj****

VSwitchId

string

The ID of the vSwitch.

vsw-5szpp1os9m55myirbflfw****

Name

string

The name of the NAT gateway.

test0

CreationTime

string

The time when the NAT gateway was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

2021-11-22T07:03:32Z

Spec

string

The type of the NAT gateway.

enat.default

Status

string

The status of the NAT gateway. Valid values:

  • Creating: After you send a request to create a NAT gateway, the system creates the NAT gateway in the background. The NAT gateway remains in the Creating state until the operation is completed.

  • Available: The NAT gateway is in the Available state after the creation is complete.

  • Deleting: After you send a request to delete a NAT gateway, the system deletes the NAT gateway in the background. The NAT gateway remains in the Deleting state until the operation is completed.

Available

IpLists

array<object>

The EIPs that are associated with the NAT gateway.

object

The EIP that is associated with the NAT gateway.

UsingStatus

string

The association between the EIP and the Internet NAT gateway. Valid values:

  • UsedByForwardTable: The EIP is specified in a DNAT entry.

  • UsedBySnatTable: The EIP is specified in an SNAT entry.

  • Idle: The EIP is not specified in an SNAT entry or a DNAT entry.

Idle

IpAddress

string

The EIP.

8.XX.XX.162

AllocationId

string

The ID of the EIP.

eip-50g****

Tags

array<object>

The collection of tags.

object

The collection of tags.

Value

string

Tag value.

TestValue

Key

string

Tag key.

TestKey

TagKey deprecated

string

Tag key.

TestKey

TagValue deprecated

string

Tag value.

TestValue

Examples

Success response

JSON format

{
  "RequestId": "2818A8F4-5E2B-5611-8732-5ACF7B677059",
  "PageNumber": 1,
  "TotalCount": 49,
  "PageSize": 10,
  "NatGateways": [
    {
      "EnsRegionId": "cn-xiangyang-5",
      "NatGatewayId": "nat-5t7nh1cfm6kxiszlttr38****",
      "NetworkId": "n-5s2ml1olj0kzaws9n1yrj****",
      "VSwitchId": "vsw-5szpp1os9m55myirbflfw****",
      "Name": "test0",
      "CreationTime": "2021-11-22T07:03:32Z",
      "Spec": "enat.default",
      "Status": "Available",
      "IpLists": [
        {
          "UsingStatus": "Idle",
          "IpAddress": "8.XX.XX.162",
          "AllocationId": "eip-50g****"
        }
      ],
      "Tags": [
        {
          "Value": "TestValue",
          "Key": "TestKey",
          "TagKey": "TestKey",
          "TagValue": "TestValue"
        }
      ]
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 Invalid%s The specified parameter %s is invalid.
400 Missing%s You must specify the parameter %s.
400 ens.interface.error Failed to call API.
400 NoPermission Permission denied.
400 InvalidParameter.%s The specified field %s invalid. Please check it again.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.