首页 专有网络 VPC 开发参考 API参考 API目录 网关终端节点 CreateVpcGatewayEndpoint - 创建网关终端节点

CreateVpcGatewayEndpoint - 创建网关终端节点

更新时间: 2023-09-19 03:55:08

调用CreateVpcGatewayEndpoint接口创建网关终端节点。

接口说明

使用说明

  • CreateVpcGatewayEndpoint接口属于异步接口,即系统返回一个EndpointId,但该网关终端节点尚未创建成功,系统后台的创建任务仍在进行。您可以调用GetDhcpOptionsSet查询网关终端节点的创建状态:
    • 当网关终端节点处于Creating状态时,表示网关终端节点正在创建中。
    • 当网关终端节点处于Created状态时,表示网关终端节点创建成功。
  • CreateVpcGatewayEndpoint接口不支持针对同一个终端节点服务并发创建网关终端节点。

调试

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

调试

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
vpc:CreateVpcGatewayEndpointWrite
  • GatewayEndpoint
    acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/*

请求参数

名称类型必填描述示例值
VpcIdstring

要创建网关终端节点的VPC ID。

该VPC必须与网关终端节点在同一个地域。

vpc-bp1gsk7h12ew7oegk****
ServiceNamestring

终端节点服务名称。

com.aliyun.cn-hangzhou.oss
PolicyDocumentstring

云服务的访问策略。

关于访问策略的语法和结构,请参见权限策略语法和结构

{ "Version" : "1", "Statement" : [ { "Effect" : "Allow", "Resource" : [ "*" ], "Action" : [ "*" ], "Principal" : [ "*" ] } ] }
EndpointNamestring

网关终端节点的名称。

名称的长度在1~128个字符之间。

test
EndpointDescriptionstring

网关终端节点的描述信息。

描述信息的长度在1~255个字符之间。

test
ClientTokenstring

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

从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。

说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId不一样。
5A2CFF0E-5718-45B5-9D4D-70B3FF3898
DryRunboolean

是否只预检此次请求,取值:

  • true:发送检查请求,不会创建网关终端节点。检查项包括AccessKey是否有效、RAM用户的授权情况和是否填写了必需参数。如果检查不通过,则返回对应错误。如果检查通过,会返回错误码DryRunOperation

  • false(默认值):发送正常请求,通过检查后返回2xx HTTP状态码并创建网关终端节点。

false
ResourceGroupIdstring

网关终端节点所属的资源组ID。

rg-acfmxazb4ph****
RegionIdstring

要创建的网关终端节点的地域ID。

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

cn-hangzhou

返回参数

名称类型描述示例值
object

请求ID。

RequestIdstring

请求ID。

62CFC815-E08A-5CF4-92D1-54273EC9E406
EndpointIdstring

网关终端节点实例ID。

vpce-bp1w1dmdqjpwul0v3****
ServiceNamestring

终端节点服务名称。

com.aliyun.cn-hangzhou.oss
EndpointNamestring

网关终端节点的名称。

test
CreationTimestring

网关终端节点的创建时间。按照ISO8601标准表示,并需要使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ。

2021-08-27T01:58:37Z
ResourceGroupIdstring

网关终端节点所属的资源组ID。

rg-acfmxazb4ph****

示例

正常返回示例

JSON格式

{
  "RequestId": "62CFC815-E08A-5CF4-92D1-54273EC9E406",
  "EndpointId": "vpce-bp1w1dmdqjpwul0v3****",
  "ServiceName": "com.aliyun.cn-hangzhou.oss",
  "EndpointName": "test",
  "CreationTime": "2021-08-27T01:58:37Z",
  "ResourceGroupId": "rg-acfmxazb4ph****"
}

错误码

HTTP status code错误码错误信息描述
400OperationFailed.ConcurrentOperationThe operation is failed because of concurrent operation.-
400IdempotentParameterMismatchThe request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.-
400IllegalParam.PolicyDocumentThe param of PolicyDocument is illegal.-
400IllegalParam.GatewayEndpointNameThe param of GatewayEndpointName is illegal.-
400IllegalParam.GatewayEndpointDescriptionThe param of GatewayEndpointDescription is illegal.-
400ResourceAlreadyExist.GatewayEndpointThe specified resource gateway endpoint is already exist.-
400ResourceNotFound.ServiceNameThe specified resource service name is not found.-
400ResourceNotFound.VpcIdThe specified resource vpc is not found.-
400Forbidden.OperateShareResourceThe operation is failed because of shared vpc.-
400IncorrectStatus.VpcThe status of vpc [%s] is incorrect.-
400IncorrectStatus.CenStatusThe status of vpc cenStatus [%s] is incorrect.-
400OperationFailed.VpcIpv6DisabledThe operation is failed because of VpcIpv6Disabled.-
400UnsupportedFeature.GatewayEndpointThe feature of gatewayEndpoint is not supported for %s.-
400SystemBusySystem is busy, please try again later.-
400ForbbidenUser not authorized to operate on the specified resource.您没有权限操作该资源,请您申请操作权限后再试。
400OperationDenied.PolicyDocumentThe gatewayEndpoint does not support policy.-
400MissingParam.PolicyDocumentThe param of PolicyDocument is missing.-
400OperationDenied.NotAuthorizedUser not authorized to operate on the specified resource.-
400InvalidPolicy.WrongFormatInvalid input policy format.输入策略信息格式错误。

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

变更历史

变更时间变更内容概要操作
2023-07-05OpenAPI 错误码发生变更,OpenAPI 入参发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
入参OpenAPI 入参发生变更
    新增入参:Tag
2023-05-29OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
2023-03-23OpenAPI 错误码发生变更,OpenAPI 入参发生变更,OpenAPI 返回结构发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
入参OpenAPI 入参发生变更
    新增入参:ResourceGroupId
出参OpenAPI 返回结构发生变更
阿里云首页 专有网络 VPC 相关技术圈