使用阿里云产品用PHP语音开发
Re使用阿里云产品用PHP语音开发
比如ecs的demo,获取ecs列表参考
https://help.aliyun.com/document_detail/25506.html?spm=5176.product8314827_25365.6.238.Eieryp,先阅读对应api,可以看请求参数只有RegionId是必须带的。其他可以自己定义
include_once '../aliyun-php-sdk-core/Config.php';
use Ecs\Request\V20140526 as Ecs;
$iClientProfile = DefaultProfile::getProfile('cn-hangzhou', 'your-accesskey', 'your-accesssecret');
$client = new DefaultAcsClient($iClientProfile);
$request = new Ecs\DescribeInstancesRequest();
$request->setMethod('GET');
$request->setRegionId('cn-hangzhou');
$response = $client->getAcsResponse($request);
print_r($response);
-------------------------
回 楼主hpy的帖子
媒体转码提交转码的demo,对比
https://help.aliyun.com/document_detail/29226.html?spm=5176.product29194.6.131.bwpSV9这个API
include_once '../aliyun-php-sdk-core/Config.php';
use Mts\Request\V20140618 as Mts;
$iClientProfile = DefaultProfile::getProfile('cn-hangzhou', 'accesskeyid', 'accesssecret');
$client = new DefaultAcsClient($iClientProfile);
$request = new Mts\SubmitJobsRequest();
$request->setMethod('GET');
$input = '{\'Bucket\':\'bucketname',\'Location\':\'oss-cn-hangzhou\',\'Object\':\'1.flv\'}';
$output = '[{\'OutputObject\':\'merge.mp4\',\'TemplateId\':\'S00000001-200020\',\'MergeList\':[{\'MergeURL\':\'http://zuichi.oss-cn-hangzhou.aliyuncs.com/movie.mp4\',\'Start\':\'15\',\'Duration\':\'15\'},{\'MergeURL\':\'http://zuichi.oss-cn-hangzhou.aliyuncs.com/ys.mp4\',\'Start\':\'15\',\'Duration\':\'15\'}]}]';
$request->setInput($input);
$request->setOutputBucket('zuichi');
$request->setOutputs($output);
$request->setPipelineId('097b8c1cae9c4af0a25bd28630e305e7');
$response = $client->getAcsResponse($request);
print_r($response);
赞0
踩0