connections.ssh

class connections.ssh.ApplianceSsh
__init__(system, connect_args, call_timeout=None)
connect()

Connect to an appliance, disable timeouts and return the ssh object. :return: paramiko ssh object

disconnect()
prep_cmd(operation, **update_cmds)
Returns:ActCmd object with ssh_command attribute
call(command_obj)

Use when you explicitly want to connect over ssh and send raw ssh commands.

This houses the functionality unlike rest method because I want to avoid passing around the client to retain channels.

Parameters:command_obj – Instance of ActCmd object
Returns:stdout, stderr, exit status
post_cmd(command_obj)
raw(ssh_command, statuses=None)

Send an ssh command with the only processing being newline stripping.

Threaded timeouts still apply to raw. If you need absolute individual control use method call.

Parameters:
  • ssh_command – command to send
  • statuses – list of acceptable exit statuses
Returns:

namedtuple ssh_output

params_to_cli(operation, **update_cmds)

Takes a functional cli operation and appends rest like inputs.

ex.
self.cmd(‘udsinfo lshost’, filtervalue=’ostype=Linux’)
returns:
“/act/bin/udsinfo lshost -filtervalue ‘ostype=Linux’”
Parameters:
  • operation – A functional cli operation
  • update_cmds
Returns:

convert_ssh_output(stdout, stderr)