R12.3-2026Apr21
Use Case - Return Map URL of a Calculated Path to Third-party System
In a third-party system, you can trigger NetBrain to calculate an end-to-end path and then return the map URL of the calculated path to the third-party system.
Workflow
The pseudo-code below describes the main flow at both the NetBrain side and third-party system side.
Code |
1.In NetBrain: 1.1 Open System Automation Task Manager in NetBrain Desktop. 1.2 Under API Stub Manager, create a Stub and choose "Map a Path". Check online help for more setting detail. 1.3 [Optional] Add pre-defined Runbook into the Stub if needed. 1.4 Save and enable the Stub. 2.In Script (third-party system): 2.1 Login into NetBrain session and get system token. 2.2 Set the operation tenant and domain. 2.3 Get the default gateway information of Source IP. 2.4 Trigger Path and get Map ID. 2.5.0 Back to NetBrain API Stub Manager, check trigger history under API Triggered Tasks, and open the Map. 2.5.1 [Optional] Export the Map Visio or Xmap. 2.6 Logout the session. |
| Note: Step 2.5.0 is a must if step 2.5.1 is defined, because the system will not create map record until you open the map task id. |
API Script
You can refer to the script below to call APIs. This sample script first imports a python library maintained by NetBrain, and you need to write your own ones in practical use.
Code |
|