Demystifying iControl REST Part 7 - Understanding Transactions
Updated Jun 06, 2023
Version 2.0Was this article helpful?
Hi all,
I have question on the PEM rest API query.
[root@ip-10-1-1-8:Active:Standalone] config # tmsh show pem sessiondb all Pem::Sessiondb Blade number 0 TMM number 2 ------------------------------------- Subscriber Information ------------------------------------- Subscriber Id demouser1 Subscriber Id Type NAI Subscriber Type Dynamic ------------------------------------- Session Information ------------------------------------- IP Address 10.1.20.11 Policy Server Session Id Quota Server Session Id Session State provisioned Session Origin radius User-Name 3GPP-IMSI 3GPP-IMEISV 3GPP-User-Location-Info Called-Station-Id Calling-Station-Id NAS-IP-Address NAS-IPv6-Address Device Name Device OS Bytes Uplink 404726 Bytes Downlink 3060546 Flows Total 126 Flows Current 1 Flows Max 61 Transactions 36 ------------------------------------- Policy Name Policy Type -------------------------------------
.......
or query filer with "subscriber-id"
[root@ip-10-1-1-8:Active:Standalone] config # tmsh show pem sessiondb Subscriber-Id demouser1 Pem::Sessiondb Blade number 0 TMM number 2 ------------------------------------- Subscriber Information ------------------------------------- Subscriber Id demouser1 Subscriber Id Type NAI Subscriber Type Dynamic ------------------------------------- Session Information ------------------------------------- IP Address 10.1.20.11 Policy Server Session Id Quota Server Session Id Session State provisioned Session Origin radius User-Name 3GPP-IMSI 3GPP-IMEISV 3GPP-User-Location-Info Called-Station-Id Calling-Station-Id NAS-IP-Address NAS-IPv6-Address Device Name Device OS Bytes Uplink 404726 Bytes Downlink 3060546 Flows Total 126 Flows Current 1 Flows Max 61 Transactions 36 ------------------------------------- Policy Name Policy Type ------------------------------------- Student_block Predefined Student Predefined ------------------------------------- Total sessions found: 1
But i don't know how can i request in API uri. I had tried some but still failed.
Can you help to educate me how to convert this as rest API request?
root@ip-10-1-1-8:Active:Standalone] config # curl -k -u admin:admin -H "Content-Type: application/json" -X GET https://10.1.1.8/mgmt/tm/pem/sessiondb?Subscriber-Id=demosuer1 {"code":400,"message":"Query parameter Subscriber-Id is invalid.","errorStack":[],"apiError":1}[root@ip-10-1-1-8:Active:Standalone] config # curl -k -u admin:admin c^C [root@ip-10-1-1-8:Active:Standalone] config # curl -k -u admin:admin -H "Content-Type: application/json" -X GET https://10.1.1.8/mgmt/tm/pem/sessiondb {"code":400,"message":"At least one filtering argument or option 'all' must be specified","errorStack":[],"apiError":26214401}[root@ip-10-1-1-8:Active:Standalone] config # curl -k -u admin:admin -H "Content-Type: application/json" -X GET https://10.1.1.8/mgmt/tm/pem/sessiondb/all {"code":400,"message":"Found unexpected URI tmapi_mapper/pem/sessiondb/all.","errorStack":[],"apiError":1}[root@ip-10-1-1-8:Active:Standalone] config # [root@ip-10-1-1-8:Active:Standalone] config #