You need to enable JavaScript to run this app.
导航

DeleteSubnet

最近更新时间2024.01.10 10:41:28

首次发布时间2021.07.29 14:11:53

调用 DeleteSubnet 接口,删除指定的子网。

调用说明

前提条件
说明
子网内无网卡您可调用 DescribeNetworkInterfaces 接口,查看是否存在网卡。 若存在,可调用 DeleteNetworkInterface 接口删除网卡。
子网未关联SNAT规则您可调用 DescribeSnatEntries 接口,查看是否关联SNAT规则。若已关联,可调用 DeleteSnatEntry 接口删除SNAT规则。
子网无高可用虚拟IP您可调用 DescribeHaVips 接口,查看是否存在高可用虚拟IP。若存在,可调用 DeleteHaVip 接口删除高可用虚拟IP。
子网未关联网络ACL您可调用 DescribeSubnets 接口,查看是否关联网络ACL。 若存在,可调用 DisassociateNetworkAcl 接口与网络ACL解除关联。

调试

请求参数

参数名称
类型
是否必选
示例值
描述
ActionStringDeleteSubnet要执行的操作,取值: DeleteSubnet。
VersionString2020-04-01API版本信息,取值为:2020-04-01。

SubnetId

String

subnet-bp15zckdt37pq72zv****

待删除子网的ID。
您可以调用 DescribeSubnets 接口,查询子网的ID。

返回数据

参数名称
类型
示例值
描述
RequestIdString2021062415303301022514515207C4****请求ID。

请求示例

GET /?Action=DeleteSubnet&Version=2020-04-01&SubnetId=subnet-bp15zdt37pq72zv**** HTTP/1.1
Host: open.volcengineapi.com
Service: vpc
Region: cn-beijing

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2021062415303301022514515207C4****",
        "Action": "DeleteSubnet",
        "Version": "2020-04-01",
        "Service": "vpc",
        "Region": "cn-beijing"
    },
   "Result": {
        "RequestId": "2021062415303301022514515207C4****"
    }
}

错误码

此处仅展示当前API的错误码,更多错误码请参见公共错误码

HttpCode
错误码
错误信息
描述
400InvalidCen.InvalidStatusThe CEN that the specified VPC attached to is not in the correct status for the request.VPC关联的CEN实例所处的状态无法响应请求,请稍后再试。
400InvalidFlowLog.InvalidStatusThe specified flow log is not in the correct status for the request.指定流日志所处的状态无法响应该请求。
400InvalidSubnet.InUseThe specified subnet has dependent resource of an elastic network interface.指定的子网包含网卡,无法删除。
400InvalidSubnet.InUseThe specified subnet has dependent resource of an SNAT entry.指定的子网包含SNAT规则,无法删除。
400InvalidSubnet.InUseThe specified subnet is associated with Network ACL.指定的子网被网络ACL关联,无法删除。
400InvalidSubnet.InUseThe specified subnet has dependent resource of an HaVip.指定的子网包含高可用虚拟IP,无法删除。
400InvalidVpc.InvalidStatusThe specified VPC is not in the correct status for the request.指定的VPC所处状态无法响应该请求。
404InvalidSubnet.NotFoundThe specified subnet does not exist.指定的子网不存在。