/api/channel/dashboard

获取全局通道统计信息及指定的通道信息

需要通道查看权限

接口原型

协议 HTTP/HTTPS GET
URL ip[:port]/api/channel/dashboard
数据格式 响应消息:Content-Type: application/json

请求URL参数

参数 描述
start 开始序号
count 返回的最大数量
live 设置为1,则只获取当前live的通道
output-start 可选参数,用于设置channel中的output的开始索引,如不配置默认为0
output-count 可选参数,用于设置channel中的output返回数量,如不配置默认为10个
client-start 可选参数,用于设置channel中的client的开始索引,如不配置默认为0
client-count 可选参数,用于设置channel中的client返回数量,如不配置默认为10个
history 可选参数,设置为1将返回所有通道总流量的历史数据
sort 排序方式,目前仅支持name, 如果不提供则是默认的按照加入时间进行排序
order 指定升序还是降序,可设置:descending, ascending,只有当sort指定了name时才有效,否则为非法

请求示例

GET /api/channel/dashboard?count=3&history=0&output-count=2&start=0 HTTP/1.1
Accept: application/json, text/plain, */*
Cookie: mwcloud-sid=OCXWUMGEYPGIAWWOETYXPNMVHDZIAZJP; mwcloud-uid=Admin;

响应参数

Response Header
参数 描述
Content-Type 取值为:'application/json; charset=UTF-8'
Response Body
参数 描述
result 返回码
info 通道全局统计信息
channels 通道列表,参考通道列表
通道全局统计信息
参数 描述
date-time 服务器当前系统时间,单位秒
channel 全局通道统计信息,参考全局通道数量信息
data-in 所有通道总的接收数据统计信息,参考网络数据统计信息
data-out 所有通道总的发送的数据统计信息,参考网络数据统计信息
全局通道数量信息
参数 描述
enable-num 当前已启用的通道数量
limit-num 当前最大可启用通道数量
live-num 当前正常直播的通道数量
limit-create-num 最大可创建的通道数量
used-num 已创建的通道数量
网络数据统计信息
参数 描述
mbps-s 每秒的数据流量,单位Mb
mbps-m 过去一分钟的平均码率统计,单位Mb
mbps-h 过去一小时的平均码率统计,单位Mb
hist-s 过去60秒的历史数据流量,单位Mb,只有设置请求参数history为1时才存在
hist-m 过去60分钟的历史数据流量,单位Mb,只有设置请求参数history为1时才存在
通道列表
参数 描述
list 列表形式的通道详细信息,每个通道的数据结构参考通道统计信息
start 通道的开始计数与调用参数start对应
total 服务器上总共的通道数量

响应示例

{
    "channels": {
        "list": [
            {
                "config": {
                    "enable": true,
                    "play-key": "PULL-69A8534C-0619-4745-A882-1C6951C24D66",
                    "protocol": {
                        "prefer": 1,
                        "rtmp": true,
                        "srt": true
                    },
                    "push-key": "PUSH-29CACFC0-DFAF-45FF-9200-BA6A53708986"
                },
                "id": 100054,
                "input": {
                    "addr": "",
                    "conn-state": 10,
                    "device": {
                        "is-online": true,
                        "product-id": 790,
                        "sn": "C316230601002",
                        "warn": 0
                    },
                    "id": 20,
                    "kbps": 33647,
                    "name": "Ultra Encode C316230601002",
                    "protocol": 1,
                    "state": 2,
                    "type": 257
                },
                "name": "%9",
                "preview": {
                    "img-url": "998190d3-c8a6-486f-bd1c-e6731ca46895",
                    "video-url": {
                        "flv": "PULL-69A8534C-0619-4745-A882-1C6951C24D66"
                    }
                },
                "state": 2,
                "status": {
                    "in-kbps": 33647,
                    "living-time-s": 103076,
                    "num-client": 0,
                    "out-kbps": 0
                },
                "url": {
                    "rtmp": {
                        "app": "live",
                        "play": "PULL-69A8534C-0619-4745-A882-1C6951C24D66",
                        "port": 1935,
                        "push": "PUSH-29CACFC0-DFAF-45FF-9200-BA6A53708986"
                    },
                    "srt": {
                        "passphrase": "1234567890",
                        "play": "PULL-69A8534C-0619-4745-A882-1C6951C24D66",
                        "port": 80,
                        "push": "PUSH-29CACFC0-DFAF-45FF-9200-BA6A53708986"
                    }
                }
            },
            {
                "config": {
                    "enable": true,
                    "play-key": "PULL-6346FFC8-5AC5-45B3-AA5C-886F56C54676",
                    "protocol": {
                        "prefer": 1,
                        "rtmp": true,
                        "srt": true
                    },
                    "push-key": "PUSH-29D40DE2-EDED-4C28-A364-C4FE5C8ACFC7"
                },
                "id": 100053,
                "name": "#1s",
                "outputs": {
                    "list": [
                        {
                            "conn-state": 2,
                            "id": 11089,
                            "is-serv": true,
                            "kbps": 0,
                            "living-time-s": 0,
                            "name": "rtsp_test",
                            "num-clients": 0,
                            "protocol": 16,
                            "state": 2,
                            "type": 514
                        }
                    ],
                    "start": 0,
                    "total": 1
                },
                "preview": {
                    "img-url": "43e6edba-b2e6-4041-b442-5a0d610970af"
                },
                "state": 2,
                "status": {
                    "in-kbps": 0,
                    "num-client": 0,
                    "out-kbps": 0
                },
                "url": {
                    "rtmp": {
                        "app": "live",
                        "play": "PULL-6346FFC8-5AC5-45B3-AA5C-886F56C54676",
                        "port": 1935,
                        "push": "PUSH-29D40DE2-EDED-4C28-A364-C4FE5C8ACFC7"
                    },
                    "srt": {
                        "passphrase": "1234567890",
                        "play": "PULL-6346FFC8-5AC5-45B3-AA5C-886F56C54676",
                        "port": 80,
                        "push": "PUSH-29D40DE2-EDED-4C28-A364-C4FE5C8ACFC7"
                    }
                }
            },
            {
                "config": {
                    "enable": false,
                    "play-key": "%",
                    "protocol": {
                        "prefer": 1,
                        "rtmp": true,
                        "srt": true
                    },
                    "push-key": "@"
                },
                "id": 100052,
                "input": {
                    "addr": "",
                    "conn-state": 0,
                    "device": {
                        "is-online": false,
                        "product-id": 787,
                        "sn": "A313220727002",
                        "warn": 0
                    },
                    "id": 1,
                    "kbps": 0,
                    "name": "ultra encode AIO 7002",
                    "protocol": 0,
                    "state": 0,
                    "type": 257
                },
                "name": "change2",
                "outputs": {
                    "list": [
                        {
                            "conn-state": 0,
                            "id": 11082,
                            "kbps": 0,
                            "living-time-s": 0,
                            "mode": "caller",
                            "name": "srt-233-mediahub-47",
                            "protocol": 2,
                            "report": {
                                "pkt-drop": 0,
                                "pkt-drop-total": 0,
                                "pkt-loss": 0.0
                            },
                            "state": 0,
                            "type": 514
                        },
                        {
                            "conn-state": 0,
                            "id": 11081,
                            "kbps": 0,
                            "living-time-s": 0,
                            "mode": "caller",
                            "name": "srt-233-mediahub-46",
                            "protocol": 2,
                            "report": {
                                "pkt-drop": 0,
                                "pkt-drop-total": 0,
                                "pkt-loss": 0.0
                            },
                            "state": 0,
                            "type": 514
                        }
                    ],
                    "start": 0,
                    "total": 3
                },
                "state": 1,
                "url": {
                    "rtmp": {
                        "app": "live",
                        "play": "%",
                        "port": 1935,
                        "push": "@"
                    },
                    "srt": {
                        "passphrase": "1234567890",
                        "play": "%",
                        "port": 80,
                        "push": "@"
                    }
                }
            }
        ],
        "start": 0,
        "total": 53
    },
    "clients": {
        "current-num": 0,
        "limit-num": 30
    },
    "info": {
        "channel": {
            "enable-num": 2,
            "limit-create-num": 1000,
            "limit-num": 1000,
            "live-num": 1,
            "used-num": 53
        },
        "data-in": {
            "mbps-h": 32.996239700734286,
            "mbps-m": 33.01496862192623,
            "mbps-s": 33.2822265625
        },
        "data-out": {
            "mbps-h": 0.0,
            "mbps-m": 0.0,
            "mbps-s": 0.0
        },
        "date-time": 0
    },
    "result": 0
}

与“”相关结果约

    找不到与“”相关的结果

    与“”相关结果约

      找不到与“”相关的结果