获取视频流列表
功能介绍
此接口用于获取所有视频流的详细信息。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET /v1/{project_id}/streams
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取方法请参考获取项目ID |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
offset |
否 |
Integer |
查询的开始位置,取值范围为0~100000,必须与limit一起使用。与limit同时缺省时,返回所有结果。该参数适用于所有查询列表的接口。如果offset超过数据总条数,则结果返回空列表。 |
limit |
否 |
Integer |
返回结果的最大条目数,取值范围为1~1000,必须与offset一起使用。与offset同时缺省时,返回所有结果。该参数适用于所有查询列表的接口。 |
sort |
否 |
String |
返回结果的排序规则。
默认为ASC,需要有offset和limit参数,sort参数才会生效。 |
order_by |
否 |
String |
选择按一个字段排序,可选值如下。
默认为created_at,按照创建时间排序。需要有offset和limit参数,order_by参数才会生效。 |
name |
否 |
String |
按照视频流名称过滤,支持模糊查询。 |
stream_state |
否 |
String |
按视频流状态过滤,可选值如下。
不区分大小写。 |
retention_state |
否 |
String |
按视频流转储状态过滤,可选值如下。
不区分大小写。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
普通租户的token。 |
Authorization |
否 |
String |
使用AK/SK方式认证时必选,携带的鉴权信息。 |
X-Sdk-Date |
否 |
String |
使用AK/SK方式认证时必选,请求的发生时间。 |
X-Project-Id |
否 |
String |
使用AK/SK方式认证时必选,携带项目ID信息。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
stream_id |
String |
视频流ID。 |
name |
String |
视频流名称。 |
encode_type |
String |
视频流编码格式。 |
access_type |
String |
视频接入类型。 |
access_key |
String |
RTMP视频流的密钥。接入类型(access_type)为RTMP时,才有该参数。 |
url |
String |
HTTP-FLV视频流的地址。接入类型(access_type)为HTTP-FLV时,才有该参数。 |
transfer_protocol |
String |
GB视频传输协议(TCP|UDP)。只有当视频介入类型为GB/T28181时,才有该参数。 |
share_type |
String |
视频流共享类型。
|
state |
String |
视频流状态。
|
retention |
retention object |
视频流转储信息。 |
retention_state |
String |
按视频流转储状态过滤,可选值如下。
不区分大小写。 |
created_at |
String |
视频流创建时间。 |
updated_at |
String |
视频流更新时间。 |
请求示例
GET /v1/3266392d188c47d09948b1**********/streams
响应示例
状态码: 200
正常
[ {
"access_type" : "RTMP",
"updated_at" : "2018-12-25T12:59:37Z",
"share_type" : "PUBLIC",
"stream_id" : "stream-0BOPSRsT",
"access_key" : "ALKJOWLKJSDNFGO******KSJDF",
"name" : "stream_test1",
"created_at" : "2018-12-25T12:59:37Z",
"description" : "",
"state" : "ACTIVE",
"retention_state" : "ACTIVE",
"tag" : [ {
"key" : "group"
}, {
"value" : "number1"
} ],
"retention" : {
"bucket" : "iva-ly-test",
"path" : "testRetention",
"timezone" : "GMT+08:00",
"retention_in_hour" : 1,
"retention_forever" : false,
"store_type" : "OBS",
"slice_in_minute" : 5
},
"encode_type" : "H264"
}, {
"access_type" : "HTTP-FLV",
"updated_at" : "2018-12-25T12:59:37Z",
"share_type" : "PUBLIC",
"stream_id" : "stream-9IzU3TdL",
"url" : "https://xxxxxxxx.com/live",
"name" : "RTMP******",
"created_at" : "2018-12-25T12:59:37Z",
"description" : "",
"state" : "ACTIVE",
"retention_state" : "ACTIVE",
"tag" : [ {
"key" : "group",
"value" : "number1"
} ],
"retention" : {
"bucket" : "iva-ly-test",
"path" : "testRetention/",
"timezone" : "GMT+08:00",
"retention_in_hour" : 1,
"retention_forever" : false,
"store_type" : "OBS",
"slice_in_minute" : 5
},
"encode_type" : "H264"
}, {
"access_type" : "GB/T28181",
"updated_at" : "2018-12-25T10:52:00Z",
"share_type" : "PUBLIC",
"stream_id" : "stream-0P5g9fQ2",
"access_key" : "0000",
"name" : "channel_9339084235132000****",
"created_at" : "2018-12-25T10:52:00Z",
"description" : "",
"state" : "STOPPED",
"retention_state" : "STOPPED",
"tag" : [ ],
"encode_type" : "H265"
} ]
状态码: 400
请求错误。具体返回错误码请参考错误码说明
{
"error_msg" : "Invalid request parameter, url can not be null or empty when access type is HTTP-FLV.",
"error_code" : "VIS.0005"
}
状态码
状态码 |
描述 |
---|---|
200 |
正常 |
400 |
请求错误。具体返回错误码请参考错误码说明 |