123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
-
- require dirname(__FILE__) . '/../vendor/autoload.php';
-
- $secretId = "COS_SECRETID";
- $secretKey = "COS_SECRETKEY";
- $region = "ap-beijing";
- $cosClient = new Qcloud\Cos\Client(
- array(
- 'region' => $region,
- 'schema' => 'https',
- 'credentials'=> array(
- 'secretId' => $secretId ,
- 'secretKey' => $secretKey)));
- try {
- $result = $cosClient->putBucketLifecycle(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Rules' => array(
- array(
- 'Expiration' => array(
- 'Days' => integer,
- ),
- 'ID' => 'string',
- 'Filter' => array(
- 'Prefix' => 'string'
- ),
- 'Status' => 'string',
- 'Transitions' => array(
- array(
- 'Days' => integer,
- 'StorageClass' => 'string'
- ),
-
- ),
- ),
-
- )
- ));
-
- print_r($result);
- } catch (\Exception $e) {
-
- echo "$e\n";
- }
|