Queries information about a specified NAT gateway.
Usage notes
You can call this operation to query information about a specified Internet NAT gateway or Virtual Private Cloud (VPC) NAT gateway. In this topic, "NAT gateway" refers to both gateway types.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
RegionId | String | Yes | cn-qingdao |
The ID of the region where the NAT gateway is deployed. You can call the DescribeRegions operation to query the most recent region list. |
NatGatewayId | String | Yes | ngw-bp1b0lic8uz4r6vf2**** |
The ID of the NAT gateway. |
Action | String | Yes | GetNatGatewayAttribute |
The operation that you want to perform. Set the value to GetNatGatewayAttribute. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
VpcId | String | vpc-bp15zckdt37pq72z**** |
The ID of the VPC to which the NAT gateway belongs. |
CreationTime | String | 2021-12-08T12:20:20Z |
The time when the NAT gateway was created. Format: YYYY-MM-DDThh:mm:ssZ. |
Status | String | Available |
The status of the NAT gateway. Valid values:
|
NatType | String | Enhanced |
The type of the Internet NAT gateway. Only Enhanced is returned, which indicates an enhanced Internet NAT gateway. |
NetworkType | String | internet |
The type of the NAT gateway. Valid values:
|
RegionId | String | cn-qingdao |
The ID of the region where the NAT gateway is deployed. |
EcsMetricEnabled | Boolean | true |
Indicates whether the traffic monitoring feature is enabled. Valid values:
|
RequestId | String | 4EC47282-1B74-4534-BD0E-403F3EE64CAF |
The ID of the request. |
Description | String | NAT |
The description of the NAT gateway. |
ExpiredTime | String | 2021-12-26T12:20:20Z |
The time when the NAT gateway expires. |
ResourceGroupId | String | rg-bp67acfmxazb4ph**** |
The ID of the resource group. |
NatGatewayId | String | ngw-bp1047e2d4z7kf2ki**** |
The ID of the NAT gateway. |
BusinessStatus | String | Normal |
The service status of the NAT gateway. Valid values:
|
Name | String | abc |
The name of the NAT gateway. |
ForwardTable | Object |
The information about the DNAT table. |
|
ForwardTableId | String | ftb-uf6gj3mhsg94qsqst**** |
The ID of the DNAT table. |
ForwardEntryCount | Integer | 1 |
The number of DNAT entries. |
SnatTable | Object |
The information about the SNAT table. |
|
SnatEntryCount | Integer | 1 |
The number of SNAT entries. |
SnatTableId | String | stb-SnatTableIds**** |
The ID of the SNAT table. |
FullNatTable | Object |
The information about the FULLNAT table. |
|
FullNatEntryCount | Long | 1 |
The number of FULLNAT entries. |
FullNatTableId | String | fulltb-gw88z7hhlv43rmb26**** |
The ID of the FULLNAT table. |
BillingConfig | Object |
The billing information. |
|
InternetChargeType | String | PayBySpec |
The metering method of the NAT gateway. Valid values:
|
AutoPay | String | false |
Indicates whether automatic payment is enabled. If the InstanceChargeType parameter is set to PrePaid, one of the following values is returned:
The return value of this parameter is empty if InstanceChargeType is set to PostPaid. |
Spec | String | Small |
The specification of the Internet NAT gateway. If the InternetChargeType parameter is set to PayBySpec, one of the following values is returned:
|
InstanceChargeType | String | PostPaid |
The billing method of the NAT gateway. The value is set to PostPaid, which indicates the pay-as-you-go billing method. |
PrivateInfo | Object |
The private network information about the NAT gateway. |
|
MaxBandwidth | Integer | 5120 |
The maximum bandwidth. Unit: Mbit/s. |
VswitchId | String | vsw-bp1s2laxhdf9ayjbo*** |
The ID of the vSwitch to which the NAT gateway belongs. |
PrivateIpAddress | String | 192.168.XX.XX |
The private IP address. |
IzNo | String | cn-qingdao-b |
The zone where the NAT gateway is deployed. |
EniInstanceId | String | eni-bp1cmgtoaka8vfyg**** |
The ID of the elastic network interface (ENI). |
DeletionProtectionInfo | Object |
The information about the deletion protection feature. |
|
Enabled | Boolean | true |
Indicates whether deletion protection is enabled.
|
IpList | Array of IpList |
The elastic IP addresses (EIPs) that are associated with the Internet NAT gateway. |
|
UsingStatus | String | idle |
The association status of the EIP.
|
IpAddress | String | 116.33.XX.XX |
The IP address of the EIP. |
AllocationId | String | eip-bp13e9i2qst4g6jzi**** |
The ID of the EIP. |
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]/?RegionId=cn-qingdao
&NatGatewayId=ngw-bp1b0lic8uz4r6vf2****
&Action=GetNatGatewayAttribute
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetNatGatewayAttributeResponse>
<VpcId>vpc-bp15zckdt37pq72z****</VpcId>
<CreationTime>2021-12-08T12:20:20Z</CreationTime>
<Status>Available</Status>
<NatType>Enhanced</NatType>
<NetworkType>internet</NetworkType>
<RegionId>cn-qingdao</RegionId>
<EcsMetricEnabled>true</EcsMetricEnabled>
<RequestId>4EC47282-1B74-4534-BD0E-403F3EE64CAF</RequestId>
<Description>NAT</Description>
<ExpiredTime>2021-12-26T12:20:20Z</ExpiredTime>
<ResourceGroupId>rg-bp67acfmxazb4ph****</ResourceGroupId>
<NatGatewayId>ngw-bp1047e2d4z7kf2ki****</NatGatewayId>
<BusinessStatus>Normal</BusinessStatus>
<Name>abc</Name>
<ForwardTable>
<ForwardTableId>ftb-uf6gj3mhsg94qsqst****</ForwardTableId>
<ForwardEntryCount>1</ForwardEntryCount>
</ForwardTable>
<SnatTable>
<SnatEntryCount>1</SnatEntryCount>
<SnatTableId>stb-SnatTableIds****</SnatTableId>
</SnatTable>
<FullNatTable>
<FullNatEntryCount>1</FullNatEntryCount>
<FullNatTableId>fulltb-gw88z7hhlv43rmb26****</FullNatTableId>
</FullNatTable>
<BillingConfig>
<InternetChargeType>PayBySpec</InternetChargeType>
<AutoPay>false</AutoPay>
<Spec>Small</Spec>
<InstanceChargeType>PostPaid</InstanceChargeType>
</BillingConfig>
<PrivateInfo>
<MaxBandwidth>5120</MaxBandwidth>
<VswitchId>vsw-bp1s2laxhdf9ayjbo***</VswitchId>
<PrivateIpAddress>192.168.XX.XX</PrivateIpAddress>
<IzNo>cn-qingdao-b</IzNo>
<EniInstanceId>eni-bp1cmgtoaka8vfyg****</EniInstanceId>
</PrivateInfo>
<DeletionProtectionInfo>
<Enabled>true</Enabled>
</DeletionProtectionInfo>
<IpList>
<UsingStatus>idle</UsingStatus>
<IpAddress>116.33.XX.XX</IpAddress>
<AllocationId>eip-bp13e9i2qst4g6jzi****</AllocationId>
</IpList>
<PrivateLinkEnabled>true</PrivateLinkEnabled>
<PrivateLinkMode>FullNat</PrivateLinkMode>
</GetNatGatewayAttributeResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"VpcId" : "vpc-bp15zckdt37pq72z****",
"CreationTime" : "2021-12-08T12:20:20Z",
"Status" : "Available",
"NatType" : "Enhanced",
"NetworkType" : "internet",
"RegionId" : "cn-qingdao",
"EcsMetricEnabled" : true,
"RequestId" : "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
"Description" : "NAT",
"ExpiredTime" : "2021-12-26T12:20:20Z",
"ResourceGroupId" : "rg-bp67acfmxazb4ph****",
"NatGatewayId" : "ngw-bp1047e2d4z7kf2ki****",
"BusinessStatus" : "Normal",
"Name" : "abc",
"ForwardTable" : {
"ForwardTableId" : "ftb-uf6gj3mhsg94qsqst****",
"ForwardEntryCount" : 1
},
"SnatTable" : {
"SnatEntryCount" : 1,
"SnatTableId" : "stb-SnatTableIds****"
},
"FullNatTable" : {
"FullNatEntryCount" : 1,
"FullNatTableId" : "fulltb-gw88z7hhlv43rmb26****"
},
"BillingConfig" : {
"InternetChargeType" : "PayBySpec",
"AutoPay" : "false",
"Spec" : "Small",
"InstanceChargeType" : "PostPaid"
},
"PrivateInfo" : {
"MaxBandwidth" : 5120,
"VswitchId" : "vsw-bp1s2laxhdf9ayjbo***",
"PrivateIpAddress" : "192.168.XX.XX",
"IzNo" : "cn-qingdao-b",
"EniInstanceId" : "eni-bp1cmgtoaka8vfyg****"
},
"DeletionProtectionInfo" : {
"Enabled" : true
},
"IpList" : [ {
"UsingStatus" : "idle",
"IpAddress" : "116.33.XX.XX",
"AllocationId" : "eip-bp13e9i2qst4g6jzi****"
} ],
"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.