Todos os produtos
Search
Central de documentação

Virtual Private Cloud:DescribeVSwitches

Última atualização: Jul 07, 2026

Consulta as informações sobre vSwitches disponíveis que são utilizados para uma rede interna.

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

Nenhuma autorização necessária para esta operação. Se você encontrar problemas com esta operação, entre em contato com o suporte técnico.

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

VpcId

string

Não

O ID da virtual private cloud (VPC) à qual os vSwitches pertencem.

Nota

Você deve definir pelo menos um entre RegionId e VpcId.

vpc-25cdvfeq58pl****

VSwitchId

string

Não

O ID do vSwitch que você deseja consultar.

vsw-23dscddcffvf3****

ZoneId

string

Não

O ID da zona à qual os vSwitches pertencem. Você pode chamar a operação DescribeZones para consultar a lista de zonas mais recente.

cn-hangzhou-d

RegionId

string

Não

O ID da região do vSwitch. Você pode chamar a operação DescribeRegions para consultar a lista de regiões mais recente.

Nota

Você deve definir pelo menos um entre RegionId e VpcId.

cn-hangzhou

VSwitchName

string

Não

O nome exato do vSwitch que você deseja consultar. A correspondência aproximada não é suportada.

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

vSwitch

DryRun

boolean

Não

Especifica se deve ser realizado apenas um dry run, sem executar a solicitação real. Valores válidos:

  • true: realiza apenas um dry run. O sistema verifica a solicitação quanto a possíveis problemas, incluindo valores de parâmetros ausentes, sintaxe de solicitação incorreta e limites de serviço. Se a solicitação falhar no dry run, uma mensagem de erro será retornada. Se a solicitação passar no dry run, o código de erro DryRunOperation será retornado.

  • false (padrão): realiza um dry run e executa a solicitação real. Se a solicitação passar no dry run, um código de status HTTP 2xx será retornado e a operação será executada.

true

IsDefault

boolean

Não

Especifica se devem ser consultados os vSwitches padrão na região especificada. Valores válidos:

  • true

  • false

Se você não definir este parâmetro, o sistema consultará todos os vSwitches na região especificada por padrão.

true

RouteTableId

string

Não

O ID da tabela de rotas.

vtb-bp145q7glnuzdvzu2****

ResourceGroupId

string

Não

O ID do grupo de recursos ao qual o vSwitch pertence.

rg-bp67acfmxazb4ph****

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. Valor máximo: 50. Valor padrão: 10.

10

VSwitchOwnerId

integer

Não

O ID da conta Alibaba Cloud à qual o vSwitch pertence.

2546073170691****

EnableIpv6

boolean

Não

Especifica se devem ser consultados vSwitches com IPv6 habilitado na região. Valores válidos:

  • true

  • false

Se você não definir este parâmetro, o sistema consultará todos os vSwitches na região especificada por padrão.

false

Tag

array<object>

Não

As tags.

object

Não

Key

string

Não

A chave da tag. Você pode especificar no máximo 20 chaves de tag. A chave da tag não pode ser uma string vazia.

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://.

FinanceDept

Value

string

Não

O valor da tag. Você pode especificar no máximo 20 valores de tag. O valor da tag pode ser uma string vazia.

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

FinanceJoshua

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

Os parâmetros de resposta.

PageSize

integer

O número de entradas retornadas por página.

10

RequestId

string

O ID da solicitação.

9A572171-4E27-40D1-BD36-D26C9E71E29E

PageNumber

integer

O número da página retornada.

1

TotalCount

integer

O número total de entradas retornadas.

1

VSwitches

object

VSwitch

array<object>

Os detalhes sobre o vSwitch.

array<object>

VpcId

string

The ID of the VPC to which the vSwitch belongs.

vpc-257gcdcdq64****

Status

string

The status of the vSwitch. Valid values:

  • Pending

  • Available

Available

CreationTime

string

The time when the vSwitch was created.

2022-01-18T12:43:57Z

IsDefault

boolean

Indicates whether the vSwitch is the default vSwitch. Valid values:

  • true

  • false

true

