Queries the information about a specified NAT gateway.

API description

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
NatGatewayId String Yes ngw-bp1b0lic8uz4r6vf2****

The ID of the NAT gateway.

RegionId String Yes cn-qingdao

The region ID of the NAT gateway.

You can call the DescribeRegions operation to query the most recent region list.

Response parameters

Parameter Type Example Description
BillingConfig Struct

The billing information.

AutoPay String false

Indicates whether automatic payment is enabled. Valid values:

  • false: Automatic payment is disabled. After an order is generated, you must go to the Order Center to complete the payment.
  • true: Automatic payment is enabled. Payments are automatically completed.

If InstanceChargeType is set to PrePaid, this parameter is returned. If InstanceChargeType is set to PostPaid, this parameter is not returned.

InstanceChargeType String PostPaid

The billing method of the NAT gateway. Valid values:

  • PostPaid: pay-as-you-go
  • PrePaid: subscription
Note For NAT gateways created on the International site (alibabacloud.com), only PostPaid (pay-as-you-go) is returned.
InternetChargeType String PayBySpec

The metering method of the NAT gateway. Valid values:

  • PayBySpec: pay-by-specification
  • PayByLcu: pay-by-actual-usage
Spec String Small

The specification of the Internet NAT gateway.

  • Small: small
  • Middle: medium
  • Large: large
BusinessStatus String Normal

The status of the NAT gateway. Valid values:

  • Normal: normal
  • FinancialLocked: locked due to overdue payments
CreationTime String 2017-06-08T12:20:20Z

The time that indicates when the NAT gateway was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

DeletionProtectionInfo Struct

The information about the deletion protection feature.

Enabled Boolean true

Indicates whether the deletion protection feature is enabled. Valid values:

  • true: yes
  • false: no
Description String NAT

The description of the NAT gateway.

EcsMetricEnabled Boolean true

Indicates whether the traffic monitoring feature is enabled. Valid values:

  • true: yes
  • false: no
ExpiredTime String 2017-08-26T16:00Z

The time that indicates when the NAT gateway expires.

ForwardTable Struct

The information about DNAT entries.

ForwardEntryCount Integer 1

The number of DNAT entries.

ForwardTableId String ftb-uf6gj3mhsg94qsqst****

The ID of the DNAT table.

IpList Array of IpList

The elastic IP addresses (EIPs) that are associated with the NAT gateway.

AllocationId String eip-bp13e9i2qst4g6jzi****

The ID of the EIP.

IpAddress String 116.33.XX.XX

The EIP.

UsingStatus String idle

Indicates how the EIP is used. Valid values:

  • idle: The EIP is not specified in an SNAT entry or a DNAT entry.
  • UsedBySnatTable: The EIP is specified in an SNAT entry.
  • UsedByForwardTable: The EIP is specified in a DNAT entry.
Name String abc****

The name of the NAT gateway.

NatGatewayId String ngw-bp1047e2d4z7kf2ki****

The ID of the NAT gateway.

NatType String Enhanced

The type of the Internet NAT gateway. Only Enhanced is returned, which specifies an enhanced Internet NAT gateway.

NetworkType String internet

The type of the NAT gateway. Valid values:

  • internet: an Internet NAT gateway
  • intranet: a VPC NAT gateway
PrivateInfo Struct

The information about the private network.

EniInstanceId String 10

The instance ID of the elastic network interface (ENI).

IzNo String cn-hangzhou-b

The zone where the NAT gateway is deployed.

MaxBandwidth Integer 5120

The bandwidth limit. Unit: Mbit/s.

PrivateIpAddress String 192.168.XX.XX

The private IP address.

VswitchId String vsw-bp1s2laxhdf9ayjbo***

The ID of the vSwitch to which the NAT gateway belongs.

RegionId String cn-hangzhou

The region ID of the NAT gateway.

RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF

The ID of the request.

ResourceGroupId String rg-bp67acfmxazb4ph****

The ID of the resource group.

SnatTable Struct

The information about the SNAT entries.

SnatEntryCount Integer 1

The number of SNAT entries.

SnatTableId String stb-SnatTableIds****

The ID of the SNAT table.

Status String Available

The status of the NAT gateway. Valid values:

  • Creating: After you send a request to create a NAT gateway, the system creates the NAT gateway in the background. The NAT gateway remains in the Creating state until the operation is completed.
  • Available: If the operation is successful, the NAT gateway is created and the NAT gateway changes to the Available state.
  • Modifying: After you send a request to modify a NAT gateway, the system modifies the NAT gateway in the background. The NAT gateway remains in the Modifying state until the operation is completed.
  • Deleting: After you send a request to delete a NAT gateway, the system deletes the NAT gateway in the background. The NAT gateway remains in the Deleting state until the operation is completed.
  • Converting: After you send a request to upgrade a standard NAT gateway to an enhanced NAT gateway, the system upgrades the NAT gateway in the background. The NAT gateway remains in the Converting state until the operation is completed.
