任务中心接口
更新时间:2024-08-30
查询指定任务
通过任务的唯一标识 taskId 查询指定任务详细信息。
请求语法
GET /v2/tasks/{taskId} HTTP/1.1
accept-encoding: gzip, deflate
x-bce-string: <utc-string-string>
connection: keep-alive
accept: */*
host: vod.bj.baidubce.com
x-bce-request-id: <bce-request-id>
content-type: application/json
authorization: <bce-authorization-string>
请求头域
无特殊请求头域。
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
mediaId | string | 媒资的唯一标识,开发者可通过 mediaId 查询指定媒资的详细信息 | 是 |
请求示例
GET /v2/tasks/tks-ehwtuaz03yv5pu36 HTTP/1.1
accept-encoding: gzip, deflate
x-bce-string: 2024-03-24T13:08:44Z
connection: keep-alive
accept: */*
host: vod.bj.baidubce.com
x-bce-request-id: d97c57d0-ca44-4d1c-bfeb-941a92440968
content-type: application/json
authorization: <bce-authorization-string>
响应头域
无特殊响应头域。
响应参数
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
taskId | string | true | 任务id | |
workflowName | string | true | 工作流名称 | |
workflowId | string | True | 工作流id | |
mediaId | string | true | 媒资id | |
status | string | true | 任务状态 | READY RUNNING SUCCESS FAILED |
createTime | string | true | 任务创建时间 | |
finishTime | string | false | 任务完成时间 | |
nodes | [object] | true | ||
nodeType | string | true | 节点类型 | |
nodeName | string | true | 节点名称 | |
status | string | true | 任务状态 | |
output | string | false | 黑边、vca、vcr任务输出信息 | |
presetName | string | true | 模板名称 | |
urls | [string] | false | 转码、抽帧、字幕输出文件url列表 |
响应示例
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: d97c57d0-ca44-4d1c-bfeb-941a92440968
Cache-Control: no-cache
Server: BWS
string: Tue, 24 Mar 2024 13:34:07 GMT
Content-Type: application/json;charset=UTF-8
{
"taskId": "tsk-ehwtuaz03yv5pu36",
"workflowName": "zm_slt_hb",
"workflowId": "ehwty5yu7pn7nxqc7rde",
"mediaId": "mda-ehwth0gvkaj8c53z",
"status": "SUCCESS",
"createTime": "2024-08-21T09:44:42Z",
"finishTime": "2024-08-21T09:45:30Z",
"nodes": [
{
"nodeType": "START",
"nodeName": "输入",
"status": "SUCCESS",
"errMsg": ""
},
{
"nodeType": "TRANSCODING",
"nodeName": "转码",
"status": "SUCCESS",
"errMsg": "",
"presetName": "vod.video_hls_h264_360p",
"urls": [
"https://bj-bos.baidu-int.com/v1/vod-egyrrahca3f80ev6/mda-ehwth0gvkaj8c53z/ehwty5yu7pn7nxqc7rde/ehwtjx45wftjhq4eqqf6/mda-ehwth0gvkaj8c53z.m3u8?authorization=bce-auth-v1%2F213ee4f72b944fdba2e3326af256b781%2F2024-08-21T13%3A02%3A57Z%2F3600%2F%2F3831af9a665083331bbca8fec3fdbdbd34d1a2154359f7d03859d14bf5172e47"
]
},
{
"nodeType": "PUBLISH",
"nodeName": "发布",
"status": "SUCCESS",
"errMsg": ""
},
{
"nodeType": "THUMBNAIL",
"nodeName": "缩略图",
"status": "SUCCESS",
"errMsg": "",
"presetName": "vod.thumbnail_cover",
"urls": [
"https://bj-bos.baidu-int.com/v1/vod-egyrrahca3f80ev6/mda-ehwth0gvkaj8c53z/ehwty5yu7pn7nxqc7rde/ehwttwiu8p6eyas1e7aj/mda-ehwth0gvkaj8c53z.jpg?authorization=bce-auth-v1%2F213ee4f72b944fdba2e3326af256b781%2F2024-08-21T13%3A02%3A57Z%2F3600%2F%2F33b647958086bc3f82fabf4c8af5af3b9539c6090cdd349371742eefd9a755ca"
]
},
{
"nodeType": "BLACK_BORDER_DETECT",
"nodeName": "黑边检测",
"status": "SUCCESS",
"errMsg": "",
"output": {
"meta": {
"width": 1280,
"height": 720
}
}
}
]
}
任务分页接口
对用户的所有任务按条件筛选并用marker机制显示。
请求语法
GET /v2/tasks?marker={marker}&maxSize={maxSize}&status={status}&beginTime={beginTime}&endTime={endTime}&mediaId={mediaId}&taskId={taskId} HTTP/1.1
accept-encoding: gzip, deflate
x-bce-string: <utc-string-string>
connection: keep-alive
accept: */*
host: vod.bj.baidubce.com
x-bce-request-id: <bce-request-id>
content-type: application/json
authorization: <bce-authorization-string>
请求头域
无特殊请求头域。
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
marker | string | 本次请求的marker,标记查询的起始位置,是上次marker机制查询返回的nextMarker,首次查询不提供本字段 | 否 |
maxSize | int | 本次请求返回的任务列表的最大元素个数,有效值:[1-1000],默认值:10 | 否 |
status | string | 任务运行状态,可选READY RUNNING SUCCESS FAILED | 否 |
beginTime | string | 任务创建时间(createTime)上限,用于筛选创建时间等于或晚于beginTime的任务 | 否 |
endTime | string | 任务结束时间(createTime)下限,用于筛选结束时间等于或早于endTime的任务 | 否 |
mediaId | string | 媒资id | 否 |
taskId | string | 任务id | 否 |
请求示例
GET /v1/media?marker=tsk-ehwtuaz03yv5pu36&maxSize=2&status=SUCESS&begin=2024-09-11T12:18:30Z&end=2024-09-13T12:18:30Z HTTP/1.1
accept-encoding: gzip, deflate
x-bce-string: 2024-03-24T13:08:44Z
host: vod.bj.baidubce.com
accept: */*
connection: keep-alive
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2024-03-24T13:08:44Z/1800/host;x-string/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
响应头域
无特殊响应头域。
响应参数
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
data | [object] | true | |||
+ taskId | string | true | 任务id | ||
+ mediaId | string | true | 媒资id | ||
+ status | string | true | 处理状态 | ||
+ createTime | string | true | 任务创建时间 | ||
+ finishTime | string | true | 任务更新时间 | 任务更新时间为完成时间 | |
marker | string | true | 本次查询起点 | ||
nextMarker | string | true | 下次查询起点 | ||
isTruncated | string | true | 后续是否还有数据 |
响应示例
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
Cache-Control: no-cache
Server: BWS
string: Tue, 24 Mar 2024 13:08:44 GMT
Content-Type: application/json;charset=UTF-8
{
"data": [
{
"taskId": "tsk-ehwtuaz03yv5pu36",
"mediaId": "mda-ehwth0gvkaj8c53z",
"status": "SUCCESS",
"createTime": "2024-08-21T09:44:42Z",
"finishTime": "2024-08-21T09:45:30Z"
},
{
"taskId": "tsk-ehpr44qzn1b5e2tv",
"mediaId": "mda-ehprgts1t3bbap3x",
"status": "SUCCESS",
"createTime": "2024-08-14T07:26:19Z",
"finishTime": "2024-08-14T07:26:26Z"
}
],
"marker": "tsk-ehwtuaz03yv5pu36",
"nextMarker": "tsk-ehfqdrvz3gaexysj",
"isTruncated": true
}
重试任务接口
对用户指定的任务进行重试
请求语法
POST /v2/tasks/rerun HTTP/1.1
accept-encoding: gzip, deflate
x-bce-string: <utc-string-string>
connection: keep-alive
accept: */*
host: vod.bj.baidubce.com
x-bce-request-id: <bce-request-id>
content-type: application/json
authorization: <bce-authorization-string>
请求头域
无特殊请求头域。
请求参数
名称 | 类型 | 必选 | 中文名 | 说明 |
---|---|---|---|---|
taskId | string | 是 | 任务id |
请求示例
POST /v2/tasks/rerun HTTP/1.1
accept-encoding: gzip, deflate
x-bce-string: 2024-03-24T13:08:44Z
host: vod.bj.baidubce.com
accept: */*
connection: keep-alive
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2024-03-24T13:08:44Z/1800/host;x-string/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
{
"taskId": "tsk-ehmqrw779r54y55x"
}
响应头域
无特殊响应头域。
响应参数
无
响应示例
HTTP/1.1 HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
Cache-Control: no-cache
Server: BWS
string: Tue, 24 Mar 2024 13:08:44 GMT
Content-Type: application/json;charset=UTF-8