智能点播VideoWorks

    工作流接口

    新建工作流接口

    接口描述

    创建工作流Workflow;

    请求(Request)

    • 请求语法:
    POST /v{version}/workflow HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:
    字段名称 字段类型 是否必选 字段描述
    name String 必选 工作流名称
    expression 自定义Dag类型 必选 工作流Dag描述,工作流结构比较复杂,不建议通过API创建,建议使用console创建,所以这里不给出具体字段信息
    • 请求示例:
    POST /v1/workflow HTTP/1.1
    x-bce-date: 2019-05-31T09:27:33Z
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
    {
        "name": "workflowname",
        "expression": {
            "stages": {
                "start": {
                    "name": "start",
                    "param": {
                        "input": "{\"autoProcess\":false}"
                    },
                    "type": "START"
                },
                "transcoding": {
                    "name": "transcoding",
                    "param": {
                        "input": "{\"job\":{\"pipelineName\":\"test_transcoding\",\"source\":{},\"target\":{\"presetName\":\"bvwtest\"}},\"needDetectBlackBoard\":false,\"adjustOrientation\":\"ALL\"}"
                    },
                    "type": "TRANSCODING"
                },
                "publish": {
                    "name": "publish",
                    "param": {
                        "input": "{\"autoPublish\":true,\"domains\":{\"videoworks-target\":\"videoworks.baidu.com\"},\"notificationName\":\"notification\"}"
                    },
                    "type": "PUBLISH"
                }
            },
            "dependencies": {
                "start": [
                    "transcoding"
                ],
                "transcoding": [
                    "publish"
                ],
                "publish": [] 
            }
        }
    }

    响应(Response)

    • 响应头域:无特殊Header参数
    • 响应参数:无
    • 响应示例:
    HTTP/1.1 200 OK
    Transfer-Encoding: chunked
    x-bce-request-id: ca8620b4-0527-4153-b6ed-3a6c0a4da937
    Cache-Control: no-cache
    Server: BWS
    Date: Fri, 31 May 2019 09:27:33 GMT
    Content-Type: application/json;charset=UTF-8

    删除工作流接口

    接口描述

    根据工作流名称删除指定工作流;

    说明:只有没有被媒资处理使用的工作流才允许删除;

    请求(Request)

    • 请求语法
    DELETE /v{version}/workflow/{name} HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    x-bce-request-id: {bce-request-id}
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:无
    • 请求示例:
    DELETE /v1/workflow/{name} 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参数
    • 响应参数:无
    • 响应示例:
    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

    更新工作流接口

    接口描述

    根据工作流名称更新指定工作流;

    说明:只有没有被媒资处理使用的工作流才允许更新;

    请求(Request)

    • 请求语法
    PUT /v{version}/workflow/{name} HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:
    字段名称 字段类型 必要性 字段描述
    expression 自定义Dag类型 必选 工作流Dag描述,工作流结构比较复杂,不建议通过API更新,建议使用console更新,所以这里不给出具体字段信息
    • 请求示例:
    PUT /v1/workflow/{name} 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
    {
        "expression": {
            "stages": 
                "start": {
                    "name": "start",
                    "param": {
                        "input": "{\"autoProcess\":false}"
                    },
                    "type": "START"
                },
                "transcoding": {
                    "name": "transcoding",
                    "param": {
                        "input": "{\"job\":{\"pipelineName\":\"test_transcoding\",\"source\":{},\"target\":{\"presetName\":\"bvwtest\"}},\"needDetectBlackBoard\":false,\"adjustOrientation\":\"ALL\"}"
                    },
                    "type": "TRANSCODING"
                },
                "publish": {
                    "name": "publish",
                    "param": {
                        "input": "{\"autoPublish\":true,\"domains\":{\"videoworks-target\":\"videoworks.baidu.com\"},\"notificationName\":\"notification\"}"
                    },
                    "type": "PUBLISH"
                }
            },
            "dependencies": {
                "start": [
                    "transcoding"
                ],
                "transcoding": [
                    "publish"
                ],
                "publish": [] 
            }
        }
    }

    响应(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

    工作流查询接口

    接口描述

    根据工作流名称查询指定工作流;

    请求(Request)

    • 请求语法
    GET /v{version}/workflow/{name} 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/workflow/{name} 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参数
    • 响应参数:
    字段名称 字段类型 字段描述
    workflowId String 系统生成的工作流Id
    name String 工作流名称
    status Object 状态,状态值:NORMAL/DISABLE
    expression String 工作流描述
    createTime String 工作流创建时间
    updateTime 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
    {
        "workflowId": "wfs-jf1m7xdkjrzj3uir",
        "name": "thumbnail_jpg",
        "status": "NORMAL",
        "expression": "{\"stages\":{\"thumbnail\":{\"stageId\":\"stg-jf1m0ty6bxktszv3\",\"name\":\"thumbnail\",\"param\":{\"input\":\"{\\\"job\\\":{\\\"pipelineName\\\":\\\"test_thumbnail\\\",\\\"source\\\":{},\\\"target\\\":{\\\"format\\\":\\\"jpg\\\",\\\"sizingPolicy\\\":\\\"keep\\\",\\\"widthInPixel\\\":600,\\\"heightInPixel\\\":450},\\\"capture\\\":{\\\"mode\\\":\\\"auto\\\"}}}\"},\"type\":\"THUMBNAIL\"},\"publish\":{\"stageId\":\"stg-jf1mansrr8vqbf2n\",\"name\":\"publish\",\"param\":{\"input\":\"{\\\"autoPublish\\\":true,\\\"domains\\\":{\\\"videoworks-target\\\":\\\"videoworks.baidu.com\\\"},\\\"notificationName\\\":\\\"notification\\\"}\"},\"type\":\"PUBLISH\"},\"start\":{\"stageId\":\"stg-jf1mr49yi8f4392h\",\"name\":\"start\",\"param\":{\"input\":\"{\\\"autoProcess\\\":false}\"},\"type\":\"START\"}},\"dependencies\":{\"thumbnail\":[\"publish\"],\"publish\":[],\"start\":[\"thumbnail\"]}}",
        "createTime": "2019-06-26T03:06:29Z",
        "createTime": "2019-06-26T03:06:29Z"
    }

    查询工作流列表接口

    接口描述

    查询工作流列表;

    请求(Request)

    • 请求语法
    GET /v{version}/workflow?pageNo={pageNo}&pageSize={pageSize}&status=NORMAL HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:
    字段名称 字段类型 必要性 字段描述
    pageNo Integer 必选 第几页,默认第一页
    pageSize Integer 必选 每页多少条,最大1000
    status String 可选 媒资状态,状态值:NOMAL/DISABLE
    name String 可选 工作流名称
    beginTime Date 可选 创建时间下限
    endTime Date 可选 创建时间上限
    • 请求示例:
    GET /v1/workflow?pageNo=1&pageSize=10 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参数
    • 响应参数:
    字段名称 字段类型 字段描述
    workflowId String 系统生成的工作流Id
    name String 工作流名称
    status Object 状态,状态值:NORMAL/DISABLE
    expression String 工作流描述
    createTime String 工作流创建时间
    updateTime String 工作流更新时间
    using Boolean 工作流是否被使用
    • 响应示例:
    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
    {
        "data": [
            {
                "workflowId": "wfs-jgrjy6vhtm2tzxj8",
                "name": "wf716",
                "status": "NORMAL",
                "expression": "{\"stages\":{\"发布\":{\"stageId\":\"stg-jgrjiurs6gspddad\",\"name\":\"发布\",\"param\":{\"input\":\"{}\"},\"type\":\"PUBLISH\"},\"输入\":{\"stageId\":\"stg-jgrj8g365hu251jd\",\"name\":\"输入\",\"param\":{\"input\":\"{}\"},\"type\":\"START\"}},\"dependencies\":{\"输入\":[\"发布\"],\"发布\":[]}}",
                "createTime": "2019-07-16T09:57:30Z",
                "updateTime": "2019-07-26T11:05:49Z",
                "using": true
            }
        ],
        "pageNo": 1,
        "pageSize": 10,
        "totalCount": 1
    }

    启用工作流接口

    接口描述

    启用工作流;

    请求(Request)

    • 请求语法
    PUT /v{version}/workflow/{name}?enable HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:无
    • 请求示例:
    PUT /v1/workflow/wf716?enable 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参数
    • 响应参数:工作流名称列表
    • 响应示例:
    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

    禁用工作流接口

    接口描述

    禁用工作流;

    请求(Request)

    • 请求语法
    PUT /v{version}/workflow/{name}?disable HTTP/1.1
    x-bce-date: {utc-date-string}
    host: bvw.bj.baidubce.com
    content-type: application/json
    authorization: {bce-authorization-string}
    • 请求头域:无特殊Header参数
    • 请求参数:无
    • 请求示例:
    PUT /v1/workflow/wf716?disable 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参数
    • 响应参数:工作流名称列表
    • 响应示例:
    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
    上一篇
    错误返回
    下一篇
    工作流运行实例接口