5.5. _conn module

class capture_it._conn.conn(ip, un, pw, en, delay_factor, visual_progress, logger_list, devtype='', hostname='')

Bases: object

Initiate an active connection. use it with context manager to execute necessary commands on to it.

Parameters:
  • ip (str) – ip address of device to establish ssh connection with

  • un (str) – username to login to device

  • pw (str) – user password to login to device

  • en (str) – enable password (For cisco)

  • delay_factor (int) – connection stability factor

  • visual_progress (int) – scale 0 to 10. 0 being no output, 10 all.

  • logger (list) – device logging messages list

  • devtype (str, optional) – device type from DeviceType class. Defaults to ‘’.

  • hostname (str, optional) – hostname of device ( if known ). Defaults to ‘’.

Properties:

hn (str): hostname devvar (dict) : {‘ip’:ip, ‘host’:hostname} devtype (str) : device type (‘cisco_ios’, ‘arista_eos’, ‘juniper_junos’)

property clsStr
property devtype

device type * ‘cisco’: ‘cisco_ios’, * ‘arista’: ‘arista_eos’, * ‘juniper’: ‘juniper_junos’

Returns:

device type

Return type:

str

property hn

device hostname

Returns:

device hostname

Return type:

str