Todos os produtos
Search
Central de documentação

NAT Gateway:DescribeNatGateways

Última atualização: Jun 29, 2026

Consulta as informações detalhadas dos NAT gateways que atendem às condições especificadas em uma região especificada em formato de lista.

Descrição da operação

Esta operação oferece suporte à consulta de informações detalhadas sobre NAT gateways de Internet ou NAT gateways de VPC. O termo "NAT gateway" usado neste documento não faz distinção entre os dois tipos.

Experimente agora

Experimente esta API no OpenAPI Explorer, sem necessidade de assinatura manual. Chamadas bem-sucedidas geram automaticamente código SDK correspondente aos seus parâmetros. Faça o download com segurança de credenciais integrada para uso local.

Testar

Autorização RAM

A tabela abaixo descreve a autorização necessária para chamar esta API. Você pode defini-la em uma política do Resource Access Management (RAM). As colunas da tabela estão detalhadas abaixo:

  • Ação: As ações que podem ser usadas no elemento Action das instruções de política de permissão do RAM para conceder permissões para executar a operação.

  • API: A API que você pode chamar para executar a ação.

  • Nível de acesso: O nível de acesso predefinido concedido para cada API. Valores válidos: create, list, get, update e delete.

  • Tipo de recurso: O tipo de recurso que suporta autorização para executar a ação. Indica se a ação suporta permissão em nível de recurso. O recurso especificado deve ser compatível com a ação. Caso contrário, a política será ineficaz.

    • Para APIs com permissões em nível de recurso, os tipos de recursos obrigatórios são marcados com um asterisco (*). Especifique o Nome de Recurso Alibaba Cloud (ARN) correspondente no elemento Resource da política.

    • Para APIs sem permissões em nível de recurso, é exibido como Todos os Recursos. Use um asterisco (*) no elemento Resource da política.

  • Chave de condição: As chaves de condição definidas pelo serviço. A chave permite controle granular, aplicando-se somente a ações ou a ações associadas a recursos específicos. Além das chaves de condição específicas do serviço, o Alibaba Cloud fornece um conjunto de chaves de condição comuns aplicáveis a todos os serviços compatíveis com RAM.

  • Ação dependente: As ações dependentes necessárias para executar a ação. Para concluir a ação, o usuário RAM ou a função RAM deve ter permissões para executar todas as ações dependentes.

Ação

Nível de acesso

Tipo de recurso

Chave de condição

Ação dependente

vpc:DescribeNatGateways

get

NatGateway

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

NatGateway

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

Nenhuma Nenhuma

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

RegionId

string

Sim

O ID da região do NAT gateway a ser consultado.

Você pode chamar a operação DescribeRegions para obter o ID da região.

cn-hangzhou

NatGatewayId

string

Não

O ID do NAT gateway a ser consultado.

ngw-bp1uewa15k4iy5770****

VpcId

string

Não

O ID da VPC à qual o NAT gateway a ser consultado pertence.

vpc-bp15zckdt37pq72z****

Name

string

Não

O nome do NAT gateway a ser consultado.

O nome deve ter de 1 a 128 caracteres e não pode começar com http:// ou https://.

test

InstanceChargeType

string

Não

  • PrePaid: o método de cobrança por assinatura legado. O método de cobrança por assinatura não está mais disponível para novas compras.

O método de cobrança da instância do NAT gateway a ser consultada. Valor válido: PostPaid (pós-pago).

PostPaid

Spec

string

Não

A especificação do NAT gateway. Deixe este parâmetro vazio.

中国站示例值:Small,国际站示例值:无需填写

NatType

string

Não

O tipo do NAT gateway. Valor válido: Enhanced (NAT gateway aprimorado).

Enhanced

ResourceGroupId

string

Não

O ID do grupo de recursos ao qual o NAT gateway a ser consultado pertence.

rg-bp67acfmxazb4ph****

PageNumber

integer

Não

O número da página. Valor padrão: 1.

10

PageSize

integer

Não

O número de entradas por página para consultas paginadas. Valor máximo: 50. Valor padrão: 10.

1

DryRun

boolean

Não

