tencent cloud

Cloud Object Storage

最新情報とお知らせ
製品アップデート情報
製品のお知らせ
製品概要
製品概要
機能概要
応用シナリオ
製品の優位性
基本概念
リージョンとアクセスドメイン名
仕様と制限
製品の課金
課金概要
課金方式
課金項目
無料利用枠
記帳例
請求書の確認とダウンロード
お支払い遅れについて
よくある質問
クイックスタート
コンソールクイックスタート
COSBrowserクイックスタート
ユーザーガイド
リクエストの作成
バケット
オブジェクト
データ管理
バッチ処理
グローバルアクセラレーション
監視とアラーム
運用管理センター
データ処理
インテリジェントツールボックス使用ガイド
データワークフロー
アプリ統合
ツールガイド
ツール概要
環境のインストールと設定
COSBrowserツール
COSCLIツール
COSCMDツール
COS Migrationツール
FTP Serverツール
Hadoopツール
COSDistCpツール
HDFS TO COSツール
オンラインツール (Onrain Tsūru)
セルフ診断ツール
実践チュートリアル
概要
アクセス制御と権限管理
パフォーマンスの最適化
AWS S3 SDKを使用したCOSアクセス
データディザスタリカバリバックアップ
ドメイン名管理の実践
画像処理の実践
COSオーディオビデオプレーヤーの実践
データセキュリティ
データ検証
COSコスト最適化ソリューション
サードパーティアプリケーションでのCOSの使用
移行ガイド
サードパーティクラウドストレージのデータをCOSへ移行
データレークストレージ
クラウドネイティブデータレイク
メタデータアクセラレーション
データアクセラレーター GooseFS
データ処理
データ処理概要
画像処理
メディア処理
コンテンツ審査
ファイル処理
ドキュメントプレビュー
トラブルシューティング
RequestId取得の操作ガイド
パブリックネットワーク経由でのCOSへのファイルアップロード速度の遅さ
COSへのアクセス時に403エラーコードが返される
リソースアクセス異常
POST Objectの一般的な異常
セキュリティとコンプライアンス
データ災害復帰
データセキュリティ
クラウドアクセスマネジメント
よくある質問
よくあるご質問
一般的な問題
従量課金に関するご質問
ドメインコンプライアンスに関するご質問
バケット設定に関する質問
ドメイン名とCDNに関するご質問
ファイル操作に関するご質問
権限管理に関するご質問
データ処理に関するご質問
データセキュリティに関するご質問
署名付きURLに関するご質問
SDKクラスに関するご質問
ツール類に関するご質問
APIクラスに関するご質問
Agreements
Service Level Agreement
プライバシーポリシー
データ処理とセキュリティ契約
連絡先
用語集
ドキュメントCloud Object Storage

GET Service(List Buckets)

フォーカスモード
フォントサイズ
最終更新日: 2026-04-02 10:08:35

Feature Description

The GET Service API is used to query the list of all buckets owned by the requester or the list of buckets in a specific region.
Note:
If you have just created a bucket and immediately call the GET Service API, due to the eventual consistency nature of this API, the returned results may not include the bucket you just created.


Authorization Description

Set the action in the authorization policy to cos:GetService. View all action.

Request

Request Example

Example I
GET / HTTP/1.1
Host: service.cos.myqcloud.com
Date: GMT Date
Authorization: Auth String
Example 2
GET / HTTP/1.1
Host: cos.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String
Note:
Authorization: Auth String (For details, see the request signature document).
Host: To query all bucket lists, specify it as service.cos.myqcloud.com, to query bucket lists in a specific region, specify it as cos.<Region>.myqcloud.com, where <Region> is the available region for COS, refer to the Regions and Access Domains document.

Request Parameter

