1- # python-digitalocean
2-
3- This library provides easy access to Digital Ocean APIs to deploy droplets, images and more.
4-
5- [ ![ ] ( https://travis-ci.org/koalalorenzo/python-digitalocean.svg )] ( https://travis-ci.org/koalalorenzo/python-digitalocean )
6-
7- [ ![ ] ( https://img.shields.io/github/forks/badges/shields.svg?style=social&label=Fork )] ( https://travis-ci.org/koalalorenzo/python-digitalocean )
8- [ ![ ] ( https://img.shields.io/github/stars/badges/shields.svg?style=social&label=Star )] ( https://travis-ci.org/koalalorenzo/python-digitalocean )
9- [ ![ ] ( https://img.shields.io/github/watchers/badges/shields.svg?style=social&label=Watch )] ( https://travis-ci.org/koalalorenzo/python-digitalocean )
1+ <h1 align =" center " >python-digitalocean</h1 >
2+ <p align =" center " >Easy access to Digital Ocean APIs to deploy droplets, images and more.</p >
3+
4+ <p align =" center " >
5+ <a href =" https://travis-ci.org/koalalorenzo/python-digitalocean " ><img src =" https://travis-ci.org/koalalorenzo/python-digitalocean.svg " alt =" Build Status " ></a >
6+ <a href =" https://travis-ci.org/koalalorenzo/python-digitalocean " ><img src =" https://img.shields.io/github/forks/badges/shields.svg?style=social&label=Fork " ></a >
7+ <a href =" https://travis-ci.org/koalalorenzo/python-digitalocean " ><img src =" https://img.shields.io/github/stars/badges/shields.svg?style=social&label=Star " ></a >
8+ <a href =" https://travis-ci.org/koalalorenzo/python-digitalocean " ><img src =" https://img.shields.io/github/watchers/badges/shields.svg?style=social&label=Watch " ></a >
9+ </p >
10+
11+ ## Table of Contents
12+
13+ - [ How to install] ( #how-to-install )
14+ - [ Features] ( #features )
15+ - [ Examples] ( #examples )
16+ - [ Listing the droplets] ( #listing-the-droplets )
17+ - [ Listing the droplets by tags] ( #listing-the-droplets-by-tags )
18+ - [ Add a tag to a droplet] ( #add-a-tag-to-a-droplet )
19+ - [ Shutdown all droplets] ( #shutdown-all-droplets )
20+ - [ Creating a Droplet and checking its status] ( #creating-a-droplet-and-checking-its-status )
21+ - [ Checking the status of the droplet] ( #checking-the-status-of-the-droplet )
22+ - [ Add SSHKey into DigitalOcean Account] ( #add-sshkey-into-digitalocean-account )
23+ - [ Creating a new droplet with all your SSH keys] ( #creating-a-new-droplet-with-all-your-ssh-keys )
24+ - [ Creating a Firewall] ( #creating-a-firewall )
25+ - [ Getting account requests/hour limits status] ( #getting-account-requests-hour-limits-status )
26+ - [ Testing] ( #testing )
27+ - [ Test using Docker] ( #test-using-docker )
28+ - [ Testing using pytest manually] ( #testing-using-pytest-manually )
29+ - [ Links] ( #links )
1030
1131## How to install
1232
@@ -18,6 +38,8 @@ or via sources:
1838
1939 python setup.py install
2040
41+ ** [ ⬆ back to top] ( #table-of-contents ) **
42+
2143## Features
2244python-digitalocean support all the features provided via digitalocean.com APIs, such as:
2345
@@ -34,8 +56,9 @@ python-digitalocean support all the features provided via digitalocean.com APIs,
3456* Enable/Disable automatic Backups
3557* Restore root password of a Droplet
3658
59+ ** [ ⬆ back to top] ( #table-of-contents ) **
3760
38- ## Examples
61+ ## Examples
3962### Listing the droplets
4063
4164This example shows how to list all the active droplets:
@@ -47,6 +70,8 @@ my_droplets = manager.get_all_droplets()
4770print (my_droplets)
4871```
4972
73+ ** [ ⬆ back to top] ( #table-of-contents ) **
74+
5075### Listing the droplets by tags
5176
5277This example shows how to list all the active droplets:
@@ -58,6 +83,8 @@ my_droplets = manager.get_all_droplets(tag_name="awesome")
5883print (my_droplets)
5984```
6085
86+ ** [ ⬆ back to top] ( #table-of-contents ) **
87+
6188### Add a tag to a droplet
6289
6390This example shows how to list all the active droplets:
@@ -69,6 +96,8 @@ tag.create() # create tag if not already created
6996tag.add_droplets([" DROPLET_ID" ])
7097```
7198
99+ ** [ ⬆ back to top] ( #table-of-contents ) **
100+
72101### Shutdown all droplets
73102
74103This example shows how to shutdown all the active droplets:
@@ -81,6 +110,8 @@ for droplet in my_droplets:
81110 droplet.shutdown()
82111```
83112
113+ ** [ ⬆ back to top] ( #table-of-contents ) **
114+
84115### Creating a Droplet and checking its status
85116
86117This example shows how to create a droplet and how to check its status
@@ -96,6 +127,8 @@ droplet = digitalocean.Droplet(token="secretspecialuniquesnowflake",
96127droplet.create()
97128```
98129
130+ ** [ ⬆ back to top] ( #table-of-contents ) **
131+
99132### Checking the status of the droplet
100133``` python
101134actions = droplet.get_actions()
@@ -105,6 +138,8 @@ for action in actions:
105138 print action.status
106139```
107140
141+ ** [ ⬆ back to top] ( #table-of-contents ) **
142+
108143### Add SSHKey into DigitalOcean Account
109144``` python
110145from digitalocean import SSHKey
@@ -116,6 +151,8 @@ key = SSHKey(token='secretspecialuniquesnowflake',
116151key.create()
117152```
118153
154+ ** [ ⬆ back to top] ( #table-of-contents ) **
155+
119156### Creating a new droplet with all your SSH keys
120157``` python
121158manager = digitalocean.Manager(token = " secretspecialuniquesnowflake" )
@@ -131,6 +168,8 @@ droplet = digitalocean.Droplet(token="secretspecialuniquesnowflake",
131168droplet.create()
132169```
133170
171+ ** [ ⬆ back to top] ( #table-of-contents ) **
172+
134173### Creating a Firewall
135174
136175This example creates a firewall that only accepts inbound tcp traffic on port 80 from a specific load balancer and allows outbout tcp traffic on all ports to all addresses.
@@ -161,7 +200,10 @@ firewall = Firewall(token="secretspecialuniquesnowflake",
161200firewall.create()
162201```
163202
164- ## Getting account requests/hour limits status:
203+ ** [ ⬆ back to top] ( #table-of-contents ) **
204+
205+ ## Getting account requests/hour limits status
206+
165207Each request will also include the rate limit information:
166208
167209``` python
@@ -196,6 +238,7 @@ domains = manager.get_all_domains()
196238print (manager.ratelimit_limit)
197239```
198240
241+ ** [ ⬆ back to top] ( #table-of-contents ) **
199242
200243## Testing
201244
@@ -210,6 +253,8 @@ Then you can run all the tests (for both python 2 and python 3)
210253
211254** Note** : This will use Ubuntu 14.04 as base and use your repository to run tests. So every time you edit some files, please run these commands to perform tests on your changes.
212255
256+ ** [ ⬆ back to top] ( #table-of-contents ) **
257+
213258### Testing using pytest manually
214259Use [ pytest] ( http://pytest.org/ ) to perform testing. It is recommended to use a dedicated virtualenv to perform tests, using these commands:
215260
@@ -221,10 +266,13 @@ To run all the tests manually use py.test command:
221266
222267 $ python -m pytest
223268
269+ ** [ ⬆ back to top] ( #table-of-contents ) **
224270
225271## Links
226272
227273 * GitHub: [ https://github.com/koalalorenzo/python-digitalocean ] ( https://github.com/koalalorenzo/python-digitalocean )
228274 * PyPI page: [ https://pypi.python.org/pypi/python-digitalocean/ ] ( https://pypi.python.org/pypi/python-digitalocean/ )
229275 * Author Website: [ http://who.is.lorenzo.setale.me/ ?] ( http://setale.me/ )
230276 * Author Blog: [ http://blog.setale.me/ ] ( http://blog.setale.me/ )
277+
278+ ** [ ⬆ back to top] ( #table-of-contents ) **
0 commit comments