API to get LLB values for listing page

Review Request #633 — Created Jan. 28, 2025 and submitted — Latest diff uploaded

apoorva.sn
AMP
amp_3_7
AA-2572
pmurugaiyan, prajesh, shuinvy

Problem

API to get LLB values for listing page:
Link Name, Gateway IP, Status, Bandwidth Threshold, Bandwidth Usage, Bandwidth In, Bandwidth Out, Connections, Hits

API to get LLB values for Dashboard page:
hits, connections

Solution

Have introduced a new logic to get the LLB Stats and the monitoring data values from Influx DB

Tested with the Postman using following URL:
1. Listing Page
https://192.168.85.47:8888/llb/stats

{"action":"get_llb_stats"}

{
"results": [
{
"statement_id": 0,
"series": [
{
"name": "llbStats",
"tags": {
"agent_host": "192.168.85.101"
},
"columns": [
"time",
"linkName",
"linkGateway",
"linkStatus",
"linkThresh",
"linkUsage",
"linkBandwidIn",
"linkBandwidOut",
"linkConn",
"linkHits"
],
"values": [
[
1738049430000,
"VLAN-162",
"192.168.162.1",
"Up",
"10485760kbps",
0,
"0bps",
"0bps",
0,
1482
],
[
1738049430000,
"VLAN-85",
"192.168.85.1",
"Up",
"10485760kbps",
0,
"0bps",
"0bps",
1,
1483
]
]
}
]
}
]
}

  1. Monitoring Page
    https://192.168.85.47:8888/llb/monitoring_data

{
"results": [
{
"statement_id": 0,
"series": [
{
"name": "llbStats",
"columns": [
"time",
"top",
"linkName",
"agent_host"
],
"values": [
[
1738147200812,
0,
"VLAN-162",
"192.168.85.101"
],
[
1738147200812,
0,
"VLAN-85",
"192.168.85.101"
]
]
}
]
},
{
"statement_id": 1,
"series": [
{
"name": "llbStats",
"columns": [
"time",
"top",
"linkName",
"agent_host"
],
"values": [
[
1738147210000,
4,
"VLAN-85",
"192.168.85.101"
],
[
1738147210000,
1,
"VLAN-162",
"192.168.85.101"
]
]
}
]
}
]
}

    Loading...