Todos os produtos
Search
Central de documentação

Virtual Private Cloud:DescribeRouteTables

Última atualização: Jul 07, 2026

Chama a operação DescribeRouteTables para consultar tabelas de rotas.

Nota

Esta API foi descontinuada. Recomendamos migrar para Vpc(2016-04-28) - DescribeRouteTableList para funcionalidade aprimorada e suporte contínuo. Embora a API descontinuada permaneça temporariamente acessível, nenhuma atualização ou correção de bugs será fornecida.

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:DescribeRouteTables

list

*RouteTable

acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}

  • vpc:VBR
  • vpc:VRouter
Nenhuma

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

RegionId

string

Não

O ID da região da VPC à qual a tabela de rotas pertence.

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

ap-southeast-6

VRouterId

string

Não

O ID do vRouter a ser consultado.

Nota

Você deve especificar pelo menos um dos seguintes parâmetros: VRouterId, RouteTableId, RouterId e RouteTableName. Você não pode especificar VRouterId e RouterId ao mesmo tempo.

vrt-bp1lhl0taikrteen****

RouteTableId

string

Não

O ID da tabela de rotas a ser consultada.

Nota

Você deve especificar pelo menos um dos seguintes parâmetros: VRouterId, RouteTableId, RouterId e RouteTableName. Você não pode especificar VRouterId e RouterId ao mesmo tempo.

vtb-bp145q7glnuzdvzu2****

RouterType

string

Não

O tipo do roteador ao qual a tabela de rotas pertence. Valores válidos:

  • VRouter (padrão): vRouter.

  • VBR: Virtual Border Router.

VRouter

RouterId

string

Não

O ID do roteador ao qual a tabela de rotas pertence.

Nota

Você deve especificar pelo menos um dos seguintes parâmetros: VRouterId, RouteTableId, RouterId e RouteTableName. Você não pode especificar VRouterId e RouterId ao mesmo tempo.

vrt-bp1lhl0taikrteen8****

Type

string

Não

O tipo de destino da rota a ser consultada. Valores válidos:

  • Custom: rota personalizada.

  • System: rota do sistema.

  • BGP: rota BGP.

  • CEN: rota do Cloud Enterprise Network (CEN).

  • ECR: rota do Express Connect Router (ECR).

Custom

RouteTableName

string

Não

O nome da tabela de rotas a ser consultada.

O nome deve ter de 2 a 128 caracteres e deve começar com uma letra ou um caractere chinês. Pode conter dígitos, pontos (.), underscores (_) e hifens (-).

Nota

Você deve especificar pelo menos um dos seguintes parâmetros: VRouterId, RouteTableId, RouterId e RouteTableName. Você não pode especificar VRouterId e RouterId ao mesmo tempo.

doctest

ResourceGroupId

string

Não

O ID do grupo de recursos ao qual a tabela de rotas pertence.

rg-acfmxazb4ph****

PageNumber

integer

Não

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

1

PageSize

integer

Não

O número de entradas por página durante a paginação. Valor máximo: 50. Valor padrão: 10.

10

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.

DC668356-BCB4-42FD-9BC3-FA2B2E04B634

PageNumber

integer

O número da página atual.

1

TotalCount

integer

O número total de entradas retornadas.

1

RouteTables

object

RouteTable

array<object>

Os detalhes das tabelas de rotas.

array<object>

A hora em que a tabela de rotas foi criada.

CreationTime

string

The time when the route table was created.

The time is displayed in UTC in the YYYY-MM-DDThh:mm:ssZ format.

2022-08-22T10:40:25Z

Status

string

The status of the route table. Valid values:

  • Pending: being configured.

  • Available: active.

Available

VRouterId

string

The ID of the vRouter.

vrt-bp1lhl0taikrteen****

RouteTableType

string

The type of the route table. Valid values:

  • Custom: custom route table.

  • System: system route table.

Custom

ResourceGroupId

string

The ID of the resource group to which the route table belongs.

rg-acfmxazb4ph****

RouteTableId

string

The ID of the route table.

vtb-bp145q7glnuzdvzu2****

RouteEntrys

object

RouteEntry

array<object>

The route information.

array<object>

The route information.

Type

string

The destination type of the route. Valid values:

  • Custom: custom route.

  • System: system route.

  • BGP: BGP route.

  • CEN: Cloud Enterprise Network (CEN) route.

  • ECR: Express Connect Router (ECR) route.

Custom

Status

string

The status of the route. Valid values:

  • Pending: being configured.

  • Available: active.

  • Modifying: being modified.

Available

NextHopType

string

