All Products
Search
Document Center

Object Storage Service:get-bucket-website

Last Updated:Aug 26, 2024

Queries the static website hosting status and redirection rules of a bucket.

Usage notes

By default, an Alibaba Cloud account has the permissions to query the static website hosting status and redirection rules of a bucket. If you want to query the static website hosting status and redirection rules of a bucket by using a RAM user or Security Token Service (STS), you must have the oss:GetBucketWebsite permission. For more information, see Attach a custom policy to a RAM user.

Command syntax

ossutil api get-bucket-website --bucket value [flags]

Parameter

Type

Description

--bucket

string

The name of the bucket whose static website hosting status and redirection rules you want to query.

Note
  • The get-bucket-website command corresponds to the GetBucketWebsite operation. For more information about the parameters in the GetBucketWebsite operation, see GetBucketWebsite.

  • For more information about supported global command-line options, see Global command-line options.

Examples

  • Run the following command to query the static website hosting status and redirection rules of a bucket named examplebucket:

    ossutil api get-bucket-website --bucket examplebucket
  • Run the following command to query the static website hosting status and redirection rules of a bucket named examplebucket and display the query results in the JSON format:

    ossutil api get-bucket-website --bucket examplebucket --output-format json
  • Run the following command to query the static website hosting status and redirection rules of a bucket named examplebucket and display the query results in the YAML format:

    ossutil api get-bucket-website --bucket examplebucket --output-format yaml