Queries NAT gateways that meet specific conditions in a specified region.
Operation description
You can call this operation to query both Virtual Private Cloud (VPC) NAT gateways and Internet NAT gateways. NAT gateways in this topic refer to both VPC NAT gateways and Internet NAT gateways.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vpc:DescribeNatGateways | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the NAT gateways that you want to query. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
NatGatewayId | string | No | The ID of the NAT gateway. | ngw-bp1uewa15k4iy5770**** |
VpcId | string | No | The ID of the 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 If this parameter is not set, the system automatically assigns a name to the NAT gateway. | test |
InstanceChargeType | string | No | The billing method of the NAT gateway. Set the value to PostPaid, which specifies the pay-as-you-go billing method. | PostPaid |
Spec | string | No | The size of the NAT gateway. Ignore this parameter. | Invalid parameter. |
NatType | string | No | The type of NAT gateway. Set the value to 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 number of the page to return. Default value: 1. | 10 |
PageSize | integer | No | The number of entries to return on each page. 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. Valid values:
| Available |
NetworkType | string | No | The type of the NAT gateway. Valid values:
| internet |
Tag | array<object> | No | The tags. | |
object | No | The tags. | ||
Key | string | No | The tag keys of the NAT gateway. You can specify up to 20 tag keys. Each tag key cannot exceed 64 characters in length, and cannot start with | KeyTest |
Value | string | No | The tag values of the NAT gateway. You can specify up to 20 tag values. The tag value cannot exceed 128 characters in length, and cannot start with | valueTest |
ZoneId | string | No | The ID of the zone to which the NAT gateway belongs. | cn-hangzhou-b |
Response parameters
Examples
Sample success responses
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": false,
"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"
}
]
}
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | The specified region ID does not exist. |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | An internal error occurred. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-10-23 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-05-07 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-01-18 | API Description Update. The Error code has changed | View Change Details |
2023-03-01 | The Error code has changed | View Change Details |
2022-08-26 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2021-11-17 | The Error code has changed. The response structure of the API has changed | View Change Details |
2021-11-17 | The Error code has changed. The response structure of the API has changed | View Change Details |