Queries NAT gateways that meet specific conditions in a specified region.
Usage notes
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
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeNatGateways |
The operation that you want to perform. Set the value to DescribeNatGateways. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the NAT gateway that you want to query. You can call the DescribeRegions operation to query the most recent region list. |
NatGatewayId | String | No | ngw-bp1uewa15k4iy5770**** |
The ID of the NAT gateway. |
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 | Example value for the Alibaba Cloud China site: Small. If you use the Alibaba Cloud International site, ignore this parameter. |
The size of the NAT gateway. Ignore this parameter. |
NatType | String | No | Enhanced |
The type of NAT gateway. Set the value to Enhanced (enhanced NAT gateway). |
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 returned per page. Maximum value: 50. Default value: 10. |
DryRun | Boolean | No | true |
Specifies whether only to precheck the request. Valid values:
|
Status | String | No | Available |
The status of the NAT gateway. Valid values:
|
NetworkType | String | No | internet |
The type of the NAT gateway. Valid values:
|
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:
|
CreationTime | String | 2021-06-08T12:20:20Z |
The time when the NAT gateway was created. |
VpcId | String | vpc-bp15zckdt37pq72z**** |
The ID of the VPC where the NAT gateway is deployed. |
NatType | String | Enhanced |
The type of the NAT gateway. The value is set to Enhanced (enhanced NAT gateway). |
AutoPay | Boolean | false |
Indicates whether automatic payment is enabled. Valid values:
|
Spec | String | Small |
The size of the NAT gateway. An empty value is returned for the parameter. |
DeletionProtection | Boolean | true |
Indicates whether the deletion protection feature is enabled. Valid values:
|
NetworkType | String | internet |
The type of NAT gateway. Valid values:
|
SecurityProtectionEnabled | Boolean | false |
Indicates whether the firewall feature is enabled. Valid values:
|
InstanceChargeType | String | PostPaid |
The billing method of the NAT gateway. Set the value to PostPaid, which specifies 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:
|
IcmpReplyEnabled | Boolean | false |
Indicates whether the ICMP non-retrieval feature is enabled. Valid values:
|
Description | String | NAT |
The description of the NAT gateway. |
ExpiredTime | String | 2021-08-26T16:00Z |
The time when the NAT gateway expires. |
ResourceGroupId | String | rg-bp67acfmxazb4ph**** |
The ID of the resource group to which the instance belongs. |
NatGatewayId | String | ngw-bp1047e2d4z7kf2ki**** |
The ID of the NAT gateway. |
InternetChargeType | String | PayByLcu |
The metering method for the NAT gateway. Valid values:
|
BusinessStatus | String | Normal |
The status of the NAT gateway. Valid values:
|
Name | String | abc |
The name of the NAT gateway. |
IpLists | Array of IpList |
The IP address information about the NAT gateway. |
|
IpList | |||
UsingStatus | String | UsedByForwardTable |
The status of the elastic IP address (EIP) associated with the NAT gateway. Valid values:
|
IpAddress | String | 116.62.XX.XX |
The IP address of the EIP associated with the NAT gateway. |
SnatEntryEnabled | Boolean | false |
Indicates whether EIPs specified in DNAT entries can be specified in SNAT entries. Valid values:
|
AllocationId | String | eip-m5egzuvp3dgixen6**** |
The ID of the EIP associated with the NAT gateway. |
PrivateIpAddress | String | 192.168.XX.XX |
The private IP address of the NAT gateway. |
ForwardTableIds | Array of String | ftb-uf6gj3mhsg94qsqst**** |
The ID of the 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 belongs. |
EniInstanceId | String | eni-m5eg4ozy5st8q3q4**** |
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 | indirect |
The mode in which the ENI is associated with the NAT gateway.
|
PrivateLinkEnabled | Boolean | true |
Indicates whether the NAT gateway supports PrivateLink. Valid values:
|
PrivateLinkMode | String | FullNat |
The mode that is used by PrivateLink. Valid values:
|
Examples
Sample requests
http(s)://[Endpoint]/?Action=DescribeNatGateways
&RegionId=cn-hangzhou
&NatGatewayId=ngw-bp1uewa15k4iy5770****
&VpcId=vpc-bp15zckdt37pq72z****
&Name=test
&InstanceChargeType=PostPaid
Example value for the Spec parameter: Small. You can use this value on the Alibaba Cloud China site. If you use the Alibaba Cloud International site, ignore this parameter.
&NatType=Enhanced
&ResourceGroupId=rg-bp67acfmxazb4ph****
&PageNumber=10
&PageSize=1
&DryRun=true
&Status=Available
&NetworkType=internet
&ZoneId=cn-hangzhou-b
&Common request parameters
Sample success 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>2021-06-08T12:20:20Z</CreationTime>
<VpcId>vpc-bp15zckdt37pq72z****</VpcId>
<NatType>Enhanced</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>2021-08-26T16:00Z</ExpiredTime>
<ResourceGroupId>rg-bp67acfmxazb4ph****</ResourceGroupId>
<NatGatewayId>ngw-bp1047e2d4z7kf2ki****</NatGatewayId>
<InternetChargeType>PayByLcu</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>eni-m5eg4ozy5st8q3q4****</EniInstanceId>
<MaxBandwidth>5120</MaxBandwidth>
<PrivateIpAddress>192.168.XX.XX</PrivateIpAddress>
<IzNo>cn-hangzhou-b</IzNo>
<EniType>indirect</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",
"PageNumber" : 10,
"TotalCount" : 10,
"NatGateways" : [ {
"Status" : "Creating",
"CreationTime" : "2021-06-08T12:20:20Z",
"VpcId" : "vpc-bp15zckdt37pq72z****",
"NatType" : "Enhanced",
"Spec" : "Small",
"DeletionProtection" : true,
"NetworkType" : "internet",
"SecurityProtectionEnabled" : false,
"InstanceChargeType" : "PostPaid",
"RegionId" : "cn-hangzhou",
"EcsMetricEnabled" : true,
"IcmpReplyEnabled" : false,
"Description" : "NAT",
"ExpiredTime" : "2021-08-26T16:00Z",
"ResourceGroupId" : "rg-bp67acfmxazb4ph****",
"NatGatewayId" : "ngw-bp1047e2d4z7kf2ki****",
"InternetChargeType" : "PayByLcu",
"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" : "eni-m5eg4ozy5st8q3q4****",
"MaxBandwidth" : 5120,
"PrivateIpAddress" : "192.168.XX.XX",
"IzNo" : "cn-hangzhou-b",
"EniType" : "indirect"
},
"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.