Python SDK for the Generator Labs REST API

We’re extremely excited to announce the release of the office Generator Labs Python SDK. Developers can us this simple wrapper library to integrate all the features of the Generator Labs API into their existing processes.

Installation

The Python SDK can be installed via the Python package manager:

pip install generatorlabs

Or if you prefer, you can clone the source code from the official GitHub repository.

API Access Token

To authenticate API requests, you must use the Account SID and Access Token, available from the Account -> API Access section of the Generator Labs Portal.

Example Usage

Using the Python SDK only requires a few lines of code. In this example, we’ll request a list of hosts from our account:

import generatorlabs

try:
 client = generatorlabs.Client('Your Account SID', 'Your Auth Token')

data = client.hosts.get();

except generatorlabs.GeneratorLabsException as err:
 print(err)

In this example, we’ll start a manual check process, using the real-time check features of the Generator Labs API:

import generatorlabs

try:
 client = generatorlabs.Client('Your Account SID', 'Your Auth Token')

data = client.check.start({

"host": "10.10.10.11",
 "callback": "https://your.website.com/callback.php",
 "details": 1
 });

except generatorlabs.GeneratorLabsException as err:
 print(err)

See our API Reference for a complete list of all the Python SDK features.

Leave a Reply

Your email address will not be published. Required fields are marked *