Updated on 2025-08-22 GMT+08:00

Listing Buckets

Functions

You can perform this operation to list all buckets that you have created across all regions.

Request Syntax

1
2
3
4
GET / HTTP/1.1 
Host: obs.region.myhuaweicloud.com
Date: date
Authorization: authorization

Regardless of the endpoint you specified, a list of buckets spanning all regions is returned.

When creating a bucket, do not list buckets.

Request Parameters

This request contains no parameters.

Request Headers

This request's message header is the same as that of a common request. For details, see Table 1. This request can contain additional headers. The following table describes the additional headers for this request.

Table 1 Additional request headers

Parameter

Mandatory (Yes/No)

Type

Description

x-obs-bucket-type

No

String

Definition:

This header specifies the type of buckets contained in the list.

Example: x-obs-bucket-type: POSIX

Constraints:

If this header is not carried, the list of all buckets and parallel file systems is obtained.

Range:

  • OBJECT: Obtain the list of all buckets.
  • POSIX: Obtain the list of all parallel file systems.

Default value:

If the request header is not carried, the default value is blank, indicating that both OBJECT and POSIX are carried.

Request Elements

The request does not use request elements.

Response Syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
GET HTTP/1.1 status_code
Content-Type: type
Date: date
Content-Length: length

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<ListAllMyBucketsResult xmlns="http://obs.region.myhuaweicloud.com/doc/2015-06-30/"> 
    <Owner> 
        <ID>id</ID>
    </Owner> 
    <Buckets>
        <Bucket> 
            <Name>bucketName</Name> 
            <CreationDate>date</CreationDate>
            <Location>region</Location>
            <BucketType>buckettype</BucketType>
        </Bucket> 
        ... 
    </Buckets> 
</ListAllMyBucketsResult> 

Response Headers

The response to the request uses common headers. For details, see Table 1.

Response Elements

This response contains the XML list of buckets owned by the user. Table 2 describes the elements.

Table 2 Response elements

Parameter

Type

Description

ListAllMyBucketsResult

XML

Definition:

List of buckets. It is the parent node of Owner and Buckets.

Range:

None

Owner

XML

Definition:

Owner of the bucket.

Range:

For details, see Table 3.

Buckets

XML

Definition:

List of buckets returned.

Range:

For details, see Table 4.

Table 3

Parameter

Type

Description

ID

String

Definition:

Domain ID (account ID) of the owner.

Range:

For details, see Domain ID.

Table 4

Parameter

Type

Description

Bucket

XML

Definition:

Detailed bucket information, including the bucket name and creation time.

Range:

For details, see Table 5.

Table 5 Bucket parameters

Parameter

Type

Description

Name

String

Definition:

Bucket name

Range:

The value is a string of 3 to 63 characters.

CreationDate

String

Definition:

Time (UTC) when the bucket is created. The date is in the ISO8601 format, for example, 2025-06-28T08:57:41.047Z.

Range:

The value is a string of 24 characters.

Location

String

Definition:

Region where a bucket is located

Range:

For more information about valid OBS regions and endpoints, see Regions and Endpoints.

BucketType

String

Definition:

Bucket type

Range:

  • OBJECT: object bucket
  • POSIX: parallel file system

Error Responses

No special error responses are returned. For details about error responses, see Table 2.

Sample Request

1
2
3
4
5
6
7
GET /
 HTTP/1.1
User-Agent: curl/7.29.0
Host: obs.region.myhuaweicloud.com
Accept: */*
Date: Mon, 25 Jun 2018 05:37:12 +0000
Authorization: OBS GKDF4C7Q6SI0IPGTXTJN:9HXkVQIiQKw33UEmyBI4rWrzmic= 

Sample Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: BF260000016435722C11379647A8A00A
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSGGDRUM62QZi3hGP8Fz3gOloYCfZ39U
Content-Type: application/xml
Date: Mon, 25 Jun 2018 05:37:12 GMT
Content-Length: 460

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListAllMyBucketsResult xmlns="http://obs.ap-southeast-1.myhuaweicloud.com/doc/2015-06-30/">
  <Owner>
    <ID>783fc6652cf246c096ea836694f71855</ID>
  </Owner>
  <Buckets>
    <Bucket>
      <Name>examplebucket01</Name>
      <CreationDate>2018-06-21T09:15:01.032Z</CreationDate>
      <Location>region</Location>
      <BucketType>OBJECT</BucketType>
    </Bucket>
    <Bucket>
      <Name>examplebucket02</Name>
      <CreationDate>2018-06-22T03:56:33.700Z</CreationDate>
      <Location>region</Location>
      <BucketType>OBJECT</BucketType>
    </Bucket>
  </Buckets>
</ListAllMyBucketsResult>