connection.appliance_rest

class connection.appliance_rest.ApplianceRest
__init__(system, params, call_timeout=None)
Parameters:
  • system – Appliance to connect to (ip or dns name)
  • params – Dictionary of params to send to connect; ex. {‘name’: ‘ex’, ‘password’: ‘ex’, ‘vendorkey’: ‘ex’}
  • call_timeout – Maximum time to spend attempting an individual call
connect()

Connect and get a sessionid from the appliance.

disconnect(sid=None)

Logout of an actifio rest session.

prep_cmd(command, **update_cmds)
call(command_obj)
_protect_sid(method, url, params, verify=False, **kwargs)

Resend the operation if it looks like the sessionid has been dropped (default times out at 30 minutes).

ui_call(method, url_suffix, params=None, data=None, **kwargs)

Used to send Actifio desktop rest calls.

Parameters:
  • method – type of rest call to make. ie. GET, POST
  • input_dictionary – python object to be converted to json
  • url_suffix – What follows actifio in the UI call. i.e. https://<some_hostname>/actifio/<url_suffix here>
Returns:

ActResponse object of request

cli_to_rest(operation)

Turn a cli command into rest method, url, and params. Argument should be the first parameter.

Method and url return are strings while params is a dictionary. Argument should be the first command because barring documenting and updating all valueless keynames (i.e. -force -nowait etc.) this encoder cannot figure out what parameters are switches and which expect a value. :param operation: The full operation to be converted. ex. “udsinfo lshost 1234 -filtervalue some=thing&also=this :return: method (str), url (str), params (dict)