#
Statistics
#
Statistics
The Statistics API returns an ordered array of statistical data. It's usually used to render a table.
GET https://msp_domain/v2/stats/:type
Header
Path
Query String
Response
200 Success
A JSON array of Statistics
[
{
"meta": {
"gid":"00000000-0000-0000-0000-000000000000",
"name":"My Gold",
"model":"gold"
},
"value": 20
},
{
"meta": {
"gid":"00000000-0000-0000-0000-000000000001",
"name":"My Purple",
"model":"purple"
},
"value": 10
}
]
401 Permission Denied
Examples
const axios = require('axios');
// Change these three configurations to what you need
const msp_domain = process.env.msp_domain || "mydomain.firewalla.net";
const token = process.env.token || "your_personal_access_token";
const type = process.env.type || "topBoxesByBlockedFlows";
const group = process.env.group || "137";
axios({
method: 'get',
url: `https://${msp_domain}/v2/stats/${type}?group=${group}`,
headers: {
Authorization: `Token ${token}`,
"Content-Type": "application/json"
}
}).then((res) => {
let data = res.data;
console.log(data);
})
curl --request GET \
--url "https://${msp_domain}/v2/stats/${type}?group=${group}" \
--header "Authorization: Token ${your_personal_access_token}"
#
Simple Statistics
This API gives a set of simple statistical numbers. Check out Simple Statistics for more details
GET https://msp_domain/v2/stats/simple
Header
Query String
Response
200 Success
A JSON representation of Simple Statistic
{
"onlineBoxes": 12,
"offlineBoxes": 4,
"alarms": 48,
"rules": 32
}
401 Permission Denied
Examples
const axios = require('axios');
// Change these three configurations to what you need
const msp_domain = process.env.msp_domain || "mydomain.firewalla.net";
const token = process.env.token || "your_personal_access_token";
const group = process.env.end || "137";
axios({
method: 'get',
url: `https://${msp_domain}/v2/stats/simple?group=${group}`,
headers: {
Authorization: `Token ${token}`,
"Content-Type": "application/json"
}
}).then((res) => {
let data = res.data;
console.log(data);
})
curl --request GET \
--url "https://${msp_domain}/v2/stats/simple?group=${group}" \
--header "Authorization: Token ${your_personal_access_token}"