GetNatGatewayAttribute

Updated at:

Queries the details of a NAT gateway instance.

Operation description

This operation queries the details of an Internet NAT gateway or a VPC NAT gateway. The term "NAT gateway" in this topic refers to both types unless otherwise specified.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:GetNatGatewayAttribute

get

*NatGateway

acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the NAT gateway.

You can call the DescribeRegions operation to query region IDs.

cn-qingdao

NatGatewayId

string

Yes

The instance ID of the NAT gateway.

ngw-bp1b0lic8uz4r6vf2****

Response elements

Element

Type

Description

Example

object

VpcId

string

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

vpc-bp15zckdt37pq72z****

CreationTime

string

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

2021-12-08T12:20:20Z

Status

string

The status of the NAT gateway. Valid values:

  • Creating: The NAT gateway is being created. Creating a NAT gateway is an asynchronous operation. The NAT gateway remains in the Creating state until it is created.

  • Available: The NAT gateway is available. This is a stable state after the NAT gateway is created.

  • Modifying: The NAT gateway is being modified. Modifying the specifications of a NAT gateway is an asynchronous operation. The NAT gateway remains in the Modifying state until it is modified.

  • Deleting: The NAT gateway is being deleted. Deleting a NAT gateway is an asynchronous operation. The NAT gateway remains in the Deleting state until it is deleted.

  • Converting: The NAT gateway is being upgraded. Upgrading a standard NAT gateway to an enhanced NAT gateway is an asynchronous operation. The NAT gateway remains in the Converting state until it is upgraded.

Available

NatType

string

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

Enhanced

NetworkType

string

The type of the NAT gateway. Valid values:

  • internet: Internet NAT gateway.

  • intranet: VPC NAT gateway.

internet

RegionId

string

The region ID of the NAT gateway.

cn-qingdao

EcsMetricEnabled

boolean

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

  • true: The gateway traffic monitoring feature is enabled.

  • false: The gateway traffic monitoring feature is disabled.

true

RequestId

string

The request ID.

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

Description

string

The description of the NAT gateway.

NAT

ExpiredTime

string

The expiration time of the NAT gateway. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

2021-12-26T12:20:20Z

ResourceGroupId

string

The ID of the resource group.

rg-bp67acfmxazb4ph****

NatGatewayId

string

The ID of the NAT gateway.

ngw-bp1047e2d4z7kf2ki****

BusinessStatus

string

The service status of the NAT gateway. Valid values:

  • Normal: The NAT gateway is running normally.

  • FinancialLocked: The NAT gateway is locked due to an overdue payment.

Normal

Name

string

The name of the NAT gateway.

abc

ForwardTable

object

The information about the DNAT table.

ForwardTableId

string

The ID of the DNAT table.

ftb-uf6gj3mhsg94qsqst****

ForwardEntryCount

integer

The number of DNAT entries.

1

SnatTable

object

The information about the SNAT table.

SnatEntryCount

integer

The number of SNAT entries.

1

SnatTableId

string

The ID of the SNAT table.

stb-SnatTableIds****

FullNatTable

object

The information about the FULLNAT table.

FullNatEntryCount

integer

The number of FULLNAT entries.

1

FullNatTableId

string

The ID of the FULLNAT table.

fulltb-gw88z7hhlv43rmb26****

BillingConfig

object

The billing configuration.

InternetChargeType

string

The billing type of the NAT gateway instance. Valid values:

  • PayBySpec: billing by defined specifications.

  • PayByLcu: billing by usage.

PayBySpec

AutoPay

string

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

  • false: Automatic payment is disabled. After an order is generated, you must complete the payment in the User Center.

  • true: Automatic payment is enabled. The order is automatically paid.

If the InstanceChargeType parameter is set to PostPaid, this parameter is left empty.

false

Spec

string

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

  • Small: small.

  • Middle: medium.

  • Large: large. If the InternetChargeType parameter is set to PayByLcu, this parameter is left empty.

Small

InstanceChargeType

string

The billing method of the NAT gateway. Valid values:

  • PostPaid: pay-as-you-go.

  • PrePaid: subscription.

PostPaid

PrivateInfo

object

The private network information about the NAT gateway.

MaxBandwidth

integer

The maximum bandwidth. Unit: Mbit/s.

5120

VswitchId

string

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

vsw-bp1s2laxhdf9ayjbo***

PrivateIpAddress

string

The private IP address.

192.168.XX.XX

IzNo

string

The zone to which the NAT gateway belongs.

cn-qingdao-b

EniInstanceId

string

The instance ID of the elastic network interface controller (NIC).

eni-bp1cmgtoaka8vfyg****

DeletionProtectionInfo

object

The deletion protection information.

Enabled

boolean

Indicates whether deletion protection is enabled. Valid values:

  • true: Deletion protection is enabled.

  • false: Deletion protection is disabled.

true

IpList

array<object>

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

object

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

UsingStatus

string

The association status of the EIP that is associated with the Internet NAT gateway. Valid values:

  • idle: The EIP is not associated with an SNAT entry or a DNAT entry.

  • UsedBySnatTable: The EIP is associated with an SNAT entry.

  • UsedByForwardTable: The EIP is associated with a DNAT entry.

idle

IpAddress

string

The IP address of the EIP.

116.33.XX.XX

AllocationId

string

The instance ID of the EIP.

eip-bp13e9i2qst4g6jzi****

PrivateLinkEnabled

boolean

Indicates whether PrivateLink is supported. Valid values:

  • true: PrivateLink is supported.

  • false: PrivateLink is not supported.

true

PrivateLinkMode

string

The translation mode of the PrivateLink service. Valid values:

  • FullNat: FULLNAT mode.

  • Geneve: Geneve mode.

FullNat

EnableSessionLog

boolean

Indicates whether the session log feature is enabled. Valid values:

  • true: The session log feature is enabled.

  • false: The session log feature is disabled.

true

LogDelivery

object

The session log configuration.

LogDeliveryType

string

The destination type of the session log delivery. Valid value:

  • sls: Simple Log Service.

sls

LogDestination

string

The destination address to which the session log is delivered.

acs:log:cn-hangzhou:0000:project/nat_session_log_project/logstore/session_log_test

DeliveryStatus

string

The delivery status of the session log. Valid values:

  • Succsess: The delivery is successful.

  • Failure: The delivery failed.

Failure

DeliverLogsErrorMessage

string

The error message returned when the session log delivery fails.

LogStoreNotExist: logstore session_log_test does not exist

AccessMode

object

The access mode for reverse access to the VPC NAT gateway.

ModeValue

string

The access mode. Valid values:

  • route: route mode.

  • tunnel: tunnel mode.

route

TunnelType

string

The tunnel mode type. Valid value:

  • geneve: Geneve.

geneve

AvailabilityMode

string

The disaster recovery type of the NAT gateway. Valid values:

  • CrossAZ: cross-zone disaster recovery.

  • SingleAZ: single-zone disaster recovery.

CrossAZ

Examples

Success response

JSON format

{
  "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",
  "EnableSessionLog": true,
  "LogDelivery": {
    "LogDeliveryType": "sls",
    "LogDestination": "acs:log:cn-hangzhou:0000:project/nat_session_log_project/logstore/session_log_test",
    "DeliveryStatus": "Failure",
    "DeliverLogsErrorMessage": "LogStoreNotExist: logstore session_log_test does not exist"
  },
  "AccessMode": {
    "ModeValue": "route",
    "TunnelType": "geneve"
  },
  "AvailabilityMode": "CrossAZ"
}

Error codes

HTTP status code

Error code

Error message

Description

404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.