智能点播VideoWorks

    工作流运行实例接口

    运行实例接口(Instance API)

    查询工作流运行实例接口

    接口描述

    根据instanceId查询工作流运行实例信息;

    请求(Request)

    • 请求语法
    GET /v{version}/instance/{instanceId} HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:无
    • 请求示例:
    GET /v1/instance/ins-jf1mzvw68yqjez4v HTTP/1.1
    x-bce-date: 2015-07-03T09:28:13Z
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715

    响应(Response)

    • 响应头域:无特殊Header参数
    • 响应参数:
    字段名称 字段类型 字段描述
    instanceId String 系统生成的工作流运行实例Id
    status String 运行状态,SUCCESS:成功,FAILED:失败
    errorMsg String 失败信息
    workflowId String 对应的工作流Id
    workflowName String 对应的工作流名称
    mediaId String 对应的媒资Id
    sourceBucket String 对应的媒资source bucket
    sourceKey String 对应的媒资sourceKey
    stages Map 工作流stage任务运行结果Map
    + key String 工作流Stage名称
    + value Object 工作流stage任务运行结果
    ++ taskId String 任务Id
    ++ instanceId String 对应的运行实例instanceId
    ++ status String 运行状态,SUCCESS:成功,FAILED:失败
    ++ stageId String 对应的stageId
    ++ name String 对应的stageName
    ++ param Object 任务参数
    +++ input String 任务输入参数
    +++ output Object 任务输出参数
    ++++ taskId String 任务ID
    ++++ output String 任务正在的输出在这里
    ++++ beginTime String 任务开始运行时间
    ++++ endTime String 任务结束运行时间
    ++ type String stage类型
    dependencies Map 工作流依赖关系
    + key String 工作流Stage名称
    + value List 该工作流的下游Stage名称
    • 响应示例:
    HTTP/1.1 200 OK
    x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
    Date: Tue, 24 Mar 2015 13:06:02 GMT
    Transfer-Encoding: chunked
    Content-Type: application/json;charset=UTF-8
    Cache-Control: no-cache
    {
        "instanceId": "ins-jg0neb1ndk2f5arj",
        "status": "RUNNING",
        "workflowId": "wfs-jg0mg3dtpnefsfux",
        "workflowName": "test_20190725",
        "mediaId": "mda-jg0njq3z8dn2d267",
        "sourceBucket": "videoworks-source",
        "sourceKey": "movie1564059236224.mp4",
        "stages": {
            "blackBorderDetect": {
                "taskId": "tsk-jg0n25fzrvgec9y7",
                "instanceId": "ins-jg0neb1ndk2f5arj",
                "status": "SUCCESS",
                "stageId": "stg-jg0m5cnadmm2sd9t",
                "name": "blackBorderDetect",
                "param": {
                    "input": "{\"sourceBucket\":\"videoworks-source\",\"sourceKey\":\"movie1564059236224.mp4\"}",
                    "output": {
                        "taskId": "tsk-jg0n25fzrvgec9y7",
                        "output": "{\"jobId\":\"job-jg0np3rxjdttzvca\",\"doCrop\":false,\"borderArea\":{\"x\":0,\"y\":0,\"width\":320,\"height\":240},\"meta\":{\"width\":320,\"height\":240},\"extraInfo\":\"{\\\"x\\\":0,\\\"y\\\":0,\\\"width\\\":320,\\\"height\\\":240,\\\"type\\\":4,\\\"is_vertical\\\":0,\\\"code\\\":0,\\\"msg\\\":\\\"OK\\\"}\"}",
                        "beginTime": "2019-07-25T12:54:00Z",
                        "endTime": "2019-07-25T12:54:02Z",
                        "success": true
                    }
                },
                "type": "BLACK_BORDER_DETECT"
            },
            "start": {
                "taskId": "tsk-jg0ne2mvh5anf7nu",
                "instanceId": "ins-jg0neb1ndk2f5arj",
                "status": "SUCCESS",
                "stageId": "stg-jg0mrkrd5m474y5k",
                "name": "start",
                "param": {
                    "input": "{\"sourceBucket\":\"videoworks-source\",\"sourceKey\":\"movie1564059236224.mp4\"}",
                    "output": {
                        "taskId": "tsk-jg0ne2mvh5anf7nu",
                        "output": "null",
                        "beginTime": "2019-07-25T12:53:59Z",
                        "endTime": "2019-07-25T12:53:59Z",
                        "success": true
                    }
                },
                "type": "START"
            },
            "thumbnail": {
                "taskId": "tsk-jg0nuvzagfid84pi",
                "instanceId": "ins-jg0neb1ndk2f5arj",
                "status": "RUNNING",
                "stageId": "stg-jg0m42umikm6yr15",
                "name": "thumbnail",
                "param": {
                    "input": "{\"job\":{\"pipelineName\":\"test_thumbnail\",\"source\":{\"sourceBucket\":\"videoworks-source\",\"key\":\"movie1564059236224.mp4\"},\"target\":{\"targetBucket\":\"videoworks-source\",\"format\":\"jpg\",\"sizingPolicy\":\"keep\",\"widthInPixel\":600,\"heightInPixel\":450},\"capture\":{\"mode\":\"auto\"}},\"notificationName\":\"test\"}",
                    "output": {
                        "taskId": "tsk-jg0nuvzagfid84pi",
                        "output": "{\"jobId\":\"job-jg0whr1ynkcezud3\"}",
                        "beginTime": "2019-07-25T12:54:00Z",
                        "endTime": "2019-07-25T12:54:00Z",
                        "success": true
                    }
                },
                "type": "THUMBNAIL"
            },
            "mediaInfo": {
                "taskId": "tsk-jg0n3ad7ze5jaun9",
                "instanceId": "ins-jg0neb1ndk2f5arj",
                "status": "SUCCESS",
                "stageId": "stg-jg0mradkkn9wbbh7",
                "name": "mediaInfo",
                "param": {
                    "input": "{\"sourceBucket\":\"videoworks-source\",\"sourceKey\":\"movie1564059236224.mp4\"}",
                    "output": {
                        "taskId": "tsk-jg0n3ad7ze5jaun9",
                        "output": "{\"bucket\":\"videoworks-source\",\"key\":\"movie1564059236224.mp4\",\"fileSizeInByte\":318465,\"type\":\"video\",\"container\":\"mov,mp4,m4a,3gp,3g2,mj2\",\"durationInSecond\":13,\"video\":{\"codec\":\"h264\",\"heightInPixel\":240,\"widthInPixel\":320,\"bitRateInBps\":80637,\"frameRate\":29.97},\"audio\":{\"codec\":\"aac\",\"channels\":2,\"sampleRateInHz\":48000,\"bitRateInBps\":115752},\"etag\":\"3cf571d4cf2a4c4b2df823a27852a7d5\"}",
                        "beginTime": "2019-07-25T12:54:00Z",
                        "endTime": "2019-07-25T12:54:00Z",
                        "success": true
                    }
                },
                "type": "MEDIAINFO"
            },
            "transcoding": {
                "taskId": "tsk-jg0n5w1zw8jdnhj5",
                "instanceId": "ins-jg0neb1ndk2f5arj",
                "status": "RUNNING",
                "stageId": "stg-jg0mvqqx6n9fszta",
                "name": "transcoding",
                "param": {
                    "input": "{\"job\":{\"pipelineName\":\"test_transcoding\",\"source\":{\"clips\":[{\"bucket\":\"videoworks-source\",\"sourceKey\":\"movie1564059236224.mp4\"}]},\"target\":{\"targetBucket\":\"videoworks-source\",\"presetName\":\"bvwtest\"}},\"needDetectBlackBorder\":false,\"adjustOrientation\":\"ALL\"}",
                    "output": {
                        "taskId": "tsk-jg0n5w1zw8jdnhj5",
                        "output": "{\"jobId\":\"job-jg0ws78edx8yeh1z\"}",
                        "beginTime": "2019-07-25T12:54:02Z",
                        "endTime": "2019-07-25T12:54:02Z",
                        "success": true
                    }
                },
                "type": "TRANSCODING"
            },
            "publish": {
                "taskId": "tsk-jg0nh53shftgytms",
                "instanceId": "ins-jg0neb1ndk2f5arj",
                "status": "READY",
                "stageId": "stg-jg0m9szn3yvca9he",
                "name": "publish",
                "param": {
                    "input": "{}"
                },
                "type": "PUBLISH"
            }
        },
        "dependencies": {
            "blackBorderDetect": [
                "transcoding"
            ],
            "thumbnail": [
                "publish"
            ],
            "publish": [],
            "start": [
                "blackBorderDetect",
                "mediaInfo",
                "thumbnail"
            ],
            "mediaInfo": [
                "publish"
            ],
            "transcoding": [
                "publish"
            ]
        }
    }

    查询工作流实例Stage任务URL列表

    接口描述:

    根据运行实例ID查询该运行实例下所有Stage的可播放的URL信息;

    请求(Request)

    • 请求语法
    GET /v{version}/instance/{instanceId}?queryStageTaskUrlList HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:无
    • 请求示例:
    GET /v1/ins-jgyfnegx9kvduw66?queryTaskUrlList HTTP/1.1
    x-bce-date: 2015-07-03T09:28:13Z
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715

    响应(Response)

    • 响应头域:无特殊Header参数
    • 响应参数:
    字段名称 字段类型 字段描述
    taskId String 任务ID
    instanceId String 该任务对应的实例ID
    stageName String Stage名称
    stageType String Stage类型
    status String 任务状态,READY/RUNNING/SUCCESS/FAILED
    domains object 输出bucket对应的domain
    + domain String CDN加速域名
    + enableHttps boolean 是否开启Https
    targetBucket String 输出bucket
    targetKeys list 输出对应的Object keys
    • 响应示例:
    HTTP/1.1 200 OK
    x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
    Date: Tue, 24 Mar 2015 13:06:02 GMT
    Transfer-Encoding: chunked
    Content-Type: application/json;charset=UTF-8
    Cache-Control: no-cache
    {
        "taskUrls": [
            {
                "taskId": "tsk-jgyf8x85ex866nvp",
                "stageName": "thumbnail",
                "stageType": "THUMBNAIL",
                "targetBucket": "videoworks-source",
                "status": "SUCCESS",
                "domains": [
                    {
                        "domain": "videoworks-source.bcecdn.qa.sandbox.baidu.com",
                        "enableHttps": true
                    }
                ],
                "targetKeys": [
                    "videoworks/mda-jgyf2p2ehbksexaa/test_20190722/thumbnail/movie16.jpg"
                ]
            },
            {
                "taskId": "tsk-jgyfkganisuksgus",
                "stageName": "transcoding",
                "stageType": "TRANSCODING",
                "targetBucket": "videoworks-source",
                "status": "SUCCESS",
                "domains": [
                    {
                        "domain": "videoworks-source.bcecdn.qa.sandbox.baidu.com",
                        "enableHttps": true
                    }
                ],
                "targetKeys": [
                    "videoworks/mda-jgyf2p2ehbksexaa/test_20190722/transcoding/movie16.mp4"
                ]
            }
        ]
    }

    查询工作流实例可打点视频列表

    接口描述:

    根据运行实例ID查询该运行实例下所有可以打点的视频URL列表;

    请求(Request)

    • 请求语法
    GET /v{version}/instance/{instanceId}?queryKeyFrameUrlList HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:无
    • 请求示例:
    GET /v1/ins-jgyfnegx9kvduw66?queryTaskUrlList HTTP/1.1
    x-bce-date: 2015-07-03T09:28:13Z
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715

    响应(Response)

    • 响应头域:无特殊Header参数
    • 响应参数:
    字段名称 字段类型 字段描述
    mediaId String 媒资ID
    instanceId String 该媒资对应的实例ID
    tasks Object task内容
    + taskId String 实例的任务ID
    + stageName boolean 任务对应的节点名
    + targetBucket boolean 任务输出文件的BOS bucket
    + targetKey boolean 任务输出文件的BOS key列表
    • 响应示例:
    HTTP/1.1 200 OK
    x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
    Date: Tue, 24 Mar 2015 13:06:02 GMT
    Transfer-Encoding: chunked
    Content-Type: application/json;charset=UTF-8
    Cache-Control: no-cache
    {
        "mediaId": "mda-xxx",
        "instanceId": "ins-xxx",
        "tasks": [
            {
                "taskId": "tsk-jgyfkganisuksgus",
                "stageName": "转码720p",
                "targetBucket": "videoworks-source",
                "targetKey": [
                    "videoworks/mda-jgyf2p2ehbksexaa/test_20190722/transcoding720/movie16.mp4"
                ]
            },
            {
                "taskId": "tsk-suksgusjgyfkgani",
                "stageName": "转码360p",
                "targetBucket": "videoworks-source",
                "targetKey": [
                    "videoworks/mda-jgyf2p2ehbksexaa/test_20190722/transcoding360/movie16.mp4"
                ]
            }
        ]
    }

    添加工作流实例打点信息

    接口描述:

    根据运行实例ID添加该实例下视频的打点信息

    请求(Request)

    • 请求语法
    POST /v{version}/instance/{instanceId}?addKeyFrameDesc HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:
    字段名称 字段类型 字段描述 参数位置
    tasks Object 打点任务集合 Requestbody
    + taskIds List 任务ID列表 Requestbody
    + keyFrameDesc List 打点信息列表 Requestbody
    ++ offset Long 打点时间 Requestbody
    ++ content String 打点内容,格式自定义 Requestbody
    • 请求示例:
    GET /v1/ins-jgyfnegx9kvduw66?queryTaskUrlList HTTP/1.1
    x-bce-date: 2015-07-03T09:28:13Z
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
    
    {
        "tasks": [
            {
                "taskIds": [
                    "tsk-jgyfkganisuksgus",
                    "tsk-isuksgusjgyfkgan"
                ],
                "keyFrameDesc": [
                    {
                        "offset": 10,
                        "content": "{\"desc\":\"打点1\",\"thumb\":\"http://bj.bcebos.com/test/test.jpg\"}"
                    },
                    {
                        "offset": 35,
                        "content": "{\"desc\":\"打点2\",\"type\":\"答题\",\"duration\":30}"
                    }
                ]
            },
            {
                "taskIds": [
                    "tsk-jaufgfnfufolmnas"
                ],
                "keyFrameDesc": [
                    {
                        "offset": 10,
                        "content": "{\"desc\":\"打点1\",\"thumb\":\"http://bj.bcebos.com/test/test.jpg\"}"
                    }
                ]
            }
        ]
    }

    响应(Response)

    • 响应头域:无特殊Header参数
    • 响应参数:无
    • 响应示例:
    HTTP/1.1 200 OK
    x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
    Date: Tue, 24 Mar 2015 13:06:02 GMT
    Transfer-Encoding: chunked
    Content-Type: application/json;charset=UTF-8
    Cache-Control: no-cache

    查询工作流实例打点信息

    接口描述:

    根据运行实例ID查询该运行实例下所有可以打点的视频URL列表;

    请求(Request)

    • 请求语法
    GET /v{version}/instance/{instanceId}?queryKeyFrameDescList HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:无
    • 请求示例:
    GET /v1/ins-jgyfnegx9kvduw66?queryTaskUrlList HTTP/1.1
    x-bce-date: 2015-07-03T09:28:13Z
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715

    响应(Response)

    • 响应头域:无特殊Header参数
    • 响应参数:
    字段名称 字段类型 字段描述
    mediaId String 媒资ID
    instanceId String 该媒资对应的实例ID
    tasks Object task内容
    + taskId String 实例的任务ID
    + stageName boolean 任务对应的节点名
    + targetBucket boolean 任务输出文件的BOS bucket
    + domains List 任务输出文件的CDN域名列表
    ++ domain String 任务输出文件的CDN域名
    ++ enableHttps Boolean 是否运行HTTPs请求
    + keyFrameDesc Boolean 任务输出文件的BOS key列表
    ++ offset Long 打点时间
    ++ content String 打点内容,格式自定义
    • 响应示例:
    HTTP/1.1 200 OK
    x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
    Date: Tue, 24 Mar 2015 13:06:02 GMT
    Transfer-Encoding: chunked
    Content-Type: application/json;charset=UTF-8
    Cache-Control: no-cache
    {
        "mediaId": "mda-xxx",
        "instanceId": "ins-xxx",
        "tasks": [
            {
                "taskId": "tsk-jgyfkganisuksgus",
                "stageName": "转码720p",
                "targetBucket": "videoworks-source",
                "domains": [
                    {
                        "domain": "videoworks-source.bcecdn.qa.sandbox.baidu.com",
                        "enableHttps": true
                    }
                ],
                "targetKey": [
                    "videoworks/mda-jgyf2p2ehbksexaa/test_20190722/transcoding720/movie16.mp4"
                ],
                "keyFrameDesc": [
                    {
                        "offset": 10,
                        "content": "{\"desc\":\"打点1\",\"thumb\":\"http://bj.bcebos.com/test/test.jpg\"}"
                    },
                    {
                        "offset": 35,
                        "content": "{\"desc\":\"打点2\",\"type\":\"答题\",\"duration\":30}"
                    }
                ]
            },
            {
                "taskId": "tsk-isuksgusjgyfkgan",
                "stageName": "转码480p",
                "targetBucket": "videoworks-source",
                "domains": [
                    {
                        "domain": "videoworks-source.bcecdn.qa.sandbox.baidu.com",
                        "enableHttps": true
                    }
                ],
                "targetKey": [
                    "videoworks/mda-jgyf2p2ehbksexaa/test_20190722/transcoding480/movie16.mp4"
                ],
                "keyFrameDesc": [
                    {
                        "offset": 10,
                        "content": "{\"desc\":\"打点1\",\"thumb\":\"http://bj.bcebos.com/test/test.jpg\"}"
                    },
                    {
                        "offset": 35,
                        "content": "{\"desc\":\"打点2\",\"type\":\"答题\",\"duration\":30}"
                    }
                ]
            },
            {
                "taskId": "tsk-isuksgusjgyfkgan",
                "stageName": "转码360p",
                "targetBucket": "videoworks-source",
                "domains": [
                    {
                        "domain": "videoworks-source.bcecdn.qa.sandbox.baidu.com",
                        "enableHttps": true
                    }
                ],
                "targetKey": [
                    "videoworks/mda-jgyf2p2ehbksexaa/test_20190722/transcoding360/movie16.mp4"
                ],
                "keyFrameDesc": [
                    {
                        "offset": 10,
                        "content": "{\"desc\":\"打点1\",\"thumb\":\"http://bj.bcebos.com/test/test.jpg\"}"
                    },
                    {
                        "offset": 35,
                        "content": "{\"desc\":\"打点2\",\"type\":\"答题\",\"duration\":30}"
                    }
                ]
            }
        ]
    }
    上一篇
    工作流接口
    下一篇
    工作流运行实例任务接口