CreateAccessPoint
調(diào)用CreateAccessPoint接口創(chuàng)建接入點(diǎn)。
注意事項(xiàng)
阿里云賬號(hào)默認(rèn)擁有創(chuàng)建接入點(diǎn)的權(quán)限。如果您希望通過RAM用戶或者STS的方式創(chuàng)建接入點(diǎn),您必須擁有
oss:CreateAccessPoint
權(quán)限。單個(gè)阿里云賬號(hào)支持創(chuàng)建1000個(gè)接入點(diǎn)。
單個(gè)Bucket支持創(chuàng)建100個(gè)接入點(diǎn)。
請(qǐng)求語法
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>
請(qǐng)求頭
此接口僅涉及公共請(qǐng)求頭。更多信息,請(qǐng)參見公共請(qǐng)求頭(Common Request Headers)。
請(qǐng)求元素
名稱 | 類型 | 是否必選 | 示例值 | 描述 |
CreateAccessPointConfiguration | 容器 | 是 | 不涉及 | 保存接入點(diǎn)信息的容器。 父節(jié)點(diǎn):無 子節(jié)點(diǎn):AccessPointName,NetworkOrigin和VpcConfiguration |
AccessPointName | 字符串 | 是 | ap-01 | 填寫接入點(diǎn)名稱。接入點(diǎn)命名規(guī)范如下:
父節(jié)點(diǎn):CreateAccessPointConfiguration 子節(jié)點(diǎn):無 |
NetworkOrigin | 字符串 | 是 | vpc | 接入點(diǎn)網(wǎng)絡(luò)來源。取值如下:
父節(jié)點(diǎn):CreateAccessPointConfiguration 子節(jié)點(diǎn):無 |
VpcConfiguration | 容器 | 否 | 不涉及 | 保存VPC網(wǎng)絡(luò)來源信息的容器。 父節(jié)點(diǎn):CreateAccessPointConfiguration 子節(jié)點(diǎn):VpcId |
VpcId | 字符串 | 否 | vpc-t4nlw426y44rd3iq4xxxx | 僅當(dāng)NetworkOrigin取值為vpc時(shí),需要指定VPC ID。 重要 通過接入點(diǎn)限制VPC來源時(shí),需確保選擇的VPC地域與OSS支持的網(wǎng)關(guān)終端節(jié)點(diǎn)區(qū)域相匹配,否則會(huì)導(dǎo)致鑒權(quán)請(qǐng)求無法關(guān)聯(lián)至對(duì)應(yīng)的VPC,進(jìn)而引發(fā)鑒權(quán)失敗。關(guān)于OSS支持的網(wǎng)關(guān)終端節(jié)點(diǎn)地域,請(qǐng)參見OSS支持的網(wǎng)關(guān)終端節(jié)點(diǎn)地域。 父節(jié)點(diǎn):VpcId 子節(jié)點(diǎn):無 |
響應(yīng)頭
此接口僅包含公共響應(yīng)頭。更多信息,請(qǐng)參見公共響應(yīng)頭(Common Response Headers)。
響應(yīng)元素
名稱 | 類型 | 示例值 | 描述 |
CreateAccessPointResult | 容器 | 不涉及 | 保存接入點(diǎn)信息的容器。 子節(jié)點(diǎn):AccessPointArn,Alias |
AccessPointArn | 字符串 | acs:oss:cn-hangzhou:128364106451xxxx:accesspoint/ap-01 | 接入點(diǎn)ARN。 |
Alias | 字符串 | ap-01-45ee7945007a2f0bcb595f63e2215cxxxx-ossalias | 接入點(diǎn)別名。 |
示例
請(qǐng)求示例
PUT /?accessPoint HTTP/1.1 Date: Mon, 19 Jun 2023 03:15:40 GMT Content-Length:0 Content-Type: application/xml Host: oss-example.oss-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>
返回示例
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>