Feature Description
Trigger a batch data processing job using independent task parameters.
Authorization Description
When using a sub-account, you need to add the ci:CreateInventoryTriggerJob permission to the action in the authorization policy. For all operation APIs supported by Cloud Infinite (CI), see CI action. Activating a Service
To use this feature, you need to bind a bucket in advance and enable Cloud Infinite service. Note:
Note: After binding Cloud Infinite, if you manually perform the unbind operation on the bucket, you will not be able to continue using this feature.
Use Limits
When using this API, please first confirm the relevant restrictions. For details, see Usage Limits. Request
Request Sample
POST /inventorytriggerjob HTTP/1.1
Host: <BucketName-APPID>.ci.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>
Content-Type: application/xml
<body>
Request Header
Request Body
The implementation of this request operation requires the following request body.
<Request>
<Name>demo</Name>
<Type>Job</Type>
<Input>
<Prefix>input</Prefix>
</Input>
<Operation>
<TimeInterval>
<Start>2022-02-01T12:00:00+0800</Start>
<End>2022-05-01T12:00:00+0800</End>
</TimeInterval>
<UserData>this is my inventorytriggerjob</UserData>
<CallBack>https://www.callback.com</CallBack>
<Tag>Transcode</Tag>
<JobParam>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
</JobParam>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>output/${InventoryTriggerJobId}/out.mp4</Object>
</Output>
<JobLevel>0</JobLevel>
</Operation>
</Request>
The data are described as follows:
|
Request | None. | Container for saving requests | Container | Yes |
The specific data description of the Container type Request is as follows:
|
Name | Request | Existing triggered task name, supports Chinese, English, digits, hyphen (-), and underscore (_), length limited to 128 characters. | String | Yes |
Type | Request | Batch processing task type: Job | String | Yes |
Input | Request | File information to be operated | Container | Yes |
Operation | Request | Operation rule | Container | Yes |
The specific data description of the Container type Input
is as follows: |
Manifest | Request.Input | COS inventory list filename COS inventory generation manifest.json file | String | No |
UrlFile | Request.Input | URL filename Each URL in the file is the access address of an object in COS | String | No |
Prefix | Request.Input | Object prefix | String | No |
Object | Request.Input | File path | String | No |
The specific data description of the Container type Operation
is as follows: |
TimeInterval | Request.Operation | Time-filtered trigger range | Container | No |
Tag | Request.Operation | Created media task type Tag | String | Yes |
Output | Request.Operation | Output address information When the media task type is not VideoTag, ExtractDigitalWatermark, MediaInfo, or QualityEstimate, this parameter is required. | Container | No |
JobParam | Request.Operation | task parameter | Container | Yes |
QueueId | Request.Operation | Queue ID | String | No |
QueueType | Request.Operation | Queue type, limited to SpeedTranscoding, is valid only when Tag is Transcode and QueueId is empty, indicating that accelerated transcoding is enabled. | String | No |
UserData | Request.Operation | User Information | String | No |
JobLevel | Request.Operation | Task priority, level restrictions: 0, 1, 2. Higher levels indicate higher task priority, default is 0. | String | No |
CallBackFormat | Request.Operation | Job callback format, JSON or XML, default is XML, priority is higher than the callback format of the queue. | String | No |
CallBackType | Request.Operation | Job callback type, Url or TDMQ, default is Url, priority is higher than the callback type of the queue. | String | No |
CallBack | Request.Operation | Job callback address, with a higher priority than the queue's callback address. When set to no, it indicates that the queue's callback address does not generate callbacks. | String | No |
CallBackMqConfig | Request.Operation | Task callback TDMQ configuration (required when CallBackType is TDMQ) | Container | No |
The specific data description of the Container type CallBackMqConfig is as follows:
|
MqRegion | Request.Operation.CallBackMqConfig | Message Queue belongs to the park. Currently supports parks sh (Shanghai), bj (Beijing), gz (Guangzhou), cd (Chengdu), hk (Hong Kong (China)) | String | Yes |
MqMode | Request.Operation.CallBackMqConfig | Message Queue usage mode, default Queue: Topic subscription: Topic Queue Service | String | Yes |
MqName | Request.Operation.CallBackMqConfig | TDMQ Topic Name | String | Yes |
The following types are supported for Operation.Tag:
|
video-to-GIF | Animation |
intelligent cover | SmartCover |
audio and video transcoding | Transcode |
Video screenshot | Snapshot |
Automatic Speech Recognition (ASR) | SpeechRecognition |
Audio/Video splicing | Concat |
Highlights | VideoMontage |
SDR to HDR | SDRtoHDR |
Voice separation | VoiceSeparate |
Video enhancement | VideoProcess |
Super resolution | SuperResolution |
Audio and video repackaging | Segment |
Video tag | VideoTag |
Image Processing | PicProcess |
Digital watermark | DigitalWatermark |
Extract digital watermark | ExtractDigitalWatermark |
Asynchronously fetch media information | MediaInfo |
Separate audio and video stream | StreamExtract |
Text To Speech (TTS) | Tts |
audio noise reduction | NoiseReduction |
video quality analysis | QualityEstimate |
abnormal image detection | ImageInspect |
The specific data description of the Container type TimeInterval is as follows:
|
Start | Request.Operation.TimeInterval | Start Time | String | No | 0 | Scan the upload time of objects %Y-%m-%dT%H:%m:%S%z |
End | Request.Operation.TimeInterval | End Time | String | No | Current Time | Scan the upload time of objects %Y-%m-%dT%H:%m:%S%z |
The specific data description of the Container type Output is as follows:
|
Region | Request.Operation.Output | Region of the bucket | String | Yes | None. |
Bucket | Request.Operation.Output | Bucket's name | String | Yes | None. |
Object | Request.Operation.Output | result filename | String | No | When the media task type is not Snapshot, VoiceSeparate, or StreamExtract, this parameter is required. When the media task type is SmartCover and Request.Operation.JobParam.SmartCover.Count is greater than 1, the ${Number} parameter must be included. When the media task type is Snapshot and Snapshot.Count is greater than 1, the ${Number} parameter must be included. |
AuObject | Request.Operation.Output | voice result filename | String | No | This parameter is valid when the task type is VideoSeparate and cannot be empty at the same time as Object. |
SpriteObject | Request.Operation.Output | sprite sheet name | String | No | When the media task type is Snapshot, this parameter is valid and cannot be empty at the same time as Object. When Snapshot.Count is greater than 1, the ${Number} parameter must be included. Support only jpg |
StreamExtract | Request.Operation.Output | Stream separation result file configuration message | Container | Yes | This parameter is valid when the media task type is StreamExtract, and it is required. |
The specific data description of the Container type StreamExtract is as follows:
|
Index | Request.Operation.Output.StreamExtract | Stream number, corresponding to Response.MediaInfo.Stream.Video.Index and Response.MediaInfo.Stream.Audio.Index in media information. For details, see get media information interface. When the input media format is mxf, only Video Stream extraction is supported. | String | Yes |
Object | Request.Operation.Output.StreamExtract | Result output filename | String | Yes |
The specific data description of the Container type JobParam is as follows:
|
TemplateId | Request.Operation.JobParam | template ID | String | No |
TranscodeTemplateId | Request.Operation.JobParam | transcoding template ID, valid when the media task type is VideoProcess, SuperResolution, or SDR2HDR | Container | No |
Animation | Request.Operation.JobParam | animation task parameter, valid when the media task type is Animation | Container | No |
Transcode | Request.Operation.JobParam | transcode task parameter, valid when the media task type is Transcode, VideoProcess, SuperResolution, or SDR2HDR | String | No |
SmartCover | Request.Operation.JobParam | Smart Cover Task parameters, valid when the media task type is SmartCover | Container | No |
DigitalWatermark | Request.Operation.JobParam | Digital watermark parameters, valid when the media task type is Transcode, VideoProcess, SuperResolution, or DigitalWatermark | Container | No |
Watermark | Request.Operation.JobParam | watermark template parameters, same as Request.Watermark in the CreateMediaTemplate API for creating watermark templates. This parameter is valid when the media task type is Transcode, SDR2HDR, VideoProcess, or SuperResolution. | Container | No |
WatermarkTemplateId | Request.Operation.JobParam | Watermark template parameters, same as Request.Watermark in the CreateMediaTemplate API. This parameter is valid when the media task type is Transcode, SDR2HDR, VideoProcess, or SuperResolution. | Container | No |
RemoveWatermark | Request.Operation.JobParam | Remove watermark parameters, valid for media task type Transcode. | Container | No |
Subtitles | Request.Operation.JobParam | Subtitle parameters, valid for media task type Transcode. | Container | No |
Snapshot | Request.Operation.JobParam | Screenshot task parameters, valid for media task type Snapshot. | Container | No |
SpeechRecognition | Request.Operation.JobParam | Speech recognition task parameters, valid for media task type SpeechRecognition. | Container | No |
ConcatTemplate | Request.Operation.JobParam | Concatenation task parameters, valid for media task type Concat. | Container | No |
VoiceSeparate | Request.Operation.JobParam | Voice separation task parameters, valid for media task type VoiceSeparate. | Container | No |
VideoMontage | Request.Operation.JobParam | Striking highlight task parameters, valid for media task type VideoMontage. | Container | No |
SDRtoHDR | Request.Operation.JobParam | SDR2HDR task parameters, valid for media task type SDRtoHDR. | Container | No |
VideoProcess | Request.Operation.JobParam | Video enhancement task parameters, valid for media task type VideoProcess. | Container | No |
SuperResolution | Request.Operation.JobParam | Super resolution task parameters, valid for media task type SuperResolution. | Container | No |
Segment | Request.Operation.JobParam | Remux job parameters, valid when the media task type is Segment. | Container | No |
ExtractDigitalWatermark | Request.Operation.JobParam | Extract digital watermark task parameters, valid when the media task type is ExtractDigitalWatermark. | Container | No |
VideoTag | Request.Operation.JobParam | Video tag task parameters, valid when the media task type is VideoTag. | Container | No |
TtsTpl | Request.Operation.JobParam | Text-to-speech template parameters, valid when the media task type is Tts. | Container | No |
NoiseReduction | Request.Operation.JobParam | Audio noise reduction template parameters, valid when the media task type is NoiseReduction. | Container | No |
Note
Priority using TemplateId, use parameters in types of corresponding task when there is no TemplateId.
The specific data description of the Container type DigitalWatermark is as follows:
|
Message | Request.Operation.JobParam.DigitalWatermark | Embedded digital watermark string information, length not exceeding 64 characters, supporting only Chinese, English, digits, _, -, and *. | String | Yes |
Type | Request.Operation.JobParam.DigitalWatermark | Watermark type, currently can only be set to Text. | String | Yes |
Version | Request.Operation.JobParam.DigitalWatermark | Watermark version, currently can only be set to V1. | String | Yes |
IgnoreError | Request.Operation.JobParam.DigitalWatermark | Whether to ignore errors and continue executing the task when watermarking fails, limited to true/false, default false. When Request.Operation.Tag is DigitalWatermark, this parameter is invalid. The watermarking failed task fails. | String | No |
Content of Container type Animation:
Content of Container type Transcode:
Content of Container type Watermark:
Content of Container type RemoveWatermark:
Content of Container type SmartCover:
Content of Container type Snapshot:
Content of Container type SpeechRecognition:
Content of Container type ConcatTemplate:
Content of Container type VoiceSeparate:
Content of Container type VideoMontage:
Content of Container type SDRtoHDR:
Content of Container type VideoProcess:
Content of Container type SuperResolution:
Content of Container type Segment:
Content of Container type ExtractDigitalWatermark:
Content of Container type VideoTag:
Content of Container type TtsTpl:
Content of Container type NoiseReduction:
Response
Response Headers
Response Body
The response body is returned as application/xml. An example including the complete node data is shown below:
<Response>
<RequestId>NjJiZDU1ZmZfOTBmYTUwNjRfNzdjY18xYQ==<RequestId>
<JobsDetail>
<Code>Success</Code>
<Type>Job</Type>
<Message/>
<Name>demo</Name>
<JobId>be8f65004eb8511eaaed4f377124a303c</JobId>
<State>Running</State>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>2022-06-27T15:23:11+0800</StartTime>
<EndTime>2022-06-27T15:25:10+0800</EndTime>
<Input>
<Prefix>input</Prefix>
</Input>
<Operation>
<TimeInterval>
<Start>2022-02-01T12:00:00+0800</Start>
<End>2022-05-01T12:00:00+0800</End>
</TimeInterval>
<QueueId>p893bcda225bf4945a378da6662e81a89</QueueId>
<UserData>this is my inventorytriggerjob</UserData>
<CallBack>https://www.callback.com</CallBack>
<Tag>Transcode</Tag>
<JobParam>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
</JobParam>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>output/${InventoryTriggerJobId}/out.mp4</Object>
</Output>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>
The data are as follows:
|
Response | None. | Container for saving results | Container |
Content of Container node Response:
|
RequestId | Response | unique request ID | String |
JobsDetail | Response | Task details | Container |
Content of JobsDetail
in Container node: |
Code | Response.JobsDetail | error code, which is meaningful only when State is Failed | String |
Message | Response.JobsDetail | error description, which is meaningful only when State is Failed | String |
Type | Response.JobsDetail | Batch processing task type: Job | String |
Name | Response.JobsDetail | Newly created task name | String |
JobId | Response.JobsDetail | ID of the newly created task | String |
State | Response.JobsDetail | Task status, one of Submitted, Running, Success, Failed, Pause, Cancel. | String |
CreationTime | Response.JobsDetail | Task creation time | String |
StartTime | Response.JobsDetail | Task start time | String |
EndTime | Response.JobsDetail | Task end time | String |
Input | Response.JobsDetail | The resource address of the task input is the same as Request.Input in request. | Container |
Operation | Response.JobsDetail | | Container |
Error Codes
This request returns common error responses and error codes. For more information, see Error Codes. Examples
Request
POST /inventorytriggerjob HTTP/1.1
Authorization:q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=****************************************
Host:bucket-1250000000.ci.ap-beijing.myqcloud.com
Content-Length: 166
Content-Type: application/xml
<Request>
<Name>demo</Name>
<Type>Job</Type>
<Input>
<Prefix>input</Prefix>
</Input>
<Operation>
<TimeInterval>
<Start>2022-02-01T12:00:00+0800</Start>
<End>2022-05-01T12:00:00+0800</End>
</TimeInterval>
<UserData>this is my inventorytriggerjob</UserData>
<CallBack>https://www.callback.com</CallBack>
<Tag>Transcode</Tag>
<JobParam>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
</JobParam>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>output/${InventoryTriggerJobId}/out.mp4</Object>
</Output>
<JobLevel>0</JobLevel>
</Operation>
</Request>
Response
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Mon, 28 Jun 2022 15:23:12 GMT
Server: tencent-ci
x-ci-request-id: NjJiZDU1ZmZfOTBmYTUwNjRfNzdjY18x****
<Response>
<RequestId>NjJiZDU1ZmZfOTBmYTUwNjRfNzdjY18x****<RequestId>
<JobsDetail>
<Code>Success</Code>
<Type>Job</Type>
<Message/>
<Name>demo</Name>
<JobId>be8f65004eb8511eaaed4f377124a303c</JobId>
<State>Running</State>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>2022-06-27T15:23:11+0800</StartTime>
<EndTime>2022-06-27T15:25:10+0800</EndTime>
<Input>
<Prefix>input</Prefix>
</Input>
<Operation>
<TimeInterval>
<Start>2022-02-01T12:00:00+0800</Start>
<End>2022-05-01T12:00:00+0800</End>
</TimeInterval>
<QueueId>p893bcda225bf4945a378da6662e81a89</QueueId>
<UserData>this is my inventorytriggerjob</UserData>
<CallBack>https://www.callback.com</CallBack>
<Tag>Transcode</Tag>
<JobParam>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
</JobParam>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>output/${InventoryTriggerJobId}/out.mp4</Object>
</Output>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>