Skip to content

Commit a2b5a39

Browse files
authored
Fix sample (#134)
1 parent 693e28c commit a2b5a39

File tree

5 files changed

+85
-4711
lines changed

5 files changed

+85
-4711
lines changed

sample/putBucketInventory.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
'secretKey' => $secretKey)));
1515
try {
1616
$result = $cosClient->putBucketInventory(array(
17-
'Bucket'=>$bucket,
18-
//bucket的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
17+
'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
1918
'Id' => 'string',
2019
'Destination' => array(
2120
'COSBucketDestination'=>array(
@@ -36,8 +35,8 @@
3635
'OptionalFields' => array(
3736
'Size',
3837
'ETag',
39-
)
40-
));
38+
)
39+
));
4140
// 请求成功
4241
print_r($result);
4342
} catch (\Exception $e) {

sample/putBucketLogging.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
'secretKey' => $secretKey)));
1515
try {
1616
$result = $cosClient->putBucketLogging(array(
17-
//bucket的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
18-
'Bucket'=>$bucket,
17+
'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
1918
'LoggingEnabled' => array(
20-
'TargetBucket' => 'lewzylucd-1251668577',
19+
'TargetBucket' => 'examplebucket2-125000000', //格式:BucketName-APPID
2120
'TargetPrefix' => '',
2221
)
2322
));

sample/putBucketTagging.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
'secretKey' => $secretKey)));
1515
try {
1616
$result = $cosClient->putBucketTagging(array(
17-
//bucket的命名规则为{name}-{appid} ,此处填写的存储桶名称必须为此格式
18-
'Bucket'=>$bucket,
17+
'Bucket' => 'examplebucket-125000000', //格式:BucketName-APPID
1918
'TagSet' => array(
2019
array('Key'=>'key1',
2120
'Value'=>'value1',

src/Qcloud/Cos/Service.php

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ public static function getService() {
247247
'ACP' => array(
248248
'type' => 'object',
249249
'additionalProperties' => true,
250+
),
251+
'PicOperations' => array(
252+
'type' => 'string',
253+
'location' => 'header',
254+
'sentAs' => 'Pic-Operations',
250255
)
251256
)
252257
),
@@ -833,6 +838,21 @@ public static function getService() {
833838
)
834839
),
835840
),
841+
// 查询存储桶(Bucket) Accelerate配置信息的方法.
842+
'GetBucketAccelerate' => array(
843+
'httpMethod' => 'GET',
844+
'uri' => '/{Bucket}?accelerate',
845+
'class' => 'Qcloud\\Cos\\Command',
846+
'responseClass' => 'GetBucketAccelerateOutput',
847+
'responseType' => 'model',
848+
'parameters' => array(
849+
'Bucket' => array(
850+
'required' => true,
851+
'type' => 'string',
852+
'location' => 'uri',
853+
)
854+
),
855+
),
836856
// 查询存储桶(Bucket) Website配置信息的方法.
837857
'GetBucketWebsite' => array(
838858
'httpMethod' => 'GET',
@@ -1708,6 +1728,37 @@ public static function getService() {
17081728
),
17091729
),
17101730
),
1731+
// 配置存储桶(Bucket) Accelerate的方法.
1732+
'PutBucketAccelerate' => array(
1733+
'httpMethod' => 'PUT',
1734+
'uri' => '/{Bucket}?accelerate',
1735+
'class' => 'Qcloud\\Cos\\Command',
1736+
'responseClass' => 'PutBucketAccelerateOutput',
1737+
'responseType' => 'model',
1738+
'data' => array(
1739+
'xmlRoot' => array(
1740+
'name' => 'AccelerateConfiguration',
1741+
),
1742+
'xmlAllowEmpty' => true,
1743+
),
1744+
'parameters' => array(
1745+
'Bucket' => array(
1746+
'required' => true,
1747+
'type' => 'string',
1748+
'location' => 'uri',
1749+
),
1750+
'Status' => array(
1751+
'required' => true,
1752+
'type' => 'string',
1753+
'location' => 'xml',
1754+
),
1755+
'Type' => array(
1756+
'required' => true,
1757+
'type' => 'string',
1758+
'location' => 'xml',
1759+
),
1760+
),
1761+
),
17111762
// 配置存储桶(Bucket) website的方法.
17121763
'PutBucketWebsite' => array(
17131764
'httpMethod' => 'PUT',
@@ -3438,6 +3489,24 @@ public static function getService() {
34383489
),
34393490
),
34403491
),
3492+
'GetBucketAccelerateOutput' => array(
3493+
'type' => 'object',
3494+
'additionalProperties' => true,
3495+
'properties' => array(
3496+
'Status' => array(
3497+
'type' => 'string',
3498+
'location' => 'xml',
3499+
),
3500+
'Type' => array(
3501+
'type' => 'string',
3502+
'location' => 'xml',
3503+
),
3504+
'RequestId' => array(
3505+
'location' => 'header',
3506+
'sentAs' => 'x-cos-request-id',
3507+
),
3508+
),
3509+
),
34413510
'GetBucketWebsiteOutput' => array(
34423511
'type' => 'object',
34433512
'additionalProperties' => true,
@@ -3941,6 +4010,16 @@ public static function getService() {
39414010
),
39424011
),
39434012
'PutBucketWebsiteOutput' => array(
4013+
'type' => 'object',
4014+
'additionalProperties' => true,
4015+
'properties' => array(
4016+
'RequestId' => array(
4017+
'location' => 'header',
4018+
'sentAs' => 'x-cos-request-id',
4019+
),
4020+
),
4021+
),
4022+
'PutBucketAccelerateOutput' => array(
39444023
'type' => 'object',
39454024
'additionalProperties' => true,
39464025
'properties' => array(

0 commit comments

Comments
 (0)