调用GetNatGatewayAttribute接口查询单个NAT网关实例的信息。

使用说明

本接口可以查询单个公网NAT网关或VPC NAT网关的信息,文中出现的“NAT网关”不做具体的区分。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
RegionId String cn-qingdao

NAT网关所属的地域ID。

您可以通过调用DescribeRegions接口获取地域ID。

NatGatewayId String ngw-bp1b0lic8uz4r6vf2****

NAT网关实例ID。

Action String GetNatGatewayAttribute

系统规定参数。取值:GetNatGatewayAttribute

返回数据

名称 类型 示例值 描述
VpcId String vpc-bp15zckdt37pq72z****

NAT网关实例所属VPC的ID。

CreationTime String 2021-12-08T12:20:20Z

NAT网关的创建时间。格式为:YYYY-MM-DDThh:mm:ssZ。

Status String Available

NAT网关的状态。取值:

  • Creating:创建中。创建NAT网关是异步操作,在创建完成之前是Creating状态。
  • Available:可用。NAT网关创建完成后的状态,是稳定状态。
  • Modifying:修改中。变配NAT网关是异步操作,在变配的过程中是Modifying状态。
  • Deleting:删除中。删除NAT网关是异步操作,在删除的过程中是Deleting状态。
  • Converting:转换中。普通型NAT网关转换到增强型NAT网关是异步操作,在转换过程中是Converting状态。
NatType String Enhanced

公网NAT网关的类型,当前取值为Enhanced,即增强型公网NAT网关。

NetworkType String internet

NAT网关的类型。取值:

  • internet:公网NAT网关。
  • intranet:VPC NAT网关。
RegionId String cn-qingdao

NAT网关实例所在的地域ID。

EcsMetricEnabled Boolean true

是否开启了网关流量监控功能。取值:

  • true:开启了网关流量监控功能。
  • false:未开启网关流量监控功能。
RequestId String 4EC47282-1B74-4534-BD0E-403F3EE64CAF

请求ID。

Description String NAT

NAT网关实例的描述。

ExpiredTime String 2021-12-26T12:20:20Z

NAT网关实例的过期时间。

ResourceGroupId String rg-bp67acfmxazb4ph****

资源组ID。

NatGatewayId String ngw-bp1047e2d4z7kf2ki****

NAT网关实例的ID。

BusinessStatus String Normal

NAT网关的业务状态。取值:

  • Normal:正常。
  • FinancialLocked:欠费锁定状态。
Name String abc

NAT网关实例名称。

ForwardTable Object

DNAT列表的信息。

ForwardTableId String ftb-uf6gj3mhsg94qsqst****

DNAT表的ID。

ForwardEntryCount Integer 1

DNAT条目的个数。

SnatTable Object

SNAT列表信息。

SnatEntryCount Integer 1

SANT条目的个数。

SnatTableId String stb-SnatTableIds****

SNAT列表的ID。

FullNatTable Object

FULLNAT列表的信息。

FullNatEntryCount Long 1

FULLNAT条目的个数。

FullNatTableId String fulltb-gw88z7hhlv43rmb26****

FULLNAT表的ID。

BillingConfig Object

账单配置信息。

InternetChargeType String PayBySpec

NAT网关实例的计费类型。取值:

  • PayBySpec:按固定规格计费。
  • PayByLcu:按使用量计费。
AutoPay String false

是否自动付费,当InstanceChargeType参数的值为PrePaid时,返回以下值:

  • false:不开启自动付费,生成订单后需要到订单中心完成支付。
  • true:开启自动付费,自动支付订单。

InstanceChargeType参数的值为PostPaid时,返回值为空。

Spec String Small

公网NAT网关实例的规格,且当InternetChargeTypePayBySpec时,返回以下值:

  • Small:小型。
  • Middle:中型。
  • Large:大型。

    InternetChargeTypePayByLcu时,返回值为空。

InstanceChargeType String PostPaid

NAT网关实例的付费模式,取值:PostPaid(按量付费)。

PrivateInfo Object

NAT网关实例的私网信息。

MaxBandwidth Integer 5120

最大带宽值,单位为Mbps。

VswitchId String vsw-bp1s2laxhdf9ayjbo***

NAT网关实例所属的交换机ID。

PrivateIpAddress String 192.168.XX.XX

私网IP地址。

IzNo String cn-qingdao-b

NAT网关实例所属的可用区。

EniInstanceId String eni-bp1cmgtoaka8vfyg****

弹性网卡实例ID。

DeletionProtectionInfo Object

删除保护信息。

Enabled Boolean true

是否开启删除保护功能。

  • true:开启了删除保护功能。
  • false:未开启删除保护功能。
IpList Array of IpList

公网NAT网关绑定的弹性公网IP列表。

UsingStatus String idle

公网NAT网关实例绑定的弹性公网IP的关联关系。

  • idle:弹性公网IP未关联SNAT条目或DNAT条目。
  • UsedBySnatTable:弹性公网IP已关联SNAT条目。
  • UsedByForwardTable:弹性公网IP已关联DNAT条目。
IpAddress String 116.33.XX.XX

弹性公网IP的地址。

AllocationId String eip-bp13e9i2qst4g6jzi****

弹性公网IP的实例ID。

PrivateLinkEnabled Boolean true

是否支持私网连接,取值:

  • true:支持私网连接。
  • false:不支持私网连接。
PrivateLinkMode String FullNat

私网连接服务转化模式,取值:

  • FullNat:使用FULLNAT模式。
  • Geneve:使用Geneve模式。

示例

请求示例

http(s)://[Endpoint]/?RegionId=cn-qingdao
&NatGatewayId=ngw-bp1b0lic8uz4r6vf2****
&Action=GetNatGatewayAttribute
&公共请求参数

正常返回示例

XML格式

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

<GetNatGatewayAttributeResponse>
    <VpcId>vpc-bp15zckdt37pq72z****</VpcId>
    <CreationTime>2021-12-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>2021-12-26T12:20:20Z</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>eni-bp1cmgtoaka8vfyg****</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格式

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

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

错误码

HttpCode 错误码 错误信息 描述
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. 指定的RegionId不存在。

访问错误中心查看更多错误码。