GetService supports filtering buckets based on bucket Tags, region, and creation time through request parameters. Specifically, when buckets are filtered based on bucket Tags, only one bucket Tag can be passed in. If a bucket contains multiple bucket Tags, it will be returned as long as any one of them matches the user-specified bucket Tag.
Name
Description
Type
Required or Not
tagkey
Supports filtering buckets based on bucket Tags (composed of tag key tagkey and tag value tagvalue). Only one bucket Tag can be passed in, and tagkey is used to pass in the tag key. If you need to query buckets based on bucket Tags, then tagkey and tagvalue are required fields.
string
No
tagvalue
Supports filtering buckets based on bucket Tags (composed of tag key tagkey and tag value tagvalue). Only one bucket Tag can be passed in, and tagvalue is used to pass in the tag value. If you need to query buckets based on bucket Tags, then tagkey and tagvalue are required fields.
string
No
region
Supports filtering buckets by region, for example region=ap-beijing. For COS supported regions, refer to Regions and Access Domains
string
No
create-time
GMT timestamp, used together with the range parameter, supports filtering buckets based on creation time, for example create-time=1642662645
Timestamp
No
range
Used together with the create-time parameter to filter buckets based on creation time. Supported enumeration values: lt (creation time earlier than create-time), gt (creation time later than create-time), lte (creation time earlier than or equal to create-time), gte (creation time later than or equal to create-time).
string
No
marker
Start marker. Bucket entries are returned in UTF-8 lexicographical order starting after (exclusive) this marker.
string
No
max-keys
The maximum number of entries returned in a single response. The default value is 2000, and the maximum is 2000. If not all buckets are listed in a single response, COS will return a NextMarker node, whose value is to be used as the marker parameter in the next GetService request.
integer
No
When the bucket Tag authorization status differs from the GetService authorization, the authorization and response behavior for GetService requests are as follows. For the authorization method regarding tag-based authorization, refer to Authorizing Sub-Accounts to Retrieve Bucket Lists Based on Bucket Tags.
Bucket Tag authorization status
GetService authorization status
GetService request
Request returned
The root account granted the sub-account resource operation permissions for bucket Tag tagA through bucket Tag authorization.
You have not been authorized for the GetService permission.
Include the bucket Tag parameter tagA
List of buckets containing bucket Tag tagA
Does not include the bucket Tag parameter
Access Denied
Grant additional GetService permission
Include the bucket Tag parameter tagA
List of buckets containing bucket Tag tagA
Does not include the bucket Tag parameter
List of all buckets
The root account did not grant the sub-account resource operation permissions for bucket Tag tagA through bucket Tag authorization.
You have not been authorized for the GetService permission.
Include the bucket Tag parameter tagA
Access Denied
Does not include the bucket Tag parameter
Access Denied
Grant additional GetService permission
Include the bucket Tag parameter tagA
List of buckets containing bucket Tag tagA
Does not include the bucket Tag parameter
List of all buckets

Request Header

This API only uses common request headers. For details, see Common Request Headers.

Request Body

This API has no request body.

Response

Response Headers

This API only returns common response headers. For details, see Common Response Headers.

Response Body

The query succeeded, returning application/xml data, containing a list of buckets in all or specific regions.
<ListAllMyBucketsResult>
<Owner>
<ID>string</ID>
<DisplayName>string</DisplayName>
</Owner>
<Marker></Marker>
<NextMarker></NextMarker>
<IsTruncated></IsTruncated>
<Buckets>
<Bucket>
<Name>string</Name>
<Location>Enum</Location>
<CreationDate>date</CreationDate>
</Bucket>
<Bucket>
<Name>string</Name>
<Location>Enum</Location>
<CreationDate>date</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>
The detailed node descriptions are as follows:
Node Name (Keyword)
Parent Node
Description
Type
ListAllMyBucketsResult
N/A
Save all information of the GET Service results.
Container
Content of the ListAllMyBucketsResult node of the container type:
Node Name (Keyword)
Parent Node
Description
Type
Owner
ListAllMyBucketsResult
Bucket owner information
Container
Buckets
ListAllMyBucketsResult
List of buckets
Container
Marker
ListAllMyBucketsResult
Indicates the starting point of this GetService (ListBuckets) operation.
string
IsTruncated
ListAllMyBucketsResult
Whether all results have been returned.
true: indicates that not all results were returned this time.
false: indicates that all results have been returned this time.
string
NextMarker
ListAllMyBucketsResult
When not all results are returned, to be used as the marker parameter for subsequent GetService requests.
string
Owner content of container nodes:
Node Name (Keyword)
Parent Node
Description
Type
ID
ListAllMyBucketsResult.Owner
The full ID of the bucket owner, in the format qcs::cam::uin/[OwnerUin]:uin/[OwnerUin]
For example, qcs::cam::uin/100000000001:uin/100000000001
string
DisplayName
ListAllMyBucketsResult.Owner
Bucket owner name
string
Content of the Buckets node of the container type:
Node Name (Keyword)
Parent Node
Description
Type
Bucket
ListAllMyBucketsResult.Buckets
Bucket information
Container
Buckets.Bucket content of the Container node:
Node Name (Keyword)
Parent Node
Description
Type
Name
ListAllMyBucketsResult.Buckets.Bucket
Bucket name in the format <BucketName-APPID>
For example, examplebucket-1250000000
string
Location
ListAllMyBucketsResult.Buckets.Bucket
Region of the bucket. For enumerated values, see the Regions and Endpoints documentation.
For example, ap-beijing, ap-hongkong, eu-frankfurt, etc.
Enum
CreationDate
ListAllMyBucketsResult.Buckets.Bucket
Creation time of the bucket in ISO8601 format, such as 2019-05-24T10:56:40Z
date

