Python wrapper for Digital Ocean API V2
Project description
Python wrapper for Digital Ocean API V2.
Installation
pip install dosa
Usage
import dosa
API_KEY = 'Your API Key'
dosa.set_debug() # enables debug logs
client = dosa.Client(api_key=API_KEY)
# Droplets
client.droplets.list()
status, result = client.droplets.create(name='terminator', region='nyc2',\
size='512mb', image='ubuntu-14-04-x32', ssh_keys=[12345])
new_droplet_id = result['id']
# Droplet
new_droplet = client.Droplet(new_droplet_id)
print(new_droplet.info())
## shortcuts
new_droplet.status()
new_droplet.ip_addresses()
client.droplets.delete(new_droplet_id)
# SSH Keys
pub_key = open('~/.ssh/id_rsa.pub').read()
client.keys.create(name='RSA key', public_key=pub_key)
client.keys.list()
# Images
client.images.list()
client.images.all()
# Extras
# $ ls keys/
# rsa_pub1.id rsa_pub2.key rsa_pub3.key
keys_dir = 'keys'
client.sync_ssh_keys(keys_dir)
Credits
Created while working on Scroll.in’s project.
Dosa?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dosa-0.6.1.tar.gz
(4.1 kB
view details)
File details
Details for the file dosa-0.6.1.tar.gz
.
File metadata
- Download URL: dosa-0.6.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b33599ccf9e1c9047c0e5da68f56770452295edfd64f1f8cdff2f37dda5bfaf |
|
MD5 | 45095cd4133e622557a003b8a30e382f |
|
BLAKE2b-256 | 81db885bc186c1dfdfb9f65d80a678c47e43073e597356a614e2d095294f6d08 |