更新时间:2025-10-16 GMT+08:00
分享

创建流

功能介绍

创建流

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

POST /v1/{project_id}/flows

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方法请参考获取项目ID。

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token,使用Token鉴权方式时为必填项。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

Authorization

String

使用AK/SK方式认证时必填,携带的鉴权信息。

X-Sdk-Date

String

请求的发生时间,使用AK/SK方式认证时为必填项。

X-Project-Id

String

使用AK/SK方式认证时为必填项,携带项目ID信息。

表3 请求Body参数

参数

是否必选

参数类型

描述

name

String

流名称

region

String

区域

sources

Array of FlowSource objects

入流信息

表4 FlowSource

参数

是否必选

参数类型

描述

source_listener_address

String

拉流地址

source_listener_port

Integer

拉流端口,2077/2088不可选

stream_id

String

srt拉流streamid

min_latency

Integer

最小时延,单位ms

cidr_whitelist

Array of strings

推流CIDR IP白名单列表

description

String

描述

protocol

String

协议,srt-caller,srt-listener

name

String

入流资源名称

decryption

FlowSourceDecryption object

StreamConnect flow解密信息,

表5 FlowSourceDecryption

参数

是否必选

参数类型

描述

algorithm

String

加密算法,aes128: 加密算法为aes-128,aes192:加密算法为aes-192,aes256: 加密算法为AES-256

key_type

String

秘钥类型,speke:使用speke协议获取秘钥,static-key:静态秘钥,srt-password:SRT协议秘钥

目前仅支持srt-password类型,其他类型暂不支持

passphrase

String

srt解密秘钥,用于flow对srt流进行解密

响应参数

状态码:201

表6 响应Body参数

参数

参数类型

描述

flow

FlowDetailRespBody object

流信息

表7 FlowDetailRespBody

参数

参数类型

描述

name

String

流名称

region

String

区域

sources

Array of FlowSource objects

入流信息

status

String

状态

flow_id

String

流id

outputs

Array of FlowOutput objects

流输出信息

表8 FlowSource

参数

参数类型

描述

source_listener_address

String

拉流地址

source_listener_port

Integer

拉流端口,2077/2088不可选

stream_id

String

srt拉流streamid

min_latency

Integer

最小时延,单位ms

cidr_whitelist

Array of strings

推流CIDR IP白名单列表

description

String

描述

protocol

String

协议,srt-caller,srt-listener

name

String

入流资源名称

decryption

FlowSourceDecryption object

StreamConnect flow解密信息,

表9 FlowSourceDecryption

参数

参数类型

描述

algorithm

String

加密算法,aes128: 加密算法为aes-128,aes192:加密算法为aes-192,aes256: 加密算法为AES-256

key_type

String

秘钥类型,speke:使用speke协议获取秘钥,static-key:静态秘钥,srt-password:SRT协议秘钥

目前仅支持srt-password类型,其他类型暂不支持

passphrase

String

srt解密秘钥,用于flow对srt流进行解密

表10 FlowOutput

参数

参数类型

描述

name

String

名称

type

String

类型

状态码:400

表11 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

响应示例

状态码

状态码

描述

201

流创建成功响应

400

流创建失败响应

错误码

请参见错误码

相关文档