旁路推流(FLS / 平台任务)
构建时从公开 REST 接口定义的 `streaming` 标签生成:方法、路径、参数、请求体、响应与 curl。
分组概览
本页由公开 REST 接口定义在构建时生成:标签 streaming,共 10 个操作(全量 189 个)。鉴权、信封与分页约定见 REST API 总览.
| 方法 | 路径 | 摘要 |
|---|---|---|
GET | /v1/projects/{appid}/fls/entry_points | Agora FLS: list entry points |
POST | /v1/projects/{appid}/fls/entry_points | Agora FLS: create an entry point |
DELETE | /v1/projects/{appid}/fls/entry_points/{entryPoint} | Agora FLS: delete an entry point |
PUT | /v1/projects/{appid}/fls/entry_points/{entryPoint}/admin/record/standard/regions/{region}/tasks | Agora FLS: start pushing a stream name |
DELETE | /v1/projects/{appid}/fls/entry_points/{entryPoint}/admin/record/standard/regions/{region}/tasks/{streamName} | Agora FLS: stop pushing a stream name |
GET | /v1/streams | List streaming tasks |
POST | /v1/streams | Start a RTMP/HLS streaming task |
GET | /v1/streams/{id} | Get a streaming task |
POST | /v1/streams/{id}/heartbeat | Viewer heartbeat (resets idle timeout) |
POST | /v1/streams/{id}/stop | Stop a streaming task |
操作详情
GET /v1/projects/{appid}/fls/entry_points
Agora FLS: list entry points
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | { entryPoints } (sorted strings) — FlsEntryPointList |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/projects/$APP_ID/fls/entry_points" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/projects/{appid}/fls/entry_points
Agora FLS: create an entry point
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
id | query | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | { entryPoint, entryPoints } — FlsEntryPoint |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/projects/$APP_ID/fls/entry_points?id=weekly-sync_1a2b" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"DELETE /v1/projects/{appid}/fls/entry_points/{entryPoint}
Agora FLS: delete an entry point
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
entryPoint | path | 是 | string | pattern ^[A-Za-z0-9_-]{1,64}$ |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | { deleted, entryPoint } — FlsEntryPointDelete |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/v1/projects/$APP_ID/fls/entry_points/live" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PUT /v1/projects/{appid}/fls/entry_points/{entryPoint}/admin/record/standard/regions/{region}/tasks
Agora FLS: start pushing a stream name
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
entryPoint | path | 是 | string | pattern ^[A-Za-z0-9_-]{1,64}$ |
region | path | 是 | enum(cn | ap | na | eu) | |
id | query | 是 | string | |
cname | query | string |
响应
| 状态码 | 说明 / schema |
|---|---|
202 | { streamName, taskId, state, region } — FlsTaskAccepted |
调用示例
curl -s -X PUT "$NIMEET_API_BASE/v1/projects/$APP_ID/fls/entry_points/live/admin/record/standard/regions/cn-shanghai/tasks?id=weekly-sync_1a2b&cname=weekly-sync" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"DELETE /v1/projects/{appid}/fls/entry_points/{entryPoint}/admin/record/standard/regions/{region}/tasks/{streamName}
Agora FLS: stop pushing a stream name
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
entryPoint | path | 是 | string | pattern ^[A-Za-z0-9_-]{1,64}$ |
region | path | 是 | enum(cn | ap | na | eu) | |
streamName | path | 是 | string | pattern ^[A-Za-z0-9_-]{1,128}$ |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | { streamName, taskId, state } — FlsTaskStop |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/v1/projects/$APP_ID/fls/entry_points/live/admin/record/standard/regions/cn-shanghai/tasks/weekly-sync_1a2b" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /v1/streams
List streaming tasks
鉴权:项目凭证(customerId:customerSecret 的 Base64)
响应
| 状态码 | 说明 / schema |
|---|---|
200 | { total, streams } — StreamingTaskList |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/streams" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/streams
Start a RTMP/HLS streaming task
鉴权:项目凭证(customerId:customerSecret 的 Base64)
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
channelName | string | 是 | |
entryPoint | string | 默认 "live" | |
streamName | string | ||
rtmpUrl | string | ||
hls | boolean | 默认 true | |
idleTimeoutSeconds | integer | 默认 300 | |
maxDurationSeconds | integer | ||
idempotencyKey | string |
{
"channelName": "weekly-sync",
"entryPoint": "live",
"hls": true,
"idleTimeoutSeconds": 300
}响应
| 状态码 | 说明 / schema |
|---|---|
202 | accepted — StreamingTask |
403 | Banned or service not enabled — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/streams" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"channelName":"weekly-sync","entryPoint":"live","hls":true,"idleTimeoutSeconds":300}'GET /v1/streams/{id}
Get a streaming task
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
id | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | task — StreamingTask |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/streams/weekly-sync_1a2b" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/streams/{id}/heartbeat
Viewer heartbeat (resets idle timeout)
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
id | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the task with a refreshed lastActiveAt — StreamingTask |
404 | Resource not found — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/streams/weekly-sync_1a2b/heartbeat" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/streams/{id}/stop
Stop a streaming task
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
id | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the stopped task (same shape as GET /v1/streams/{id}) — StreamingTask |
404 | Resource not found — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/streams/weekly-sync_1a2b/stop" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"本分组用到的 Schema
Error — object{ code, message, reason, sdkCode, details }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | string | 是 | stable machine code, see errors.json |
message | string | 是 | |
reason | string | ||
sdkCode | integer | Agora-aligned client error number | |
details | object |
FlsEntryPoint — object{ entryPoint, entryPoints }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
entryPoint | string | 是 | |
entryPoints | array<string> | 是 |
FlsEntryPointDelete — object{ deleted, entryPoint }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
deleted | boolean | 是 | |
entryPoint | string | 是 |
FlsEntryPointList — object{ entryPoints }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
entryPoints | array<string> | 是 |
FlsTaskAccepted — object{ streamName, taskId, state, region }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
streamName | string | 是 | |
taskId | string | 是 | |
state | enum(starting | running | stopping | stopped | failed | expired) | 是 | |
region | string | 是 |
FlsTaskStop — object{ streamName, taskId, state }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
streamName | string | 是 | |
taskId | string | 是 | |
state | enum(starting | running | stopping | stopped | failed | expired) | 是 |
StreamingTask — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | ||
channelName | string | ||
entryPoint | string | ||
streamName | string | ||
rtmpUrl | string | ||
hlsUrl | string | ||
state | enum(starting | running | stopping | stopped | failed | expired) | ||
idleTimeoutSeconds | integer | ||
lastActiveAt | string | format date-time | |
error | string | null |
StreamingTaskList — object{ total, streams }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
total | integer | 是 | |
streams | array<object> | 是 |