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

CreateVpnGatewayRoute

最近更新时间2023.09.05 08:20:02

首次发布时间2022.04.28 07:17:15

调用CreateVpnGatewayRoute为VPN网关添加一条目的路由条目。

请求参数

名称类型是否必选示例值描述
ActionStringCreateVpnGatewayRoute要执行的操作,取值:CreateVpnGatewayRoute。
VersionString2020-04-01API版本信息。
VpnGatewayIdStringvgw-3tehy13n2l4c6c0v****待添加路由条目的VPN网关的ID。
DestinationCidrBlockString192.XX.XX.0/24VPN网关路由条目的目标网段。
NextHopIdStringvgc-3tex2x1cwd4c6c0v****路由下一跳IPsec连接的ID。您可调用DescribeVpnConnections查询IPsec连接的ID信息。

返回数据

名称类型
示例值
描述
RequestIdString20220322145233010225243081016A****请求ID。
VpnGatewayRouteIdStringvgr-3tex2c6c0v844c****新添加的VPN网关路由条目的ID。

请求示例

GET /?Action=CreateVpnGatewayRoute&Version=2020-04-01&VpnGatewayId=vgw-12bfa2du7fojk17q7y1rk****&DestinationCidrBlock=172.XX.XX.0/24&NextHopId=vgc-7qthudw0ll6jmc**** HTTP/1.1
Host: open.volcengineapi.com
ServiceName: vpn
Region: cn-beijing

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20220322145233010225243081016A****",
        "Action": "CreateVpnGatewayRoute",
        "Version": "2020-04-01",
        "Service": "vpn",
        "Region": "cn-beijing"
    },
    "Result": {
        "RequestId": "20220322145233010225243081016A****",
        "VpnGatewayRouteId": "vgr-3tex2c6c0v844c****"
    }
}

错误码

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

HttpCode错误码错误信息描述
400InvalidCidr.MalformedThe specified cidr block is malformed.指定的网段格式不合法。
400InvalidRouteCidr.MalformedThe specified CIDR is malformed.指定的网段不合法。
400InvalidVpnGateway.InvalidStatusThe specified VPN gateway is not in the correct status for the request.指定的VPN网关所处的状态无法响应该请求。
400QuotaExceeded.RouteEachVPNGatewayYou've reached the limit on the number of route entries per VPN gateway that you can create.已达到每个VPN网关可创建的路由条目的数量上限。
400QuotaExceeded.RouteEntryRoute entry of a route table number exceeded quota.已达到可创建路由条目的数量上限。
400InvalidVpnGatewayRoute.SslVpnClientIpPoolConflictThe specified vpn gateway route conflicts with that of existing SSL server client ip pool.指定VPN网关路由与已有SSL服务端所属客户端网段存在冲突。
404InvalidProject.NotFoundThe specified Project does not exist.指定的项目不存在。
404InvalidVpnGatewayRoute.InvalidNextHopThe specified connection does not belong to the specified VPN gateway.指定的下一跳不属于指定的VPN网关。
404InvalidVpnConnection.NotFoundThe specified IPSec connection does not exist.指定的IPSec连接不存在。
404InvalidVpnGateway.NotFoundThe specified VPN gateway does not exist.指定的VPN网关不存在。
404InvalidRouteTable.NotFoundThe specified route table does not exist.指定的路由表不存在。
409InvalidRouteCidr.ConflictThe specified CIDR block conflicts with that of another route in your route table.指定的CIDR地址块与所属路由表中另一个规则CIDR地址块冲突。
409InvalidRouteCidr.ConflictThe specified CIDR block conflicts with that of another subnet in your VPC.指定的CIDR地址块与所属VPC中另一个子网的CIDR地址块冲突。
412InvalidVpnGateway.ExpiredThe specified VPN gateway has expired.指定的VPN网关已过期。