A python wrapper for the Server Density Api
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
serverdensity
tests
.editorconfig
.gitignore
.travis.yml
AUTHORS.rst
CONTRIBUTING.rst
LICENSE
MANIFEST.in
Makefile
README.rst
requirements.txt
requirements_dev.txt
setup.cfg
setup.py
tox.ini
travis_pypi_setup.py

README.rst

Server Density Python Wrapper

A python wrapper for the Server Density Api It runs on both python 2.7 and up to python 3.5

Up and running

There are two ways of using the api wrapper. Either calling the endpoints from an instance of ApiClient or from an instance of the class of an endpoint such as Device.

from serverdensity.wrapper import ApiClient
from serverdensity.wrapper import Device

token = '2dfae5bf81f65492a40569d39b29ffa3'

client = ApiClient(token)
device = client.devices.create(data={'name': 'testdevice'})


# instead of keyword arguments, it can also take a dictionary.
device2 = Device(token, name='name2')
device2.create()

# This will create an AttributeError, since name is required to create a
# device at some point.
device3 = Device(token, group='testgroup')

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.