Queries the details of NAT gateways that meet specified conditions in a specified region.
Operation description
This operation queries the details of Internet NAT gateways and VPC NAT gateways. The term NAT gateway in this document refers to both types unless otherwise specified.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:DescribeNatGateways |
get |
NatGateway
NatGateway
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the NAT gateway. You can call the DescribeRegions operation to query region IDs. |
cn-hangzhou |
| NatGatewayId |
string |
No |
The ID of the NAT gateway. |
ngw-bp1uewa15k4iy5770**** |
| VpcId |
string |
No |
The ID of the virtual private cloud (VPC) to which the NAT gateway belongs. |
vpc-bp15zckdt37pq72z**** |
| Name |
string |
No |
The name of the NAT gateway. The name must be 1 to 128 characters in length, and cannot start with |
test |
| InstanceChargeType |
string |
No |
The billing method of the NAT gateway. Valid value: PostPaid (pay-as-you-go). |
PostPaid |
| Spec |
string |
No |
|
Example value for the China site: Small. Example value for the international site: leave empty |
| NatType |
string |
No |
The type of the NAT gateway. Valid value: Enhanced (enhanced NAT gateway). |
Enhanced |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the NAT gateway belongs. |
rg-bp67acfmxazb4ph**** |
| PageNumber |
integer |
No |
The page number. Default value: 1. |
10 |
| PageSize |
integer |
No |
The number of entries per page for paging in a paged query. Maximum value: 50. Default value: 10. |
1 |
| DryRun |
boolean |
No |
Specifies whether to only perform a dry run for this request. Valid values:
|
false |
| Status |
string |
No |
The status of the NAT gateway. Valid values:
|
Available |
| NetworkType |
string |
No |
The type of the NAT gateway. Valid values:
|
internet |
| Tag |
array<object> |
No |
The list of tags. |
|
|
object |
No |
The list of tags. |
||
| Key |
string |
No |
The tag key of the NAT gateway. You can specify up to 20 tag keys. The tag key can be up to 128 characters in length, and cannot start with |
KeyTest |
| Value |
string |
No |
The tag value of the NAT gateway. You can specify up to 20 tag values. The tag value can be up to 128 characters in length, and cannot start with |
valueTest |
| ZoneId |
string |
No |
The zone ID of the NAT gateway. |
cn-hangzhou-b |
| AvailabilityMode |
string |
No |
The disaster recovery type of the NAT gateway. Valid values:
|
CrossAZ |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The number of entries per page. |
||
| PageSize |
integer |
The number of entries per page. |
10 |
| RequestId |
string |
The request ID. |
4EC47282-1B74-4534-BD0E-403F3EE64CAF |
| PageNumber |
integer |
The current page number. |
10 |
| TotalCount |
integer |
The total number of NAT gateways queried. |
1 |
| NatGateways |
object |
||
| NatGateway |
array<object> |
The details of the NAT gateways. |
|
|
array<object> |
The details of the NAT gateways. |
||
| Status |
string |
The status of the NAT gateway. Valid values:
|
Creating |
| CreationTime |
string |
The time when the NAT gateway was created. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. |
2021-06-08T12:20:20Z |
| VpcId |
string |
The ID of the VPC to which the NAT gateway belongs. |
vpc-bp15zckdt37pq72z**** |
| NatType |
string |
The type of the NAT gateway. Valid value: Enhanced (enhanced NAT gateway). |
Enhanced |
| AutoPay |
boolean |
Specifies whether automatic payment is enabled for orders. Valid values:
|
false |
| Spec |
string |
The specification of the NAT gateway. This parameter returns an empty value. When InternetChargeType is set to PayByLcu, an empty value is returned. |
Small |
| DeletionProtection |
boolean |
Specifies whether deletion protection is enabled. Valid values:
|
true |
| NetworkType |
string |
The type of the NAT gateway. Valid values:
|
internet |
| SecurityProtectionEnabled |
boolean |
Specifies whether the firewall feature is enabled. Valid values:
|
false |
| InstanceChargeType |
string |
The billing method of the NAT gateway. Valid value: PostPaid (pay-as-you-go). |
PostPaid |
| RegionId |
string |
The region ID of the NAT gateway. |
cn-hangzhou |
| EcsMetricEnabled |
boolean |
Specifies whether gateway traffic monitoring is enabled. Valid values:
|
true |
| IcmpReplyEnabled |
boolean |
Specifies whether ICMP echo reply is enabled. Valid values:
|
true |
| Description |
string |
The description of the NAT gateway. |
NAT |
| ExpiredTime |
string |
The expiration time of the NAT gateway. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format. |
2021-08-26T16:00Z |
| ResourceGroupId |
string |
The ID of the resource group. |
rg-bp67acfmxazb4ph**** |
| NatGatewayId |
string |
The ID of the NAT gateway. |
ngw-bp1047e2d4z7kf2ki**** |
| InternetChargeType |
string |
The billing method of the NAT gateway. Valid values:
|
PayByLcu |
| BusinessStatus |
string |
The service status of the NAT gateway. Valid values:
|
Normal |
| Name |
string |
The name of the NAT gateway. |
abc |
| IpLists |
object |
||
| IpList |
array<object> |
The list of EIPs associated with the Internet NAT gateway. |
|
|
object |
The list of IP addresses of the NAT gateway. |
||
| UsingStatus |
string |
The association status of the EIP associated with the Internet NAT gateway. Valid values:
|
UsedByForwardTable |
| IpAddress |
string |
The IP address of the EIP associated with the NAT gateway. |
116.62.XX.XX |
| SnatEntryEnabled |
boolean |
Specifies whether an IP address that is already used in a DNAT entry can also be used in an SNAT entry. Valid values:
|
false |
| AllocationId |
string |
The instance ID of the EIP associated with the NAT gateway. |
eip-m5egzuvp3dgixen6**** |
| PrivateIpAddress |
string |
The private IP address of the NAT gateway. |
192.168.XX.XX |
| ForwardTableIds |
object |
||
| ForwardTableId |
array |
The ID of the DNAT table of the NAT gateway. |
|
|
string |
The ID of the DNAT table. |
ftb-uf6gj3mhsg94qsqst**** |
|
| SnatTableIds |
object |
||
| SnatTableId |
array |
The ID of the SNAT table of the NAT gateway. |
|
|
string |
The ID of the SNAT table. |
stb-uf6dalcdu0krz423p**** |
|
| FullNatTableIds |
object |
||
| FullNatTableId |
array |
The ID of the FULLNAT table. |
|
|
string |
The ID of the FULLNAT table. |
fulltb-gw88z7hhlv43rmb26**** |
|
| NatGatewayPrivateInfo |
object |
The private network information of the enhanced Internet NAT gateway. Note
If NatType is set to Normal, all parameters in this list return empty values. |
|
| VswitchId |
string |
The ID of the vSwitch to which the NAT gateway belongs. |
vsw-bp1s2laxhdf9ayjbo**** |
| EniInstanceId |
string |
The instance ID of the elastic network interface controller (NIC). |
eni-m5eg4ozy5st8q3q4**** |
| MaxBandwidth |
integer |
The maximum bandwidth. Unit: Mbit/s. |
5120 |
| MaxSessionQuota |
integer |
The maximum number of concurrent connections supported by the NAT gateway. |
2000000 |
| MaxSessionEstablishRate |
integer |
The maximum number of new connections per second supported by the NAT gateway. |
100000 |
| PrivateIpAddress |
string |
The private IP address. |
192.168.XX.XX |
| IzNo |
string |
The zone to which the NAT gateway belongs. |
cn-hangzhou-b |
| EniType |
string |
The attachment mode between the elastic network interface controller (NIC) and the NAT gateway. Valid values:
|
indirect |
| PrivateLinkEnabled |
boolean |
Specifies whether PrivateLink is supported. Valid values:
|
true |
| PrivateLinkMode |
string |
The PrivateLink service translation mode. Valid values:
|
FullNat |
| EipBindMode |
string |
The EIP attachment mode of the NAT gateway. Valid values:
Note
When the EIP attachment mode of the NAT gateway is the standard EIP mode, the EIP occupies a private IP of the vSwitch to which the NAT gateway belongs. Ensure that there are sufficient private IP addresses in the vSwitch. If there are no active idle private IP addresses in the vSwitch, you cannot attach new EIPs. When the EIP attachment mode is the standard EIP mode, the maximum number of EIPs that can be attached to the NAT gateway is 50. |
MULTI_BINDED |
| Tags |
object |
||
| Tag |
array<object> |
The list of tags. |
|
|
object |
The list of tags. |
||
| TagKey |
string |
The tag key of the instance. |
KeyTest |
| TagValue |
string |
The tag value of the instance. |
valueTest |
| EnableSessionLog |
string |
Specifies whether session logging is enabled. Valid values:
|
true |
| AccessMode |
object |
The access mode for reverse access to the VPC NAT gateway. |
|
| ModeValue |
string |
The access mode. Valid values:
|
route |
| TunnelType |
string |
The tunnel mode type. Valid values:
|
geneve |
| AvailabilityMode |
string |
The disaster recovery type of the NAT gateway. Valid values:
|
CrossAZ |
| IpPrefixList |
object |
||
| IpPrefixList |
array<object> |
The list of NAT IP prefix CIDR blocks. |
|
|
object |
|||
| IpPrefix |
string |
The NAT IP prefix CIDR block. |
192.168.0.0/28 |
Examples
Success response
JSON format
{
"PageSize": 10,
"RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
"PageNumber": 10,
"TotalCount": 1,
"NatGateways": {
"NatGateway": [
{
"Status": "Creating",
"CreationTime": "2021-06-08T12:20:20Z",
"VpcId": "vpc-bp15zckdt37pq72z****",
"NatType": "Enhanced",
"AutoPay": false,
"Spec": "Small",
"DeletionProtection": true,
"NetworkType": "internet",
"SecurityProtectionEnabled": false,
"InstanceChargeType": "PostPaid",
"RegionId": "cn-hangzhou",
"EcsMetricEnabled": true,
"IcmpReplyEnabled": true,
"Description": "NAT",
"ExpiredTime": "2021-08-26T16:00Z",
"ResourceGroupId": "rg-bp67acfmxazb4ph****",
"NatGatewayId": "ngw-bp1047e2d4z7kf2ki****",
"InternetChargeType": "PayByLcu",
"BusinessStatus": "Normal",
"Name": "abc",
"IpLists": {
"IpList": [
{
"UsingStatus": "UsedByForwardTable",
"IpAddress": "116.62.XX.XX",
"SnatEntryEnabled": false,
"AllocationId": "eip-m5egzuvp3dgixen6****",
"PrivateIpAddress": "192.168.XX.XX"
}
]
},
"ForwardTableIds": {
"ForwardTableId": [
"ftb-uf6gj3mhsg94qsqst****"
]
},
"SnatTableIds": {
"SnatTableId": [
"stb-uf6dalcdu0krz423p****"
]
},
"FullNatTableIds": {
"FullNatTableId": [
"fulltb-gw88z7hhlv43rmb26****"
]
},
"NatGatewayPrivateInfo": {
"VswitchId": "vsw-bp1s2laxhdf9ayjbo****",
"EniInstanceId": "eni-m5eg4ozy5st8q3q4****",
"MaxBandwidth": 5120,
"MaxSessionQuota": 2000000,
"MaxSessionEstablishRate": 100000,
"PrivateIpAddress": "192.168.XX.XX",
"IzNo": "cn-hangzhou-b",
"EniType": "indirect"
},
"PrivateLinkEnabled": true,
"PrivateLinkMode": "FullNat",
"EipBindMode": "MULTI_BINDED",
"Tags": {
"Tag": [
{
"TagKey": "KeyTest",
"TagValue": "valueTest"
}
]
},
"EnableSessionLog": "true",
"AccessMode": {
"ModeValue": "route",
"TunnelType": "geneve"
},
"AvailabilityMode": "CrossAZ",
"IpPrefixList": {
"IpPrefixList": [
{
"IpPrefix": "192.168.0.0/28"
}
]
}
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | An internal error occurred. |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.