123456789101112131415161718192021222324252627282930 |
- <?php
- require_once __DIR__.'/../../../vendor/autoload.php';
- use TencentCloud\Common\Credential;
- use TencentCloud\Common\Profile\ClientProfile;
- use TencentCloud\Common\Profile\HttpProfile;
- use TencentCloud\Common\Exception\TencentCloudSDKException;
- use TencentCloud\Scf\V20180416\ScfClient;
- use TencentCloud\Scf\V20180416\Models\ListFunctionsRequest;
- try {
- $cred = new Credential(getenv("TENCENTCLOUD_SECRET_ID"), getenv("TENCENTCLOUD_SECRET_KEY"));
- $httpProfile = new HttpProfile();
- $httpProfile->setEndpoint("scf.tencentcloudapi.com");
- $clientProfile = new ClientProfile();
- $clientProfile->setHttpProfile($httpProfile);
- $client = new ScfClient($cred, "ap-guangzhou", $clientProfile);
- $req = new ListFunctionsRequest();
- $params = '{}';
- $req->fromJsonString($params);
- $resp = $client->ListFunctions($req);
- print_r($resp->toJsonString());
- }
- catch(TencentCloudSDKException $e) {
- echo $e;
- }
|