Queries NAT gateways that meet specific conditions in a specified region.

Descriptions

You can call this operation to query an Internet NAT gateway or a virtual private cloud (VPC) NAT gateway. The term "NAT gateway" in this topic refers to both NAT gateway types.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No DescribeNatGateways

The operation that you want to perform. Set the value to DescribeNatGateways.

RegionId String Yes cn-hangzhou

The ID of the region where the NAT gateways are deployed. You can call the DescribeRegions operation to query the most recent region list.

NatGatewayId String No ngw-bp1uewa15k4iy5770****

The ID of the NAT gateway that you want to query.

VpcId String No vpc-bp15zckdt37pq72z****

The ID of the VPC to which the NAT gateway belongs.

Name String No test

The name of the NAT gateway.

InstanceChargeType String No PostPaid

The billing method of the NAT gateway. Set the value to PostPaid, which specifies the pay-as-you-go billing method.

Spec String No Small

The size of the Internet NAT gateway. Valid values:

  • Small (default): small
  • Middle: medium
  • Large: large
NatType String No Normal

The type of the Internet NAT gateway. Valid values:

  • Normal: standard
  • Enhanced: enhanced
ResourceGroupId String No rg-bp67acfmxazb4ph****

The ID of the resource group to which the NAT gateway belongs.

PageNumber Integer No 10

The number of the page to return. Default value: 1.

PageSize Integer No 1

The number of entries to return on each page. Maximum value: 50. Default value: 10.

DryRun Boolean No true

Specifies whether to only precheck the API request. Valid values:

  • true: prechecks the request only. Resources are not queried. The system checks whether your AccessKey pair is valid, whether the RAM user is authorized, and whether required parameters are set. If the request fails the precheck, the corresponding error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false: prechecks the request. This is the default value. After the request passes the precheck, a 2xx HTTP status code is returned and resources are queried.
Status String No Available

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 remains in a stable state after the NAT gateway is created.
  • Modifying: After you send a request to modify a NAT gateway, the system modifies the NAT gateway in the background. The NAT gateway remains in the Modifying state until the operation is completed.
  • 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.
  • Converting: After you send a request to upgrade a standard NAT gateway to an enhanced NAT gateway, the system upgrades the NAT gateway in the background. The NAT gateway remains in the Converting state until the operation is completed.
NetworkType String No internet

The type of the NAT gateway. Valid values:

  • internet: an Internet NAT gateway
  • intranet: a VPC NAT gateway
ZoneId String No cn-hangzhou-b

The ID of the zone to which the NAT gateway belongs.

Response parameters

Parameter Type Example Description
PageSize Integer 10

The number of entries returned per page.

RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF

The ID of the request.

PageNumber Integer 10

The page number of the returned page.

TotalCount Integer 10

The number of NAT gateway entries that are returned.

NatGateways Array of NatGateway

The details about the NAT gateway.

NatGateway
Status String Creating

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: If the operation is successful, the NAT gateway is created and the NAT gateway changes to the Available state.
  • Modifying: After you send a request to modify a NAT gateway, the system modifies the NAT gateway in the background. The NAT gateway remains in the Modifying state until the operation is completed.
  • 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.
  • Converting: After you send a request to upgrade a standard NAT gateway to an enhanced NAT gateway, the system upgrades the NAT gateway in the background. The NAT gateway remains in the Converting state until the operation is completed.
CreationTime String 2020-06-08T12:20:20Z

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

VpcId String vpc-bp15zckdt37pq72z****

The ID of the VPC where the NAT gateway is deployed.

NatType String Normal

The type of the Internet NAT gateway. Valid values:

  • Normal: standard
  • Enhanced: enhanced
Spec String Small

The size of the NAT gateway. Valid values:

  • Small: small
  • Middle: medium
  • Large: large
DeletionProtection Boolean true

Indicates whether the deletion protection feature is enabled. Valid values:

  • true: yes
  • false: no
NetworkType String internet

The type of NAT gateway. Valid values:

  • internet: an Internet NAT gateway
  • intranet: a VPC NAT gateway
SecurityProtectionEnabled Boolean false

Indicates whether the firewall feature is enabled. Valid values:

  • false: no
  • true: yes
InstanceChargeType String PostPaid

