AE-2140 : Dashboard - Create APIs and Integrate the same with GUI for the SSLVPN and Cleanup duplicate functions for dashboard

Review Request #1076 — Created Sept. 26, 2025 and submitted

pmurugaiyan
AMP
amp_4_0
AE-2140
apoorva.sn, mmiriam, ngurunathan, shuinvy

The SSLVPN APIs for the Dashboard has been added & Integrated with the GUI.

Code cleanup for the duplicate functions and graphs.

The changes has been tested locally.

POST /top-ssl-vpn-metrics

[
{
"metric": "active_sessions",
"agent_host": "192.168.85.20",
"vsite_name": "viste2",
"value": 0
},
{
"metric": "client_network",
"agent_host": "192.168.85.20",
"vsite_name": "viste2",
"received": 0,
"sent": 0
},
{
"metric": "server_network",
"agent_host": "192.168.85.20",
"vsite_name": "viste2",
"received": 0,
"sent": 0
}
]


Description From Last Updated

Can we rename the value field to something more descriptive, such as active_sessions, client_throughput, or server_throughput, depending on what the …

apoorva.snapoorva.sn

same as above

apoorva.snapoorva.sn

can we rename. same comment as before

apoorva.snapoorva.sn

ideally be d['metric'] == 'active_sessions' rght ?

apoorva.snapoorva.sn

Instead of building a dictionary with all possible fields and then removing irrelevant ones in sanitize_metrics, can we construct the …

apoorva.snapoorva.sn
apoorva.sn
  1. 
      
  2. Can we rename the value field to something more descriptive, such as active_sessions, client_throughput, or server_throughput, depending on what the metric actually represents?
    From an API response perspective, the generic field name value doesn’t clearly convey its meaning and can be confusing for consumers parsing the JSON.

    Please consider updating all similar cases throughout the API (for example, wherever value is used for different metrics) so that the field name is self-explanatory and matches the metric type.
    This will make the API more maintainable and user-friendly.

    1. Like I mentioned in the other PR - we can have the common names for the fields and endpoint can be the differentiater. This makes our parsing simpler, rather than writing a complex parser for each and every response individually.

    2. From UI Perpective it might be better choice today. But I fell this might be difficult from API perspective in future when we expose our API's to customers.
      Better to have names according the field names which we are sending in response of the API.

    3. This API meant for the dashboard - Now, we making the API calls for every 10 seconds as we dont have the websockets implementation yet. So, the latency is the key here, we are already showing maximum 10s delayed data, so dont want to add any further days here.

      {
      "metric": "active_sessions",
      "agent_host": "192.168.85.20",
      "vsite_name": "viste2",
      "value": 0
      }

      we have metric classifier as 'active_sessions', we dont have to repeat the same for value again as a key. Its self explanatory. This way our data has a structure for parsing. Which we are taking advantage for the faster rendering with minimal efforts. With this approach we can form N number of similar data and process it with ease.

  3. ideally be d['metric'] == 'active_sessions'
    rght ?

  4. Instead of building a dictionary with all possible fields and then removing irrelevant ones in sanitize_metrics, can we construct the response dictionary to include only the fields required for each metric type?
    This would avoid unnecessary additions/removals, reduce payload size, and make the API response cleaner and easier to maintain.

    1. Yes, this was a intended approach, here instead of making a 3 different SQL queries we are making only one, and fetching the common results. We can improvise it at a later stage. Please refer the current response, add let me know if any cleanup required.

  5. 
      
pmurugaiyan
pmurugaiyan
shuinvy
  1. Ship It!
  2. 
      
pmurugaiyan
Review request changed

Status: Closed (submitted)

Loading...