Queries one or more NAT Gateways in a region.

Make the API call

You can use OpenAPI Explorer to make API calls, search for API calls, perform debugging, and generate SDK example code.

Request parameters

Parameter Type Required? Example value Description
Action String Yes DescribeNatGateways

The name of this action. Value: DescribeNatGateways

RegionId String Yes cn-hangzhou

To query the region ID, call DescribeRegions.

NatGatewayId String No ngw-bp1uewa15k4iy5770****

The ID of the NAT Gateway.

VpcId String No vpc-bp15zckdt37pq72z****

The ID of the VPC.

Name String No test

The name of the NAT Gateway.

InstanceChargeType String No PostPaid

The billing method of the instance. Valid values:

  • PostPaid: pay-as-you-go
  • PrePaid: subscription

This parameter can only be set to PostPaid on the international site.

Spec String No Large

The specification of the NAT Gateway. Valid values:

  • Small (default)
  • Middle
  • Large
  • XLarge.1
NatType string No Normal

The type of the NAT Gateway. Valid value: Normal

ResourceGroupId String No rg-bp67acfmxazb4ph****

The ID of the resource group.

PageNumber Integer No 10

The page number. Default value: 1

PageSize Integer No 1

The number of entries per page in the case of a paged query result. Maximum value: 100. Default value: 10

Response parameters

Parameter Type Example value Description
RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF

The ID of the request.

TotalCount Integer 10

The number of total entries.

PageNumber Integer 10

The current page number.

PageSize Integer 10

The number of entries per page.

NatGateways Array

Details of NAT Gateways.

NatGatewayId String ngw-bp1047e2d4z7kf2ki****

The ID of the NAT Gateway.

RegionId String cn-hangzhou

The ID of the region to which the NAT Gateway belongs.

Name String abc

The name of the NAT Gateway.

Description String NAT

The description of the NAT Gateway.

VpcId String vpc-bp15zckdt37pq72z****

The ID of the VPC.

Spec String Small

The specification of the NAT Gateway.

InstanceChargeType String PostPaid

The billing method of the instance.

  • PostPaid: pay-as-you-go
  • PrePaid: subscription

This parameter can only be set to PostPaid on the international site.

ExpiredTime String 2017-08-26T16:00Z

The time when the NAT Gateway expires.

AutoPay Boolean true

Indicates whether the NAT Gateway order is paid automatically. Valid values:

  • false: Automatic payment is not enabled. After an order is placed, you must go to the order center to complete the payment.
  • true: Automatic payment is enabled and the order is paid automatically.
Note This parameter is required if the value of the InstanceChargeType is set to PrePaid.
BusinessStatus String Normal

The business status of the NAT Gateway:

  • Normal: The NAT Gateway is in the normal status.
  • FinancialLocked: The NAT Gateway is locked because of an overdue bill.
  • SecurityLocked: The NAT Gateway is locked due to security reasons.
CreationTime String 2017-06-08T12:20:55

The time when the instance was created. The format follows the ISO 8601 standard and uses UTC time. Format: YYYY-MM-DDThh:mmZ.

Status String Initiating

The status of the NAT gateway:

  • Initiating: The NAT Gateway is being initialized.
  • Available: The NAT Gateway is available.
  • Pending: The NAT Gateway is being configured.
NatType String Normal

The type of the NAT Gateway. Valid value: Normal

InternetChargeType String PayBySpec

The billing method for network usage of the NAT Gateway. This value can only be PayBySpec.

ResourceGroupId String rg-bp67acfmxazb4ph****

The ID of the resource group.

DeletionProtection Boolean true

Indicates whether deletion protection is enabled for the instance.

  • true: Deletion protection is enabled.
  • false: Deletion protection is disabled.
IpLists Array

The Elastic IP address associated with the NAT Gateway.

IpAddress String 116.62.222.xx

The IP address of the Elastic IP address.

ForwardTableIds List ftb-uf6gj3mhsg94qsqst****

The ID of the port forwarding table.

SnatTableIds List stb-uf6dalcdu0krz423p****

The ID of the SNAT table of the NAT Gateway.

BandwidthPackageIds List bwp-s6lmotmkk****

The ID of the bandwidth package associated with the NAT Gateway.

NatGatewayPrivateInfo Struct

The private information of the NAT Gateway.

