tencent cloud

All product documents
Fetching Bucket List of COS
Last updated: 2024-01-24 17:36:30
Fetching Bucket List of COS
Last updated: 2024-01-24 17:36:30

SDK Description

ListCosBuckets is used to fetch the bucket list of COS.

Request Parameters

For more information, see Common Request Parameters.

Response Parameters

Parameter Name
Type
Description
cosBucketsList
Array
COS bucket list
The parameter cosBucketsList is composed as follows:
Parameter Name
Type
Description
name
String
COS bucket name
region
String
The region of the bucket
appId
String
Account APPID or project APPID

Example

Request example

$config = array('SecretId' => 'Your secretId',
'SecretKey' => 'Your secretKey',
'RequestMethod' => 'GET',
'DefaultRegion' => 'gz');
$ca = QcloudApi::load(QcloudApi::MODULE_CLOUDAUDIT, $config);
$package = array();
$a = $ca->ListCosBuckets($package);
if ($a === false) {
$error = $ca->getError();
echo "Error code:" . $error->getCode() . ".\\n";
echo "message:" . $error->getMessage() . ".\\n";
echo "ext:" . var_export($error->getExt(), true) . ".\\n";
} else {
var_dump($a);
}
echo "\\nRequest :" . $ca->getLastRequest();
echo "\\nResponse :" . $ca->getLastResponse();
echo "\\n";

Response example

{
"cosBucketsList": [
{
"name": "cloudaudit",
"region": "ap-shanghai",
"appId": "1254962721"
},
{
"name": "cloudtrail",
"region": "ap-shanghai",
"appId": "1254962721"
},
{
"name": "sundehuixxx",
"region": "ap-shanghai",
"appId": "1254962721"
}
]
}
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon