GetBucketWebsite
更新时间 2026-04-10 20:09:07
最近更新时间: 2026-04-10 20:09:07
功能说明
GetBucketWebsite请求为查询与存储桶关联的Website配置信息(静态网站托管配置或者数据回源配置)。
请求消息样式
GET /{Bucket}?website HTTP/1.1
Host: xxxx.zos.ctyun.cn
Accept-Encoding: identity
X-Amz-Date: 20220408T085626Z
X-Amz-Content-SHA256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Authorization: string请求消息参数
| 参数名称 | 参数描述 | 类型 | 是否必须 |
|---|---|---|---|
| Bucket | 参数解释: 桶的名称。 | String | 是 |
请求消息头
该请求使用公共的请求消息头,请参见如何调用API-构造请求-请求消息头。
请求消息元素
该请求消息中不带消息元素。
响应消息样式
HTTP/1.1 Status Code
x-amz-request-id: tx000000000000000000002-00624ff8ba-1138-default
Content-Type: application/xml
Content-Length: 982
Date: Fri, 08 Apr 2022 08:56:26 GMT
Connection: Keep-Alive
<?xml version="1.0" encoding="UTF-8"?>
<WebsiteConfiguration>
<RedirectAllRequestsTo>
<HostName>string</HostName>
<Protocol>string</Protocol>
</RedirectAllRequestsTo>
<IndexDocument>
<Suffix>string</Suffix>
</IndexDocument>
<ErrorDocument>
<Key>string</Key>
</ErrorDocument>
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>string</HttpErrorCodeReturnedEquals>
<KeyPrefixEquals>string</KeyPrefixEquals>
</Condition>
<Redirect>
<Type>string</Type>
<HostName>string</HostName>
<HttpRedirectCode>string</HttpRedirectCode>
<Protocol>string</Protocol>
<ReplaceKeyPrefixWith>string</ReplaceKeyPrefixWith>
<ReplaceKeyWith>string</ReplaceKeyWith>
</Redirect>
</RoutingRule>
</RoutingRules>
</WebsiteConfiguration>响应消息头
该请求的响应消息使用公共的响应消息头,请参见如何调用API-响应结果-响应消息头。
响应消息元素
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| WebsiteConfiguration | 参数解释: Website配置信息的根节点。 | Container |
表WebsiteConfiguration
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| ErrorDocument | 参数解释: 错误文档配置。 | Container |
| IndexDocument | 参数解释: 索引文档配置。 | Container |
| RedirectAllRequestsTo | 参数解释: 重定向所有请求配置,该规则与其他规则互斥,也就是说使用了重定向规则就不能配置其他规则。 | Container |
| RoutingRules | 参数解释: 回源规则配置。 | Container |
表ErrorDocument
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| Key | 参数解释: 指定的通用错误文档,当发生错误且未命中重定向规则中的错误码重定向时,将返回该错误文档中的内容。 | String |
表IndexDocument
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| Suffix | 参数解释: 指定索引文档后缀。例如指定为index.html,那么当访问到存储桶的根目录时,会自动返回 index.html 的内容,或者当访问到article/目录时,会自动返回 article/index.html的内容。 | String |
表RedirectAllRequestsTo
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| HostName | 参数解释: 要重定向的主机名。 | String |
| Protocol | 参数解释: 重定向时使用的协议。 | String |
表RoutingRules
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| RoutingRule | 参数解释: 回源规则。 | Container |
表RoutingRule
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| Condition | 参数解释: 回源条件。 | Container |
| Redirect | 参数解释: 回源规则,可以配置重定向回源规则或镜像回源规则。 | Container |
表Condition
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| HttpErrorCodeReturnedEquals | 参数解释: 触发回源的错误码。 | String |
| KeyPrefixEquals | 参数解释: 触发回源的对象前缀。 | String |
表Redirect
| 参数名称 | 参数描述 | 类型 |
|---|---|---|
| Type | 参数解释: 指定回源类型,可选重定向回源(REDIRECTION)或镜像回源(MIRROR)。 | String |
| HostName | 参数解释: 回源生效时回源请求的主机名。 | String |
| HttpRedirectCode | 参数解释: 回源响应中的HTTP状态码。 | String |
| Protocol | 参数解释: 回源生效时使用的协议(http或https)。 | String |
| ReplaceKeyPrefixWith | 参数解释: 回源生效时回源请求中的对象名前缀。 | String |
| ReplaceKeyWith | 参数解释: 回源生效时回源请求中的对象名。 | String |
错误码
请参见调用前必知-错误码-全局错误码。