If the value of NatType is Normal, all parameters returned in this list are null.

EniInstanceId Integer 10

The ID of the ENI.

PrivateIpAddress String 192.168.1.xx

The private IP address.

VswitchId String vsw-bp1s2laxhdf9ayjbo****

The ID of the VSwitch.

IzNo String cn-hangzhou-b

The zone.

MaxBandwidth Integer 5120

The maximum bandwidth. Unit: Mbit/s

Examples

Request example

http(s)://vpc.aliyuncs.com/? Action=DescribeNatGateways
&RegionId=cn-hangzhou
&<CommonParameters>

Response example

XML format

<DescribeNatGatewaysResponse>
    <PageNumber>1</PageNumber>
    <TotalCount>1</TotalCount>
    <PageSize>10</PageSize>
    <RequestId>1207C80C-7CAB-4874-A9A0-D19EC9F35490</RequestId>
    <NatGateways>
            <NatGateway>
                    <Description></Description>
                    <Spec>Small</Spec>
                    <IpLists>
                            <IpList>
                                    <IpAddress>118.xx.xx.181</IpAddress>
                                    <AllocationId>eip-bp1xyg5ipmh3nledx****</AllocationId>
                                    <UsingStatus>UsedBySnatTable</UsingStatus>
                            </IpList>
                            <IpList>
                                    <IpAddress>47.xx.xx.34</IpAddress>
                                    <AllocationId>eip-bp19eue77u20cffjc****</AllocationId>
                                    <UsingStatus>UsedByForwardTable</UsingStatus>
                            </IpList>
                    </IpLists>
                    <ForwardTableIds>
                            <ForwardTableId>ftb-bp15o9aylj19vfvgt****</ForwardTableId>
                    </ForwardTableIds>
                    <VpcId>vpc-bp15k6sx6fhdz2jw4****</VpcId>
                    <NatGatewayId>ngw-bp1047e2d4z7kf2ki****</NatGatewayId>
                    <CreationTime>2018-01-10T09:48:29Z</CreationTime>
                    <BandwidthPackageIds>
        </BandwidthPackageIds>
                    <Name></Name>
                    <Status>Available</Status>
                    <BusinessStatus>Normal</BusinessStatus>
                    <RegionId>cn-hangzhou</RegionId>
                    <SnatTableIds>
                            <SnatTableId>stb-bp1tyr0o48w6wymur****</SnatTableId>
                    </SnatTableIds>
                    <InstanceChargeType>PostPaid</InstanceChargeType>
            </NatGateway>
    </NatGateways>
</DescribeNatGatewaysResponse>

JSON format

{
    "PageNumber": 1, 
    "TotalCount": 1, 
    "PageSize": 10, 
    "RequestId": "1207C80C-7CAB-4874-A9A0-D19EC9F35490", 
    "NatGateways": {
        "NatGateway": [ 
            {
                "Description": "", 
                "Spec":"Small", 
                "IpLists": {
                    "IpList": [
                        {
                            "IpAddress":"192.xx.xx.159", 
                            "AllocationId":"eip-bp1xyg5ipmh3nledxywxf", 
                            "UsingStatus":"UsedBySnatTable"
                        }, 
                        {
                            "IpAddress":"12.xx.xx.78" 
                            "AllocationId":"eip-bp19eue77u20cffjcu4ea", 
                            "UsingStatus":"UsedByForwardTable"
                        }
                    ]
                }, 
                "ForwardTableIds":{
                    "ForwardTableId":[
                        "ftb-bp15o9aylj19vfvgt****"
                    ]
                }, 
                "VpcId":"vpc-bp15k6sx6fhdz2jw4daz0", 
                "NatGatewayId": "ngw-bp1047e2d4z7kf2ki****", 
                "CreationTime": "2018-01-10T09:48:29Z", 
                "BandwidthPackageIds": {
                    "BandwidthPackageId": [ ]
                }, 
                "Name": "", 
                "Status": "Available", 
                "BusinessStatus": "Normal", 
                "RegionId": "cn-hangzhou", 
                "SnatTableIds": {
                    "SnatTableId": [
                        "stb-bp1tyr0o48w6wymur****"
                    ]
                }, 
                "InstanceChargeType": "PostPaid"
            }
        ]
    }
}

Errors

HTTP status code Error code Error message Description
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The specified RegionId does not exist.

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