This URL is used to retrieve the traffic send/received statistics for the Sensor.
Resource URL
GET /sensor/{sensorId}/port/{portId}/trafficstats/trafficrxtx
Request Parameters
URL Parameters:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| sensorId | Sensor id | Number | Yes |
| portId | Port id belonging to the device mentioned | Number | Yes |
Response Parameters
Following fields are returned if the request parameters are correct, otherwise error details are returned.| Field Name | Description | Data Type |
|---|---|---|
| totalBytesSent | Total bytes sent on the given port of the Sensor | String |
| totalBytesReceived | Total bytes received at the given port of the Sensor | String |
| totalPacketsSent | Total number of packets sent on the given port of the Sensor | String |
| totalPacketsReceived | Total number of packets received at the given port of the Sensor | String |
| packetsUnicastSent | Total number of unicast packets sent on the given port of the Sensor | String |
| packetsUnicastReceived | Total number of unicast packets received at the given port of the Sensor | String |
| packetsBroadcastSent | Total number of broadcast packets sent on the given port of the Sensor | String |
| packetsBroadcastReceived | Total number of broadcast packets received at the given port of the Sensor | String |
| packetsMulticastSent | Total number of multicast packets sent on the given port of the Sensor | String |
| packetsMulticastReceived | Total number of multicast packets received at the given port of the Sensor | String |
| crcErrorsSent | Total number of packets sent with crc errors on a given port of the Sensor | String |
| crcErrorsReceived | Total number of packets sent with crc errors at a given port of the Sensor | String |
Example
Request
GET https://<NSM_IP>/sdkapi/sensor/1009/port/124/trafficstats/trafficrxtx
Response
{
"totalBytesSent": "4800",
"totalBytesReceived": "2374734758",
"totalPacketsSent": "63",
"totalPacketsReceived": "2828977",
"packetsUnicastSent": "62",
"packetsUnicastReceived": "2828956",
"packetsBroadcastSent": "1",
"packetsBroadcastReceived": "19",
"packetsMulticastSent": "0",
"packetsMulticastReceived": "2",
"crcErrorsSent": "0",
"crcErrorsReceived": "0"
}
Error Information
Following error codes are returned by this URL:
| No | HTTP Error Code | SDK API errorId | SDK API errorMessage |
|---|---|---|---|
| 1 | 404 | Invalid Sensor: When the device id given is not valid | |
| 2 | 404 | Invalid port: If the given port does not belong to the device |