The billing method of the NAT gateway. The value is set to PostPaid, which indicates the pay-as-you-go billing method.

RegionId String cn-hangzhou

The ID of the region where the NAT gateway is deployed.

EcsMetricEnabled Boolean true

Indicates whether the traffic monitoring feature is enabled. Valid values:

  • true: yes
  • false: no
IcmpReplyEnabled Boolean false

Indicates whether the ICMP non-retrieval feature is enabled. Valid values:

  • true: yes
  • false: no
Description String NAT

The description of the NAT gateway.

ExpiredTime String 2020-08-26T16:00Z

The time when the NAT gateway expires.

ResourceGroupId String rg-bp67acfmxazb4ph****

The ID of the resource group.

NatGatewayId String ngw-bp1047e2d4z7kf2ki****

The ID of the region where the NAT gateway is deployed.

InternetChargeType String PayBySpec

The metering method for the NAT gateway. Valid values:

  • PayBySpec: pay-by-specification
  • PayByLcu: pay-by-CU
BusinessStatus String Normal

The status of the NAT gateway. Valid values:

  • Normal: The NAT gateway works as expected.
  • FinancialLocked: The NAT gateway is locked due to overdue payments.
Name String abc

The name of the NAT gateway.

IpLists Array of IpList

The IP address information about the NAT gateway.

IpList
IpAddress String 116.62.XX.XX

The elastic IP addresses (EIPs) that are associated with the NAT gateway.

SnatEntryEnabled Boolean false

Indicates whether IP addresses that are used in DNAT entries can be specified in SNAT entries. Valid values:

  • true: yes
  • false: no
PrivateIpAddress String 192.168.XX.XX

The private IP address of the NAT gateway.

ForwardTableIds Array of String ftb-uf6gj3mhsg94qsqst****

The ID of the Destination Network Address Translation (DNAT) table.

SnatTableIds Array of String stb-uf6dalcdu0krz423p****

The ID of the SNAT table of the NAT gateway.

FullNatTableIds Array of String fulltb-gw88z7hhlv43rmb26****

The ID of the FULLNAT table.

NatGatewayPrivateInfo Object

The private network information about the enhanced Internet NAT gateway.

Note If NatType is set to Normal, all parameters returned in this list are empty.
VswitchId String vsw-bp1s2laxhdf9ayjbo****

The ID of the vSwitch to which the NAT gateway is attached.

EniInstanceId String 10

The ID of the elastic network interface (ENI).

MaxBandwidth Integer 5120

The maximum bandwidth. Unit: Mbit/s.

PrivateIpAddress String 192.168.XX.XX

The private IP address.

IzNo String cn-hangzhou-b

The zone to which the NAT gateway belongs.

EniType String Secondary

The type of the ENI. Valid values:

  • Primary: primary
  • Secondary: secondary
PrivateLinkEnabled Boolean true

Indicates whether the NAT gateway supports PrivateLink. Valid values:

  • true: yes
  • false: no
PrivateLinkMode String FullNat

The mode that is used by PrivateLink. Valid values:

  • FullNat: the FULLNAT mode
  • Geneve: the GENEVE mode

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeNatGateways
&RegionId=cn-hangzhou
&NatGatewayId=ngw-bp1uewa15k4iy5770****
&VpcId=vpc-bp15zckdt37pq72z****
&Name=test
&InstanceChargeType=PostPaid
&Spec=Small
&NatType=Normal
&ResourceGroupId=rg-bp67acfmxazb4ph****
&PageNumber=10
&PageSize=1
&DryRun=true
&Status=Available
&NetworkType=internet
&ZoneId=cn-hangzhou-b
&Common request parameters

