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

CreateCustomerGateway

最近更新时间2024.04.18 17:23:56

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

调用CreateCustomerGateway创建一个用户网关。

调试

请求参数

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

CustomerGatewayName

String

CGW-t26c

用户网关的名称。

  • 以中文、字母、数字开头,只能包含中文、字母、数字、点号(.)、下划线(_)和短划线(-)。
  • 长度限制为1 ~ 128个字符。
  • 不填默认为用户网关的ID。
IpAddressString8.XX.XX.8对端本地数据中心网关的静态公网IP地址或其他VPC的VPN网关出口IP地址。若对端为非固定静态公网IP,此处需传入0.0.0.0

Description

String

This is a sample description

用户网关的描述信息。

  • 以中文、字母、数字开头,只能包含中文、字母、数字、点号(.)、空格( )、下划线(_)、中划线(-)、等号(=)、英文逗号(,)、中文逗号(,)、中文句号(。)。
  • 长度限制为0 ~ 255个字符。
  • 不填默认为空字符串。

ClientToken

String

123e4567-e89b-12d3-a456-42665544****

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

  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。
  • 仅支持ASCII字符,且不能超过64个字符。
  • 若不传入ClientToken,则此次API调用不进行幂等校验。
ProjectNameStringProject_1用户网关所属的项目。不填默认为default,即创建的资源属于default项目。您可调用ListProjects查询当前账号下项目的信息。

返回数据

名称类型
示例值
描述
RequestIdString2022032111142501022524314704AF****请求ID。
CustomerGatewayIdStringcgw-3tex2x1cwd4c6c0v****新创建用户网关的ID。

请求示例

GET /?Action=CreateCustomerGateway&Version=2020-04-01&CustomerGatewayName=test&Description=test&IpAddress=1.1.1.1 HTTP/1.1
Host: open.volcengineapi.com
ServiceName: vpn
Region: cn-beijing

返回示例

{
    "ResponseMetadata":{
        "RequestId":"2022032111142501022524314704AF****",
        "Action":"CreateCustomerGateway",
        "Version":"2020-04-01",
        "Service":"vpn",
        "Region":"cn-beijing"
    },
    "Result":{
        "RequestId":"2022032111142501022524314704AF****",
        "CustomerGatewayId":"cgw-2d670j2o9lc0058ozfddg****"
    }
}

错误码

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

HttpCode错误码错误信息描述
400InvalidName.MalformedThe specified name is malformed.Ensure the maximum length of name is 128.指定的名称格式不合法。名称长度不能超过128个字符。
400InvalidName.MalformedThe specified name is malformed.指定的名称格式不合法。请修复名称格式后重试。
400InvalidDescription.MalformedThe specified description is malformed.Ensure the maximum length of description is 255.指定的描述格式不合法。描述长度不能超过255个字符。
400InvalidDescription.MalformedThe specified description is malformed.指定的描述格式不合法。请修复描述格式后重试。
400InvalidCustomerGatewayIp.MalformedThe specified customer gateway ip is malformed.指定的用户网关IP不合法。
400QuotaExceeded.CustomerGatewayYou've reached the limit on the number of customer gateway per region that you can create.已达到每个地域可创建的用户网关的数量上限。
400IdempotentParameterMismatchArguments on this idempotent request are inconsistent with arguments used in previous request(s).此幂等请求的参数与前一个请求中使用的参数不一致。
400InvalidParameter.ClientTokenMalformedThe specified parameter ClientToken is malformed.指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。
404InvalidProject.NotFoundThe specified Project does not exist.指定的项目不存在。
412IdempotentProcessingThe request uses the same client token as a previous one that is still in process.幂等请求处理中。