R12.1-2025Jul03

API Data Selection in Parser

When creating API-based Intent for SDN/Cloud diagnosis, end users need to define their own functions for retrieving data through APIs, which significantly raises the threshold for writing intents and is in contradiction with the concept of No-code Automation. To resolve this issue, NetBrain re-defines API retrieval ability to let end users directly select one from API Data Library or customize API manually.

An API Data Library is built to define and maintain the standard API data that is crucial for automation. Both NI Editor and Visual Parser are adjusted accordingly to facilitate the selection of these pre-defined API data.

The new workflow in visual parser is:

Select API type Select API Adapter Select device (filter devices based on the selected type) Select API Data (adjusting function is moved to this step from API adapter step) Retrieve.

The API functionality is enhanced to add and retrieve the values in API Data Library from the API Data drop-down. When defining API type parser, use the drop down menu in API Data to add/retrieve the data and parse the API return. If a version like ACI is not supported, the ‘API Data’ option will not appear in the UI.

The API Data functionality has following two options:

Information Note: It is recommended to use the option Select API Data to Retrieve than the second option Customized Function.

Select API Data to Retrieve

  1. Create a Parser and Name it (e.g., API Parser).

  2. Define the parser as an API type parser by selecting API from the Select Data dropdown. 

  3. Select API Adapter as Devices, Amazon AWS, and then select to retrieve data on device igw-7c051715
     
  4. Select Select API Data to Retrieve from the API Data dropdown, then select predefined API data from Library to auto-generate the Python function from the API Library.

    Information Note: API data can be selected because Amazon AWS is available API Data Category in the system. 
  5. Alternatively, you can select Customized Function to manually define the function script. 

    Information Note: If the script has been modified before, a prompt “Last modified on $timestamp" will appear at the bottom of this window.
  6. Click Retrieve, then the API data will display in the left pane. 

  7. Double-click words from the left pane to parse variables $state and $vpc, then click Apply to save the paragraph pattern. 

  8. Click the  icon at the upper-right corner to save the parser.