tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

GET Service(List Buckets)

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 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>

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan