Skip to content

Statistic ​

9 operations. Call any of them with omada_call_operation (or, in full tool mode, as a tool named by its operationId).

OperationMethodSummary
getOswRankingCardsPOSTGet switch ranking cards
getOltStatChartPOSTGet olt statistics chart
getOswStackDetailStatPOSTGet switch stack statistics
getStackStatChartPOSTGet stack statistics chart
getSwitchStatGETGet switch statistics
getSwitchStatChartPOSTGet switch statistics chart
getDevice5MinStatisticPOSTGet device statistic data 5 min
getDeviceDailyStatisticPOSTGet device statistic data daily
getDeviceHourlyStatisticPOSTGet device statistic data hourly

getOswRankingCards ​

POST /openapi/v1/{omadacId}/sites/{siteId}/health/switches/rankingCards

Get switch ranking cards

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)

Request body — application/json (required) — schema TimeQueryOpenApiVO

FieldTypeRequiredDescription
startintegeryesStart time, number of seconds from UTC0 1970/01/01
endintegeryesEnd time, number of seconds from UTC0 1970/01/01
json
// omada_call_operation
{
  "operationId": "getOswRankingCards",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Get switch ranking cards
The interface requires one of the permissions:
Incidents Page View Only

getOltStatChart ​

POST /openapi/v1/{omadacId}/sites/{siteId}/stat/olts/{deviceMac}/chart

Get olt statistics chart

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
deviceMacpathstringyesDevice MAC address, like AA-BB-CC-DD-EE-FF

Request body — application/json (required) — schema OltStatQueryOpenApiDTO

FieldTypeRequiredDescription
startintegeryesStart time, number of seconds from UTC0 1970/01/01
endintegeryesEnd time, number of seconds from UTC0 1970/01/01
attrsarray<string>yesAttributes to be queried. Attributes not included in attrs will return a value of 0.Item of attrs should be a value as follows: mem, cpu, up, down, onuCount, tx, rx, txRate, rxRate, txPackets, rxPackets, txBroadcastPackets, rxBroadcastPackets, txMulticastPackets, rxMulticastPackets
oltPortsarray<string>noStatistics of the selected ports of Olt would be queried.
json
// omada_call_operation
{
  "operationId": "getOltStatChart",
  "params": {
    "siteId": "<siteId>",
    "deviceMac": "<deviceMac>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Display statistics based on the time granularity calculated by start and end times:
Within 26 hours, 5 minutes of data is displayed
26 hours to 7 days 2 hours, showing hourly statistics
7 days 2 hours to 120 days 2 hours, showing daily statistics
120 days 2 hours or more, showing weekly statistics
The interface requires one of the permissions:
Site Statics Manager View Only
Site Device Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.

getOswStackDetailStat ​

POST /openapi/v1/{omadacId}/sites/{siteId}/stat/stack/{stackId}

Get switch stack statistics

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
stackIdpathstringyesStack ID

Request body — application/json (required) — schema OswStackStatQueryVO

FieldTypeRequiredDescription
startintegeryesStart time, number of seconds from UTC0 1970/01/01
endintegeryesEnd time, number of seconds from UTC0 1970/01/01
attrsarray<string>yesAttributes to be queried. Attributes not included in attrs will return a value of 0.Item of attrs should be a value as follows: mem, cpu, tx, rx, txRate, rxRate, txPkts, rxPkts, txBroadPkts, rxBroadPkts, txMultiPkts, rxMultiPkts, dropPkts, txErrPkts, rxErrPkts
intervalintegeryesInterval should be a value as follows: 0:5min, 1:hourly, 2:daily
json
// omada_call_operation
{
  "operationId": "getOswStackDetailStat",
  "params": {
    "siteId": "<siteId>",
    "stackId": "<stackId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Get switch stack statistics
The interface requires one of the permissions:
Site Statics Manager View Only
Site Device Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-40200 - This switch stack is not existed.

getStackStatChart ​

POST /openapi/v1/{omadacId}/sites/{siteId}/stat/stack/{stackId}/chart

Get stack statistics chart

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
stackIdpathstringyesStack ID

Request body — application/json (required) — schema OswStackStatQueryOpenApiDTO

FieldTypeRequiredDescription
startintegeryesStart time, number of seconds from UTC0 1970/01/01
endintegeryesEnd time, number of seconds from UTC0 1970/01/01
attrsarray<string>yesAttributes to be queried. Attributes not included in attrs will return a value of 0. Item of attrs should be a value as follows: mem, cpu, tx, rx, txRate, rxRate, txPkts, rxPkts, txBroadPkts, rxBroadPkts, txMultiPkts, rxMultiPkts, dropPkts, txErrPkts, rxErrPkts
standardPortsarray<string>noStatistics of the selected ports of Stack would be queried.
json
// omada_call_operation
{
  "operationId": "getStackStatChart",
  "params": {
    "siteId": "<siteId>",
    "stackId": "<stackId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Display statistics based on the time granularity calculated by start and end times:
Within 26 hours, 5 minutes of data is displayed
26 hours to 7 days 2 hours, showing hourly statistics
7 days 2 hours to 120 days 2 hours, showing daily statistics
120 days 2 hours or more, showing weekly statistics
The interface requires one of the permissions:
Site Statics Manager View Only
Site Device Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.

getSwitchStat ​

GET /openapi/v1/{omadacId}/sites/{siteId}/stat/switches/{deviceMac}

Get switch statistics

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
deviceMacpathstringyesDevice MAC address, like AA-BB-CC-DD-EE-FF
json
// omada_call_operation
{
  "operationId": "getSwitchStat",
  "params": {
    "siteId": "<siteId>",
    "deviceMac": "<deviceMac>"
  }
}
Details, permissions and error codes

Get switch statistics
The interface requires one of the permissions:
Site Statics Manager View Only
Site Device Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-39700 - Switch does not exist

getSwitchStatChart ​

POST /openapi/v1/{omadacId}/sites/{siteId}/stat/switches/{deviceMac}/chart

Get switch statistics chart

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
deviceMacpathstringyesDevice MAC address, like AA-BB-CC-DD-EE-FF

Request body — application/json (required) — schema OswStatQueryOpenApiDTO

FieldTypeRequiredDescription
startintegeryesStart time, number of seconds from UTC0 1970/01/01
endintegeryesEnd time, number of seconds from UTC0 1970/01/01
attrsarray<string>yesAttributes to be queried. Attributes not included in attrs will return a value of 0. Item of attrs should be a value as follows: mem, cpu, tx, rx, txRate, rxRate, txPkts, rxPkts, txBroadPkts, rxBroadPkts, txMultiPkts, rxMultiPkts, dropPkts, txErrPkts, rxErrPkts
portsarray<integer>noStatistics of the selected ports of Switch would be queried.
json
// omada_call_operation
{
  "operationId": "getSwitchStatChart",
  "params": {
    "siteId": "<siteId>",
    "deviceMac": "<deviceMac>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Display statistics based on the time granularity calculated by start and end times:
Within 26 hours, 5 minutes of data is displayed
26 hours to 7 days 2 hours, showing hourly statistics
7 days 2 hours to 120 days 2 hours, showing daily statistics
120 days 2 hours or more, showing weekly statistics
The interface requires one of the permissions:
Site Statics Manager View Only
Site Device Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.

getDevice5MinStatistic ​

POST /openapi/v2/{omadacId}/sites/{siteId}/stat/{deviceMac}/5min

Get device statistic data 5 min

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
deviceMacpathstringyesDevice MAC address, like AA-BB-CC-DD-EE-FF
typequerystringyesDevice Type. Supported type: ap, gateway, switch, olt.

Request body — application/json (required) — schema StatQueryVO

FieldTypeRequiredDescription
startintegeryesStart time, number of seconds from UTC0 1970/01/01
endintegeryesend time, number of seconds from UTC0 1970/01/01
attrsarray<string>yesAttributes to be queried. Attributes not included in attrs will return a value of 0 or be omitted. The supported attrs and response fields depend on the device type and statistic granularity. For details, refer to section 5.9.1 Device Statistics of the Open API Access Guide.
portsarray<integer>noThe ports in the lag. Each item is Integer, for example: [1, 2].
standardPortsarray<string>noStatistics of the selected ports would be queried , the param is valid when stacking
oltPortsarray<string>noStatistics of the selected ports of olt would be queried.
json
// omada_call_operation
{
  "operationId": "getDevice5MinStatistic",
  "params": {
    "siteId": "<siteId>",
    "deviceMac": "<deviceMac>",
    "type": "<type>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Get device statistic data 5 min. The supported attrs and response fields depend on the type parameter. For details, refer to section 5.9.1 Device Statistics of the Open API Access Guide.
The interface requires one of the permissions:
Site Device Manager View Only
Site Statics Manager View Only

getDeviceDailyStatistic ​

POST /openapi/v2/{omadacId}/sites/{siteId}/stat/{deviceMac}/daily

Get device statistic data daily

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
deviceMacpathstringyesDevice MAC address, like AA-BB-CC-DD-EE-FF
typequerystringyesDevice Type. Supported type: ap, gateway, switch, olt.

Request body — application/json (required) — schema StatQueryVO

FieldTypeRequiredDescription
startintegeryesStart time, number of seconds from UTC0 1970/01/01
endintegeryesend time, number of seconds from UTC0 1970/01/01
attrsarray<string>yesAttributes to be queried. Attributes not included in attrs will return a value of 0 or be omitted. The supported attrs and response fields depend on the device type and statistic granularity. For details, refer to section 5.9.1 Device Statistics of the Open API Access Guide.
portsarray<integer>noThe ports in the lag. Each item is Integer, for example: [1, 2].
standardPortsarray<string>noStatistics of the selected ports would be queried , the param is valid when stacking
oltPortsarray<string>noStatistics of the selected ports of olt would be queried.
json
// omada_call_operation
{
  "operationId": "getDeviceDailyStatistic",
  "params": {
    "siteId": "<siteId>",
    "deviceMac": "<deviceMac>",
    "type": "<type>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Get device statistic data daily. The supported attrs and response fields depend on the type parameter. For details, refer to section 5.9.1 Device Statistics of the Open API Access Guide.
The interface requires one of the permissions:
Site Device Manager View Only
Site Statics Manager View Only

getDeviceHourlyStatistic ​

POST /openapi/v2/{omadacId}/sites/{siteId}/stat/{deviceMac}/hourly

Get device statistic data hourly

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
deviceMacpathstringyesDevice MAC address, like AA-BB-CC-DD-EE-FF
typequerystringyesDevice Type. Supported type: ap, gateway, switch, olt.

Request body — application/json (required) — schema StatQueryVO

FieldTypeRequiredDescription
startintegeryesStart time, number of seconds from UTC0 1970/01/01
endintegeryesend time, number of seconds from UTC0 1970/01/01
attrsarray<string>yesAttributes to be queried. Attributes not included in attrs will return a value of 0 or be omitted. The supported attrs and response fields depend on the device type and statistic granularity. For details, refer to section 5.9.1 Device Statistics of the Open API Access Guide.
portsarray<integer>noThe ports in the lag. Each item is Integer, for example: [1, 2].
standardPortsarray<string>noStatistics of the selected ports would be queried , the param is valid when stacking
oltPortsarray<string>noStatistics of the selected ports of olt would be queried.
json
// omada_call_operation
{
  "operationId": "getDeviceHourlyStatistic",
  "params": {
    "siteId": "<siteId>",
    "deviceMac": "<deviceMac>",
    "type": "<type>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Get device statistic data hourly. The supported attrs and response fields depend on the type parameter. For details, refer to section 5.9.1 Device Statistics of the Open API Access Guide.
The interface requires one of the permissions:
Site Device Manager View Only
Site Statics Manager View Only

Released under the MIT License. Not affiliated with or endorsed by TP-Link.