Skip to content

Commit de8082a

Browse files
nic12347franktguo
andauthored
CI-三期迭代 (#310)
Co-authored-by: franktguo <franktguo@tencent.com>
1 parent dd1b7a0 commit de8082a

File tree

54 files changed

+5967
-1656
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5967
-1656
lines changed

sample/createAiTranslationJobs.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
require dirname(__FILE__, 2) . '/vendor/autoload.php';
4+
5+
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
6+
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
7+
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
8+
$cosClient = new Qcloud\Cos\Client(
9+
array(
10+
'region' => $region,
11+
'schema' => 'https', // 万象接口必须使用https
12+
'credentials'=> array(
13+
'secretId' => $secretId ,
14+
'secretKey' => $secretKey)));
15+
try {
16+
// 提交一个翻译任务 https://cloud.tencent.com/document/product/460/84799
17+
$result = $cosClient->createAiTranslationJobs(array(
18+
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
19+
'Tag' => 'Translation',
20+
'Input' => array(
21+
'Object' => 'test.docx',
22+
'Lang' => 'zh',
23+
'Type' => 'docx',
24+
// 'BasicType' => '',
25+
),
26+
'Operation' => array(
27+
// 'UserData' => 'xxx',
28+
// 'JobLevel' => '',
29+
// 'NoNeedOutput' => 'true',
30+
'Translation' => array(
31+
'Lang' => 'en',
32+
'Type' => 'docx',
33+
),
34+
'Output' => array(
35+
'Region' => $region,
36+
'Bucket' => 'examplebucket-125000000',
37+
'Object' => 'xxx.txt',
38+
),
39+
),
40+
// 'CallBack' => '',
41+
// 'CallBackFormat' => '',
42+
// 'CallBackType' => '',
43+
// 'CallBackMqConfig' => array(
44+
// 'MqRegion' => '',
45+
// 'MqMode' => '',
46+
// 'MqName' => '',
47+
// ),
48+
));
49+
// 请求成功
50+
print_r($result);
51+
} catch (\Exception $e) {
52+
// 请求失败
53+
echo($e);
54+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
require dirname(__FILE__, 2) . '/vendor/autoload.php';
4+
5+
$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
6+
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
7+
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
8+
$cosClient = new Qcloud\Cos\Client(
9+
array(
10+
'region' => $region,
11+
'schema' => 'https', // 万象接口必须使用https
12+
'credentials'=> array(
13+
'secretId' => $secretId ,
14+
'secretKey' => $secretKey)));
15+
try {
16+
// 提交一个分词任务 https://cloud.tencent.com/document/product/460/84800
17+
$result = $cosClient->createAiWordsGeneralizeJobs(array(
18+
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
19+
'Tag' => 'WordsGeneralize',
20+
'Input' => array(
21+
'Object' => 'test.txt',
22+
),
23+
'Operation' => array(
24+
// 'UserData' => '',
25+
// 'JobLevel' => '',
26+
'WordsGeneralize' => array(
27+
'NerMethod' => 'DL',
28+
'SegMethod' => 'MIX',
29+
),
30+
),
31+
// 'CallBack' => '',
32+
// 'CallBackFormat' => '',
33+
// 'CallBackType' => '',
34+
// 'CallBackMqConfig' => array(
35+
// 'MqRegion' => '',
36+
// 'MqMode' => '',
37+
// 'MqName' => '',
38+
// ),
39+
));
40+
// 请求成功
41+
print_r($result);
42+
} catch (\Exception $e) {
43+
// 请求失败
44+
echo($e);
45+
}

sample/createDocProcessJobs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
$result = $cosClient->createDocProcessJobs(array(
1717
'Bucket' => 'examplebucket-1250000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
1818
'Tag' => 'DocProcess', //任务的 Tag:DocProcess 固定值
19-
'QueueId' => 'pd8e422a2ea134165a92f2012ea43****', //任务所在的队列 ID
2019
'Input' => array(
2120
'Object' => 'Append功能测试.pdf' //待操作的文件对象
2221
),

sample/createFileCompressJobs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
$result = $cosClient->createFileCompressJobs(array(
1818
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
1919
'Tag' => 'FileCompress',
20-
// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg',
2120
'Operation' => array(
2221
'UserData' => 'xxx',
2322
'FileCompressConfig' => array(

sample/createFileHashCodeJobs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
$result = $cosClient->createFileHashCodeJobs(array(
1818
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
1919
'Tag' => 'FileHashCode',
20-
// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg',
2120
'Input' => array(
2221
'Object' => 'test.mp4',
2322
),

sample/createFileUncompressJobs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
$result = $cosClient->createFileUncompressJobs(array(
1818
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
1919
'Tag' => 'FileUncompress',
20-
// 'QueueId' => 'pcc3ae89sa9d807fs89dg789sdg',
2120
'Input' => array(
2221
'Object' => 'test.zip',
2322
),

sample/createInventoryTriggerJob.php

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
$cosClient = new Qcloud\Cos\Client(
99
array(
1010
'region' => $region,
11-
'schema' => 'https', //协议头部,默认为http
11+
'schema' => 'https', // 万象接口必须使用https
1212
'credentials'=> array(
1313
'secretId' => $secretId ,
1414
'secretKey' => $secretKey)));
1515
try {
1616
// https://cloud.tencent.com/document/product/436/71516 触发批量存量任务
17+
// 1. 触发任务(工作流)https://cloud.tencent.com/document/product/460/76887
1718
$result = $cosClient->createInventoryTriggerJob(array(
1819
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
1920
'Name' => '存量触发任务名称',
21+
'Type' => 'Workflow',
2022
'Input' => array(
2123
// 'Manifest' => '',
2224
// 'UrlFile' => '',
@@ -28,6 +30,76 @@
2830
// 'TimeInterval' => array(
2931
// 'Start' => '',
3032
// 'End' => '',
33+
// ),
34+
),
35+
));
36+
// 请求成功
37+
print_r($result);
38+
39+
// 2. 触发任务(独立节点)https://cloud.tencent.com/document/product/460/80155
40+
$result = $cosClient->createInventoryTriggerJob(array(
41+
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
42+
'Name' => '存量触发任务名称',
43+
'Type' => 'Job',
44+
'Input' => array(
45+
// 'Manifest' => '',
46+
// 'UrlFile' => '',
47+
// 'Prefix' => '',
48+
'Object' => 'test01.png',
49+
),
50+
'Operation' => array(
51+
'Tag' => '',
52+
'QueueId' => '',
53+
'QueueType' => '',
54+
'TimeInterval' => array(
55+
'Start' => '',
56+
'End' => '',
57+
),
58+
'Output' => array(
59+
'Region' => '',
60+
'Bucket' => '',
61+
'Object' => '',
62+
'AuObject' => '',
63+
'SpriteObject' => '',
64+
'StreamExtract' => array(
65+
'Index' => '',
66+
'Object' => '',
67+
),
68+
),
69+
'JobParam' => array(
70+
// 根据Tag输入相应参数,参数详情参考 https://cloud.tencent.com/document/product/460/80155
71+
'TemplateId' => '',
72+
'TranscodeTemplateId' => '',
73+
'WatermarkTemplateId' => '',
74+
// 'Animation' => ...,
75+
// 'Transcode' => ...,
76+
// 'SmartCover' => ...,
77+
// 'DigitalWatermark' => ...,
78+
// 'Watermark' => ...,
79+
// 'RemoveWatermark' => ...,
80+
// 'Snapshot' => ...,
81+
// 'SpeechRecognition' => ...,
82+
// 'ConcatTemplate' => ...,
83+
// 'VoiceSeparate' => ...,
84+
// 'VideoMontage' => ...,
85+
// 'SDRtoHDR' => ...,
86+
// 'VideoProcess' => ...,
87+
// 'SuperResolution' => ...,
88+
// 'Segment' => ...,
89+
// 'ExtractDigitalWatermark' => ...,
90+
// 'VideoTag' => ...,
91+
// 'TtsTpl' => ...,
92+
// 'NoiseReduction' => ...,
93+
),
94+
// 'UserData' => '',
95+
// 'JobLevel' => '',
96+
// 'CallBackFormat' => '',
97+
// 'CallBackType' => '',
98+
// 'CallBack' => '',
99+
// 'CallBackMqConfig' => array(
100+
// 'MqRegion' => '',
101+
// 'MqMode' => '',
102+
// 'MqName' => '',
31103
// ),
32104
),
33105
));

sample/createMediaAnimationJobs.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
$result = $cosClient->createMediaAnimationJobs(array(
1919
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
2020
'Tag' => 'Animation',
21-
'QueueId' => 'p81e648af2aee49688xxxxxxxxxxxxxxxx',
2221
'Input' => array(
2322
'Object' => 'video01.mp4'
2423
),
@@ -42,7 +41,6 @@
4241
$result = $cosClient->createMediaAnimationJobs(array(
4342
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
4443
'Tag' => 'Animation',
45-
'QueueId' => 'p81e648af2aee49688xxxxxxxxxxxxxxxx',
4644
'Input' => array(
4745
'Object' => 'video01.mp4'
4846
),

sample/createMediaConcatJobs.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
$result = $cosClient->createMediaConcatJobs(array(
1919
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
2020
'Tag' => 'Concat',
21-
'QueueId' => 'asdadadfafsdkjhfjghdfjg',
2221
'CallBack' => 'https://example.com/callback',
2322
'Input' => array(
2423
'Object' => 'video01.mp4'
@@ -42,7 +41,6 @@
4241
$result = $cosClient->createMediaConcatJobs(array(
4342
'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
4443
'Tag' => 'Concat',
45-
'QueueId' => 'asdadadfafsdkjhfjghdfjg',
4644
'CallBack' => 'https://example.com/callback',
4745
'Input' => array(
4846
'Object' => 'video01.mp4'
@@ -88,6 +86,34 @@
8886
'Height' => '',
8987
'Fps' => '30',
9088
),
89+
'AudioMixArray' => array(
90+
array(
91+
'AudioSource' => '',
92+
'MixMode' => '',
93+
'Replace' => '',
94+
'EffectConfig' => array(
95+
'EnableStartFadein' => '',
96+
'StartFadeinTime' => '',
97+
'EnableEndFadeout' => '',
98+
'EndFadeoutTime' => '',
99+
'EnableBgmFade' => '',
100+
'BgmFadeTime' => '',
101+
),
102+
),
103+
array(
104+
'AudioSource' => '',
105+
'MixMode' => '',
106+
'Replace' => '',
107+
'EffectConfig' => array(
108+
'EnableStartFadein' => '',
109+
'StartFadeinTime' => '',
110+
'EnableEndFadeout' => '',
111+
'EndFadeoutTime' => '',
112+
'EnableBgmFade' => '',
113+
'BgmFadeTime' => '',
114+
),
115+
),
116+
),
91117
),
92118
),
93119
));

sample/createMediaConcatTemplate.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,34 @@
4646
'Container' => array(
4747
'Format' => 'mp4',
4848
),
49+
'AudioMixArray' => array(
50+
array(
51+
'AudioSource' => '',
52+
'MixMode' => '',
53+
'Replace' => '',
54+
'EffectConfig' => array(
55+
'EnableStartFadein' => '',
56+
'StartFadeinTime' => '',
57+
'EnableEndFadeout' => '',
58+
'EndFadeoutTime' => '',
59+
'EnableBgmFade' => '',
60+
'BgmFadeTime' => '',
61+
),
62+
),
63+
array(
64+
'AudioSource' => '',
65+
'MixMode' => '',
66+
'Replace' => '',
67+
'EffectConfig' => array(
68+
'EnableStartFadein' => '',
69+
'StartFadeinTime' => '',
70+
'EnableEndFadeout' => '',
71+
'EndFadeoutTime' => '',
72+
'EnableBgmFade' => '',
73+
'BgmFadeTime' => '',
74+
),
75+
),
76+
),
4977
),
5078
));
5179
// 请求成功

0 commit comments

Comments
 (0)