2022-03-17 19:05:23 -03:00
|
|
|
#!/usr/bin/python3
|
|
|
|
import conn
|
2022-03-18 15:32:48 -03:00
|
|
|
import yaml
|
2022-03-17 19:05:23 -03:00
|
|
|
|
2022-03-18 15:32:48 -03:00
|
|
|
conf = conn.configfile("test.yaml")
|
|
|
|
# ***
|
|
|
|
# conf._connections_del(id = "zab3mu", folder="teco")
|
|
|
|
# conf._connections_add(id = "zzztest", folder="teco" ,host = "10.21.96.45", user="sarabada")
|
|
|
|
# conf._folder_add(folder="zzz")
|
|
|
|
# conf._folder_add(folder="zzz", subfolder="achus")
|
|
|
|
# conf._connections_add(id = "zzztec", subfolder="achus", folder="zzz" ,host = "10.21.96.45")
|
|
|
|
# conf._connections_add(id = "zzztec", subfolder="achus", folder="zzz" ,host = "10.21.96.45", options=" saracatanga")
|
|
|
|
# conf._folder_del(folder = "zzz", subfolder = "achus")
|
|
|
|
# conf._profiles_add(id = "test", user = 'tesuser')
|
|
|
|
# conf._profiles_add(id = "test", user = 'tesuser', protocol = 'telnet')
|
|
|
|
# conf._profiles_del(id = "test")
|
|
|
|
# print(yaml.dump(conf.profiles))
|
|
|
|
# conf.saveconfig("test.yaml")
|
|
|
|
# ***
|
|
|
|
xr=conn.node("xr@home", **conf.connections["home"]["xr"], config=conf)
|
|
|
|
ios=conn.node("ios@home", **conf.connections["home"]["ios"], config=conf)
|
|
|
|
norman = conn.node("norman@home", **conf.connections["home"]["norman"], config=conf)
|
|
|
|
eve = conn.node("eve@home", **conf.connections["home"]["eve"], config=conf)
|
|
|
|
# xr.run(["term len 0","show ip bgp", "show ip bgp summ"], folder="test")
|
|
|
|
# ios.run(["term len 0","show ip bgp", "show ip bgp summ"], folder="test")
|
|
|
|
# norman.run(["ls -la", "pwd"], folder = "test")
|
|
|
|
# eve.run(["ls -la", "pwd"], folder = "test")
|
|
|
|
xr.interact()
|
2022-03-17 19:05:23 -03:00
|
|
|
|