123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- require dirname(__FILE__, 2) . '/vendor/autoload.php';
- $secretId = "SECRETID";
- $secretKey = "SECRETKEY";
- $region = "ap-beijing";
- $cosClient = new Qcloud\Cos\Client(
- array(
- 'region' => $region,
- 'scheme' => 'https',
- 'credentials'=> array(
- 'secretId' => $secretId ,
- 'secretKey' => $secretKey)));
- try {
-
- $result = $cosClient->DatasetSimpleQuery(array(
- 'AppId' => 'AppId',
- 'Headers' => array(
- 'Accept' => 'application/json',
- 'Content-Type' => 'application/json',
- ),
- 'DatasetName'=> 'test',
-
- 'Query'=> array(
- 'Operation'=> 'and',
- 'SubQueries' => array(
- array(
- 'Field'=> 'ContentType',
- 'Value'=> 'image/jpeg',
- 'Operation'=> 'eq',
- ),
- array(
- 'Field'=> 'Size',
- 'Value'=> '1000',
- 'Operation'=> 'gt',
- ),
- ),
- ),
- 'MaxResults'=> 100,
- 'Sort'=> 'CustomId',
- 'Order'=> 'desc',
-
- 'Aggregations'=> array(
- ),
- ));
-
- print_r($result);
- } catch (\Exception $e) {
-
- echo($e);
- }
|