Especifica se deve ser realizado um dry run. Valores válidos:

  • true: realiza um dry run sem consultar o status do recurso. Os itens de verificação incluem se o par de AccessKey é válido, se o usuário RAM está autorizado e se os parâmetros obrigatórios foram especificados. Se a verificação falhar, o erro correspondente será retornado. Se a verificação for bem-sucedida, o código de erro DryRunOperation será retornado.

  • false (padrão): realiza uma solicitação normal. Após a verificação ser bem-sucedida, um código de status HTTP 2xx é retornado e o status do recurso é consultado diretamente.

false

Status

string

Não

O status do NAT gateway a ser consultado. Valores válidos:

  • Creating: a criação de um NAT gateway é uma operação assíncrona. O status é Creating antes que a criação seja concluída.

  • Available: o status após a criação do NAT gateway. Este é um status estável.

  • Modifying: a modificação de um NAT gateway é uma operação assíncrona. O status é Modifying durante o processo de modificação.

  • Deleting: a exclusão de um NAT gateway é uma operação assíncrona. O status é Deleting durante o processo de exclusão.

  • Converting: a conversão de um NAT gateway padrão para um NAT gateway aprimorado é uma operação assíncrona. O status é Converting durante o processo de conversão.

Available

NetworkType

string

Não

O tipo do NAT gateway a ser consultado. Valores válidos:

  • internet: NAT gateway de Internet.

  • intranet: NAT gateway de VPC.

internet

Tag

array<object>

Não

A lista de tags.

object

Não

A lista de tags.

Key

string

Não

A chave da tag da instância do NAT gateway. Você pode especificar até 20 chaves de tag.

A chave da tag pode ter até 128 caracteres. Não pode começar com aliyun ou acs: e não pode conter http:// ou https://.

KeyTest

Value

string

Não

O valor da tag da instância do NAT gateway. Você pode especificar até 20 valores de tag.

O valor da tag pode ter até 128 caracteres. Não pode começar com aliyun ou acs: e não pode conter http:// ou https://.

valueTest

ZoneId

string

Não

O ID da zona onde o NAT gateway está implantado.

cn-hangzhou-b

AvailabilityMode

string

Não

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

O número de entradas por página.

PageSize

integer

O número de entradas por página.

10

RequestId

string

O ID da solicitação.

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

PageNumber

integer

O número da página atual.

10

TotalCount

integer

O número total de entradas na lista de NAT gateways.

1

NatGateways

object

NatGateway

array<object>

As informações detalhadas do NAT gateway.

array<object>

As informações detalhadas do NAT gateway.

Status

string

The status of the NAT gateway. Valid values:

  • Creating: Creating a NAT gateway is an asynchronous operation. The status is Creating before the creation is complete.

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

  • Modifying: Modifying a NAT gateway is an asynchronous operation. The status is Modifying during the modification process.

  • Deleting: Deleting a NAT gateway is an asynchronous operation. The status is Deleting during the deletion process.

  • Converting: Converting a standard NAT gateway to an enhanced NAT gateway is an asynchronous operation. The status is Converting during the conversion process.

Creating

CreationTime

string

The creation time of the NAT gateway.

2021-06-08T12:20:20Z

VpcId

string

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

vpc-bp15zckdt37pq72z****

NatType

string

The type of the NAT gateway. Valid value: Enhanced (enhanced NAT gateway).

Enhanced

AutoPay

boolean

Specifies whether to automatically pay the order. Valid values:

  • false: does not automatically pay the order.

  • true: automatically pays the order.

false

Spec

string

The specification of the NAT gateway. The return value of this parameter is empty.

When InternetChargeType is PayByLcu, the return value is empty.

Small

DeletionProtection

boolean

Indicates whether deletion protection is enabled. Valid values:

  • true: enabled.

  • false: disabled.

true

NetworkType

string

The type of the NAT gateway. Valid values:

  • internet: Internet NAT gateway.

  • intranet: VPC NAT gateway.

internet

SecurityProtectionEnabled

boolean

Indicates whether the firewall feature is enabled. Valid values:

  • false: disabled.

  • true: enabled.

false

InstanceChargeType

string

The billing method of the NAT gateway instance. Valid value: PostPaid (pay-as-you-go).

PostPaid

RegionId

string

