digitalocean.com API to manage Droplets and Images
Project description
# python-digitalocean
python-digitalocean is a python package that provide easy acces to digitalocean.com APIs to manage droplets, images and more.
## How to install
You can install python-digitalocean using **pip**
pip install -U python-digitalocean
or via sources:
python setup.py install
## Features
python-digitalocean support all the features provided via digitalocean.com APIs, such as:
* Get user's Droplets
* Get user's Images ( Snapshot and Backups )
* Get pubblic Images
* Get Droptlet's event status
* Create and Remove a Droplet
* Resize a Droplet
* shutdown, restart and boot a Droplet
* power off, power on and "power cycle" a Droplet
* Perform Snapshot
* Enable/Disable automatic Backups
* Restore root password of a Droplet
## Examples
### Shutdown all droplets
This example shows how to shutdown all the droplets active:
import digitalocean
manager = digitalocean.Manager(client_id="ABC", api_key="ABC")
my_droplets = manager.get_all_droplets()
for droplet in my_droplets:
droplet.shutdown()
### Creating a Droplet and checking it's status
This example shows how to create a droplet and how to check it's status
import digitalocean
droplet = digitalocean.Droplet(client_id=client_id,
api_key=api_key,
name = 'Example',
region_id=1 #New York,
image_id=2676 #Ubuntu 12.04 x64 Server,
size_id=66 #512MB,
backup_active=False)
droplet.create()
### Checking the status of the droplet
events = droplet.get_events()[0]
### Refreshing the event status
event.load()
#Once it shows 100, droplet is up and running
print event.percentage
python-digitalocean is a python package that provide easy acces to digitalocean.com APIs to manage droplets, images and more.
## How to install
You can install python-digitalocean using **pip**
pip install -U python-digitalocean
or via sources:
python setup.py install
## Features
python-digitalocean support all the features provided via digitalocean.com APIs, such as:
* Get user's Droplets
* Get user's Images ( Snapshot and Backups )
* Get pubblic Images
* Get Droptlet's event status
* Create and Remove a Droplet
* Resize a Droplet
* shutdown, restart and boot a Droplet
* power off, power on and "power cycle" a Droplet
* Perform Snapshot
* Enable/Disable automatic Backups
* Restore root password of a Droplet
## Examples
### Shutdown all droplets
This example shows how to shutdown all the droplets active:
import digitalocean
manager = digitalocean.Manager(client_id="ABC", api_key="ABC")
my_droplets = manager.get_all_droplets()
for droplet in my_droplets:
droplet.shutdown()
### Creating a Droplet and checking it's status
This example shows how to create a droplet and how to check it's status
import digitalocean
droplet = digitalocean.Droplet(client_id=client_id,
api_key=api_key,
name = 'Example',
region_id=1 #New York,
image_id=2676 #Ubuntu 12.04 x64 Server,
size_id=66 #512MB,
backup_active=False)
droplet.create()
### Checking the status of the droplet
events = droplet.get_events()[0]
### Refreshing the event status
event.load()
#Once it shows 100, droplet is up and running
print event.percentage
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
File details
Details for the file python-digitalocean-0.2.5.tar.gz.
File metadata
- Download URL: python-digitalocean-0.2.5.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d432e08a7382aa2ac44754c15f0002a4d7c3076afd12107d512c954b48e321e
|
|
| MD5 |
412b27d68a32dd3f3f6482c8650d84d5
|
|
| BLAKE2b-256 |
19789bc731d2e1cc18e9d7e884c08fc39fc50a9108d2fc323cb965e29a2828a1
|