接口描述:調用本接口查詢請求數數數據
請求方式:post
請求路徑:/statistics/query-request-num-data
使用說明:
單個用戶一分鐘限制調用10000次,并發不超過100;
單次查詢輸入域名的個數不能超過100個;
單次查詢輸入結果聚合維度(group_by)的個數不能超過4個;
時間粒度為24h時,查詢開始時間與結束時間需要跨天;
若查詢結束時間不包含在該批次的最后一秒,默認end_time為該批次最后一秒,例如:時間粒度為1h,end_time設置為17:30對應的時間戳,此時end_time默認成17:59:59;
時間片統計數據均為前打點,假如請求5分鐘粒度數據,time_stamp= "2021-10-13 00:00"對應的時間戳,表示統計的數據為時間區間[2021-10-13 00:00, 2021-10-13 00:05);
根據請求參數時間粒度(Interval)和聚合維度(group_by)個數的不同,單次請求可查詢歷史數據范圍,數據延遲,對應如下, 若開始時間超過可查詢歷史數據時間范圍,超過部分的數據為0;
| 時間粒度 | 可查詢歷史數據時間范圍 | 數據延遲 | 2 ≥ 聚合維度個數 ≥ 0 ,支持最大時間跨度 | 4 ≥ 聚合維度個數 >2 支持最大的時間跨度 |
|---|---|---|---|---|
| 1m | 最近31天 | 5分鐘 | 7天 | 3小時 |
| 5m | 最近183天 | 20分鐘 | 31天 | 1天 |
| 1h | 最近183天 | 20分鐘 | 93天 | 3天 |
| 24h | 最近183天 | 20分鐘 | 93天 | 3天 |
請求參數說明(json):
| 參數 | 類型 | 是否必傳 | 名稱 | 描述 |
|---|---|---|---|---|
| start_time | int | 是 | 開始時間戳 | 起始時間,時間戳(秒)。 |
| end_time | int | 是 | 結束時間戳 | 結束時間,時間戳(秒)。 |
| interval | string | 否 | 時間粒度 | 時間粒度,目前支持1m,5m,1h和24h,默認5m。 |
| product_type | List | 否 | 產品類型列表 | 產品類型列表,不傳默認名下所有產品,可多個產品類型,作為統計篩選項。支持:“001”(靜態加速),“003”(下載加速),“004”(視頻點播加速),“008”(CDN加速),“014”(下載加速閑時),“007”(安全加速),“005”(直播加速),“006”(全站加速),“009”(應用加速),“010”(web應用防火墻(邊緣云版)),“011”(高防DDoS(邊緣云版)) |
| domain | list | 否 | 域名列表 | 域名,不傳默認名下所有域名,可多個域名,作為統計篩選項。 |
| province | list | 否 | 省編碼列表 | 省編碼,不傳默認所有省份,可多個省編碼,作為統計篩選項, |
| isp | list | 否 | 運營商編碼列表 | 運營商編碼,不傳默認所有運營商,可多個運營商編碼,作為統計篩選項, |
| network_layer_protocol | string | 否 | 網絡層協議 | 網絡層協議,不傳默認所有網絡層協議,支持作為統計篩選項,可以為ipv4、ipv6,other。 |
| application_layer_protocol | string | 否 | 應用層協議 | 應用層協議,不傳默認所有絡層協議,支持作為統計篩選項,可以為http,https,rtmp,quic,other。 |
| group_by | list | 否 | 結果聚合維度 | 指標在計算結果的聚合維度,不傳或為空默認按照時間粒度聚合,可多個統計維度,可以為product_type,domain,province,isp,network_layer_protocol,application_layer_protocol。 |
返回參數說明:
| 參數 | 類型 | 是否必傳 | 名稱 | 說明 |
|---|---|---|---|---|
| code | int | 是 | 狀態碼 | |
| message | string | 是 | 描述信息 | |
| start_time | int | 是 | 開始時間戳,時間戳(秒) | |
| end_time | int | 是 | 結束時間戳,時間戳(秒) | |
| interval | string | 是 | 時間粒度 | 和輸入保持一致,1m,5m,1h,24h。 |
| req_request_num_data_interval | list | 是 | 每個時間間隔的請求數數據 | |
| req_request_num_data_interval[*].time_stamp | int | 是 | 時間片開始時間戳 | |
| req_request_num_data_interval[*].product_type | string | 否 | 產品類型 | |
| req_request_num_data_interval[*].domain | string | 否 | 域名 | |
| req_request_num_data_interval[*].province | int | 否 | 省編碼 | |
| req_request_num_data_interval[*].isp | string | 否 | 運營商編碼 | |
| req_request_num_data_interval[*].network_layer_protocol | string | 否 | 網絡層協議 | |
| req_request_num_data_interval[*].application_layer_protocol | string | 否 | 應用層協議 | |
| req_request_num_data_interval[*].request_num | int | 是 | 請求數 | |
| req_request_num_data_interval[*].miss_request_num | int | 是 | 回源請求數 | |
| req_request_num_data_interval[*].hit_request_rate | float | 是 | 請求命中率 |
示例:
請求路徑://cdnapi-global.ctapi.daliqc.cn/statistics/query-request-num-data
示例1:
請求參數:
{
"start_time": "1662413100",
"end_time": "1662413700",
"domain": [
"daliqc.cn",
"daliqc.cn1"
],
"group_by": [
"application_layer_protocol"
]}
返回結果:
{
"start_time": 1662413100,
"code": 100000,
"end_time": 1662413700,
"interval": "5m",
"message": "success",
"req_request_num_data_interval": [
{
"hit_request_rate": 95.58,
"time_stamp": 1662413100,
"miss_request_num": 702,
"request_num": 15895,
"application_layer_protocol": "https"
},
{
"hit_request_rate": 94.69,
"time_stamp": 1662413100,
"miss_request_num": 57198,
"request_num": 1076500,
"application_layer_protocol": "http"
},
{
"time_stamp": 1662413100,
"miss_request_num": 0,
"request_num": 0,
"application_layer_protocol": "other"
},
{
"hit_request_rate": 96.2,
"time_stamp": 1662413400,
"miss_request_num": 628,
"request_num": 16513,
"application_layer_protocol": "https"
},
{
"time_stamp": 1662413400,
"miss_request_num": 0,
"request_num": 0,
"application_layer_protocol": "other"
},
{
"hit_request_rate": 95.27,
"time_stamp": 1662413400,
"miss_request_num": 52892,
"request_num": 1118536,
"application_layer_protocol": "http"
},
{
"hit_request_rate": 95.58,
"time_stamp": 1662413700,
"miss_request_num": 50997,
"request_num": 1153702,
"application_layer_protocol": "http"
},
{
"time_stamp": 1662413700,
"miss_request_num": 0,
"request_num": 0,
"application_layer_protocol": "other"
},
{
"hit_request_rate": 95.46,
"time_stamp": 1662413700,
"miss_request_num": 766,
"request_num": 16880,
"application_layer_protocol": "https"
}
]}示例2:
請求參數:
{ "start_time": "1662413100", "domain": [ "daliqc.cn", "daliqc.cn1" ], "group_by": [ "application_layer_protocol" ] }
返回結果:
{ "code": 100007, "message": "無法找到必須的請求參數:end_time" }
錯誤碼請參考:參數code和message含義