Cria um vSwitch.
Descrição da operação
Ao chamar esta operação, observe os seguintes limites:
-
Você pode criar no máximo 150 vSwitches em uma nuvem privada virtual (VPC).
-
O primeiro endereço IP e os três últimos endereços IP de cada bloco CIDR do vSwitch são reservados. Por exemplo, se o bloco CIDR de um vSwitch for 192.168.1.0/24, os endereços IP 192.168.1.0, 192.168.1.253, 192.168.1.254 e 192.168.1.255 serão reservados.
-
O número de instâncias em um vSwitch não pode exceder a capacidade restante da VPC. A capacidade restante é a diferença entre 15.000 e o número atual de instâncias.
-
Cada instância pode pertencer a apenas um vSwitch.
-
Os vSwitches não suportam multicast ou broadcast.
-
Após criar um vSwitch, você não pode modificar seu bloco CIDR.
-
CreateVSwitch é uma operação assíncrona. Após o envio de uma solicitação, o sistema retorna um ID de solicitação e executa a tarefa em segundo plano. Você pode chamar DescribeVSwitchAttributes para consultar o status da tarefa.
Se o vSwitch estiver no estado Pending, o vSwitch está sendo configurado.
Se o vSwitch estiver no estado Available, o vSwitch está disponível.
-
Você não pode chamar repetidamente a operação CreateVSwitch para criar um vSwitch em uma VPC dentro do período de tempo especificado.
Experimente agora
Testar
Autorização RAM
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| Tag |
array<object> |
Não |
A tag do recurso. |
|
|
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 no máximo 128 caracteres. Não pode começar com |
FinanceJoshua |
| 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, mas não pode conter |
FinanceDept |
| ZoneId |
string |
Sim |
O ID da zona do vSwitch. Você pode chamar a operação DescribeZones para consultar a lista de zonas mais recente. |
cn-hangzhou-b |
| 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. |
cn-hangzhou |
| CidrBlock |
string |
Sim |
O bloco CIDR do vSwitch. Observe os seguintes limites:
|
172.16.0.0/24 |
| Ipv6CidrBlock |
integer |
Não |
Os últimos oito bits do bloco CIDR IPv6 do vSwitch. Valores válidos: 0 a 255. |
12 |
| VpcId |
string |
Sim |
O ID da VPC onde você deseja criar o vSwitch. |
vpc-257gqcdfvx6n**** |
| VSwitchName |
string |
Não |
O nome do vSwitch. O nome deve ter de 1 a 128 caracteres e não pode começar com |
vSwitch-1 |
| Description |
string |
Não |
A descrição do vSwitch. A descrição deve ter de 1 a 256 caracteres e não pode começar com |
vSwitch |
| ClientToken |
string |
Não |
O token de cliente usado para garantir a idempotência da solicitação. Você pode usar o cliente para gerar o valor, mas deve garantir que ele seja exclusivo entre todas as solicitações. O token pode conter apenas caracteres ASCII. Nota
Se você não especificar este parâmetro, ClientToken será definido com o valor de RequestId. O valor de RequestId pode ser diferente para cada solicitação de API. |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
| VpcIpv6CidrBlock |
string |
Não |
O bloco CIDR IPv6 da VPC. |
2408:XXXX:0:6a::/56 |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Os dados retornados. |
||
| VSwitchId |
string |
O ID do vSwitch. |
vsw-25navfgbue4g**** |
| RequestId |
string |
O ID da solicitação. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
Exemplos
Resposta de sucesso
JSON formato
{
"VSwitchId": "vsw-25navfgbue4g****",
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | OperationFailed.ResourceConflict | vpc only support one cloud box. | |
| 400 | OperationFailed.IdempotentTokenProcessing | Action is processing. | |
| 400 | InvalidDescription.Malformed | Invalid description. | |
| 400 | InvalidVSwitchName.Malformed | Specified virtual switch name is not valid. | The format of the specified vSwitch name is invalid. Specify the name in the valid format. |
| 400 | InvalidVSwitchDiscription.Malformed | Specified virtual switch description is not valid. | |
| 400 | Abs.Vpc.InvalidDescription.Malformed | Specified virtual switch name is not valid. | |
| 400 | MissingParam.vpcId | The parameter vpcId is mandatory. | The vpcId parameter is required. |
| 400 | ResourceNotAvailable | Resource you requested is not available in this region or zone. | |
| 400 | InvalidParameter | Specified CIDR block is not valid in VPC. | |
| 400 | InvalidCidrBlock.Overlapped | Specified CIDR block overlapped with other subnets. | |
| 400 | QuotaExceeded.VSwitch | Virtual switch quota exceeded. | The number of vSwitches has reached the upper limit. Reduce the number of vSwitches and try again later. |
| 400 | IncorrectRouteEntryStatus | Some route entry status blocked this operation. | |
| 400 | IncorrectVSwitchStatus | Some virtual switch is modifying within the same VPC. | Multiple vSwitches are in the Modifying state in the same VPC. Try again later. |
| 400 | InvalidCirdrBlock.MaskLength | Specified CIDR block is not valid . | Invalid CIDR block. |
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | CreateVSwitch.IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | You cannot create a vSwitch when the CEN instance is in the current state. |
| 400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | |
| 400 | MissingParameter | Miss mandatory parameter. | |
| 400 | TaskConflict | The operation is too frequent, TaskConflict. | The system is unavailable. Try again later. |
| 400 | VPC.SWITCH.RULE.QUOTA.NOT.EXISTS | vSwitch quota rule not exists. | |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | The specified VPC does not exist. |
| 400 | RouteConflict.AlreadyExist | Route conflict exists in routing table. | Route conflicts exist in the route table. |
| 400 | OperationFailed.CidrAcross | Classic link instance cidr must not across. | |
| 400 | Duplicated.ClientToken | %s | |
| 400 | OperationFailed.Ipv6CidrBlockExisted | %s | |
| 400 | IllegalParam.Ipv6CidrBlock | %s | |
| 400 | OperationFailed.VpcIpv6Disabled | %s | |
| 400 | IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | The status of the CEN instance is invalid. |
| 400 | OperationFailed.NotifyCenCreate | Failed to notify cen when create vswitch. | |
| 400 | OperationFailed.DistibuteLock | Distibute lock fail. | The operation is locked by another request; |
| 400 | UnsupportedFeature.CloudBoxIpv6 | The IPv6 feature is not supported by cloud box. | You cannot create an IPv6 address for a CloudBox instance. |
| 400 | OperationDenied.VpcPeerExist | The operation is not allowed because the VPC peer exists. | The operation failed because VPC peering connections exist. |
| 400 | OperationDenied.CenAttached | The operation is not allowed because the VPC is attached to CEN. | The operation is not allowed because the VPC is attached to a CEN instance. |
| 400 | OperationDenied.NatgwExist | The operation is not allowed because the NAT gateway exists in VPC. | The operation is not allowed because NAT gateways exist in the VPC. |
| 400 | MissingParam.Ipv6CidrBlock | The parameter Ipv6CidrBlock is mandatory. | The Ipv6CidrBlock parameter is required. |
| 400 | IllegalParam.VpcIpv6CidrBlock | %s | |
| 400 | OperationDenied.OtherSubnetCreating | The operation is not allowed because the other VSwitch is creating. | |
| 400 | OperationDenied.VpcPeerExists | The operation is not allowed because the VpcPeer exists. | The VPC has a VPC peering connection. |
| 400 | IllegalParam.CidrBlock | The param of CidrBlock [%s] is illegal. | The CidrBlock parameter is set to an invalid value. |
| 400 | InvalidStatus.RouteEntry | RouteEntry status error. | |
| 400 | InvalidZoneId.NotFound | Specified zone does not exist. | |
| 400 | OperationDenied.ZoneIsDisabled | The specified zone is disabled. You cannot create a vSwitch in a disabled zone. | The specified zone is disabled. You cannot create a vSwitch in a disabled zone. |
| 404 | Invalid.NotExist | witch mask rule not exists. | |
| 404 | InvalidVpcId.NotFound | Specified VPC does not exist. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.