The region ID of the NAT gateway.

cn-hangzhou

EcsMetricEnabled

boolean

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

  • true: enabled.

  • false: disabled.

true

IcmpReplyEnabled

boolean

Indicates whether ICMP proxy reply is enabled. Valid values:

  • true (default): enabled.

  • false: disabled.

true

Description

string

The description of the NAT gateway.

NAT

ExpiredTime

string

The expiration time of the NAT gateway.

2021-08-26T16:00Z

ResourceGroupId

string

The resource group ID.

rg-bp67acfmxazb4ph****

NatGatewayId

string

The ID of the NAT gateway.

ngw-bp1047e2d4z7kf2ki****

InternetChargeType

string

The metering method of the NAT gateway. Valid values:

  • PayBySpec: pay by fixed specification.

  • PayByLcu: pay by capacity unit (CU).

PayByLcu

BusinessStatus

string

The business status of the NAT gateway. Valid values:

  • Normal: normal.

  • FinancialLocked: locked due to overdue payment.

Normal

Name

string

The name of the NAT gateway instance.

abc

IpLists

object

IpList

array<object>

The list of EIPs associated with the Internet NAT gateway.

object

The IP information list of the NAT gateway.

UsingStatus

string

The association of the EIP bound to the Internet NAT gateway instance. Valid values:

  • UsedByForwardTable: the EIP is used to configure DNAT rules.

  • UsedBySnatTable: the EIP is used to configure SNAT rules.

  • UsedByForwardSnatTable: the EIP is used to configure both DNAT and SNAT rules.

  • Idle: idle. No DNAT or SNAT rules are configured.

UsedByForwardTable

IpAddress

string

The IP address of the EIP bound to the NAT gateway.

116.62.XX.XX

SnatEntryEnabled

boolean

Indicates whether the IP address that is already used for DNAT entries can also be used for SNAT entries. Valid values:

  • true: can be used for SNAT entries.

  • false: cannot be used for SNAT entries.

false

AllocationId

string

The instance ID of the EIP bound to the NAT gateway.

eip-m5egzuvp3dgixen6****

PrivateIpAddress

string

The private IP address of the NAT gateway.

192.168.XX.XX

ForwardTableIds

object

ForwardTableId

array

The DNAT table ID of the NAT gateway.

string

The DNAT table ID.

ftb-uf6gj3mhsg94qsqst****

SnatTableIds

object

SnatTableId

array

The SNAT table ID of the NAT gateway.

string

The SNAT table ID.

stb-uf6dalcdu0krz423p****

FullNatTableIds

object

FullNatTableId

array

The FULLNAT table ID.

string

The FULLNAT table ID.

fulltb-gw88z7hhlv43rmb26****

NatGatewayPrivateInfo

object

The private network information of the enhanced Internet NAT gateway.

Nota

When NatType is set to Normal, all parameters in this list return empty values.

VswitchId

string

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

vsw-bp1s2laxhdf9ayjbo****

EniInstanceId

string

The elastic network interface (ENI) instance ID.

eni-m5eg4ozy5st8q3q4****

MaxBandwidth

integer

The maximum bandwidth. Unit: Mbps.

5120

MaxSessionQuota

integer

The number of concurrent connections of the NAT gateway.

2000000

MaxSessionEstablishRate

integer

The rate of new connections of the NAT gateway. Unit: connections per second.

100000

PrivateIpAddress

string

The private IP address.

192.168.XX.XX

IzNo

string

The zone to which the NAT gateway belongs.

cn-hangzhou-b

EniType

string

The binding mode between the ENI and the NAT gateway. Valid values:

  • indirect: non-passthrough mode.

  • Empty return value: passthrough mode.

indirect

PrivateLinkEnabled

boolean

Indicates whether private link is supported. Valid values:

  • true: private link is supported.

  • false: private link is not supported.

true

PrivateLinkMode

string

The private link service conversion mode. Valid values:

  • FullNat: uses FULLNAT mode.

  • Geneve: uses Geneve mode.

FullNat

EipBindMode

string

The EIP binding mode of the NAT gateway. Valid values:

  • MULTI_BINDED: multi-EIP NIC-visible mode.

  • NAT: EIP normal mode, compatible with IPv4 gateway.

