All Products
Search
Document Center

:CreateVpcGatewayEndpoint

更新時間:Aug 16, 2023

Creates a gateway endpoint.

Usage notes

  • CreateVpcGatewayEndpoint is an asynchronous operation. After a request is sent, the system returns an EndpointId and runs the task in the background. You can call the GetDhcpOptionsSet operation to query the status of the task.

    • If the gateway endpoint is in the Creating state, the gateway endpoint is being created.

    • If the gateway endpoint is in the Created state, the gateway endpoint is created.

  • You cannot repeatedly call the CreateVpcGatewayEndpoint operation for the same endpoint service within the specified period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

CreateVpcGatewayEndpoint

The operation that you want to perform. Set the value to CreateVpcGatewayEndpoint.

VpcId

String

Yes

vpc-bp1gsk7h12ew7oegk****

The ID of the virtual private cloud (VPC) where you want to create the gateway endpoint.

The VPC and gateway endpoint must be deployed in the same region.

ServiceName

String

Yes

com.aliyun.cn-hangzhou.oss

The name of the endpoint service.

PolicyDocument

String

No

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

The access policy for the cloud service.

For more information about the syntax and structure of the access policy, see Policy syntax and structure.

EndpointName

String

No

test

The name of the gateway endpoint.

The name must be 1 to 128 characters in length.

EndpointDescription

String

No

test

The description of the gateway endpoint.

The description must be 1 to 255 characters in length.

ClientToken

String

No

5A2CFF0E-5718-45B5-9D4D-70B3FF3898

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.

DryRun

Boolean

No

false

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.

  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.

ResourceGroupId

String

No

rg-acfmxazb4ph****

The ID of the resource group to which the gateway endpoint belongs.

Tag.N.Key

String

No

FinanceDept

The key of tag N to add to the resource. You can specify at most 20 tag keys. The tag key cannot be an empty string.

A tag key can be at most 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

Tag.N.Value

String

No

FinanceJoshua

The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string.

A tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

RegionId

String

Yes

cn-hangzhou

The region ID of the gateway endpoint.

You can call the DescribeRegions operation to query the most recent region list.

Response parameters

Parameter

Type

Example

Description

RequestId

String

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

The request ID.

EndpointId

String

vpce-bp1w1dmdqjpwul0v3****

The ID of the gateway endpoint.

ServiceName

String

com.aliyun.cn-hangzhou.oss

The name of the endpoint service.

EndpointName

String

test

The name of the gateway endpoint.

CreationTime

String

2021-08-27T01:58:37Z

The time when the gateway endpoint was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

ResourceGroupId

String

rg-acfmxazb4ph****

The ID of the resource group to which the gateway endpoint belongs.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateVpcGatewayEndpoint
&VpcId=vpc-bp1gsk7h12ew7oegk****
&ServiceName=com.aliyun.cn-hangzhou.oss
&PolicyDocument={   "Version" : "1",   "Statement" : [ {     "Effect" : "Allow",     "Resource" : [ "*" ],     "Action" : [ "*" ],     "Principal" : [ "*" ]   } ] }
&EndpointName=test
&EndpointDescription=test
&ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF3898
&DryRun=false
&ResourceGroupId=rg-acfmxazb4ph****
&Tag=[{"Key":"FinanceDept","Value":"FinanceJoshua"}]
&RegionId=cn-hangzhou
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/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****"
}

Error codes

HttpCode

Error code

Error message

Description

400

InvalidPolicy.WrongFormat

Invalid input policy format.

The format of the policy information is invalid.

For a list of error codes, see Service error codes.