全部产品
Search
文档中心

VPN网关:DeleteVpnGateway - 删除指定的VPN网关

更新时间:Aug 07, 2026

调用DeleteVpnGateway接口删除指定的VPN网关。

接口说明

说明

无法删除已有 IPsec 连接的 VPN 网关。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

vpc:DeleteVpnGateway

delete

*VpnGateway

acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId}

请求参数

名称

类型

必填

描述

示例值

RegionId

string

VPN 网关实例所在的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-hangzhou

ClientToken

string

客户端 Token,用于保证请求的幂等性。

由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过 64 个 ASCII 字符。

说明

若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。

02fb3da4-130e-11e9-8e44-0016e04115b

VpnGatewayId

string

VPN 网关实例的 ID。

vpn-bp1q8bgx4xnkm2ogj****

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

>0ED8D006-F706-4D23-88ED-E11ED28DCAC0

示例

正常返回示例

JSON格式

{
  "RequestId": ">0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

异常返回示例

JSON格式

{ 
    "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

错误码

HTTP status code

错误码

错误信息

描述

400 DependencyViolation.VpnConnection There are vpn connections on specified customer gateway not deleted. 指定的用户网关上有 vpn 连接未删除。
400 DependencyViolation.SslVpnServer There is SSL VPN server on specified vpn gateway not deleted. 指定的 vpn 网关上有 SSL VPN 服务端未删除。
400 VpnGateway.Configuring The specified service is configuring.
400 DependencyViolation.GreTunnel There is Gre tunnel on specified vpn gateway not deleted. 指定的 vpn 网关上有 Gre 隧道未删除。
400 InternalError The request processing has failed due to some unknown error, exception or failure.
400 TaskConflict The eip operate too frequent, TaskConflict. 操作过于频繁,任务冲突。
400 InvalidVpnGatewayInstanceId.NotFound The specified vpn gateway instance id does not exist. 指定的 VPN 网关不存在,请您检查 VPN 网关是否正确。
400 DependencyViolation.IpsecServer the resource cannot be deleted because the resource has an ipsec server dependency. 该资源无法被删除,因为该资源下有ipsec 服务端依赖。
403 Forbidden.SubUser User not authorized to operate on the specified resource as your account is created by another user. 您没有权限操作该资源,请您申请操作权限后再试。
403 Forbidden User not authorized to operate on the specified resource. 您没有权限操作指定资源,请申请权限后再操作。
403 ForbiddenRelease Forbidden to release a prepaid instance within validity period
404 InvalidVpnGatewayInstanceId.NotFound The specified vpn gateway instance id does not exist.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情