统计分析接口
更新时间:2024-08-30
数据查询
按照聚合条件查询流量带宽、媒资存储统计信息
请求语法
GET /v2/statistic HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: <utc-date-string>
connection: keep-alive
accept: */*
host: vod.bj.baidubce.com
x-bce-request-id: <bce-request-id>
content-type: application/json
authorization: <bce-authorization-string>
请求头域
无特殊请求头域。
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
metric | query | string | 是 | 查询指标,存储用量media_storage,流量cdn_flow,请求数cdn_pv,状态码cdn_status_code,请求命中率cdn_pv_hit,流量命中率cdn_flow_hit |
startTime | query | string | 是 | 开始时间 |
endTime | query | string | 是 | 结束时间 |
domain | query | string | 否 | 域名,查询CDN相关指标时指定 |
请求示例
GET /v2/statistic?metric=cdn_flow&startTime=2024-08-21T16:00:00Z&endTime=2024-08-22T15:59:59Z&domain=test.vod.e-web.com.cn HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: 2024-03-24T13:08:44Z
host: vod.bj.baidubce.com
accept: */*
connection: keep-alive
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2024-03-24T13:08:44Z/1800/host;x-date/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
响应头域
无特殊响应头域。
响应参数
响应示例
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
Cache-Control: no-cache
Server: BWS
Date: Tue, 24 Mar 2024 13:08:44 GMT
Content-Type: application/json;charset=UTF-8
{
"data": [
{
"time": "2024-08-21T16:00:00Z",
"value": 0.0,
"flow": 0.0,
"bps": 0.0
},
{
"time": "2024-08-21T16:05:00Z",
"value": 0.0,
"flow": 0.0,
"bps": 0.0
},
// ......此处每五分钟为一个汇聚结果
{
"time": "2024-08-22T15:50:00Z",
"value": 0.0,
"flow": 0.0,
"bps": 0.0
},
{
"time": "2024-08-22T15:55:00Z",
"value": 0.0,
"flow": 0.0,
"bps": 0.0
}
]
}