Crée un réseau privé virtuel (VPC).
Description de l'opération
Lorsque vous appelez cette opération pour créer un VPC, prenez note des éléments suivants :
Testez maintenant
Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.
Test
Autorisation RAM
|
vpc:CreateVpc |
create |
*VPC
|
Aucune | Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| RegionId |
string |
Oui |
L'identifiant de la région du VPC. |
cn-hangzhou |
| CidrBlock |
string |
Non |
Le bloc CIDR du VPC. |
172.16.0.0/12 |
| Ipv6CidrBlock |
string |
Non |
Le bloc CIDR IPv6 du VPC. Lorsque vous activez IPv6 pour le VPC, le système attribue un bloc CIDR IPv6. Pour attribuer un bloc CIDR IPv6, vous devez d'abord appeler AllocateVpcIpv6Cidr pour réserver le bloc CIDR IPv6, puis le transmettre. |
2408:XXXX:0:6a::/56 |
| VpcName |
string |
Non |
Le nom du VPC. |
abc |
| EnableIpv6 |
boolean |
Non |
Indique si IPv6 doit être activé. Valeurs valides : |
false |
| Description |
string |
Non |
La description du VPC. |
Ceci est mon premier VPC |
| ResourceGroupId |
string |
Non |
L'identifiant du groupe de ressources. |
rg-acfmxazb4ph6aiy**** |
| Tag |
array<object> |
Non |
Les balises de la ressource. |
|
|
object |
Non |
La balise. |
||
| Key |
string |
Non |
La clé de balise de la ressource. Vous pouvez spécifier jusqu'à 20 clés de balise. La clé de balise ne peut pas être une chaîne vide. |
FinanceDept |
| Value |
string |
Non |
La valeur de balise de la ressource. Vous pouvez spécifier jusqu'à 20 valeurs de balise. La valeur de balise peut être une chaîne vide. |
FinanceJoshua |
| DryRun |
boolean |
Non |
Indique si un test à blanc doit être effectué. Valeurs valides : |
false |
| UserCidr |
string |
Non |
Le bloc CIDR utilisateur. Séparez plusieurs blocs CIDR par des virgules (,). Vous pouvez spécifier jusqu'à trois blocs CIDR. |
192.168.0.0/12 |
| ClientToken |
string |
Non |
Le jeton client utilisé pour garantir l'idempotence de la requête. |
123e4567-e89b-12d3-a456-426655440000 |
| Ipv6Isp |
string |
Non |
Le type de bloc CIDR IPv6 du VPC. Valeurs valides : |
BGP |
| Ipv4IpamPoolId |
string |
Non |
L'identifiant d'instance du pool IPAM IPv4. |
ipam-pool-sycmt3p2a9v63i**** |
| Ipv4CidrMask |
integer |
Non |
Le masque utilisé pour allouer un bloc CIDR du pool IPAM au VPC. |
12 |
| EnableDnsHostname |
boolean |
Non |
Indique si la fonctionnalité de nom d'hôte DNS doit être activée. Valeurs valides : |
false |
| Ipv6IpamPoolId |
string |
Non |
L'identifiant d'instance du pool IPAM IPv6. |
ipam-pool-bp1aq51kkfh477z03**** |
| Ipv6CidrMask |
integer |
Non |
Le masque utilisé pour ajouter un bloc CIDR IPv6 au VPC à partir du pool IPAM. |
56 |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
L'identifiant du VPC créé. |
||
| VpcId |
string |
L'identifiant du VPC créé. |
vpc-bp15zckdt37pq72zv**** |
| VRouterId |
string |
L'identifiant du vRouter qui est automatiquement créé lors de la création du VPC. |
vrt-bp1lhl0taikrteen8**** |
| RequestId |
string |
L'identifiant de la requête. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
| RouteTableId |
string |
L'identifiant de la table de routage qui est automatiquement créée lors de la création du VPC. |
vtb-bp145q7glnuzdv**** |
| ResourceGroupId |
string |
L'identifiant du groupe de ressources. |
rg-acfmxazb4ph6aiy**** |
Exemples
JSON format
{
"VpcId": "vpc-bp15zckdt37pq72zv****",
"VRouterId": "vrt-bp1lhl0taikrteen8****",
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
"RouteTableId": "vtb-bp145q7glnuzdv****",
"ResourceGroupId": "rg-acfmxazb4ph6aiy****"
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | TOKEN_PROCESSING | Action is processing. | |
| 400 | InvokeError | instance quota rule invoke error. | Failed to get rule data, please wait zai shi |
| 400 | InvalidParameter | Specified CIDR block is not valid | |
| 400 | ResourceNotAvailable | Resource you requested is not available in this region or zone. | |
| 400 | InvalidVpcName.Malformed | Specified VPC name is not valid. | |
| 400 | InvalidVpcDiscription.Malformed | Specified VPC description is not valid. | |
| 400 | QuotaExceeded.Vpc | VPC quota exceeded. | The number of VPCs in this account has reached the upper limit. |
| 400 | ResourceNotAvailable.Vpc | Resource you requested is not available in this region or zone. | |
| 400 | InvalidUserCidr.Quota | Specified UserCidr number is greater than 3. | |
| 400 | InvalidUserCidr.Malformed | Specified UserCidr overlapping in of 100.64.0.0/10. | The user CIDR block that you specify overlaps with 100.64.0.0/10. |
| 400 | InvalidResourceGroupId | The specified ResourceGroupId does not exist. | The specified resource group ID does not exist. |
| 400 | IllegalParam.Ipv6CidrBlock | %s | |
| 400 | OperationFailed.IPv6CidrNotReserved | %s | |
| 400 | MissingParam.EnableIpv6 | %s | |
| 400 | OperationUnsupported.Ipv6Feature | %s | |
| 400 | System.ServiceBusy | System is busy, please try later. | |
| 400 | IllegalParam.UserCidr | UserCidr is not a valid or strict address. | UserCidr is illegal. |
| 400 | OperationUnsupported.ResourceGroupId | ResourceGroup is not supported in this region. | The operation is not supported. Resource group IDs are not supported in Finance Cloud. |
| 400 | IllegalParam.EnableIpv6 | %s | |
| 400 | InvalidIpv6CidrBlock.Malformed | Specified Ipv6CidrBlock is not valid. | |
| 400 | UnsupportedFeature.Ipv6Isp | The Ipv6Isp feature is not supported. | The specified IPv6 ISP is not supported. |
| 400 | ResourceNotEnough.Ipv6Cidr | The specified resource of Ipv6Cidr is not enough. | IPv6 addresses are insufficient. |
| 400 | UnsupportedFeature.IPAM | VPCs cannot be created by using IPAM. | You cannot use IPAM to create a VPC. |
| 400 | IllegalParam.Ipv4CidrMask | The specified Ipv4CidrMask is illegal. | Invalid Ipv4CidrMask. |
| 400 | IllegalParam.IpamPool | The specified IPAM pool cannot be empty. | The IPAM pool cannot be empty. |
| 400 | OperationDenied.RequestRegionInvalid | The operation is not allowed because the request is not invoked in the region of the IPAM pool. | The operation is not allowed because the request is not invoked in the region of the IPAM pool. |
| 400 | OperationDenied.IpamPoolNotInRegion | The operation is not allowed because the IPAM pool not in specific region does not support creating VPC or associating CIDR for VPC. | The operation is not allowed because the IPAM pool not in specific region does not support creating VPC or associating CIDR for VPC. |
| 400 | MissingParam.CidrOrCidrMask | The CIDR or CIDR Mask must be input. | The CIDR or CIDR Mask must be input. |
| 400 | OperationDenied.CidrInExcludeCidrs | The operation is not allowed because the input CIDR is within the illegal CIDRs. | The operation is not allowed because the input CIDR is within the illegal CIDRs. |
| 400 | OperationDenied.AvailableCidrInsufficient | The operation is not allowed because available CIDR is insufficient. | The operation is not allowed because available CIDR is insufficient. |
| 400 | UnsupportedFeature.Ipam | IPAM is not supported in this region. | The IPAM feature is not supported in this region. |
| 400 | OperationDenied.CidrUnavailableInPool | The operation is not allowed because the CIDR is unavailable in the IPAM pool. | The operation is not allowed because the CIDR is unavailable in the IPAM pool. |
| 400 | IllegalParam.CidrBlockMask | The param of CidrBlock Mask [%s] is illegal. | The subnet mask of the CIDR block is invalid. |
| 400 | UnsupportedFeature.VpcDnsHostname | The feature of vpc dns hostname is unsupported. | The VPC private domain name function does not take effect in the current region. |
| 400 | OperationDenied.MaskOfCidrIsNotAllowed | The input mask or mask of the input CIDR is not allowed. | The input mask or mask of the input CIDR is not allowed. |
| 400 | IllegalParam.Ipv6Isp | The specified Ipv6Isp is illegal. | The specified Ipv6Isp is illegal. |
| 400 | IllegalParam.CidrMask | The input CIDR mask is illegal. | The input CIDR mask is illegal. |
| 400 | InvalidRegionId.NotFound | Specified value of "regionId" is not supported. | |
| 400 | UnsupportedFeature.DhcpOptionsSet | The feature of dhcp options set is unsupported. | The DHCP Options Set function does not take effect in the current region. |
| 400 | OperationDenied.CidrMaskTooLarge | The operation is denied because the CIDR mask %s is larger than the allocationMaxNetmask %s of the pool. | The operation is denied because the CIDR mask %s is larger than the allocationMaxNetmask %s of the pool. |
| 400 | OperationDenied.CidrMaskTooSmall | The operation is denied because the CIDR mask %s is less than the allocationMinNetmask %s of the pool. | The operation is denied because the CIDR mask %s is less than the allocationMinNetmask %s of the pool. |
| 400 | Mismatch.ParamIpv6IspAndIpamPoolIpv6Isp | The specified IPv6 ISP %s does not match the IPAM pool's IPv6 ISP %s. | The specified IPv6 ISP does not match the IPv6 ISP configured in the IPAM pool. |
| 400 | IllegalParam.CidrBlock | The param of CidrBlock [%s] is illegal. | The CidrBlock parameter is set to an invalid value. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | Forbidden | User not authorized to operate on the specified resource. | You do not have the permissions to manage the specified resource. Apply for the permissions and try again. |
| 404 | ResourceNotFound.IpamPool | The dependent IPAM pool is not found. | The dependent IPAM pool is not found. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.