AE-2166: Resolving API Bugs in AMP4 For Monitoring
Review Request #1096 — Created Oct. 14, 2025 and submitted
| Information | |
|---|---|
| apoorva.sn | |
| AMP | |
| amp_4_0 | |
| AE-2166 | |
| Reviewers | |
| mmiriam, ngurunathan, pmurugaiyan, pradeep, shuinvy | |
Minor issues in the Monitoring API have been fixed:
/api/apv/slb/virtual_stats
Fix the null values and data types
/api/apv/slb/real_stats
Fix the data types - Example: port: “80"
Tested all the Monitoring API's. All are working as expected.
Output for
/api/apv/slb/virtual_stats
GET Virtual stats
————————[root@AN admin]# curl 'http://127.0.0.1:8000/apv/slb/virtual_stats' \
-H 'Accept: application/json, text/plain, /' \
-H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-b 'csrftoken=uLUtoNGWgt0FZ8tP7EnYoUalj8c7Hdur; hive_key=1; django_language=en; csrf_token=uLUtoNGWgt0FZ8tP7EnYoUalj8c7Hdur; current_user=array; hive_sess=e5681b05-7b33-4b78-8e64-f202593b6b50' \
-H 'Origin: http://127.0.0.1:8000' \
-H 'Referer: http://127.0.0.1:8000/app/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36' \
-H 'X-CSRFToken: uLUtoNGWgt0FZ8tP7EnYoUalj8c7Hdur' \
-H 'sec-ch-ua: "Not;A=Brand";v="99", "Google Chrome";v="139", "Chromium";v="139"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data '{}' \
--insecure
{"data": [{"hits_diff": 0, "last_conn_cnt": 1, "last_in": 48896.0, "last_out": 56648.0, "serverid": "vs1", "agent_host": "192.168.162.166", "addr": "192.168.162.92", "port": 443, "protocol": "5", "health_status": "1"}]}GET Virtual Stats with agent host
——————————————————————————————[root@AN admin]# curl 'http://127.0.0.1:8000/apv/slb/virtual_stats' \
-X POST \
-H 'Accept: application/json, text/plain, /' \
-H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-b 'csrftoken= uLUtoNGWgt0FZ8tP7EnYoUalj8c7Hdur; hive_key=1; django_language=en; csrf_token= uLUtoNGWgt0FZ8tP7EnYoUalj8c7Hdur; current_user=array; hive_sess=e5681b05-7b33-4b78-8e64-f202593b6b50' \
-H 'Origin: http://127.0.0.1:8000' \
-H 'Referer: http://127.0.0.1:8000/app/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36' \
-H 'X-CSRFToken: uLUtoNGWgt0FZ8tP7EnYoUalj8c7Hdur' \
-H 'sec-ch-ua: "Not;A=Brand";v="99", "Google Chrome";v="139", "Chromium";v="139"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{"query": {"agent_host": "192.168.162.166"}}' \
--insecure
{"data": [{"hits_diff": 0, "last_conn_cnt": 1, "last_in": 50856.0, "last_out": 58912.0, "serverid": "vs1", "agent_host": "192.168.162.166", "addr": "192.168.162.92", "port": 443, "protocol": "5", "health_status": "1"}]}Network Throughput
[root@AN admin]# curl 'http://127.0.0.1:8000/apv/slb/virtual_stats' \
-X POST \
-H 'Accept: application/json, text/plain, /' \
-H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-b 'csrftoken=NZpgEsdZ5NkNJF9tQgsIvfeMpAHUaVZB; hive_key=1; django_language=en; csrf_token=NZpgEsdZ5NkNJF9tQgsIvfeMpAHUaVZB; current_user=array; hive_sess=83bc2ef4-1ce3-44d1-9bfc-357643a5c7f9' \
-H 'Origin: http://127.0.0.1:8000' \
-H 'Referer: http://127.0.0.1:8000/app/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36' \
-H 'X-CSRFToken: NZpgEsdZ5NkNJF9tQgsIvfeMpAHUaVZB' \
-H 'sec-ch-ua: "Not;A=Brand";v="99", "Google Chrome";v="139", "Chromium";v="139"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--data-raw '{
"stat_name": "network_throughput",
"interval": "20s",
"agent_host": "192.168.162.166",
"from": "now-15m",
"to": "now"
}' \
--insecure
{"status": 200, "message": "success", "data": [{"ts": "2025-09-11T04:17:00+05:30", "received": null, "sent": null}, {"ts": "2025-09-11T04:17:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:17:40+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:18:00+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:18:20+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:18:40+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:19:00+05:30", "received": 6216.5, "sent": 7222.5}, {"ts": "2025-09-11T04:19:20+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:19:40+05:30", "received": 6133.0, "sent": 7102.5}, {"ts": "2025-09-11T04:20:00+05:30", "received": 6339.0, "sent": 7364.0}, {"ts": "2025-09-11T04:20:20+05:30", "received": 6273.0, "sent": 7252.0}, {"ts": "2025-09-11T04:20:40+05:30", "received": 6130.0, "sent": 7081.0}, {"ts": "2025-09-11T04:21:00+05:30", "received": 6226.5, "sent": 7222.5}, {"ts": "2025-09-11T04:21:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:21:40+05:30", "received": 6130.0, "sent": 7081.0}, {"ts": "2025-09-11T04:22:00+05:30", "received": 6130.0, "sent": 7081.0}, {"ts": "2025-09-11T04:22:20+05:30", "received": 6196.0, "sent": 7193.0}, {"ts": "2025-09-11T04:22:40+05:30", "received": 6150.5, "sent": 7102.5}, {"ts": "2025-09-11T04:23:00+05:30", "received": 6252.5, "sent": 7222.5}, {"ts": "2025-09-11T04:23:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:23:40+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:24:00+05:30", "received": 6130.0, "sent": 7081.0}, {"ts": "2025-09-11T04:24:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:24:40+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:25:00+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:25:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:25:40+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:26:00+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:26:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:26:40+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:27:00+05:30", "received": 6234.5, "sent": 7230.5}, {"ts": "2025-09-11T04:27:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:27:40+05:30", "received": 6197.5, "sent": 7110.5}, {"ts": "2025-09-11T04:28:00+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:28:20+05:30", "received": 6339.0, "sent": 7364.0}, {"ts": "2025-09-11T04:28:40+05:30", "received": 6216.5, "sent": 7222.5}, {"ts": "2025-09-11T04:29:00+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:29:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:29:40+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:30:00+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:30:20+05:30", "received": 6216.5, "sent": 7222.5}, {"ts": "2025-09-11T04:30:40+05:30", "received": 6149.0, "sent": 7193.0}, {"ts": "2025-09-11T04:31:00+05:30", "received": 6007.5, "sent": 6939.5}, {"ts": "2025-09-11T04:31:20+05:30", "received": 6112.0, "sent": 7081.0}, {"ts": "2025-09-11T04:31:40+05:30", "received": 6234.5, "sent": 7222.5}, {"ts": "2025-09-11T04:32:00+05:30", "received": 6357.0, "sent": 7364.0}]}/api/apv/slb/real_stats
GET without agent host:
curl 'http://127.0.0.1:8000/apv/slb/real_stats' \
-X POST \
-H 'Accept: application/json, text/plain, /' \
-H 'Content-Type: application/json' \
-H 'X-CSRFToken: eT3wLkGyMCkmzU2bJMwb1zXzTPJG19fp' \
-b 'csrftoken= eT3wLkGyMCkmzU2bJMwb1zXzTPJG19fp; hive_key=1; django_language=en; csrf_token= eT3wLkGyMCkmzU2bJMwb1zXzTPJG19fp; current_user=array; hive_sess=ff21c0c7-5b8d-4222-a1cb-d74d673d4363' \
--data-raw '{}' \
--insecure
{"data": [{"last_req_cnt": 0, "last_conn_per_sec": 0, "last_in": 2688, "last_out": 0, "real_server_id": "RS1", "agent_host": "192.168.162.166", "addr": "192.168.162.161", "port": 9000, "protocol": "4", "status": "1"}]}With Agent Host:
curl 'http://127.0.0.1:8000/apv/slb/real_stats' \
-X POST \
-H 'Accept: application/json, text/plain, /' \
-H 'Content-Type: application/json' \
-H 'X-CSRFToken: eT3wLkGyMCkmzU2bJMwb1zXzTPJG19fp' \
-b 'csrftoken= eT3wLkGyMCkmzU2bJMwb1zXzTPJG19fp; hive_key=1; django_language=en; csrf_token= eT3wLkGyMCkmzU2bJMwb1zXzTPJG19fp; current_user=array; hive_sess=ff21c0c7-5b8d-4222-a1cb-d74d673d4363' \
--data-raw '{}' \
--insecure
{"data": [{"last_req_cnt": 0, "last_conn_per_sec": 0, "last_in": 2688, "last_out": 0, "real_server_id": "RS1", "agent_host": "192.168.162.166", "addr": "192.168.162.161", "port": 9000, "protocol": "4", "status": "1"}]}
| Description | From | Last Updated |
|---|---|---|
|
{"status": 1, "data": {"status": 200, "message": "success", "data": [{"last_req_cnt": 0, "last_conn_per_sec": 0.0, "last_in_bps": 3200.0, "last_out_bps": 0.0, "real_server_id": "RS1", "agent_host": "192.168.162.166", … |
|
|
|
{"status": 1, "data": {"status": 200, "message": "success", "data": [{"last_req_cnt": 0, "last_conn_per_sec": 0.0, "last_in_bps": 3200.0, "last_out_bps": 0.0, "real_server_id": "RS1", "agent_host": "192.168.162.166", … |
|
-
-
branches/amp_4_0/src/webui/webui/htdocs/new/src/cm/models/system/user_mgmt/__init__.py (Diff revision 1) {"status": 1, "data": {"status": 200, "message": "success", "data": [{"last_req_cnt": 0, "last_conn_per_sec": 0.0, "last_in_bps": 3200.0, "last_out_bps": 0.0, "real_server_id": "RS1", "agent_host": "192.168.162.166", "addr": "192.168.162.161", "port": "9000", "protocol": "4", "status": "1"}]}
still some of the response are having mix of data types. "9000"
-
branches/amp_4_0/src/webui/webui/htdocs/new/src/cm/models/system/user_mgmt/__init__.py (Diff revision 1) {"status": 1, "data": {"status": 200, "message": "success", "data": [{"last_req_cnt": 0, "last_conn_per_sec": 0.0, "last_in_bps": 3200.0, "last_out_bps": 0.0, "real_server_id": "RS1", "agent_host": "192.168.162.166", "addr": "192.168.162.161", "port": "9000", "protocol": "4", "status": "1"}]}
still some of the response are having mix of data types. "9000"
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+18 -16) |
