API | Description |
Adds a style to a bucket | |
Queries styles set for a bucket | |
Deletes a style from a bucket |
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //Replace it with the actual SecretId, which can be viewed and managed at https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //Replace it with the actual SecretKey, which can be viewed and managed at https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //Replace it with the actual region, which can be viewed in the console at https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', // Protocol header, which is http by default'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->PutBucketImageStyle(array('Bucket' => 'examplebucket-1250000000', // Bucket name in the format of BucketName-Appid, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucket'StyleName' => 'style_name',// Style name'StyleBody' => 'imageMogr2/thumbnail/!50px', // Style configurations));// Request succeededprint_r($result);} catch (\\Exception $e) {// Request failedecho($e);}
Parameter | Type | Description | Required |
Bucket | String | Bucket name in the format of BucketName-APPID | Yes |
StyleName | String | Style name | Yes |
StyleBody | String | Style configurations | Yes |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([RequestId] => NWQwOGRkNDdfMjJiMjU4NjRfNzVjXzEwNmVjY2M=[Bucket] => examplebucket-1250000000[Location] => examplebucket-1250000000.pic.ap-beijing.myqcloud.com/))
Parameter | Type | Description | Parent Node |
RequestId | String | Request ID | None |
Bucket | String | Bucket name in the format of BucketName-APPID | None |
Location | String | Address of the requested resource | None |
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //Replace it with the actual SecretId, which can be viewed and managed at https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //Replace it with the actual SecretKey, which can be viewed and managed at https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //Replace it with the actual region, which can be viewed in the console at https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', // Protocol header, which is http by default'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->GetBucketImageStyle(array('Bucket' => 'examplebucket-1250000000', // Bucket name in the format of BucketName-Appid, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucket'StyleName' => 'style_name', // Style name));// Request succeededprint_r($result);} catch (\\Exception $e) {// Request failedecho($e);}
Parameter | Type | Description | Required |
Bucket | String | Bucket name in the format of BucketName-APPID | Yes |
StyleName | String | Style name | No |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([RequestId] => NWQwOGRkNDdfMjJiMjU4NjRfNzVjXzEwNmVjY2M=[Bucket] => examplebucket-1250000000[Location] => examplebucket-1250000000.pic.ap-beijing.myqcloud.com/[StyleRule] => Array([0] => Array([StyleName] => style_name[StyleBody] => imageMogr2/thumbnail/!50px))))
Parameter | Type | Description | Parent Node |
RequestId | String | Request ID | None |
Bucket | String | Bucket name in the format of BucketName-APPID | None |
Location | String | Address of the requested resource | None |
StyleRule | Array | A list of styles | None |
<?phprequire dirname(__FILE__) . '/../vendor/autoload.php';$secretId = "SECRETID"; //Replace it with the actual SecretId, which can be viewed and managed at https://console.tencentcloud.com/cam/capi$secretKey = "SECRETKEY"; //Replace it with the actual SecretKey, which can be viewed and managed at https://console.tencentcloud.com/cam/capi$region = "ap-beijing"; //Replace it with the actual region, which can be viewed in the console at https://console.tencentcloud.com/cos5/bucket$cosClient = new Qcloud\\Cos\\Client(array('region' => $region,'schema' => 'https', // Protocol header, which is http by default'credentials'=> array('secretId' => $secretId ,'secretKey' => $secretKey)));try {$result = $cosClient->DeleteBucketImageStyle(array('Bucket' => 'examplebucket-1250000000', // Bucket name in the format of BucketName-Appid, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucket'StyleName' => 'style_name', // Style name));// Request succeededprint_r($result);} catch (\\Exception $e) {// Request failedecho($e);}
Parameter | Type | Description | Required |
Bucket | String | Bucket name in the format of BucketName-APPID | Yes |
StyleName | String | Style name | Yes |
Guzzle\\Service\\Resource\\Model Object([structure:protected] =>[data:protected] => Array([RequestId] => NWQwOGRkNDdfMjJiMjU4NjRfNzVjXzEwNmVjY2M=[Bucket] => examplebucket-1250000000[Location] => examplebucket-1250000000.pic.ap-beijing.myqcloud.com/))
Parameter | Type | Description | Parent Node |
RequestId | String | Request ID | None |
Bucket | String | Bucket name in the format of BucketName-APPID | None |
Location | String | Address of the requested resource | None |
Apakah halaman ini membantu?