Queries the information about a specified NAT gateway.

Descriptions

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
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 2017-06-08T12:20:20Z

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

Status String Available

The status of the NAT gateway. Valid values:

  • Creating: being created When a NAT gateway is being created, the operation is asynchronous. The NAT gateway remains in the Creating state until it is created.
  • Available: available After a NAT gateway is created, it remains in a stable state.
  • Modifying: being modified When a NAT gateway is being upgraded or downgraded, the operation is asynchronous. The NAT gateway remains in the Modifying state until it is upgraded or downgraded.
  • Deleting: being deleted When a NAT gateway is being deleted, the operation is asynchronous. The NAT gateway remains in the Deleting state until it is deleted.
  • Converting: being converted When a standard NAT gateway is being upgraded to an enhanced NAT gateway, the operation is asynchronous. The NAT gateway remains in the Deleting state until it is converted.
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
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:

  • true: yes
  • false: no
RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF

The ID of the request.

Description String NAT

The description of the NAT gateway.

ExpiredTime String 2017-08-26T16:00Z

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 status of the NAT gateway. Valid values:

  • Normal: The NAT gateway works as expected.
  • FinancialLocked: The NAT gateway is locked due to overdue payments.
Name String abc****

The name of the NAT gateway.

ForwardTable Object

The information about DNAT entries.

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 entries.

SnatEntryCount Integer 1

The number of SNAT entries.

SnatTableId String stb-SnatTableIds****

The ID of the SNAT table.

FullNatTable Object

The information about the list of FULLNAT entries.

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:

  • PayBySpec: pay-by-specification
  • PayByLcu: pay-by-actual-usage
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.

Spec String Small

The size of the Internet NAT gateway. Valid values:

  • Small: small
  • Middle: medium
  • Large: large
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 information about the private network.

MaxBandwidth Integer 5120

The maximum bandwidth value. 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 10

The ID of the elastic network interface (ENI).

DeletionProtectionInfo Object

The information about the deletion protection feature.

Enabled Boolean true

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

  • true: yes
  • false: no
IpList Array of IpList

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

UsingStatus String idle

Indicates whether the EIP is specified in a DNAT or SNAT entry. 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.
IpAddress String 116.33.XX.XX

The IP address of the EIP.

AllocationId String eip-bp13e9i2qst4g6jzi****

The ID of the instance with which the EIP is associated.

PrivateLinkEnabled Boolean true

Indicates whether the NAT gateway supports PrivateLink. Valid values:

  • true: yes
  • false: no
PrivateLinkMode String FullNat

The mode that is used by PrivateLink. Valid values:

  • FullNat: the FULLNAT mode
  • Geneve: the GENEVE mode

Examples

Sample requests

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

Sample responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetNatGatewayAttributeResponse>
    <VpcId>vpc-bp15zckdt37pq72z****</VpcId>
    <CreationTime>2017-06-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>2017-08-26T16:00Z</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>10</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" : "2017-06-08T12:20:20Z",
  "Status" : "Available",
  "NatType" : "Enhanced",
  "NetworkType" : "internet",
  "RegionId" : "cn-qingdao",
  "EcsMetricEnabled" : true,
  "RequestId" : "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
  "Description" : "NAT",
  "ExpiredTime" : "2017-08-26T16:00Z",
  "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" : "10"
  },
  "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.