Media Push
构建时从公开 REST 接口定义的 `media-push` 标签生成:方法、路径、参数、请求体、响应与 curl。
分组概览
本页由公开 REST 接口定义在构建时生成:标签 media-push,共 5 个操作(全量 189 个)。鉴权、信封与分页约定见 REST API 总览.
| 方法 | 路径 | 摘要 |
|---|---|---|
GET | /v1/projects/{appId}/rtmp-converters | List the converters of a project |
POST | /{region}/v1/projects/{appId}/rtmp-converters | Create a Media Push converter |
GET | /{region}/v1/projects/{appId}/rtmp-converters/{converterId} | Get the streaming status of a converter |
PATCH | /{region}/v1/projects/{appId}/rtmp-converters/{converterId} | Update a converter |
DELETE | /{region}/v1/projects/{appId}/rtmp-converters/{converterId} | Destroy a converter |
操作详情
GET /v1/projects/{appId}/rtmp-converters
List the converters of a project
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
cursor | query | string | ||
channel | query | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | converters — object{ success, data } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/v1/projects/appId/rtmp-converters?cursor=value&channel=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /{region}/v1/projects/{appId}/rtmp-converters
Create a Media Push converter
Creates a converter that pushes one RTC channel to a CDN address. Use transcodeOptions for the transcoded mode and rawOptions for passthrough; the converter starts connecting and keeps pushing until it is destroyed or idles out.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
regionHintIp | query | string | format ipv4 |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
converter | object{ name, rtmpUrl, idleTimeout, jitterBufferSizeMs, transcodeOptions, rawOptions } | 是 |
{
"converter": {
"rtmpUrl": "string",
"name": "demo",
"idleTimeout": 1
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | converter created — object{ converter, fields } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
409 | a converter with the same name already exists — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtmp-converters?regionHintIp=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"converter":{"rtmpUrl":"string","name":"demo","idleTimeout":1}}'GET /{region}/v1/projects/{appId}/rtmp-converters/{converterId}
Get the streaming status of a converter
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
converterId | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | converter — object |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtmp-converters/converterId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PATCH /{region}/v1/projects/{appId}/rtmp-converters/{converterId}
Update a converter
Updates the push destination, the transcoding options or the jitter buffer. Name, idle timeout, the RTC channel and the audio/codec profile are immutable, as documented.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
converterId | path | 是 | string | 长度 0..128 |
sequence | query | integer | >= 0 |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
converter | object{ rtmpUrl, jitterBufferSizeMs, transcodeOptions, rawOptions } |
{
"converter": {
"rtmpUrl": "string",
"jitterBufferSizeMs": 1,
"transcodeOptions": {}
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | converter updated — object{ converter, fields } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X PATCH "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtmp-converters/converterId?sequence=0" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"converter":{"rtmpUrl":"string","jitterBufferSizeMs":1,"transcodeOptions":{}}}'DELETE /{region}/v1/projects/{appId}/rtmp-converters/{converterId}
Destroy a converter
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
converterId | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the request succeeded; the response body is empty |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtmp-converters/converterId" \
-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 |