Automating Ip Networks With Python
Automating Ip Networks With Python
Automating Ip Networks With Python
Python
Tomás Lynch
Vultr, LLC.
PyEZ
● Juniper
netmiko
● Arista, Cisco IOS, Juniper, MikroTik, among others
dev.open() ssh_connect=Netmiko(**device)
ssh_connect.enable()
command
ssh_connect.send_command('skip-page-display')
dev.close() ssh_connect.disconnect()
LACNOC2019 - Automation - Lynch 7
Package performance
PyEZ netmiko (ssh)
10 routers 10 routers
Distribution 1 Distribution n
PyEZ – juni.pr/2YSmf1g
[email protected]
Automation
configuration,
management,
testing,
deployment, and
operations
Device
name REST Router
ASN XML Switch
IP address JSON Server
Description NETCONF Etc.
Etc.
Variables
Variables
Script
API Infrastructure
Script
{ {
'community': [{ 'community': [{
'name': { 'name': 'EXAMPLE_COMM',
'data': 'EXAMPLE_COMM' 'members': ['65536:1']
}, }]
'members': [{ }
'data': '65536:1'
}]
}]
}
try:
cli.load(command, format='set')
except (ConfigLoadError, Exception) as err:
print ("Unable to load configuration changes: {0}".format(err))
try:
cli.load(command, format='set')
except (ConfigLoadError, Exception) as err:
print ("Unable to load configuration changes: {0}".format(err))