04-10-2022 02:53 AM
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.
04-11-2022 02:27 AM
@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).
04-10-2022 04:05 AM
if you are using only SSH, then remove telnet from config.
04-11-2022 01:27 AM
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')
04-11-2022 02:27 AM
@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).
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide