CancelFlow.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. require_once __DIR__.'/../../../vendor/autoload.php';
  3. use TencentCloud\Ess\V20201111\EssClient;
  4. use TencentCloud\Ess\V20201111\Models\UserInfo;
  5. use TencentCloud\Ess\V20201111\Models\CancelFlowRequest;
  6. use TencentCloud\Common\Exception\TencentCloudSDKException;
  7. use TencentCloud\Common\Credential;
  8. use TencentCloud\Common\Profile\ClientProfile;
  9. use TencentCloud\Common\Profile\HttpProfile;
  10. try {
  11. // 实例化一个证书对象,入参需要传入腾讯云账户secretId,secretKey
  12. $cred = new Credential("********************************", "********************************");
  13. // 实例化一个http选项,可选的,没有特殊需求可以跳过
  14. $httpProfile = new HttpProfile();
  15. $httpProfile->setReqMethod("POST"); // post请求(默认为post请求)
  16. $httpProfile->setReqTimeout(30); // 请求超时时间,单位为秒(默认60秒)
  17. $httpProfile->setEndpoint("ess.tencentcloudapi.com"); // 指定接入地域域名(默认就近接入)
  18. // 实例化一个client选项,可选的,没有特殊需求可以跳过
  19. $clientProfile = new ClientProfile();
  20. $clientProfile->setSignMethod("TC3-HMAC-SHA256"); // 指定签名算法(默认为HmacSHA256)
  21. $clientProfile->setHttpProfile($httpProfile);
  22. $client = new EssClient($cred, "ap-guangzhou", $clientProfile);
  23. $req = new CancelFlowRequest();
  24. $userInfo = new UserInfo();
  25. $userInfo->setUserId("********************************");
  26. $req->setOperator($userInfo);
  27. $req->setFlowId("********************************");
  28. $req->setCancelMessage("********************************");
  29. $resp = $client->CancelFlow($req);
  30. // 输出json格式的字符串回包
  31. print_r($resp->toJsonString());
  32. } catch (TencentCloudSDKException $e) {
  33. echo $e;
  34. }