Error Codes

This API follows unified error responses and error codes. For details, see Error Codes.

Practical Case

Case 1: Query all bucket lists

Request

GET / HTTP/1.1
Host: service.cos.myqcloud.com
Date: Fri, 24 May 2019 11:59:50 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1558699190;1558706390&q-key-time=1558699190;1558706390&q-header-list=date;host&q-url-param-list=&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 805
Connection: close
Date: Fri, 24 May 2019 11:59:51 GMT
Server: tencent-cos
x-cos-request-id: NWNlN2RjYjdfOGFiMjM1MGFfNTVjMl8zMmI1****

<ListAllMyBucketsResult>
<Owner>
<ID>qcs::cam::uin/100000000001:uin/100000000001</ID>
<DisplayName>100000000001</DisplayName>
</Owner>
</Marker>
</NextMarker>
<IsTruncated>false</IsTruncated>
<Buckets>
<Bucket>
<Name>examplebucket1-1250000000</Name>
<Location>ap-beijing</Location>
<CreationDate>2019-05-24T11:49:50Z</CreationDate>
</Bucket>
<Bucket>
<Name>examplebucket2-1250000000</Name>
<Location>ap-beijing</Location>
<CreationDate>2019-05-24T11:51:50Z</CreationDate>
</Bucket>
<Bucket>
<Name>examplebucket3-1250000000</Name>
<Location>eu-frankfurt</Location>
<CreationDate>2019-05-24T11:53:50Z</CreationDate>
</Bucket>
<Bucket>
<Name>examplebucket4-1250000000</Name>
<Location>eu-frankfurt</Location>
<CreationDate>2019-05-24T11:55:50Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>

Case 2: Query the bucket list in a specific region (filter by domain)

Request

GET / HTTP/1.1
Host: cos.ap-beijing.myqcloud.com
Date: Fri, 24 May 2019 11:59:51 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1558699191;1558706391&q-key-time=1558699191;1558706391&q-header-list=date;host&q-url-param-list=&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 495
Connection: close
Date: Fri, 24 May 2019 11:59:51 GMT
Server: tencent-cos
x-cos-request-id: NWNlN2RjYjdfZjhjODBiMDlfOWNlNF9hYzc2****

<ListAllMyBucketsResult>
<Owner>
<ID>qcs::cam::uin/100000000001:uin/100000000001</ID>
<DisplayName>100000000001</DisplayName>
</Owner>
</Marker>
</NextMarker>
<IsTruncated>false</IsTruncated>
<Buckets>
<Bucket>
<Name>examplebucket1-1250000000</Name>
<Location>ap-beijing</Location>
<CreationDate>2019-05-24T11:49:50Z</CreationDate>
</Bucket>
<Bucket>
<Name>examplebucket2-1250000000</Name>
<Location>ap-beijing</Location>
<CreationDate>2019-05-24T11:51:50Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>

Case Three: Query the list of buckets in a specific region (filtered based on request parameters)

Request

GET /?region=ap-beijing HTTP/1.1
Host: service.cos.myqcloud.com
Date: Fri, 24 May 2019 11:59:51 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1558699191;1558706391&q-key-time=1558699191;1558706391&q-header-list=date;host&q-url-param-list=&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 495
Connection: close
Date: Fri, 24 May 2019 11:59:51 GMT
Server: tencent-cos
x-cos-request-id: NWNlN2RjYjdfZjhjODBiMDlfOWNlNF9hYzc2****

