Uplink Traffic Statistics
Last Updated:2020-09-17
This interface is used to query upstream traffic & bandwidth data
Method | Path | Description |
---|---|---|
POST | /v2/stat/upload_detail?type=all/dsa/static | The type parameter specifies the data type to be queried. “all " queries total data, “dsa " queries dynamic data, and “static " queries static data. The default value is “all”. |
Request body
Parameter | Optional | Type | Description |
---|---|---|---|
startTime | Optional | Timestamp | Start time of the time range queried, the default is 24 hours ahead of the endTime, UTC time. |
endTime | Optional | Timestamp | End value of the time range queried, the default is the current time. UTC time |
period | Optional | unsigned int | Time granularity of the query, in seconds, the default value is 300s. |
domains | Optional | list<domain> | List of domain names to be queried, when the list is empty, query data of all domain names of the user |
level | Optional | string | Specify to query global, edge data or central node data. "internal " means querying central node data, “edge " means querying edge node data, and “overall " means querying global data. The default is ““overall ". |
isBandwidth | Optional | bool | Specify to query traffic or bandwidth data. When it is true, query bandwidth data; when it is false, query traffic data. The default value is false. |
Response body
Parameter | Optional | Type | Description |
---|---|---|---|
details | Required | array(map<time:timesmap>, map<key:value>) | Query results, where timesmap is in UTC time format。 When the key is flow or bps, it means the value is traffic data or bandwidth data. When isBandwidth is false, the value of key is flow, otherwise it is bps |
count | Required | unsigned int | The queried data number |
Request example - total bandwidth global data
/v2/stat/upload?stat_type=all
{
"startTime": "2019-12-31T00:00:00Z",
"endTime": "2019-12-31T00:10:00Z",
"period": 300,
"isBandwidth": false,
"keys": []
}
Return example
{
"count": 2,
"details": [
{
"flow": 1710549,
"time": "2019-12-31T00:00:00Z"
},
{
"flow": 1432608,
"time": "2019-12-31T00:05:00Z"
}
]
}