Altitude#
The full reference for Altitude APIs.
- class mygeotab.altitude.AltitudeAPI(username, password=None, database=None, session_id=None, server='my.geotab.com', timeout=300, proxies=None, cert=None)[source]#
- __init__(username, password=None, database=None, session_id=None, server='my.geotab.com', timeout=300, proxies=None, cert=None)[source]#
A wrapper around mygeotab API for altitude users.
- Parameters:
username (str) – The username used for MyGeotab servers. Usually an email address.
password (str) – The password associated with the username. Optional if session_id is provided.
database (str) – The database or company name. Optional as this usually gets resolved upon authentication.
session_id (str) – A session ID, assigned by the server.
server (str or None) – The server ie. my23.geotab.com. Optional as this usually gets resolved upon authentication.
timeout (float or None) – The timeout to make the call, in seconds. By default, this is 300 seconds (or 5 minutes).
proxies (dict or None) – The proxies dictionary to apply to the request.
cert (str or Tuple or None) – The path to client certificate. A single path to .pem file or a Tuple (.cer file, .key file).
- Raises:
Exception – Raises an Exception if a username, or one of the session_id or password is not provided.
- call_api(function_name: str, params: dict) dict [source]#
Supports getJobStatus calls, and getQueryResults calls. Retries in case of errors like connection rest.
- check_job_status(params: dict) DaasGetJobStatusResult [source]#
checks the status of a given job. jobId needs to be included in params.
- wait_for_job_to_complete(params: dict) dict [source]#
waits for a job to finish running and returns the job. jobId needs to be included in params.
- fetch_data(params: dict) dict [source]#
fetch data for the given params. jobId needs to be included in params.
- class mygeotab.altitude.DaasResult(call_result: dict)[source]#
DaasResult class, the base class for all results returned from calling our application from the gateway
- Attributes:
call_result (dict): The result returned from the api call, this includes our gateway information. api_result (dict): The “apiResult” the result computed by altitude application. jobs (list): all the possible results returned by the altitude application call, normally it should always have the length of 1. job (dict): first result returned by the altitude application call (first element of jobs). daas_errors (list): possible errors list that happened on the gateway. api_result_errors (list): possible errors list that happened on the altitude application. api_result_error_message (str): possible single error message that happened on the altitude application. api_result_error (DaasError): possible single error object that happened on the altitude application. errors (list): list of all the errors (gateway and altitude application) combined together.
- class mygeotab.altitude.DaasGetJobStatusResult(call_result: dict)[source]#
DaasGetJobStatusResult class, the returned format for checking the status of the job
- Attributes:
id (str): the id of the job returned status (dict): the status of the job state (str): the state of the job (from the status object)