获取桶的Website配置
更新时间: 2019-03-13 10:25
功能说明
获取桶的Website配置。
方法定义
- func (obsClient ObsClient) GetBucketWebsiteConfiguration(bucketName string) (output *GetBucketWebsiteConfigurationOutput, err error)
使用带授权信息URL的方法定义
- func (obsClient ObsClient) GetBucketWebsiteConfigurationWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketWebsiteConfigurationOutput, err error)
请求参数
参数名 | 类型 | 约束 | 说明 |
---|---|---|---|
bucketName | string | 必选 | 桶名。 |
返回结果
参数名 | 类型 |
---|---|
output | *GetBucketWebsiteConfigurationOutput |
err | error |
代码样例
- func main() {
- output, err := obsClient.GetBucketWebsiteConfiguration("bucketname")
- if err == nil {
- fmt.Printf("RequestId:%s\n", output.RequestId)
- fmt.Printf("Suffix:%s\n", output.IndexDocument.Suffix)
- fmt.Printf("Key:%s\n", output.ErrorDocument.Key)
- for index, routingRule := range output.RoutingRules {
- fmt.Printf("Condition[%d]-KeyPrefixEquals:%s, HttpErrorCodeReturnedEquals:%s\n", index, routingRule.Condition.KeyPrefixEquals, routingRule.Condition.HttpErrorCodeReturnedEquals)
- fmt.Printf("Redirect[%d]-Protocol:%s, HostName:%s, ReplaceKeyPrefixWith:%s, HttpRedirectCode:%s\n",
- index, routingRule.Redirect.Protocol, routingRule.Redirect.HostName, routingRule.Redirect.ReplaceKeyPrefixWith, routingRule.Redirect.HttpRedirectCode)
- }
- } else {
- if obsError, ok := err.(obs.ObsError); ok {
- fmt.Println(obsError.Code)
- fmt.Println(obsError.Message)
- } else {
- fmt.Println(err)
- }
- }
- }
父主题:桶相关接口