调用DeleteVpc接口删除一个专有网络VPC(Virtual Private Cloud)。
接口说明
调用该接口删除 VPC 时,请注意:
-
删除 VPC 之前,需要先释放或转移 VPC 内的所有资源,包括交换机、云产品实例、高可用虚拟 IP 等。
-
只有处于 Available 状态的 VPC 才可以被删除。
-
DeleteVpc 接口属于异步接口,即系统会返回一个请求 ID,但该 VPC 尚未删除成功,系统后台的删除任务仍在进行。您可以调用 DescribeVpcAttribute 查询 VPC 的删除状态:
当 VPC 处于 Deleting 状态时,表示 VPC 正在删除中。
当查询不到指定的 VPC 时,表示 VPC 删除成功。
-
DeleteVpc 接口不支持并发删除同一个 VPC。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:DeleteVpc |
delete |
*VPC
|
|
无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| VpcId |
string |
是 |
要删除的 VPC ID。 |
vpc-bp1m7v25emi1h5mtc**** |
| RegionId |
string |
否 |
要删除的 VPC 所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-hangzhou |
| ForceDelete |
boolean |
否 |
是否强制删除 VPC。取值:
当 VPC 下仅存在以下资源时可强制删除 VPC:
|
false |
| DryRun |
boolean |
否 |
是否只预检此次请求。取值:
|
false |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。 |
123e4567-e89b-12d3-a456-426655440000 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
请求 ID。 |
||
| RequestId |
string |
请求 ID。 |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
示例
正常返回示例
JSON格式
{
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | IncorrectStatus.VpcDhcpStatus | The DhcpOptionsSet status of vpc does not support this operation. | 当前VPC中的DHCP选项集实例状态不支持删除VPC |
| 400 | DependencyViolation.GatewayEndpoint | The VPC contains endpoints and cannot be deleted. | VPC中还有终端节点,不能被删除,请先删除该VPC中的终端节点再删除VPC。 |
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | DependencyViolation.RouteEntry | Specified object has dependent resources | 当前VPC还存在未删除的自定义路由规则,VPC删除失败。 |
| 400 | DependencyViolation.Instance | Specified object has dependent resources | |
| 400 | DependencyViolation.VSwitch | Specified object has dependent resources | 当前VPC还存在未删除的交换机,VPC删除失败,删除VPC下的交换机后再尝试删除VPC。 |
| 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. | VPC中还有NAT网关,不能被删除,请先删除该VPC中的NAT网关再删除VPC。 |
| 400 | DependencyViolation.RouterInterface | Specified object has dependent resources RouterInterface. | |
| 400 | DependencyViolation.SecurityGroup | Specified object has dependent resources SecurityGroup. | 当前VPC还存在未删除的安全组,VPC删除失败,请先删除该VPC下的安全组后再删除VPC。 |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | 指定的VPC不存在,请您检查VPC是否正确。 |
| 400 | Forbbiden | Active custom route in vpc. | |
| 400 | TaskConflict | The eip operate too frequent, TaskConflict. | 操作过于频繁,任务冲突。 |
| 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. | CBN当前状态不正确 |
| 400 | DependencyViolation.RouteTable | Specified object has dependent custom routeTable. | |
| 400 | DependencyViolation.NetworkAcl | Specified object has dependent resources network acl. | 指定的对象具有从属资源网络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. | 当前VPC还存在未删除的DHCP选项集实例,不允许删除 |
| 400 | InvalidRegionId.NotFound | The specified region is not found. | 指定地域不存在。 |
| 400 | DependencyViolation.CustomRouteTable | CustomRouteTable already exists. | 依赖冲突,存在自定义路由表。 |
| 400 | DependencyViolation.Ipv4Gateway | The VPC cannot be deleted when it has ipv4Gateway. | 该VPC下存在IPV4网关,无法删除。 |
| 400 | DependencyViolation.GatewayRouteTable | Specified object has dependent resources gatewayRouteTable. | |
| 400 | OperationDenied.VpcPeerExists | The operation is not allowed because the VpcPeer exists. | 指定操作被禁止,因为VPC内存在VPC对等连接。 |
| 400 | DependencyViolation.AppAccess | Specified object has dependent resources app access. | 该VPC存在反向访问授权关系,无法删除 |
| 400 | DependencyViolation.OppositeRouterInterface | Failed to delete the VPC because it has peer router interfaces. | 该VPC存在对端RouterInterface未删除,删除VPC失败。 |
| 400 | DependencyViolation.TransitRouter | Specified object has attached to Transit Router. | 您指定的资源被其他的资源依赖,不允许进行当前操作。 |
| 400 | DependencyViolation.Ipv6Gateway | The VPC contains IPv6Gateway and cannot be deleted. | 该VPC存在IPv6网关,无法删除。 |
| 400 | DependencyViolation.CloudServiceResource | The VPC contains CloudServiceResource and cannot be deleted. | 该VPC存在云服务资源,无法删除。 |
| 400 | IncorrectStatus.VpcDnsHostnameStatus | The DnsHostname status of vpc does not support this operation. | 当前VPC的私网域名状态不支持该操作。 |
| 400 | OperationDenied.AttachedToECR | The operation is not allowed because the VPC is attached to ECR %s. | VPC关联到了专线网关%s,不允许删除。 |
| 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. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。