digitalocean.com API to manage Droplets and Images
Project description
#python-digitalocean
##
python-digitalocean is a python package that provide easy access to digitalocean.com APIs to manage droplets, images and more.
[](https://tip4commit.com/github/koalalorenzo/python-digitalocean)
<div align="center">
<iframe src="http://ghbtns.com/github-btn.html?user=koalalorenzo&repo=python-digitalocean&type=follow&size=large&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="220" height="30"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=koalalorenzo&repo=python-digitalocean&type=watch&size=large&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="150" height="30"></iframe>
</div>
## 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 public Images
* Get Droplet'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 active droplets:
```python
import digitalocean
manager = digitalocean.Manager(token="secretspecialuniquesnowflake")
my_droplets = manager.get_all_droplets()
for droplet in my_droplets:
droplet.shutdown()
```
### Creating a Droplet and checking its status
This example shows how to create a droplet and how to check its status
```python
import digitalocean
droplet = digitalocean.Droplet(token="secretspecialuniquesnowflake",
name='Example',
region='nyc2', # New York 2
image='ubuntu-14-04-x64', # Ubuntu 14.04 x64
size='512mb', # 512MB
backups=True)
droplet.create()
```
### Checking the status of the droplet
```python
actions = droplet.get_actions()
for action in actions:
action.load()
# Once it shows complete, droplet is up and running
print action.status
```
## Links
* Project Site: [http://projects.setale.me/python-digitalocean](http://projects.setale.me/python-digitalocean)
* GitHub: [https://github.com/koalalorenzo/python-digitalocean](https://github.com/koalalorenzo/python-digitalocean)
* PyPi page: [https://pypi.python.org/pypi/python-digitalocean/](https://pypi.python.org/pypi/python-digitalocean/)
* Author Website: [http://who.is.lorenzo.setale.me/?](http://setale.me/)
* Author Blog: [http://blog.setale.me/](http://blog.setale.me/)
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-10395528-24', 'setale.me');
ga('send', 'pageview');
</script>
##
python-digitalocean is a python package that provide easy access to digitalocean.com APIs to manage droplets, images and more.
[](https://tip4commit.com/github/koalalorenzo/python-digitalocean)
<div align="center">
<iframe src="http://ghbtns.com/github-btn.html?user=koalalorenzo&repo=python-digitalocean&type=follow&size=large&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="220" height="30"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=koalalorenzo&repo=python-digitalocean&type=watch&size=large&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="150" height="30"></iframe>
</div>
## 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 public Images
* Get Droplet'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 active droplets:
```python
import digitalocean
manager = digitalocean.Manager(token="secretspecialuniquesnowflake")
my_droplets = manager.get_all_droplets()
for droplet in my_droplets:
droplet.shutdown()
```
### Creating a Droplet and checking its status
This example shows how to create a droplet and how to check its status
```python
import digitalocean
droplet = digitalocean.Droplet(token="secretspecialuniquesnowflake",
name='Example',
region='nyc2', # New York 2
image='ubuntu-14-04-x64', # Ubuntu 14.04 x64
size='512mb', # 512MB
backups=True)
droplet.create()
```
### Checking the status of the droplet
```python
actions = droplet.get_actions()
for action in actions:
action.load()
# Once it shows complete, droplet is up and running
print action.status
```
## Links
* Project Site: [http://projects.setale.me/python-digitalocean](http://projects.setale.me/python-digitalocean)
* GitHub: [https://github.com/koalalorenzo/python-digitalocean](https://github.com/koalalorenzo/python-digitalocean)
* PyPi page: [https://pypi.python.org/pypi/python-digitalocean/](https://pypi.python.org/pypi/python-digitalocean/)
* Author Website: [http://who.is.lorenzo.setale.me/?](http://setale.me/)
* Author Blog: [http://blog.setale.me/](http://blog.setale.me/)
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-10395528-24', 'setale.me');
ga('send', 'pageview');
</script>
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-digitalocean-1.0.tar.gz.
File metadata
- Download URL: python-digitalocean-1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0ca4d58771d5f1e9bd4180864b55b2e4a2e4473b543a99b62e50a281f578e95
|
|
| MD5 |
7aa3f0ba18da5779d7ef0e7439053e5c
|
|
| BLAKE2b-256 |
d89bfa4905f556e868a3bb10648610f41b395ba5e7fc82944f00944a2c6b041c
|
File details
Details for the file python-digitalocean-1.0.macosx-10.9-intel.tar.gz.
File metadata
- Download URL: python-digitalocean-1.0.macosx-10.9-intel.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c76025f2dd4b2497134647732d32881cef80a489983ffc8ba75995be555a9252
|
|
| MD5 |
f247d3f62aad40e11164f997f3a1a052
|
|
| BLAKE2b-256 |
4c9d3697d272f55ae1fea79cad09a18559abd71f13c9f211b77dfe02b7aac04e
|