Digital Ocean Python
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8b7bcbc Jul 7, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dopy Support for Tags API May 12, 2016
.gitignore Update setup, license and other. Feb 10, 2014
CHANGES Move to 0.3.7 Nov 11, 2015
LICENSE Update setup, license and other. Feb 10, 2014
MANIFEST.in Minor changes. Feb 10, 2014
README.rst Update README Dec 24, 2015
requirements.txt Read paginated results Aug 12, 2015
setup.py add missing requires Nov 11, 2015

README.rst

Digital Ocean API Python Wrapper

Inspired by [dop](https://github.com/ahmontero/dop).

Installation

# pip install dopy

Getting Started

To interact with Digital Ocean, you first need .. a digital ocean account with valid API keys.

Keys can be set either as Env variables, or within the code.

For API v.2.

# export DO_API_VERSION='2'
# export DO_API_TOKEN='api_token'
>>> from dopy.manager import DoManager
>>> do = DoManager(None, 'api_token', api_version=2)

For API v.1.

# export DO_CLIENT_ID='client_id'
# export DO_API_KEY='long_api_key'
>>> from dopy.manager import DoManager
>>> do = DoManager('client_id', 'long_api_key')

Methods

The methods of the DoManager are self explanatory; ex.

>>> do.all_active_droplets()
>>> do.show_droplet('12345')
>>> do.destroy_droplet('12345')
>>> do.all_regions()
>>> do.all_images()
>>> do.all_ssh_keys()
>>> do.sizes()
>>> do.all_domains()
>>> do.new_droplet('new_droplet', 66, 1601, 1)

The methods for v.2 API are similar, the only difference is using names instead of IDs for domains and slugs for sizes, images and datacenters; ex.

>>> do.show_domain('exapmle.com')
>>> do.new_droplet('new_droplet', '512mb', 'lamp', 'ams2')

Methods for Floating IPs are:

>>> do.all_floating_ips()
>>> do.new_floating_ip(droplet_id, region)
>>> do.destroy_floating_ip(ip_addr)
>>> do.assign_floating_ip(ip_addr)
>>> do.unassign_floating_ip(ip_addr)
>>> do.list_floating_ip_actions(ip_addr)
>>> do.get_floating_ip_action(ip_addr, action_id)

TODO

See github issue list - post if any needed

https://github.com/devo-ps/dopy/issues