直播分发
查询直播转码的任务数
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
dateFrom | String | 否 | 开始时间: 1.时间格式为yyyy-MM-ddTHH:mm:ss+08:00,例如,2019-01-01T10:00:00+08:00(为北京时间2018年12月2日10点0分0秒); 2.不能大于当前时间 3.最多可获取最近 30 天的数据。 |
dateTo | String | 否 | 结束时间: 1.时间格式2019-01-02T10:00:00+08:00 2.结束时间需大于开始时间,结束时间如果大于当前时间,取当前时间。 3.dateFrom,dateTo二者都未传,默认查询过去的 30 分钟;如仅有一个未传,抛异常 4.允许查询最大时间间隔:30分钟 |
domain | List | 是 | 域名: 1.可传递域名数量上限默认为200个 2.自动过滤掉非法域名(如传递非法域名,会被过滤掉,查询结果只返回合法域名的数据)。 |
参数名称 | 类型 | 描述 |
---|---|---|
code | String | 请求结果状态码 |
message | String | 请求结果信息 |
data | List | 请求结果的详细数据 |
timestamp | String | 时间片 每一个时间片数据值代表的是前一个时间粒度范围内的数据值,比如yyyy-MM-dd 00:01,代表00:00到00:51范围内的数据。 返回开始时间和结束时间包含的时间片。 |
dataDetail | List | |
domain | String | 域名 |
h265 | String | 1 or 0 , 1 代表 H265 转码,0 代表 H264 转码。 |
transcodeNum | String | 转码数量 |
duration | String | 转码时长 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
24102013 | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json和xml格式,默认为json格式 |
24102002 | There was an error in the body of your HTTP request. | 400 | 请求体格式错误 |
24102006 | The date specified is invalid. | 400 | dateFrom或dateTo不符合规范或时间区间不合法 |
24102007 | You cannot specify a period greater than xx minutes. | 400 | dateFrom和dateTo相差超过限制值 |
24102021 | Date format error | 400 | 日期格式错误 |
24102019 | The request was rejected because the number of domain(xx) exceeds the limit (xx). | 400 | 传递的域名个数超过账号限制 |
24102008 | param: domain is null or invalid. | 400 | 参数domain不符合规范 |
24102500 | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
#!/bin/bash username="example_username" apiKey="example_apiKey" date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"` password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64` curl -i --url "https://open.chinanetcenter.com/api/report/stream/task-number" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{ "dateFrom": "2020-03-17T07:58:00+08:00", "dateTo": "2020-03-17T08:10:00+08:00", "domain": ["abc.linlytest.com","www.linly.com","cly.linly.com","test3.linly.com"] }'
{ "code": "0", "message": "success", "data": [ { "timestamp": "2020-03-17 08:00", "dataDetail": [ { "domain": "test3.linly.com", "h265": "1", "transcodeNum": "10", "duration": "47000" } ] }, { "timestamp": "2020-03-17 08:01", "dataDetail": [ { "domain": "www.linly.com", "h265": "0", "transcodeNum": "20", "duration": "89000" } ] } ] }