VpcId String vpc-bp15zckdt37pq72z****

The ID of the VPC to which the NAT gateway belongs.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetNatGatewayAttribute
&NatGatewayId=ngw-bp1b0lic8uz4r6vf2****
&RegionId=cn-qingdao
&<Common request parameters>

Sample success responses

XML format

<GetNatGatewayAttributeResponse>
  <Status>Available</Status>
  <ForwardTable>
        <ForwardEntryCount>1</ForwardEntryCount>
        <ForwardTableId>ftb-uf6gj3mhsg94qsqst****</ForwardTableId>
  </ForwardTable>
  <Description>NAT</Description>
  <ResourceGroupId>rg-bp67acfmxazb4ph****</ResourceGroupId>
  <RequestId>4EC47282-1B74-4534-BD0E-403F3EE64CAF</RequestId>
  <IpList>
        <UsingStatus>idle</UsingStatus>
        <AllocationId>eip-bp13e9i2qst4g6jzi****</AllocationId>
        <IpAddress>116.33.XX.XX</IpAddress>
  </IpList>
  <BillingConfig>
        <InstanceChargeType>PostPaid</InstanceChargeType>
        <AutoPay>false</AutoPay>
        <Spec>Small</Spec>
        <InternetChargeType>PayBySpec</InternetChargeType>
  </BillingConfig>
  <DeletionProtectionInfo>
        <Enabled>true</Enabled>
  </DeletionProtectionInfo>
  <BusinessStatus>Normal</BusinessStatus>
  <NatType>Enhanced</NatType>
  <SnatTable>
        <SnatEntryCount>1</SnatEntryCount>
        <SnatTableId>stb-SnatTableIds****</SnatTableId>
  </SnatTable>
  <Name>abc****</Name>
  <EcsMetricEnabled>true</EcsMetricEnabled>
  <VpcId>vpc-bp15zckdt37pq72z****</VpcId>
  <NetworkType>internet</NetworkType>
  <ExpiredTime>2017-08-26T16:00Z</ExpiredTime>
  <CreationTime>2017-06-08T12:20:20Z</CreationTime>
  <PrivateInfo>
        <IzNo>cn-hangzhou-b</IzNo>
        <PrivateIpAddress>192.168.XX.XX</PrivateIpAddress>
        <MaxBandwidth>5120</MaxBandwidth>
        <EniInstanceId>10</EniInstanceId>
        <VswitchId>vsw-bp1s2laxhdf9ayjbo***</VswitchId>
  </PrivateInfo>
  <RegionId>cn-hangzhou</RegionId>
  <NatGatewayId>ngw-bp1047e2d4z7kf2ki****</NatGatewayId>
</GetNatGatewayAttributeResponse>

JSON format

{
    "Status": "Available",
    "ForwardTable": {
        "ForwardEntryCount": 1,
        "ForwardTableId": "ftb-uf6gj3mhsg94qsqst****"
    },
    "Description": "NAT",
    "ResourceGroupId": "rg-bp67acfmxazb4ph****",
    "RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
    "IpList": {
        "UsingStatus": "idle",
        "AllocationId": "eip-bp13e9i2qst4g6jzi****",
        "IpAddress": "116.33.XX.XX"
    },
    "BillingConfig": {
        "InstanceChargeType": "PostPaid",
        "AutoPay": false,
        "Spec": "Small",
        "InternetChargeType": "PayBySpec"
    },
    "DeletionProtectionInfo": {
        "Enabled": true
    },
    "BusinessStatus": "Normal",
    "NatType": "Enhanced",
    "SnatTable": {
        "SnatEntryCount": 1,
        "SnatTableId": "stb-SnatTableIds****"
    },
    "Name": "abc****",
    "EcsMetricEnabled": true,
    "VpcId": "vpc-bp15zckdt37pq72z****",
    "NetworkType": "internet",
    "ExpiredTime": "2017-08-26T16:00Z",
    "CreationTime": "2017-06-08T12:20:20Z",
    "PrivateInfo": {
        "IzNo": "cn-hangzhou-b",
        "PrivateIpAddress": "192.168.XX.XX",
        "MaxBandwidth": 5120,
        "EniInstanceId": 10,
        "VswitchId": "vsw-bp1s2laxhdf9ayjbo***"
    },
    "RegionId": "cn-hangzhou",
    "NatGatewayId": "ngw-bp1047e2d4z7kf2ki****"
}

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.