获取视频流列表
功能介绍
此接口用于获取所有视频流的详细信息。
调试
您可以在API Explorer中调试该接口。
URI
- URI格式
GET /v1/{project_id}/streams
- 参数说明
参数
是否必选
类型
说明
project_id
是
String
项目ID,获取方法请参见获取项目ID。
请求消息
- 请求样例
GET /v1/{project_id}/streams
- 查询参数说明
参数
是否必选
类型
说明
offset
否
Integer
查询的开始位置,取值范围为1~100000,必须与limit一起使用。
与limit同时缺省时,返回所有结果。该参数适用于所有查询列表的接口。
如果offset超过数据总条数,则结果返回空列表。
limit
否
Integer
返回结果的最大条目数,取值范围为1~1000,必须与offset一起使用。
与offset同时缺省时,返回所有结果。该参数适用于所有查询列表的接口。
sort
否
String
返回结果的排序规则:- ASC:表示升序。
- DESC:表示降序。
默认为“ASC”,需要有“offset”和“limit”参数,“sort”参数才会生效。
order_by
否
String
选择按一个字段排序,可选值为:- encode_type
- access_type
- share_type
- created_at
- name
- state
- retention_state
默认为“created_at”,按照创建时间排序。需要有“offset”和“limit”参数,“order_by”参数才会生效。
name
否
String
按照视频流名称过滤,支持模糊查询。
stream_state
否
String
按视频流状态过滤,可选值为:
- ACTIVE:表示已激活。
- STOPPED:表示未激活。
不区分大小写。
retention_state
否
String
按视频流转储状态过滤,可选值为
- ACTIVE:表示已启用转储。
- STOPPED:表示未启用转储。
不区分大小写。
响应消息
- 响应样例
[ { "access_type": "RTMP", "updated_at": "2018-12-25T12:59:37Z", "share_type": "PUBLIC", "stream_id": "stream-qGjdxQZM", "access_key": "xxxxxx", "name": "stream1", "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-qGjdxQZM", "url": " https://xxxxxxxx.com/live", "name": "stream1", "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": "GB28181", "updated_at": "2018-12-25T10:52:00Z", "share_type": "PUBLIC", "stream_id": "stream-Pc1oIImj", "access_key": "xxxxxx", "name": "channel_93390842351320000001_234123123123123", "created_at": "2018-12-25T10:52:00Z", "description": "", "state": "STOPPED", "retention_state": "STOPPED", "tag": [] "encode_type": "H265" } ]
- 参数说明
参数
类型
说明
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)。只有当视频介入类型为GB28181时,才有该参数。
share_type
String
视频流共享类型:- PRIVATE:非共享。
- PUBLIC:共享。
state
String
视频流状态:- ACTIVE:表示已激活。
- STOPPED:表示已停用。
默认为STOPPED。
retention
Object
转储信息,参见retention参数说明。
retention_state
String
按视频流转储状态过滤,可选值为
- ACTIVE:表示已启用转储。
- STOPPED:表示未启用转储。
不区分大小写。
created_at
String
视频流创建时间。
updated_at
String
视频流更新时间。
- retention参数说明
参数
类型
说明
retention_in_hour
Float
保存时长,以小时为单位。
Retention_forever
Boolbean
是否永久保存。
store_type
String
转储位置,可为“obs”,即存储到华为云对象存储OBS上。
bucket
String
OBS桶名。
path
String
OBS目录。
timezone
String
时区信息。
slice_in_minute
Float
分片长度,以分钟为单位。
取值范围为1~60,默认为5。
返回值
- 正常
- 异常
返回值
说明
400 Bad Request
请求错误。具体返回错误码请参考错误码说明。
401 Unauthorized
鉴权失败。
403 Forbidden
没有操作权限。
404 Not Found
找不到资源或没有开通服务。
500 Internal Server Error
服务内部错误。
503 Service Unavailable
服务不可用。
