This section introduces how to create an API parser to extract key metrics from a Cisco ACI network.
1.Click the icon on the taskbar and select New Parser.
2.Select Logic Nodes from the Node Type list, select Cisco ACI from the second list and then select a specific node type.
3.Define the functions to retrieve data from devices. This step contains three functions. Define these functions step by step:
4. Click Retrieve and select a device to retrieve sample data.
5.Define the functions to parse key metrics from the retrieved data. This step contains two functions. Define these functions step by step:
No. |
Function Name |
Explanation |
1) |
Declare variable tree |
This function is to declare the metrics (variables) and their types that you want to parse from the retrieved device data, and generate a variable tree. The following parameters of a variable are defined: ▪name — the name of the variable ▪type — the value type of a variable. The type includes string, int, bool, double and table. This function is in the JSON format and a sample code is as follows: ''' |
2) |
def ParseText(original_result) |
This function is used to return the specific metric values and assign the values to corresponding variables in the variable tree. The following is a sample code of this function: import re |
6. Click Save on the upper right corner of the page. The parser will be saved in the Parser Library.
See also: