Calls DescribeNatGateways to query the detailed information of NAT gateways that meet specified conditions in a specified region in list form.
Operation description
This operation supports querying detailed information about Internet NAT gateways or VPC NAT gateways. The term "NAT gateway" used in this document does not distinguish between the two types.
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 to query. You can call the DescribeRegions operation to obtain the region ID. |
cn-hangzhou |
| NatGatewayId |
string |
No |
The ID of the NAT gateway to query. |
ngw-bp1uewa15k4iy5770**** |
| VpcId |
string |
No |
The ID of the VPC to which the NAT gateway to query belongs. |
vpc-bp15zckdt37pq72z**** |
| Name |
string |
No |
The name of the NAT gateway to query. 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 instance to query. Valid value: PostPaid (pay-as-you-go). |
PostPaid |
| Spec |
string |
No |
|
中国站示例值:Small,国际站示例值:无需填写 |
| 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 to query belongs. |
rg-bp67acfmxazb4ph**** |
| PageNumber |
integer |
No |
The page number. Default value: 1. |
10 |
| PageSize |
integer |
No |
The number of entries per page for paginated queries. Maximum value: 50. Default value: 10. |
1 |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
|
false |
| Status |
string |
No |
The status of the NAT gateway to query. Valid values:
|
Available |
| NetworkType |
string |
No |
The type of the NAT gateway to query. 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 instance. You can specify up to 20 tag keys. The tag key can be up to 128 characters in length. It cannot start with |
KeyTest |
| Value |
string |
No |
The tag value of the NAT gateway instance. You can specify up to 20 tag values. The tag value can be up to 128 characters in length. It cannot start with |
valueTest |
| ZoneId |
string |
No |
The ID of the zone where the NAT gateway is deployed. |
cn-hangzhou-b |
| AvailabilityMode |
string |
No |
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 entries in the NAT gateway list. |
1 |
| NatGateways |
object |
||
| NatGateway |
array<object> |
The detailed information of the NAT gateway. |
|
|
array<object> |
The detailed information of the NAT gateway. |
||
| Status |
string |
The status of the NAT Gateway. Valid values:
|
Creating |
| CreationTime |
string |
The time when the NAT Gateway was created. |
2021-06-08T12:20:20Z |
| VpcId |
string |
The ID of the VPC where the NAT Gateway is deployed. |
vpc-bp15zckdt37pq72z**** |
| NatType |
string |
The type of NAT Gateway. A value of Enhanced indicates an Enhanced NAT Gateway. |
Enhanced |
| AutoPay |
boolean |
Indicates whether the order is automatically paid. Valid values:
|
false |
| Spec |
string |
The specification of the NAT Gateway. This parameter is empty. This parameter is empty if the |
Small |
| DeletionProtection |
boolean |
Indicates whether deletion protection is enabled. Valid values:
|
true |
| NetworkType |
string |
The type of the NAT Gateway. Valid values:
|
internet |
| SecurityProtectionEnabled |
boolean |
Indicates whether the firewall feature is enabled. Valid values:
|
false |
| InstanceChargeType |
string |
The billing method of the NAT Gateway instance. The value is PostPaid (Pay-As-You-Go). |
PostPaid |
| RegionId |
string |
The ID of the region where the NAT Gateway is deployed. |
cn-hangzhou |
| EcsMetricEnabled |
boolean |
Indicates whether the traffic monitoring feature is enabled. Valid values:
|
true |
| IcmpReplyEnabled |
boolean |
Indicates whether the ICMP reply feature is enabled. Valid values:
|
true |
| Description |
string |
The description of the NAT Gateway. |
NAT |
| ExpiredTime |
string |
The time when the NAT Gateway expires. |
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 type of the NAT Gateway. Valid values:
|
PayByLcu |
| BusinessStatus |
string |
The business status of the NAT Gateway. Valid values:
|
Normal |
| Name |
string |
The name of the NAT Gateway instance. |
abc |
| IpLists |
object |
||
| IpList |
array<object> |
A list of EIPs associated with the Internet NAT Gateway. |
|
|
object |
Details of an EIP associated with the NAT gateway. |
||
| UsingStatus |
string |
The status of the EIP associated with the Internet NAT Gateway. Valid values:
|
UsedByForwardTable |
| IpAddress |
string |
The IP address of the EIP that is associated with the NAT Gateway. |
116.62.XX.XX |
| SnatEntryEnabled |
boolean |
Indicates whether an IP address that is used in a DNAT rule can also be used in an SNAT rule. Valid values:
|
false |
| AllocationId |
string |
The ID of the EIP that is 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 |
A list of DNAT table IDs. |
|
|
string |
The ID of the DNAT table. |
ftb-uf6gj3mhsg94qsqst**** |
|
| SnatTableIds |
object |
||
| SnatTableId |
array |
A list of SNAT table IDs. |
|
|
string |
The ID of the SNAT table. |
stb-uf6dalcdu0krz423p**** |
|
| FullNatTableIds |
object |
||
| FullNatTableId |
array |
A list of FULLNAT table IDs. |
|
|
string |
The ID of the FULLNAT table. |
fulltb-gw88z7hhlv43rmb26**** |
|
| NatGatewayPrivateInfo |
object |
The private network details of the enhanced Internet NAT Gateway. Note
If |
|
| VswitchId |
string |
The ID of the VSwitch to which the NAT Gateway belongs. |
vsw-bp1s2laxhdf9ayjbo**** |
| EniInstanceId |
string |
The ID of the elastic network interface (ENI). |
eni-m5eg4ozy5st8q3q4**** |
| MaxBandwidth |
integer |
The maximum bandwidth. Unit: Mbps. |
5120 |
| MaxSessionQuota |
integer |
The maximum number of concurrent connections. |
2000000 |
| MaxSessionEstablishRate |
integer |
The maximum new connection rate, in connections per second. |
100000 |
| PrivateIpAddress |
string |
The private IP address. |
192.168.XX.XX |
| IzNo |
string |
The zone where the NAT Gateway is deployed. |
cn-hangzhou-b |
| EniType |
string |
The mode in which the ENI is associated with the NAT Gateway. Valid values:
|
indirect |
| PrivateLinkEnabled |
boolean |
Indicates whether PrivateLink is enabled. Valid values:
|
true |
| PrivateLinkMode |
string |
The mode of the PrivateLink service. Valid values:
|
FullNat |
| EipBindMode |
string |
The mode in which EIPs are associated with the NAT Gateway. Valid values:
Note
If the NAT Gateway uses standard EIP mode, each EIP consumes a private IP address from the VSwitch where the NAT Gateway is deployed. Make sure that the VSwitch has a sufficient number of private IP addresses. Otherwise, you cannot associate new EIPs with the NAT Gateway. In standard EIP mode, you can associate a maximum of 50 EIPs with a NAT Gateway. |
MULTI_BINDED |
| Tags |
object |
||
| Tag |
array<object> |
The list of tags. |
|
|
object |
A tag object, which consists of a key-value pair. |
||
| TagKey |
string |
The tag key of the instance. |
KeyTest |
| TagValue |
string |
The tag value of the instance. |
valueTest |
| EnableSessionLog |
string |
Indicates whether the session log feature is enabled. Valid values:
|
true |
| AccessMode |
object |
The reverse access mode of the VPC NAT Gateway. |
|
| ModeValue |
string |
The access mode. Valid values:
|
route |
| TunnelType |
string |
The type of the tunnel mode:
|
geneve |
| AvailabilityMode |
string |
||
| IpPrefixList |
object |
||
| IpPrefixList |
array<object> |
A list of NAT IP prefixes. |
|
|
object |
|||
| IpPrefix |
string |
The NAT IP prefix. |
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": "",
"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.