Bulk Add Data Sources Using the Python
SDK
You can bulk add network devices as data sources to
VMware Aria
Operations for Networks
by using the
network-insight-sdk-python
SDK.- You must have access to theVMware Aria Operations for Networkscollector CLI.
- You must have access to theVMware Aria Operations for Networksplatform CLI.
- You must have the CSV file containing the list of network devices in the following format:"DataSourceType","IP","fqdn","Username","Password","CSPRefreshToken","NickName", "CentralCliEnabled","IPFixEnabled","SwitchType","ParentvCenter","IsVMC", "snmp_version","snmp_community_string","snmp_username","snmp_password", "snmp_auth_type","snmp_privacy_type","ProxyIP" "DataSource1","","Domain_name","username","<pwd>","", "nick_name_discovered_devices_1","","","","","","","","","","","","10.xx.xxx.xx" "DataSource2","10.1xx.xx.1x","","username","pwd","", " nick_name_discovered_devices_2","","","","","","","","","","","","10.xx.xx.xxx"You can create the file manually, or discover the devices in your network by performing network discovery. See Discover Network Devices by Running CLI Commands for more information.
You can add the following data sources
only:
- Cisco switches
- Arista switches
- Juniper switches
- Dell switches
- F5
- Brocade switches
- Palo Alto Networks
- Check Point Firewall
- Cisco ASA
- Log in to theVMware Aria Operations for Networkscollector CLI as asupportuser.
- Log in to theVMware Aria Operations for Networksplatform CLI as asupportuser.
- Switch to aUbuntuuser. Run the following command:ub
- Navigate to the/home/ubuntudirectory.cd /home/ubuntu
- Download thenetwork-insight-sdk-pythonSDK from GitHub.wget https://github.com/vmware/network-insight-sdk-python/archive/refs/heads/master.zip
- Unzip the contents of the SDK and delete the ZIP file.unzip master.zip && rm master.zip
- Export the Python path to/home/ubuntu/network-insight-sdk-python-master/swagger_client-py2.7.egg.export PYTHONPATH=/home/ubuntu/network-insight-sdk-python-master/swagger_client-py2.7.egg
- Navigate to theexamplesdirectory within the SDK. This folder contains thedatasource_addition.pyscript.cd /home/ubuntu/network-insight-sdk-python-master/examples
- Run thedatasource_addition.pyscript to bulk add network devices toVMware Aria Operations for Networks. The supported options are:OptionRequiredDescription--deployment_typeRequiredThe type of deployment on which you are performing the bulk addition operation. Accepted values areonpremandsaas.The default value isonprem.--platform_ipRequiredThe IP address of theVMware Aria Operations for Networksplatform node1 where you want to add the devices.--usernameRequiredThe user name of the platform user.You must always enclose the username in single quotes.--passwordRequiredThe password of the platform user.You must always enclose the password in single quotes.--data_sources_csvRequiredThe location of the CSV file which contains the details of the devices.--domain_typeOptionalThe domain type to authenticate user credentials. Accepted values areLOCALandLDAP.--domain_valueOptionalIf the domain type is LDAP, provide your LDAP domain name.OptionDescription--deployment_typeThe type of deployment. Accepted values areonpremandsaas.The default value isonprem.--api_tokenThe API token to authenticate yourVMware Aria Operations for NetworksCloud credentials.--cloud_locationThe location of the data center. Accepted values areUS,UK,JP,AU, andDE.The default value isUS.--data_sources_csvThe location of the CSV file which contains the details of the devices.Here are a few examples.python datasource_addition.py --deployment_type onprem --platform_ip vrni.example.com --username 'user@vmware' --password 'mypassword' --data_sources_csv /home/ubuntu/discovered_devices.csvpython datasource_addition.py --deployment_type onprem --platform_ip vrni.example.com --username 'user@vmware.com' --password 'mypassword' --domain_type LDAP --domain_value vmware.com --data_sources_csv /home/ubuntu/discovered_devices.csvFor example:python datasource_addition.py --deployment_type vrnic --api_token YourCSPAPIToken --cloud_location UK --data_sources_csv /home/ubuntu/discovered_devices.csvYou can track the result of the network discovery operation on the CLI. If the bulk addition operation fails for one or more devices, you can rectify the errors and reattempt the operation. See Common Data Source Errors for more information.
View the data sources added to
VMware Aria
Operations for Networks
by navigating
to the page.