Supprime un cloud privé virtuel (VPC).
Description de l'opération
Lorsque vous appelez cette opération pour supprimer un VPC, prenez note des éléments suivants :
-
Avant de supprimer un VPC, libérez ou migrez toutes les ressources du VPC, y compris les vSwitches, les instances de service cloud et les adresses IP virtuelles à haute disponibilité.
-
Seuls les VPC à l'état Available peuvent être supprimés.
-
DeleteVpc est une opération asynchrone. Après l'envoi d'une requête, le système renvoie un identifiant de requête, mais le VPC n'est pas encore supprimé. La tâche de suppression s'exécute en arrière-plan. Vous pouvez appeler DescribeVpcAttribute pour interroger l'état de suppression du VPC :
Si le VPC est à l'état Deleting, le VPC est en cours de suppression.
Si le VPC est introuvable, le VPC est supprimé.
-
DeleteVpc ne prend pas en charge la suppression simultanée du même VPC.
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:DeleteVpc |
delete |
*VPC
|
|
Aucune |
Paramètres de requête
|
Paramètre |
Type |
Requis |
Description |
Exemple |
| VpcId |
string |
Oui |
L'identifiant du VPC que vous souhaitez supprimer. |
vpc-bp1m7v25emi1h5mtc**** |
| RegionId |
string |
Non |
L'identifiant de la région du VPC que vous souhaitez supprimer. Vous pouvez appeler DescribeRegions pour interroger l'identifiant de la région. |
cn-hangzhou |
| ForceDelete |
boolean |
Non |
Indique si le VPC doit être supprimé de force. Valeurs valides :
Vous ne pouvez supprimer un VPC de force que lorsque le VPC contient uniquement les ressources suivantes :
|
false |
| DryRun |
boolean |
Non |
Indique si un test à blanc doit être effectué. Valeurs valides :
|
false |
| ClientToken |
string |
Non |
Le jeton client utilisé pour garantir l'idempotence de la requête. Vous pouvez utiliser le client pour générer le jeton, mais vous devez vous assurer que le jeton est unique pour chaque requête. La valeur de ClientToken ne peut contenir que des caractères ASCII. Remarque
Si vous ne spécifiez pas ce paramètre, le système utilise le RequestId de la requête API comme ClientToken. Le RequestId peut différer pour chaque requête API. |
123e4567-e89b-12d3-a456-426655440000 |
Éléments de réponse
|
Élément |
Type |
Description |
Exemple |
|
object |
L'identifiant de la requête. |
||
| RequestId |
string |
L'identifiant de la requête. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
Exemples
JSON format
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Codes d'erreur
|
Code de statut HTTP |
Code d'erreur |
Message d'erreur |
Description |
|---|---|---|---|
| 400 | IncorrectStatus.VpcDhcpStatus | The DhcpOptionsSet status of vpc does not support this operation. | You cannot delete the VPC when the DHCP options set of the VPC is in the current state. |
| 400 | DependencyViolation.GatewayEndpoint | The VPC contains endpoints and cannot be deleted. | The VPC contains endpoints and cannot be deleted. Delete the endpoints in the VPC and then delete the VPC. |
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | DependencyViolation.RouteEntry | Specified object has dependent resources | The VPC cannot be deleted because custom routes exist in the VPC. |
| 400 | DependencyViolation.Instance | Specified object has dependent resources | |
| 400 | DependencyViolation.VSwitch | Specified object has dependent resources | vSwitches exist in the VPC and the VPC cannot be deleted. Delete the vSwitches and try again. |
| 400 | DependencyViolation.RouteInterface | Specified object has dependent route interface . | |
| 400 | DependencyViolation.Tunnel | Specified object has dependent tunnel. | |
| 400 | DependencyViolation.NatGateway | Specified object has dependent resources NatGateway. | NAT gateways exist in the VPC and the VPC cannot be deleted. Delete the NAT gateways and try again. |
| 400 | DependencyViolation.RouterInterface | Specified object has dependent resources RouterInterface. | |
| 400 | DependencyViolation.SecurityGroup | Specified object has dependent resources SecurityGroup. | Security groups exist in the VPC and the VPC cannot be deleted. Delete the security groups and try again. |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | The specified VPC does not exist. |
| 400 | Forbbiden | Active custom route in vpc. | |
| 400 | TaskConflict | The eip operate too frequent, TaskConflict. | Operations are too frequent and tasks conflict with each other. |
| 400 | InvalidAction | The VPC has been connected to the classic network ECS. Please cancel the connection before proceeding. | |
| 400 | IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | The status of the CEN instance is invalid. |
| 400 | DependencyViolation.RouteTable | Specified object has dependent custom routeTable. | |
| 400 | DependencyViolation.NetworkAcl | Specified object has dependent resources network acl. | The specified object is associated with a network ACL. |
| 400 | DependencyViolation.ClassicLinkInstance | Specified object has active classicLink instance. | |
| 400 | System.ServiceBusy | System is busy, please try later. | |
| 400 | DependencyViolation.DhcpOptionsSet | The VPC cannot be deleted when it is associated with dhcpOptionsSet. | The VPC cannot be deleted when it is associated with dhcpOptionsSet. |
| 400 | InvalidRegionId.NotFound | The specified region is not found. | The specified region does not exist. |
| 400 | DependencyViolation.CustomRouteTable | CustomRouteTable already exists. | A dependency conflict exists because custom route tables are present. |
| 400 | DependencyViolation.Ipv4Gateway | The VPC cannot be deleted when it has ipv4Gateway. | The VPC cannot be deleted because an IPv4 gateway exists in the VPC. |
| 400 | DependencyViolation.GatewayRouteTable | Specified object has dependent resources gatewayRouteTable. | |
| 400 | OperationDenied.VpcPeerExists | The operation is not allowed because the VpcPeer exists. | The VPC has a VPC peering connection. |
| 400 | DependencyViolation.AppAccess | Specified object has dependent resources app access. | The VPC has a reverse access and cannot be deleted. |
| 400 | DependencyViolation.OppositeRouterInterface | Failed to delete the VPC because it has peer router interfaces. | The VPC failed to be deleted because a peer router interface exists in the VPC. |
| 400 | DependencyViolation.TransitRouter | Specified object has attached to Transit Router. | The specified resource is dependent on other resources and the current operation is not allowed. |
| 400 | DependencyViolation.Ipv6Gateway | The VPC contains IPv6Gateway and cannot be deleted. | The VPC cannot be deleted because it contains an IPv6 gateway. |
| 400 | DependencyViolation.CloudServiceResource | The VPC contains CloudServiceResource and cannot be deleted. | The VPC cannot be deleted because it contains EPS resources. |
| 400 | IncorrectStatus.VpcDnsHostnameStatus | The DnsHostname status of vpc does not support this operation. | The private domain name status of the current VPC does not support this operation. |
| 400 | OperationDenied.AttachedToECR | The operation is not allowed because the VPC is attached to ECR %s. | The operation is not allowed because the VPC is attached to ECR %s. |
| 400 | IncorrectStatus.RouteTableStatus | Route table [%s] status [%s] is not stable. Please try again later. | Route table [%s] status [%s] is not stable. Please try again later. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | OperationDenied | The operation is not supported in this status. | |
| 404 | InvalidVpcId.NotFound | Specified VPC does not exist. |
Consultez Codes d'erreur pour la liste complète.
Notes de version
Consultez Notes de version pour la liste complète.