All Products
Search
Document Center

NAT Gateway:GetNatGatewayAttribute

Last Updated:Feb 22, 2024

Queries information about a NAT gateway.

Operation description

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:GetNatGatewayAttributeRead
  • NatGateway
    acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region where the NAT gateway is deployed.

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

cn-qingdao
NatGatewayIdstringYes

The ID of the NAT gateway.

ngw-bp1b0lic8uz4r6vf2****

Response parameters

ParameterTypeDescriptionExample
object
VpcIdstring

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

vpc-bp15zckdt37pq72z****
CreationTimestring

The time when the NAT gateway was created. Format: YYYY-MM-DDThh:mm:ssZ.

2021-12-08T12:20:20Z
Statusstring

The status of the NAT gateway. Valid values:

  • Creating: being created. The operation to create a NAT gateway 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. The operation to upgrade or downgrade a NAT gateway is asynchronous. The NAT gateway remains in the Modifying state until it is upgraded or downgraded.
  • Deleting: being deleted. The operation to delete a NAT gateway is asynchronous. The NAT gateway remains in the Deleting state until it is deleted.
  • Converting: being converted. The operation to convert a standard NAT gateway to an enhanced NAT gateway is asynchronous. The NAT gateway remains in the Converting state until it is converted.
Available
NatTypestring

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

Enhanced
NetworkTypestring

The type of the NAT gateway. Valid values:

  • internet: an Internet NAT gateway
  • intranet: a VPC NAT gateway
internet
RegionIdstring

The ID of the region where the NAT gateway is deployed.

cn-qingdao
EcsMetricEnabledboolean

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

  • true: yes
  • false: no
true
RequestIdstring

The ID of the request.

4EC47282-1B74-4534-BD0E-403F3EE64CAF
Descriptionstring

The description of the NAT gateway.

NAT
ExpiredTimestring

The time when the NAT gateway expires.

2021-12-26T12:20:20Z
ResourceGroupIdstring

The ID of the resource group.

rg-bp67acfmxazb4ph****
NatGatewayIdstring

The ID of the NAT gateway.

ngw-bp1047e2d4z7kf2ki****
BusinessStatusstring

The service status of the NAT gateway. Valid values:

  • Normal: normal
  • FinancialLocked: locked due to overdue payments
Normal
Namestring

The name of the NAT gateway.

abc
ForwardTableobject

The information about the DNAT table.

ForwardTableIdstring

The ID of the DNAT table.

ftb-uf6gj3mhsg94qsqst****
ForwardEntryCountinteger

The number of DNAT entries.

1
SnatTableobject

The information about the SNAT table.

SnatEntryCountinteger

The number of SNAT entries.

1
SnatTableIdstring

The ID of the SNAT table.

stb-SnatTableIds****
FullNatTableobject

The information about the FULLNAT table.

FullNatEntryCountlong

The number of FULLNAT entries.

1
FullNatTableIdstring

The ID of the FULLNAT table.

fulltb-gw88z7hhlv43rmb26****
BillingConfigobject

The billing information.

InternetChargeTypestring

The metering method of the NAT gateway. Valid values:

  • PayBySpec: pay-by-specification
  • PayByLcu: pay-by-CU
PayBySpec
AutoPaystring

Indicates whether automatic payment is enabled. If the InstanceChargeType parameter is set to PrePaid, one of the following values is returned:

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

The return value of this parameter is empty if InstanceChargeType is set to PostPaid.

false
Specstring

The specification of the Internet NAT gateway. If the InternetChargeType parameter is set to PayBySpec, one of the following values is returned:

  • Small: small

  • Middle: medium

  • Large: large

    The return value of this parameter is empty if InternetChargeType is set to PayByLcu.

Small
InstanceChargeTypestring

The billing method of the NAT gateway. The value is set to PostPaid, which indicates the pay-as-you-go billing method.

PostPaid
PrivateInfoobject

The private network information about the NAT gateway.

MaxBandwidthinteger

The maximum bandwidth. Unit: Mbit/s.

5120
VswitchIdstring

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

vsw-bp1s2laxhdf9ayjbo***
PrivateIpAddressstring

The private IP address.

192.168.XX.XX
IzNostring

The zone where the NAT gateway is deployed.

cn-qingdao-b
EniInstanceIdstring

The ID of the elastic network interface (ENI).

eni-bp1cmgtoaka8vfyg****
DeletionProtectionInfoobject

The information about the deletion protection feature.

Enabledboolean

Indicates whether deletion protection is enabled.

  • true: yes
  • false: no
true
IpListobject []

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

UsingStatusstring

The association status of the EIP.

  • 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.
idle
IpAddressstring

The IP address of the EIP.

116.33.XX.XX
AllocationIdstring

The ID of the EIP.

eip-bp13e9i2qst4g6jzi****
PrivateLinkEnabledboolean

Indicates whether the NAT gateway supports PrivateLink. Valid values:

  • true: yes
  • false: no
true
PrivateLinkModestring

The mode that is used by PrivateLink. Valid values:

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

Examples

Sample success responses

JSONformat

{
  "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

HTTP status codeError codeError messageDescription
404InvalidRegionId.NotFoundThe specified RegionId does not exist in our records.The specified region ID does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-03-01The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404