Generic

The following generic services are supported by all implementations.

connect

API to connect to the device.

connect arguments

Argument

Description

Default

timeout

Maximum time it can take to disconnect to the device.

30 seconds

port

Port number for protocol.

443 (IOSXE, NXOS, DCNM, BIG-IP), 8443 (Viptela), 8080 (NSO), 19399 (VIRL)

protocol

Protocol to use.

https (IOSXE, NXOS, DCNM, Viptela, BIG-IP), http (NSO, VIRL)

# Example
# -------
#
#   loading & using REST testbed yaml file in pyATS

# import the topology module
from pyats import topology

# load the above testbed file containing REST device
testbed = topology.loader.load('/path/to/rest/testbed.yaml')

# get device by name
device = testbed.devices['PE1']

# connect to it
device.connect(via='rest')

disconnect

API to disconnect from the device.

disconnect arguments

Argument

Description

Default

timeout

Maximum time it can take to disconnect from the device.

30 seconds

# Example
# -------
#
#   loading & using REST testbed yaml file in pyATS

# import the topology module
from pyats import topology

# load the above testbed file containing REST device
testbed = topology.loader.load('/path/to/rest/testbed.yaml')

# get device by name
device = testbed.devices['PE1']

# connect to it
device.connect(via='rest')

# disconnect rest connection
device.rest.disconnect()