Status API
The Status API allows to fetch statistics from the software components running in Toolpack or TMG-CONTROL.
Getting used with Status API
Status API consists of status request queries based on a "path". Each status has a path, like:
We already provide two ways of accessing the Toolpack Status:
Viewing status tree using Web Portal
I suggest that you start by using the "browse" option in the WEB portal: Go to the Web Portal -> Status -> Browse This tool will list available paths that can be queried. When you click one of these paths, the web page will show a table that list all fields returned from that path.
Note: If you bring the mouse over a field name, a tool tip will appear and show a short description.
Viewing status tree using the command-line tool
The command-line tool will also allow getting a list of available paths:
You can also query stats using one of these path, result is formatted as text output:
Example above show stat of all adapters. You can query more specific stats too:
Or you can query "recursive" information that also includes paths "under" a base path:
Or you can query very deep and specific information:
Viewing statistics field description with the command-line tool
You can query a short description of each statistic field by providing the '-D' option to the command-line tool.
For example:
Paths for ISUP Circuit states
You can query states for one circuit group using a path like this one (replace C002020_2_0_12 by your circuit group name, as seen in it's Web portal configuration):
If you're using version 2.4 or up, you also have access to individual circuits states... but you HAVE to use "-x" option (extended stats mode) to get these. To get states for all CICs of a group:
For example, to get states for CIC #1705, you can use:
Querying/modifying individual field value using the command-line tool
To query individual field value, you add "::" after the path, then specify the specific field name. For example:
Or to modify the circuit state (here to force blocking state):
Note: Remember that this change is PERSISTENT, which means circuit will remain blocked forever (no matter trunk state) until you change it again (to "Default", or "Unblocked" for example).
How to write code that use that API
Now that you understand a bit how Status API works, here is a short explanation on how to write code to manipulate these states.
In short you need to create and start the status client service in your application:
Then each available stat is reported under a "path". Your code can call the following function to get available paths:
Once you know the path you want to query, you can retrieve the stats, either synchronously or asynchronously: Synchronously:
Asynchronously:
Available options:
For more information on "pMyStatPipe", please read documentation from the header files in the code.
Once you get your "pStatList", you can get each item it retBold texturned (there can be many if your request matches many):
And for each item, you can get list of fields:
... and list each field (one field is one individual stat value):
Now, as you traverse the stat tree, you will encounter some values that can be changed using:
Once you have changed one or more fields of the stat, you can commit it:
For more detailed information, please refer to the source code of the "tbstatus" application, and to documentation in appropriate header files.
Note
Last updated
Was this helpful?