Skip to main content

How to automate exporting the site maps from Netbrain to shared folder

 

Hi @Mahendra Reddy 

you have two posibilities: you can use a benchmark task or API call.
In the benchmark task, go to Additional operations after Benchmark -> Update Maps and activate Export to Visio.
The use of the API is explained here with sample code in Python and cURL code for Postman:
https://github.com/NetBrainAPI/NetBrain-REST-API-R10/blob/master/REST%20APIs%20Documentation/Map%20Management/Export%20Map%20API.md

Carsten


Hi Carsten, 

Thanks for the quickly reply. 

We tried the first but we couldn't able to export them to shared folder. 


Hi

I use a Python script to export all my site maps to a directory. It works like this:
API call to log on to NB to get the token for the next API calls.
API call to set the domain.
API call to get a list of sites.
Start a loop to iterate through the sites, if site type = 2 (leaf site) then call API to export the map as Visio.
I use the loop to log out and log in to NB every 50 maps so as not to run into any timeouts. 
This way, I can export 360 maps in three hours.

Carsten


Reply