Nota

When the EIP binding mode of the NAT gateway is EIP normal mode, the EIP occupies a private IP address of the vSwitch where the NAT gateway is located. Make sure that sufficient private IP addresses are available in the vSwitch. If no idle private IP addresses are available in the vSwitch, new EIPs cannot be bound. When the EIP binding mode is EIP normal mode, the maximum number of EIPs that can be bound to the NAT gateway is 50.

MULTI_BINDED

Tags

object

Tag

array<object>

The list of tags.

object

The list of tags.

TagKey

string

The tag key of the instance.

KeyTest

TagValue

string

The tag value of the instance.

valueTest

EnableSessionLog

string

Indicates whether session logging is enabled. Valid values:

  • true: session logging is enabled.

  • false: session logging is disabled.

true

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:

  • geneve: Geneve type.

geneve

AvailabilityMode

string

IpPrefixList

object

IpPrefixList

array<object>

The list of NAT IP prefix address ranges.

object

IpPrefix

string

The NAT IP prefix address range.

192.168.0.0/28

Exemplos

Resposta de sucesso

JSON formato

{
  "PageSize": 10,
  "RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
  "PageNumber": 10,
  "TotalCount": 1,
  "NatGateways": {
    "NatGateway": [
      {
        "Status": "Creating",
        "CreationTime": "2021-06-08T12:20:20Z",
        "VpcId": "vpc-bp15zckdt37pq72z****",
        "NatType": "Enhanced",
        "AutoPay": false,
        "Spec": "Small",
        "DeletionProtection": true,
        "NetworkType": "internet",
        "SecurityProtectionEnabled": false,
        "InstanceChargeType": "PostPaid",
        "RegionId": "cn-hangzhou",
        "EcsMetricEnabled": true,
        "IcmpReplyEnabled": true,
        "Description": "NAT",
        "ExpiredTime": "2021-08-26T16:00Z",
        "ResourceGroupId": "rg-bp67acfmxazb4ph****",
        "NatGatewayId": "ngw-bp1047e2d4z7kf2ki****",
        "InternetChargeType": "PayByLcu",
        "BusinessStatus": "Normal",
        "Name": "abc",
        "IpLists": {
          "IpList": [
            {
              "UsingStatus": "UsedByForwardTable",
              "IpAddress": "116.62.XX.XX",
              "SnatEntryEnabled": false,
              "AllocationId": "eip-m5egzuvp3dgixen6****",
              "PrivateIpAddress": "192.168.XX.XX"
            }
          ]
        },
        "ForwardTableIds": {
          "ForwardTableId": [
            "ftb-uf6gj3mhsg94qsqst****"
          ]
        },
        "SnatTableIds": {
          "SnatTableId": [
            "stb-uf6dalcdu0krz423p****"
          ]
        },
        "FullNatTableIds": {
          "FullNatTableId": [
            "fulltb-gw88z7hhlv43rmb26****"
          ]
        },
        "NatGatewayPrivateInfo": {
          "VswitchId": "vsw-bp1s2laxhdf9ayjbo****",
          "EniInstanceId": "eni-m5eg4ozy5st8q3q4****",
          "MaxBandwidth": 5120,
          "MaxSessionQuota": 2000000,
          "MaxSessionEstablishRate": 100000,
          "PrivateIpAddress": "192.168.XX.XX",
          "IzNo": "cn-hangzhou-b",
          "EniType": "indirect"
        },
        "PrivateLinkEnabled": true,
        "PrivateLinkMode": "FullNat",
        "EipBindMode": "MULTI_BINDED",
        "Tags": {
          "Tag": [
            {
              "TagKey": "KeyTest",
              "TagValue": "valueTest"
            }
          ]
        },
        "EnableSessionLog": "true",
        "AccessMode": {
          "ModeValue": "route",
          "TunnelType": "geneve"
        },
        "AvailabilityMode": "",
        "IpPrefixList": {
          "IpPrefixList": [
            {
              "IpPrefix": "192.168.0.0/28"
            }
          ]
        }
      }
    ]
  }
}

Códigos de erro

Código de status HTTP

Código de erro

Mensagem de erro

Descrição

500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error occurred.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.