<ListAllMyBucketsResult>
<Owner>
<ID>qcs::cam::uin/100000000001:uin/100000000001</ID>
<DisplayName>100000000001</DisplayName>
</Owner>
</Marker>
</NextMarker>
<IsTruncated>false</IsTruncated>
<Buckets>
<Bucket>
<Name>examplebucket1-</Name>
<Location>ap-beijing</Location>
<CreationDate>2019-05-24T11:49:50Z</CreationDate>
</Bucket>
<Bucket>
<Name>examplebucket2-1250000000</Name>
<Location>ap-beijing</Location>
<CreationDate>2019-05-24T11:51:50Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>

Case 4: Filter bucket list based on specified Tag

The bucket examplebucket-1250000000 has the tag <key1, value1>, and the bucket examplebucket1-1250000000 has the tags <key1, value1> and <key2, value2>.

Request

GET /?tagkey=key1&tagvalue=value1 HTTP/1.1
Host: service.cos.myqcloud.com
Date: Fri, 24 May 2019 11:59:51 GMT
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1558699191;1558706391&q-key-time=1558699191;1558706391&q-header-list=date;host&q-url-param-list=&q-signature=****************************************
Connection: close

Response

HTTP/1.1 200 OK
Content-Length: 378
Content-Type: application/xml
Server: tencent-cos
Connection: keep-alive
Date: Thu, 20 Oct 2022 07:29:40 GMT
x-cos-request-id: NjM1MGY4ZTRfMWViMjM1MGFfYjg3MV8xNjdk****

<ListAllMyBucketsResult>
<Owner>
<ID>qcs::cam::uin/100000000001:uin/100000000001</ID>
<DisplayName>100000000001</DisplayName>
</Owner>
</Marker>
</NextMarker>
<IsTruncated>false</IsTruncated>
<Buckets>
<Bucket>
<Name>examplebucket-1250000000 </Name>
<Location>ap-guangzhou</Location>
<CreationDate>2022-04-11T03:01:49Z</CreationDate>
<BucketType>cos</BucketType>
</Bucket>
</Buckets>
<Buckets>
<Bucket>
<Name>examplebucket1-1250000000 </Name>
<Location>ap-guangzhou</Location>
<CreationDate>2022-04-12T03:01:49Z</CreationDate>
<BucketType>cos</BucketType>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>

Case 5: Filtering Bucket List by Creation Time

List buckets created before 2022-1-20 15:10:45.

Request

GET /?range=lt&create-time=1642662645 HTTP/1.1
Host: service.cos.myqcloud.com
User-Agent: curl/7.64.1
Accept: */*
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1667448802;1668448852&q-key-time=1667448802;1668448852&q-url-param-list=create-time;range&q-header-list=host&q-signature=****************************************

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 5566
Connection: keep-alive
Date: Thu, 03 Nov 2022 04:14:23 GMT
Server: tencent-cos
x-cos-request-id: NjM2MzQwMWZfMmJiMjM1MGFfYTc******

<ListAllMyBucketsResult>
<Owner>
<ID>qcs::cam::uin/100000000001:uin/100000000001</ID>
<DisplayName>100000000001</DisplayName>
</Owner>
</Marker>
</NextMarker>
<IsTruncated>false</IsTruncated>
<Buckets>
<Bucket>
<Name>examplebucket-1250000000</Name>
<Location>ap-beijing</Location>
<CreationDate>2021-11-23T03:02:12Z</CreationDate>
<BucketType>cos</BucketType>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>

Case VI: Pagination Query for Bucket List

Request

GET /?max-keys=1 HTTP/1.1
Host: service.cos.myqcloud.com
User-Agent: curl/7.64.1
Accept: */*
Authorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1667448802;1668448852&q-key-time=1667448802;1668448852&q-url-param-list=create-time;range&q-header-list=host&q-signature=****************************************

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 5566
Connection: keep-alive
Date: Thu, 03 Nov 2022 04:14:23 GMT
Server: tencent-cos
x-cos-request-id: NjM2MzQwMWZfMmJiMjM1MGFfYTc******

<ListAllMyBucketsResult>
<Owner>
<ID>qcs::cam::uin/100000000001:uin/100000000001</ID>
<DisplayName>100000000001</DisplayName>
</Owner>
</Marker>
<NexMarker>1</NextMarker>
<IsTruncated>true</IsTruncated>
<Buckets>
<Bucket>
<Name>examplebucket-1250000000</Name>
<Location>ap-beijing</Location>
<CreationDate>2021-11-23T03:02:12Z</CreationDate>
<BucketType>cos</BucketType>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック