Sample Exchange

 View Only

Adding multiple Data Sources with Python 

Apr 13, 2020 06:09 PM

This vRealize Network Insight Python SDK example script adds all data sources that are listed in the CSV you specify. This script requires the vRNI Python SDK, which is available here: https://github.com/vmware/network-insight-sdk-python

Example CSV:

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
VCenterDataSource,192.168.0.10,,administrator@vsphere.local,MyPassword,,vcenter,,,,,,,,,,,,192.168.0.5
NSXVManagerDataSource,,nsxv.lab,admin,MyPassword,,nsxv,TRUE,FALSE,,192.168.0.10,,,,,,,,192.168.0.5
NSXTManagerDataSource,192.168.0.12,,audit,MyPassword,,nsxt,,,,192.168.0.10,,,,,,,,192.168.0.5
PanFirewallDataSource,192.168.0.13,,admin,MyPassword,,panorama_firewall,,,,,,,,,,,,192.168.0.5
CiscoSwitchDataSource,192.168.0.14,,admin,MyPassword,,NEXUS_5K,,,NEXUS_5K,,,v3,,admin,MyPassword,MD5,NO_PRIV,192.168.0.5
VCenterDataSource,192.168.0.15,,cloudadmin@vmc.local,MyPassword,,vmc,,,,,TRUE,,,,,,,192.168.0.5
PolicyManagerDataSource,192.168.0.16,,,,LongString,policy_manager,TRUE,FALSE,,192.168.0.10,,,,,,,,192.168.0.5

# python datasource_addition.py --help

usage: datasource_addition.py [-h] [--deployment_type DEPLOYMENT_TYPE]
                              [--platform_ip PLATFORM_IP]
                              [--username USERNAME] [--password PASSWORD]
                              [--domain_type DOMAIN_TYPE]
                              [--domain_value DOMAIN_VALUE]
                              [--get_vidm_client_id] [--vidm_token VIDM_TOKEN]
                              [--api_token API_TOKEN]
                              [--data_sources_csv DATA_SOURCES_CSV]

Run Public APIs on vRNI Platform

optional arguments:
  -h, --help            show this help message and exit
  --deployment_type DEPLOYMENT_TYPE
                        Setup deployment type: onprem or niaas
  --platform_ip PLATFORM_IP
                        IP address of vRNI platform. In case of cluster IP
                        address of Platform-1
  --username USERNAME   user name for authentication
  --password PASSWORD   password for authentication
  --domain_type DOMAIN_TYPE
                        domain type for authentication: LOCAL or LDAP or VIDM
  --domain_value DOMAIN_VALUE
                        domain value for LDAP user: example.com
  --get_vidm_client_id  Get client-id for making user access-token request to
                        vIDM
  --vidm_token VIDM_TOKEN
                        Provide vidm_token
  --api_token API_TOKEN
                        Provide niaas api token
  --data_sources_csv DATA_SOURCES_CSV
                        csv file with your own data sources


#vRealizeNetworkInsight
#Python
#vRealizeNetworkInsightAPI
#Datasources
#Apache2.0
#vRealizeNetworkInsight

Statistics
0 Favorited
1 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
py file
datasource_addition.py   9 KB   1 version
Uploaded - Apr 09, 2024

Tags and Keywords

Related Entries and Links

No Related Resource entered.