The next hop type. Valid values:

  • Instance (default): ECS instance.

  • HaVip: high-availability virtual IP address.

  • VpnGateway: VPN gateway.

  • NatGateway: NAT gateway.

  • NetworkInterface: secondary elastic network interface controller (NIC).

  • RouterInterface: vRouter interface.

  • IPv6Gateway: IPv6 gateway.

  • Attachment: transit router.

  • Ipv4Gateway: IPv4 gateway.

  • GatewayEndpoint: gateway endpoint.

  • CenBasic: CEN that does not support transit routers.

  • Ecr: Express Connect Router (ECR).

Instance

RouteEntryName

string

The name of the route.

The name must be 2 to 128 characters in length and must start with a letter or a Chinese character. It can contain digits, periods (.), underscores (_), and hyphens (-).

name

RouteEntryId

string

The ID of the route.

rte-bp1mnnr2al0naomnp****

InstanceId

string

The instance ID of the instance associated with the next hop.

vpc-bp1t36rn9l53iwbsf****

RouteTableId

string

The ID of the route table.

vtb-bp15w5q90d2rk3bww****

Description

string

The description of the route. The description must be 2 to 256 characters in length and must start with a letter or a Chinese character. It cannot start with http:// or https://.

RouteEntryDescription

DestinationCidrBlock

string

The destination CIDR block of the route. Both IPv4 and IPv6 destination CIDR blocks are supported. The following requirements must be met:

  • The destination CIDR block cannot point to or be contained within 100.64.0.0/10.

  • The destination CIDR blocks of different routes in the same route table must be unique.

192.168.2.0/24

NextHops

object

NextHop

array<object>

The next hop information.

object

The next hop information.

NextHopId

string

The instance ID of the next hop.

vpn-bp10zyaph5cc8b7c7****

Weight

integer

The weight of the route.

100

NextHopType

string

The next hop type. Valid values:

  • Instance: ECS instance.

  • HaVip: high-availability virtual IP address.

  • VpnGateway: VPN gateway.

  • NatGateway: NAT gateway.

  • NetworkInterface: secondary elastic network interface controller (NIC).

  • RouterInterface: vRouter interface.

  • IPv6Gateway: IPv6 gateway.

  • Attachment: transit router.

  • Ipv4Gateway: IPv4 gateway.

  • GatewayEndpoint: gateway endpoint.

  • CenBasic: CEN that does not support transit routers.

  • Ecr: Express Connect Router (ECR).

Instance

Enabled

integer

Indicates whether the route is available. Valid values:

  • 0: unavailable.

  • 1: available.

1

VSwitchIds

object

VSwitchId

array

The vSwitch ID.

string

The vSwitch ID.

vsw-bp12mw1f8k3jgygk9****

Exemplos

Resposta de sucesso

JSON formato

{
  "PageSize": 10,
  "RequestId": "DC668356-BCB4-42FD-9BC3-FA2B2E04B634",
  "PageNumber": 1,
  "TotalCount": 1,
  "RouteTables": {
    "RouteTable": [
      {
        "CreationTime": "2022-08-22T10:40:25Z",
        "Status": "Available",
        "VRouterId": "vrt-bp1lhl0taikrteen****",
        "RouteTableType": "Custom",
        "ResourceGroupId": "rg-acfmxazb4ph****",
        "RouteTableId": "vtb-bp145q7glnuzdvzu2****",
        "RouteEntrys": {
          "RouteEntry": [
            {
              "Type": "Custom",
              "Status": "Available",
              "NextHopType": "Instance",
              "RouteEntryName": "name",
              "RouteEntryId": "rte-bp1mnnr2al0naomnp****",
              "InstanceId": "vpc-bp1t36rn9l53iwbsf****",
              "RouteTableId": "vtb-bp15w5q90d2rk3bww****",
              "Description": "RouteEntryDescription",
              "DestinationCidrBlock": "192.168.2.0/24",
              "NextHops": {
                "NextHop": [
                  {
                    "NextHopId": "vpn-bp10zyaph5cc8b7c7****",
                    "Weight": 100,
                    "NextHopType": "Instance",
                    "Enabled": 1
                  }
                ]
              }
            }
          ]
        },
        "VSwitchIds": {
          "VSwitchId": [
            "vsw-bp12mw1f8k3jgygk9****"
          ]
        }
      }
    ]
  }
}

Códigos de erro

Código de status HTTP

Código de erro

Mensagem de erro

Descrição

400 InvalidVRouterId.NotFound Specified virtual router does not exist.
400 OperationFailed.DescribeCenRoute An error occurred while querying the CEN route entry. CEN routes are abnormal.
400 OperationFailed.VRouterNotExist Operation failed because the VRouter does not exist. Operation failed because the VRouter does not exist.
400 IllegalParam.Type The parameter of Type is illegal. Illegal parameter Type.
400 OperationFailed.InvalidRouterType The operation is failed because of %s. Invalid router type.

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.