tencent cloud

Cloud Object Storage

동향 및 공지
릴리스 노트
제품 공지
제품 소개
제품 개요
기능 개요
적용 시나리오
제품 장점
기본 개념
리전 및 액세스 도메인
규격 및 제한
제품 요금
과금 개요
과금 방식
과금 항목
프리 티어
과금 예시
청구서 보기 및 다운로드
연체 안내
FAQ
빠른 시작
콘솔 시작하기
COSBrowser 시작하기
사용자 가이드
요청 생성
버킷
객체
데이터 관리
일괄 프로세스
글로벌 가속
모니터링 및 알람
운영 센터
데이터 처리
스마트 툴 박스 사용 가이드
데이터 워크플로
애플리케이션 통합
툴 가이드
툴 개요
환경 설치 및 설정
COSBrowser 툴
COSCLI 툴
COSCMD 툴
COS Migration 툴
FTP Server 툴
Hadoop 툴
COSDistCp 툴
HDFS TO COS 툴
온라인 도구 (Onrain Dogu)
자가 진단 도구
실습 튜토리얼
개요
액세스 제어 및 권한 관리
성능 최적화
AWS S3 SDK를 사용하여 COS에 액세스하기
데이터 재해 복구 백업
도메인 관리 사례
이미지 처리 사례
COS 오디오/비디오 플레이어 사례
데이터 다이렉트 업로드
데이터 보안
데이터 검증
빅 데이터 사례
COS 비용 최적화 솔루션
3rd party 애플리케이션에서 COS 사용
마이그레이션 가이드
로컬 데이터 COS로 마이그레이션
타사 클라우드 스토리지 데이터를 COS로 마이그레이션
URL이 소스 주소인 데이터를 COS로 마이그레이션
COS 간 데이터 마이그레이션
Hadoop 파일 시스템과 COS 간 데이터 마이그레이션
데이터 레이크 스토리지
클라우드 네이티브 데이터 레이크
메타데이터 가속
데이터 레이크 가속기 GooseFS
데이터 처리
데이터 처리 개요
이미지 처리
미디어 처리
콘텐츠 조정
파일 처리
문서 미리보기
장애 처리
RequestId 가져오기
공용 네트워크로 COS에 파일 업로드 시 속도가 느린 문제
COS 액세스 시 403 에러 코드 반환
리소스 액세스 오류
POST Object 자주 발생하는 오류
보안 및 컴플라이언스
데이터 재해 복구
데이터 보안
액세스 관리
자주 묻는 질문
인기 질문
일반 문제
과금
도메인 규정 준수 문제
버킷 설정 문제
도메인 및 CDN 문제
파일 작업 문제
로그 모니터링 문제
권한 관리
데이터 처리 문제
데이터 보안 문제
사전 서명 URL 관련 문제
SDK FAQ
툴 관련 문제
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>

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백