AvailableIpAddressCount

integer

The number of available IP addresses in the vSwitch.

1

NetworkAclId

string

The ID of the network access control list (ACL).

nacl-a2do9e413e0spzasx****

OwnerId

integer

The ID of the Alibaba Cloud account to which the resource belongs.

25346073170691****

VSwitchId

string

The vSwitch ID.

vsw-25bcdxs7pv1****

CidrBlock

string

The IPv4 CIDR block of the vSwitch.

172.16.0.0/24

Description

string

The description of the vSwitch.

VSwitchDescription

ResourceGroupId

string

The ID of the resource group to which the vSwitch belongs.

rg-acfmxazb4ph6aiy****

ZoneId

string

The ID of the zone to which the vSwitch belongs.

cn-hangzhou-d

Ipv6CidrBlock

string

The IPv6 CIDR block of the vSwitch.

2408:4002:10c4:4e03::/64

VSwitchName

string

The vSwitch name.

vSwitch

ShareType

string

Indicates whether the vSwitch is shared.

  • If no value is returned, the vSwitch is a regular vSwitch.

  • If Shared is returned, the vSwitch is shared.

  • If Sharing is returned, the vSwitch is being shared.

Shared

EnabledIpv6

boolean

Indicates whether IPv6 is enabled for the vSwitch. If you enable IPv6, you must configure an IPv6 CIDR block for the vSwitch. Valid values:

  • true

  • false

true

Tags

object

Tag

array<object>

The tags of the vSwitch.

object

Key

string

The tag key.

department

Value

string

The tag value.

dev

RouteTable

object

The information about the route table.

RouteTableId

string

The ID of the route table that is associated with the vSwitch.

vrt-bp145q7glnuzdv****

RouteTableType

string

The type of the route table. Valid values:

  • System

  • Custom

System

Exemplos

Resposta de sucesso

JSON formato

{
  "PageSize": 10,
  "RequestId": "9A572171-4E27-40D1-BD36-D26C9E71E29E",
  "PageNumber": 1,
  "TotalCount": 1,
  "VSwitches": {
    "VSwitch": [
      {
        "VpcId": "vpc-257gcdcdq64****",
        "Status": "Available",
        "CreationTime": "2022-01-18T12:43:57Z",
        "IsDefault": true,
        "AvailableIpAddressCount": 1,
        "NetworkAclId": "nacl-a2do9e413e0spzasx****",
        "OwnerId": 0,
        "VSwitchId": "vsw-25bcdxs7pv1****",
        "CidrBlock": "172.16.0.0/24",
        "Description": "VSwitchDescription",
        "ResourceGroupId": "rg-acfmxazb4ph6aiy****",
        "ZoneId": "cn-hangzhou-d",
        "Ipv6CidrBlock": "2408:4002:10c4:4e03::/64",
        "VSwitchName": "vSwitch",
        "ShareType": "Shared",
        "EnabledIpv6": true,
        "Tags": {
          "Tag": [
            {
              "Key": "department",
              "Value": "dev"
            }
          ]
        },
        "RouteTable": {
          "RouteTableId": "vrt-bp145q7glnuzdv****",
          "RouteTableType": "System"
        }
      }
    ]
  }
}

Códigos de erro

Código de status HTTP

Código de erro

Mensagem de erro

Descrição

400 Forbidden.VpcNotFound Specified VPC can not found. The specified VPC does not exist.
400 InvalidTagKey The tag keys are not valid. The tag index is invalid.
400 InvalidTagValue The tag values are not valid. The tag value is invalid.
400 IellgalParameter.OwnerAccount The specified parameter OwnerAccount is not valid. The specified parameter OwnerAccount is illegal.
400 IllegalParam.OwnerId The specified parameter VSwitchOwnerId is not valid.
400 InvalidVpcIdNumber.NotSupported The number of vpcIds exceeds the limit. The value of the vpcId parameter has reached the upper limit.
400 InvalidVSwitchIdNumber.NotSupported The number of vSwitchIds exceeds the limit.
404 InvalidVSwitchId.NotFound VSwitch not exist.

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.