1234567891011121314151617181920212223242526272829 |
- <?php
- require_once __DIR__.'/../../../vendor/autoload.php';
-
- use TencentCloud\Cvm\V20170312\CvmClient;
-
- use TencentCloud\Cvm\V20170312\Models\DescribeZonesRequest;
- use TencentCloud\Common\Exception\TencentCloudSDKException;
- use TencentCloud\Common\Credential;
- use TencentCloud\Common\Profile\ClientProfile;
- try {
-
- $cred = new Credential(getenv("TENCENTCLOUD_SECRET_ID"), getenv("TENCENTCLOUD_SECRET_KEY"));
- $clientProfile = new ClientProfile();
-
- $clientProfile->setSignMethod(ClientProfile::$SIGN_HMAC_SHA256);
-
- $client = new CvmClient($cred, "ap-guangzhou", $clientProfile);
-
-
- $req = new DescribeZonesRequest();
-
-
- $resp = $client->DescribeZones($req);
-
- print_r($resp->toJsonString());
- }
- catch(TencentCloudSDKException $e) {
- echo $e;
- }
|