You need to enable JavaScript to run this app.
导航

查询峰值流数

最近更新时间2024.04.22 15:52:28

首次发布时间2023.09.25 14:36:18

调用 DescribeLiveStreamCountData 接口,查询时间范围内指定推流、回源流或转码流的峰值数量。

注意事项

  • 请求频率:单用户请求频率限制为 30 次/秒
  • 数据延迟:数据延迟为 5 分钟

请求说明

  • 请求方式:POST
  • 请求地址:https://live.volcengineapi.com?Action=DescribeLiveStreamCountData&Version=2023-01-01

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

Query

参数类型是否必选示例值描述
ActionStringDescribeLiveStreamCountData接口名称。当前 API 的名称为 DescribeLiveStreamCountData
VersionString2023-01-01接口版本。当前 API 的版本为 2023-01-01

Body

参数类型是否必选示例值描述
DomainListArray of String["push.exmaple.com","push2.example.com"]直播流使用的域名列表,默认为空,表示查询所有全部域名下的直播流。您可以调用 ListDomainDetail 接口或在视频直播控制台的域名管理页面,查看直播流使用的域名。
StartTimeString2021-08-16T00:00:00+08:00查询的开始时间,RFC3339 格式的时间戳,精度为秒。
EndTimeString2021-08-16T00:01:59+08:00查询的结束时间,RFC3339 格式的时间戳,精度为秒。

Aggregation

Integer

60

聚合的时间粒度,单位为秒,支持的时间粒度如下所示。

  • 60:1 分钟。时间粒度为 1 分钟时,单次查询最大时间跨度为 24 小时,历史查询时间范围为 366 天;
  • 300:(默认值)5 分钟。时间粒度为 5 分钟时,单次查询最大时间跨度为 31 天,历史查询时间范围为 366 天;
  • 3600:1 小时。时间粒度为 1 小时时,单次查询最大时间跨度为 93 天,历史查询时间范围为 366 天;
  • 86400:1 天。时间粒度为 1 天时,单次查询最大时间跨度为 93 天,历史查询时间范围为 366 天。

DetailField

Array of String

["Domain"]

数据拆分的维度,缺省情况下不进行数据拆分,支持的维度如下所示。

  • Domain:域名。

说明

配置数据拆分维度时,对应的维度参数传入多个值时会返回按维度进行拆分的数据;对应的维度只传入一个值时不返回按此维度进行拆分的数据。

StreamType

Array of String

["push"]

流类型,缺省情况下表示全部类型,支持的流类型取值如下。

  • push:推流;
  • relay-source:回源流;
  • transcode:转码流。

返回参数

下表仅列出该接口特有的返回参数。更多信息请见返回结构

参数类型示例值描述
DomainListArray of String["push.example.com","push2.example.com"]域名列表。
StartTimeString2021-08-16T00:00:00+08:00查询的开始时间,RFC3339 格式的时间戳,精度为秒。
EndTimeString2021-08-16T00:01:59+08:00查询的结束时间,RFC3339 格式的时间戳,精度为秒。

Aggregation

Integer

60

数据聚合的时间粒度,单位为秒。

  • 60:1 分钟;
  • 300:5 分钟;
  • 3600:1 小时;
  • 86400:1 天。

DetailField

Array of String

["Domain"]

数据拆分的维度,维度说明如下所示。

  • Domain:域名。

StreamType

Array of String

["push"]

流类型,流类型说明如下。

  • push:拉流;
  • relay-source:回源流;
  • transcode:转码流。
PeakCountInteger100当前查询条件下流数最大值。
TotalStreamDataListArray of TotalStreamDataList-所有时间粒度的数据。
StreamDetailDataListArray of StreamDetailDataList-按维度拆分后的数据。

TotalStreamDataList

参数类型示例值描述
TimeStampString2021-08-16T00:00:00+08:00数据按时间粒度聚合时,每个时间粒度的开始时间,RFC3339 格式的时间戳,精度为秒。
PeakCountInteger100当前数据聚合时间粒度内的流数最大值。

StreamDetailDataList

参数类型示例值描述
DomainStringpush.example.com按域名维度进行数据拆分时的域名信息。
TotalStreamDataListArray of TotalStreamDataList-按维度进行数据拆分后,当前维度下的所有时间粒度数据。

请求示例

POST https://live.volcengineapi.com?Action=DescribeLiveStreamCountData&Version=2023-01-01
{
  "DomainList": [
    "push.example.com",
    "push2.example.com"
  ],
  "StartTime": "2021-08-16T00:00:00+08:00",
  "EndTime": "2021-08-16T00:01:59+08:00",
  "Aggregation": 60,
  "DetailField": [
    "Domain"
  ],
  "StreamType": [
    "pull",
    "relay-source"
  ]
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "201806041104200100100232280022D30",
    "Action": "DescribeLiveSourceStreamCountData",
    "Version": "2023-01-01",
    "Service": "live",
    "Region": "cn-north-1"
  },
  "Result": {
    "DomainList": [
      "push.example.com",
      "push2.example.com"
    ],
    "StartTime": "2021-08-16T00:00:00+08:00",
    "EndTime": "2021-08-16T00:01:59+08:00",
    "Aggregation": 60,
    "DetailField": [
      "Domain"
    ],
    "StreamType": [
      "pull",
      "relay-source"
    ],
    "PeakCount": 100,
    "TotalStreamDataList": [
      {
        "TimeStamp": "2021-08-16T00:00:00+08:00",
        "PeakCount": 100
      }
    ],
    "StreamDetailDataList": [
      {
        "Domain": "push.example.com",
        "TotalStreamDataList": [
          {
            "TimeStamp": "2021-08-16T00:00:00+08:00",
            "PeakCount": 100
          }
        ]
      },
      {
        "Domain": "push2.example.com",
        "TotalStreamDataList": [
          {
            "TimeStamp": "2021-08-16T00:00:00+08:00",
            "PeakCount": 100
          }
        ]
      }
    ]
  }
}

错误码

下表仅列出本接口特有的错误码。更多信息请参见公共错误码获取详细信息。

状态码错误码错误信息说明
200CommonErr-未分类错误。建议重试,如果仍返回该错误码,请联系技术支持
400InvalidParam-输入的参数无效或不符合要求,请参照请求参数说明进行检查。
400InvalidParam.BindErrorRequest parameter error, please check input data参数未通过校验,请检查参数类型是否正确。
403RequestForbidden-请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。
403RequestForbidden.AccountIDNotAllowthis AccountID does not have permission to access the corresponding resource, please check the request parameters请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。
403RequestForbidden.BillingStatusBilling status is not available for the AccountID, please activate the service or recharge.未开通视频直播服务或账号欠费,造成账单不可用,请检查服务开通情况和账号欠费情况。
404ResourceNotFound-未找到资源(域名空间、域名、应用、配置模版、证书)。建议重试,如果仍返回该错误码,请联系技术支持
500InternalErroran internal error occurred, please contact the administrator.出现内部错误,请联系技术支持
502InternalServiceErroran internal error occurred, please contact the administrator.服务间出现错误,请联系技术支持
502InternalServiceError.BadResponsean internal error occurred, please contact the administrator.服务间出现错误,请联系技术支持
504InternalServiceTimeoutInternal Service is timeout. please contact the administrator.内部服务超时,请联系技术支持

服务端 SDK

视频直播提供了配套的开发工具集 SDK,支持多种编程语言,帮助您更方便的调用 API。