Hi,
What is the purpose of having multiple connections described in testbed file? Is it possible to choose one among others for connection?
For example:
devices:
R1:
os: ios
type: ios
connections:
a:
protocol: ssh
ip: 192.168.1.1
port: 22
b:
protocol: telnet
ip: 192.168.1.1
port: 23
If I specify one of this connection (a or b) in testbed, then pyats can connect to device. If both connections are present as in example above, then connection is not working. I saw similar examples with several connections in documentation but didn't find any explanation.
Thank you.
Solved! Go to Solution.
@aidariys5 multiple connection instances start to make sense when you want to perform many show commands at the same time through asynchronous means (eg, multiprocessing, threading, etc).
if you are using only SSH, then remove telnet from config.
Thanks for reply, but I was asking about use cases of having multiple connections for one device. I found that it is needed if you describe HA pair or stack, for example.
Another usage that you can choose connection in python:
testbed = loader.load('testbed.yaml')
r1 = testbed.devices['R1']
r1.connect(alias='aaa', via='a')
r1.connect(alias='bbb', via='b')
r1.aaa.execute('show clock')
@aidariys5 multiple connection instances start to make sense when you want to perform many show commands at the same time through asynchronous means (eg, multiprocessing, threading, etc).