remot3 package

Submodules

remot3.remot3 module

Main Module

class remot3.remot3.Remot3(developerkey, user, password, apiurl='https://api.remot3.it/apv/v27/')[source]

Bases: object

Implements the remot3.it API calls

Args:
  • user (str): account user.
  • password (str): account secret password.
  • developerkey (str): account secret developer key.
  • apiurl (str): API url and version.
Params:
  • token (str): session token
get_apiurl()[source]

Returns the API url and version

get_device_address(deviceName, serviceType=None)[source]

Maps a device name to a device address

Args:
  • deviceName (str):
  • serviceType (str): the service type, e.g. SSH
Returns:
  • deviceAddress(list): a list of matching device addresses
get_server_name(deviceAddr, resource='/device/connect', token=None)[source]

Implemented the connect to a device API call

Args:
  • deviceAddres (str): the device address of the selected installation
    • token (str): Optional token to be used instead of self.token
Returns:
  • status (bool): whether the call returned successfully and the response is valid
  • proxyserver (str): the connection sever name if any, otherwise None
  • proxyserver (str): the connection port number if any, otherwise None
  • response_body (dict): the full response JSON object
get_token()[source]
list_devices(resource='/device/list/all', token=None)[source]

Implements the device/list API call

Args:
  • resource (str): API resource
  • token (str): Optional token to be used instead of self.token
  • headers (dict): Optional JSON object overriding the request header
Returns:
  • status (bool): whether the call returned successfully and the response is valid
  • devices (list): a list of devices
  • response_body (dict): the full response JSON object
login(resource='/user/login')[source]

Implements login api

Args:
  • resource (str): Overrides API resource (suburl)
Returns:
  • status (bool): whether the response is valid
  • token (str): a valid connection token or None
  • response_body (dict): the full response JSON object
parse_server_name(servername, regEx=None)[source]

Parses a server name

Args:
  • servername (str): string containing the server name
  • regEx (str): overrides the default regEx
Returns:
  • The filtered server name if a match is found or the
  • same string otherwise

Module contents

Top-level package for remot3.