查询任务详情接口(GetTaskByTaskID)

最近更新时间:2019-03-25 16:47:37

功能描述:

根据任务ID查询已创建的任务。因为点播转码服务是异步的,所以请您在创建任务3~5秒后再调用此接口查询该任务

请求方式:

GET

请求参数:

参数名 类型 是否必须 描述
TaskID string 任务ID

返回参数:

参数名 类型 是否必须 描述
ErrNum int 错误码,0:成功;非0:失败
ErrMsg string 描述本次请求错误的原因
TaskInfo json object 任务详情信息
TaskID string 任务ID
IsFlow int 是否为流式任务,1-是,0-否
FlowData json array 流式任务信息
Preset string 模板名
SrcInfo json array 源文件信息
DstBucket string 目标Bucket
DstDir string 目标目录
DstObjectKey string 目标ObjectKey
DstAcl string 目标文件访问类型
IsTop int 是否被置顶
CbUrl string 任务回调地址
CbMethod string 回调方式
ExtParam string 扩展参数
TaskStatus string 单个任务执行状态
ErrorCode string 出错码
ErrorMsg string 出错描述
CreateTime string 任务创建时间
path string 源文件路径(KS3)
index string 任务拼接顺序
type string 文件类型

请求示例:


GET /?Action=GetTaskByTaskID

&Version=2017-01-01

&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20170519T082842Z

&X-Amz-Credential=xxxxx

&X-Amz-SignedHeaders=xxxxx

&X-Amz-Signature=xxxxx

&TaskID=40d309d3b2bf373cd3f08e5b5e1bddf720160816 HTTP/1.1

Host: kvs.cn-beijing-6.api.ksyun.com

Accept: application/json

普通任务返回示例:


HTTP/1.1 200 OK

Server: ksyun-open-platform

Date: Fri, 12 May 2017 08:01:06 GMT

Content-Type: application/json;charset=UTF-8

Transfer-Encoding: chunked

{

    "TaskInfo":{

        "TaskID":"65909f7144cfc2de10cf656989cca37520160815",

        "IsFlow":0,

        "Preset":"preset_avop1",

        "SrcInfo":[

            {

                "path":"/wangshuai9/ksyun.flv",

                "index":0,

                "type":"video"

            }

        ],

        "DstBucket":"wangshuai9",

        "DstDir":"",

        "DstObjectKey":"ksyun_1.flv",

        "DstAcl":"public-read",

        "IsTop":"0",

        "CbUrl":"http://www.ksyun.com",

        "CbMethod":"callback",

        "ExtParam":"",

        "TaskStatus":"succ",

        "ErrorCode":"0",

        "ErrorMsg":"",

        "CreateTime":"2016-08-15 16:24:12"

    },

    "ErrNum":0,

    "ErrMsg":"success"

}

流式任务返回示例:


HTTP/1.1 200 OK

Server: ksyun-open-platform

Date: Fri, 12 May 2017 08:01:06 GMT

Content-Type: application/json;charset=UTF-8

Transfer-Encoding: chunked

{

    "TaskInfo":{

        "TaskID":"40d309d3b2bf373cd3f08e5b5e1bddf720160816",

        "IsFlow":1,

        "FlowData":[

            {

                "Preset":"preset_avop2",

                "SrcInfo":[

                    {

                        "path":"/wangshuai9/ksyun2.flv",

                        "index":0,

                        "type":"video"

                    }

                ],

                "DstBucket":"wangshuai9",

                "DstDir":"",

                "DstObjectKey":"ksyun_2.flv",

                "DstAcl":"public-read",

                "ExtParam":""

            },

            {

                "Preset":"preset_avop3",

                "SrcInfo":[

                    {

                        "path":"/wangshuai9/ksyun3.flv",

                        "index":0,

                        "type":"video"

                    }

                ],

                "DstBucket":"wangshuai9",

                "DstDir":"",

                "DstObjectKey":"ksyun_3.flv",

                "DstAcl":"public-read",

                "ExtParam":""

            }

        ],

        "IsTop":"1",

        "CbUrl":"http://www.ksyun.com",

        "CbMethod":"callback",

        "TaskStatus":"succ",

        "ErrorCode":"0",

        "ErrorMsg":"",

        "CreateTime":"2016-08-16 11:13:29"

    },

    "ErrNum":0,

    "ErrMsg":"success"

}

金山云,开启您的云计算之旅

免费注册