Sample responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeNatGatewaysResponse>
    <PageSize>10</PageSize>
    <RequestId>4EC47282-1B74-4534-BD0E-403F3EE64CAF	</RequestId>
    <PageNumber>10</PageNumber>
    <TotalCount>10</TotalCount>
    <NatGateways>
        <Status>Creating</Status>
        <CreationTime>2020-06-08T12:20:20Z</CreationTime>
        <VpcId>vpc-bp15zckdt37pq72z****</VpcId>
        <NatType>Normal</NatType>
        <Spec>Small</Spec>
        <DeletionProtection>true</DeletionProtection>
        <NetworkType>internet</NetworkType>
        <SecurityProtectionEnabled>false</SecurityProtectionEnabled>
        <InstanceChargeType>PostPaid</InstanceChargeType>
        <RegionId>cn-hangzhou</RegionId>
        <EcsMetricEnabled>true</EcsMetricEnabled>
        <IcmpReplyEnabled>false</IcmpReplyEnabled>
        <Description>NAT</Description>
        <ExpiredTime>2020-08-26T16:00Z</ExpiredTime>
        <ResourceGroupId>rg-bp67acfmxazb4ph****</ResourceGroupId>
        <NatGatewayId>ngw-bp1047e2d4z7kf2ki****</NatGatewayId>
        <InternetChargeType>PayBySpec</InternetChargeType>
        <BusinessStatus>Normal</BusinessStatus>
        <Name>abc</Name>
        <IpLists>
            <IpAddress>116.62.XX.XX</IpAddress>
            <SnatEntryEnabled>false</SnatEntryEnabled>
            <PrivateIpAddress>192.168.XX.XX</PrivateIpAddress>
        </IpLists>
        <ForwardTableIds>ftb-uf6gj3mhsg94qsqst****</ForwardTableIds>
        <SnatTableIds>stb-uf6dalcdu0krz423p****</SnatTableIds>
        <FullNatTableIds>fulltb-gw88z7hhlv43rmb26****</FullNatTableIds>
        <NatGatewayPrivateInfo>
            <VswitchId>vsw-bp1s2laxhdf9ayjbo****</VswitchId>
            <EniInstanceId>10</EniInstanceId>
            <MaxBandwidth>5120</MaxBandwidth>
            <PrivateIpAddress>192.168.XX.XX</PrivateIpAddress>
            <IzNo>cn-hangzhou-b</IzNo>
            <EniType>Secondary</EniType>
        </NatGatewayPrivateInfo>
        <PrivateLinkEnabled>true</PrivateLinkEnabled>
        <PrivateLinkMode>FullNat</PrivateLinkMode>
    </NatGateways>
</DescribeNatGatewaysResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "PageSize" : 10,
  "RequestId" : "4EC47282-1B74-4534-BD0E-403F3EE64CAF\t",
  "PageNumber" : 10,
  "TotalCount" : 10,
  "NatGateways" : [ {
    "Status" : "Creating",
    "CreationTime" : "2020-06-08T12:20:20Z",
    "VpcId" : "vpc-bp15zckdt37pq72z****",
    "NatType" : "Normal",
    "Spec" : "Small",
    "DeletionProtection" : true,
    "NetworkType" : "internet",
    "SecurityProtectionEnabled" : false,
    "InstanceChargeType" : "PostPaid",
    "RegionId" : "cn-hangzhou",
    "EcsMetricEnabled" : true,
    "IcmpReplyEnabled" : false,
    "Description" : "NAT",
    "ExpiredTime" : "2020-08-26T16:00Z",
    "ResourceGroupId" : "rg-bp67acfmxazb4ph****",
    "NatGatewayId" : "ngw-bp1047e2d4z7kf2ki****",
    "InternetChargeType" : "PayBySpec",
    "BusinessStatus" : "Normal",
    "Name" : "abc",
    "IpLists" : [ {
      "IpAddress" : "116.62.XX.XX",
      "SnatEntryEnabled" : false,
      "PrivateIpAddress" : "192.168.XX.XX"
    } ],
    "ForwardTableIds" : [ "ftb-uf6gj3mhsg94qsqst****" ],
    "SnatTableIds" : [ "stb-uf6dalcdu0krz423p****" ],
    "FullNatTableIds" : [ "fulltb-gw88z7hhlv43rmb26****" ],
    "NatGatewayPrivateInfo" : {
      "VswitchId" : "vsw-bp1s2laxhdf9ayjbo****",
      "EniInstanceId" : "10",
      "MaxBandwidth" : 5120,
      "PrivateIpAddress" : "192.168.XX.XX",
      "IzNo" : "cn-hangzhou-b",
      "EniType" : "Secondary"
    },
    "PrivateLinkEnabled" : true,
    "PrivateLinkMode" : "FullNat"
  } ]
}

Error codes

HttpCode Error code Error message Description
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The error message returned because the specified region ID does not exist.

For a list of error codes, visit the API Error Center.