我们已经准备好了,你呢?

2023我们与您携手共赢,为您的企业形象保驾护航!


喜讯:国内、香港、海外云服务器租用特惠活动,2核/4G/10M仅需31元每月,点击抢购>>>

点击这里注册天翼云特邀VIP帐号,立即体验天翼云对象存储>>>


天翼云对象存储(经典版)I型API参考-GET Bucket WebSite


此操作用来获得指定Bucket的website。只有根用户和拥有GET Bucket WebSite权限的子用户才能执行此操作,否则会返回403 AccessDenied错误。

请求语法

GET /?website HTTP/1.1

Host: BucketName.oos-cn.ctyunapi.cn

Date: date

Authorization: signatureValue


请求参数

名称

描述

是否必须

BucketName

存储桶名称。

响应结果

名称

描述

WebsiteConfiguration

请求的容器。

类型:容器

子节点:IndexDocument、ErrorDocument、RoutingRules   或 RedirectAllRequestsTo

IndexDocument

Suffix元素的容器。

类型:容器

父节点:WebsiteConfiguration

子节点:Suffix

Suffix

在请求website endpoint时,Suffix会被加在请求的后面。

类型:字符串
  
父节点:IndexDocument

ErrorDocument

Key 的容器。

类型:容器

父节点:WebsiteConfiguration

子节点: Key

Key

如果出现 4XX 错误,返回的Object。

类型:字符串

父节点:ErrorDocument

RoutingRules

托管模式配置到当前容器的重定向规则容器。

类型:容器
  
父节点:WebsiteConfiguration
  
子节点:RoutingRule

RoutingRule

具体重定向规则的容器。

父节点:RoutingRules

子节点:Condition、Redirect

Condition

描述重定向规则匹配的条件的容器。

类型:容器

父节点:RoutingRule

子节点:HttpErrorCodeReturnedEquals、KeyPrefixEquals

HttpErrorCodeReturnedEquals

Redirect生效时的HTTP错误码。

类型:字符串

父节点:Condition

KeyPrefixEquals

重定向规则生效时的对象名的前缀。

类型:字符串

父节点:Condition

Redirect

重定信息容器。

类型:容器

父节点:RoutingRule

子节点:Protocol、HostName、ReplaceKeyPrefixWith、   ReplaceKeyWith

Protocol

描述重定向请求时使用的协议。

类型:字符串

父节点:Redirect或者RedirectAllRequestsTo

HostName

重定向请求时使用的站点名。

类型:字符串

父节点:Redirect或者RedirectAllRequestsTo

ReplaceKeyPrefixWith

重定向请求时使用的对象名前缀。

类型:字符串

父节点:Redirect

ReplaceKeyWith

重定向请求时使用的对象名。

类型:字符串

父节点:Redirect

RedirectAllRequestsTo

托管模式为重定向请求的容器。

父节点:WebsiteConfiguration

子节点:HostName、Protocol


请求示例

GET /?website HTTP/1.1 x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 Authorization: AWS4-HMAC-SHA256 Credential=userak2222222227856/20220718/cd/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=c0097ce18aa148bad9760bccd91975c7aa52d7724e6aaeb68cd880c01e8f38f9 x-amz-date: 20220718T091530Z Host: test-bucket.oos-cn.ctyunapi.cn Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Connection: keep-alive


响应示例

HTTP/1.1 200 OK Content-Type: application/xml;charset=UTF-8 Date: Mon, 18 Jul 2022 09:15:30 GMT x-amz-request-id: 88d52b33bef4440b3a867d8e9491947396a0828487828b9778 Content-Length: 430 Server: CTYUN   <?xml version="1.0" encoding="UTF-8"?> <WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <IndexDocument> <Suffix>index.html</Suffix> </IndexDocument> <ErrorDocument> <Key>error.html</Key> </ErrorDocument> <RoutingRules> <RoutingRule> <Condition> <KeyPrefixEquals>images/</KeyPrefixEquals> </Condition> <Redirect> <ReplaceKeyWith>errorpage.html</ReplaceKeyWith> </Redirect> </RoutingRule> </RoutingRules> </WebsiteConfiguration>




推荐:TOP云智能建站优惠活动,仅880元即可搭建一个后台管理五端合一的智能网站(PC网站、手机网站、百度智能小程序、微信小程序、支付宝小程序),独享百度搜索SEO优势资源,让你的网站不仅有颜值有排面,更有排名,可以实实在在为您带来效益,请点击进入TOP云智能建站>>>,或咨询在线客服了解详情。


我们已经准备好了,你呢?

2023我们与您携手共赢,为您的企业形象保驾护航!

在线客服
联系方式

热线电话

131-3501-0006

上班时间

周一到周五

公司电话

130-0743-9476

二维码
线