GetNatGatewayAttribute

更新时间:
复制 MD 格式

Call GetNatGatewayAttribute to query the details of a NAT gateway instance.

Operation description

Use this API to query a single public nat gateway or VPC nat gateway. In this topic, "nat gateway" refers to either type.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the NAT gateway.

You can call the DescribeRegions operation to obtain the region ID.

cn-qingdao

NatGatewayId

string

Yes

The ID of the NAT gateway.

ngw-bp1b0lic8uz4r6vf2****

RegionId

string

Yes

The region ID of the NAT gateway.

You can call the DescribeRegions operation to obtain the region ID.

cn-qingdao

Response elements

Element

Type

Description

Example

object

VpcId

string

The ID of the VPC to which the NAT Gateway instance belongs.

vpc-bp15zckdt37pq72z****

CreationTime

string

The creation time of the NAT Gateway instance. The time is in the YYYY-MM-DDThh:mm:ssZ format.

2021-12-08T12:20:20Z

Status

string

The status of the NAT Gateway instance. Valid values:

  • Creating: The NAT Gateway is being created. This is an asynchronous operation.

  • Available: The NAT Gateway is available. This is the steady state of the NAT Gateway after creation.

  • Modifying: The NAT Gateway is being modified. This is an asynchronous operation.

  • Deleting: The NAT Gateway is being deleted. This is an asynchronous operation.

  • Converting: The NAT Gateway is being converted to an Enhanced NAT Gateway. This is an asynchronous operation.

Available

NatType

string

The type of the public NAT gateway. The value Enhanced indicates an Enhanced NAT Gateway.

Enhanced

NetworkType

string

The type of the NAT Gateway. Valid values:

  • internet: A public NAT gateway.

  • intranet: A VPC NAT Gateway.

internet

RegionId

string

The region ID of the NAT Gateway instance.

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

NAT

ExpiredTime

string

The expiration time of the NAT Gateway instance.

2021-12-26T12:20:20Z

ResourceGroupId

string

The ID of the resource group.

rg-bp67acfmxazb4ph****

NatGatewayId

string

The ID of the NAT Gateway instance.

ngw-bp1047e2d4z7kf2ki****

BusinessStatus

string

The business status of the NAT Gateway instance. Valid values:

  • Normal: The instance is running normally.

  • FinancialLocked: The instance is suspended due to an overdue payment.

Normal

Name

string

The name of the NAT Gateway instance.

abc

ForwardTable

object

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

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

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 method of the NAT Gateway instance. Valid values:

  • PayBySpec: billed by specification.

  • PayByLcu: billed by usage.

PayBySpec

AutoPay

string

Indicates whether auto-payment is enabled. This parameter is returned only if InstanceChargeType is set to PrePaid. Valid values:

  • false: Auto-payment is disabled. After an order is generated, the payment must be completed in the Orders console.

  • true: Auto-payment is enabled. Payments are automatically completed.

If InstanceChargeType is set to PostPaid, an empty string is returned.

false

Spec

string

The specification of the public NAT gateway instance. This parameter is returned only if InternetChargeType is set to PayBySpec. Valid values:

  • Small

  • Middle

  • Large

Small

InstanceChargeType

string

The billing method of the NAT Gateway instance. Valid values:

  • PostPaid: pay-as-you-go.

  • PrePaid: subscription.

PostPaid

PrivateInfo

object

The private network information about the NAT Gateway instance.

MaxBandwidth

integer

The maximum bandwidth, in Mbps.

5120

VswitchId

string

The ID of the vSwitch to which the NAT Gateway instance belongs.

vsw-bp1s2laxhdf9ayjbo***

PrivateIpAddress

string

The private IP address.

192.168.XX.XX

IzNo

string

The ID of the availability zone to which the NAT Gateway instance belongs.

cn-qingdao-b

EniInstanceId

string

The ID of the elastic network interface instance.

eni-bp1cmgtoaka8vfyg****

DeletionProtectionInfo

object

Information about the deletion protection feature.

Enabled

boolean

Indicates whether deletion protection is enabled.

  • true: Deletion protection is enabled.

  • false: Deletion protection is disabled.

true

IpList

array<object>

The Elastic IP Addresses (EIPs) that are associated with the public NAT gateway.

object

The Elastic IP Addresses (EIPs) that are associated with the public NAT gateway.

UsingStatus

string

The usage status of the Elastic IP Address (EIP).

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

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

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

idle

IpAddress

string

The Elastic IP Address.

116.33.XX.XX

AllocationId

string

The ID of the EIP instance.

eip-bp13e9i2qst4g6jzi****

PrivateLinkEnabled

boolean

Indicates whether PrivateLink is supported. Valid values:

  • true: PrivateLink is supported.

  • false: PrivateLink is not supported.

true

PrivateLinkMode

string

The mode of the PrivateLink service. Valid values:

  • FullNat: FULLNAT mode.

  • Geneve: Geneve mode.

FullNat

EnableSessionLog

boolean

Indicates whether session logging is enabled. Valid values:

  • true: Session logging is enabled.

  • false: Session logging is disabled.

true

LogDelivery

object

The session log delivery settings.

LogDeliveryType

string

The destination to which session logs are delivered. The value is always sls, which indicates Log Service.

sls

LogDestination

string

The Log Service Logstore to which session logs are delivered.

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

DeliveryStatus

string

The status of log delivery. Valid values:

  • Success: The logs are delivered successfully.

  • Failure: The logs failed to be delivered.

Failure

DeliverLogsErrorMessage

string

The error message that is returned when log delivery fails.

LogStoreNotExist: logstore session_log_test does not exist

AccessMode

object

The access mode of the VPC NAT Gateway.

ModeValue

string

The access mode. Valid values:

  • route: route mode.

  • tunnel: tunnel mode.

route

TunnelType

string

The tunnel type. This parameter is returned only when ModeValue is set to tunnel. Valid value:

  • geneve: Geneve.

geneve

AvailabilityMode

string

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": ""
}

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.