All Products
Search
Document Center

Object Storage Service:CreateAccessPoint

Last Updated:Apr 28, 2024

Creates an access point.

Usage notes

  • By default, an Alibaba Cloud account has the permissions to create an access point. To create an access point by using a RAM user or Security Token Service (STS), you must have the oss:CreateAccessPoint permission.

  • You can create up to 1,000 access points for an Alibaba Cloud account.

  • You can create up to 100 access points for a bucket.

Request syntax

PUT /?accessPoint HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: SignatureValue
<?xml version="1.0" encoding="UTF-8"?>
<CreateAccessPointConfiguration>
  	<AccessPointName>ap-01</AccessPointName>
    <NetworkOrigin>vpc</NetworkOrigin>
    <VpcConfiguration>
      <VpcId>vpc-t4nlw426y44rd3iq4xxxx</VpcId>
    </VpcConfiguration>
</CreateAccessPointConfiguration>

Request headers

All headers in a CreateAccessPoint request are common request headers. For more information, see Common HTTP headers.

Request elements

Element

Type

Required

Example

Description

CreateAccessPointConfiguration

Container

Yes

N/A

The container that stores the information about the access point.

Parent nodes: none

Child nodes: AccessPointName, NetworkOrigin, and VpcConfiguration

AccessPointName

String

Yes

ap-01

The name of the access point. The name of the access point must meet the following naming rules:

  • The name must be unique in a region of your Alibaba Cloud account.

  • The name cannot end with -ossalias.

  • The name can contain only lowercase letters, digits, and hyphens (-). It cannot start or end with a hyphen.

  • The name must be 3 to 19 characters in length.

Parent nodes: CreateAccessPointConfiguration

Child nodes: none

NetworkOrigin

String

Yes

vpc

The network origin of the access point. Valid values:

  • vpc: You can use a specific virtual private cloud (VPC) ID to access the access point.

  • internet: You can use public endpoints and internal endpoints to access the access point.

Parent nodes: CreateAccessPointConfiguration

Child nodes: none

VpcConfiguration

Container

No

N/A

The container that stores the information about the VPC.

Parent nodes: CreateAccessPointConfiguration

Child nodes: VpcId

VpcId

String

No

vpc-t4nlw426y44rd3iq4xxxx

The ID of the VPC that is required only when the NetworkOrigin element is set to vpc.

Parent nodes: VpcId

Child nodes: none

Response headers

The response to a CreateAccessPoint request contains only common response headers. For more information, see Common HTTP headers.

Response elements

Element

Type

Example

Description

CreateAccessPointResult

Container

N/A

The container that stores the information about the access point.

Child nodes: AccessPointArn and Alias

AccessPointArn

String

acs:oss:cn-hangzhou:128364106451xxxx:accesspoint/ap-01

The Alibaba Cloud Resource Name (ARN) of the access point.

Alias

String

ap-01-45ee7945007a2f0bcb595f63e2215cxxxx-ossalias

The alias of the access point.

Examples

  • Sample request

    PUT /?accessPoint HTTP/1.1
    Date: Mon, 19 Jun 2023 03:15:40 GMT
    Content-Length: 0
    Content-Type: application/xml
    Host: oss-example.cn-hangzhou.aliyuncs.com
    Authorization: OSS qn6q**************:77Dv****************    
    <?xml version="1.0" encoding="UTF-8"?>
    <CreateAccessPointConfiguration>
      	<AccessPointName>ap-01</AccessPointName>
        <NetworkOrigin>vpc</NetworkOrigin>
        <VpcConfiguration>
          <VpcId>vpc-t4nlw426y44rd3iq4xxxx</VpcId>
        </VpcConfiguration>
    </CreateAccessPointConfiguration>
  • Sample response

    HTTP/1.1 200 OK
    x-oss-request-id: 5C1B138A109F4E405B2Dxxxx
    Date: Mon, 19 Jun 2023 03:15:40 GMT
    Content-Length: 0
    Connection: keep-alive
    Server: AliyunOSS
    <?xml version="1.0" encoding="UTF-8"?>
    <CreateAccessPointResult>
      <AccessPointArn>acs:oss:cn-hangzhou:128364106451xxxx:accesspoint/ap-01</AccessPointArn>
      <Alias>ap-01-45ee7945007a2f0bcb595f63e2215cxxxx-ossalias</Alias>
    </CreateAccessPointResult>