You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2015/06/14 12:52:22 UTC

[11/21] libcloud git commit: Added documentation for DigitalOceanDNSDriver and other doc updates - Includes driver instantiation example - Updated Node driver documentation to reflect duality of v1/v2 api in DigitalOceanNodeDriver

Added documentation for DigitalOceanDNSDriver and other doc updates - Includes driver instantiation example - Updated Node driver documentation to reflect duality of v1/v2 api in DigitalOceanNodeDriver

Signed-off-by: Tomaz Muraus <to...@tomaz.me>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f451f210
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f451f210
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f451f210

Branch: refs/heads/trunk
Commit: f451f210df5c3b32a2caff34a71f7d104c01eb8d
Parents: c7f00b4
Author: Javier Castillo II <j....@gmail.com>
Authored: Wed Apr 15 23:01:04 2015 +0000
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sun Jun 14 18:05:58 2015 +0800

----------------------------------------------------------------------
 docs/compute/drivers/digital_ocean.rst          |  5 +--
 docs/dns/drivers/digital_ocean.rst              | 32 ++++++++++++++++++++
 .../digitalocean/instantiate_api_v1.0.py        |  2 +-
 .../digitalocean/instantiate_api_v2.0.py        |  3 --
 .../dns/digitalocean/instantiate_driver.py      |  5 +++
 5 files changed, 41 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f451f210/docs/compute/drivers/digital_ocean.rst
----------------------------------------------------------------------
diff --git a/docs/compute/drivers/digital_ocean.rst b/docs/compute/drivers/digital_ocean.rst
index 6b71ed3..67e7ebc 100644
--- a/docs/compute/drivers/digital_ocean.rst
+++ b/docs/compute/drivers/digital_ocean.rst
@@ -14,8 +14,9 @@ Instantiating a driver
 ----------------------
 
 DigitalOcean driver supports two API versions - old API v1.0 and the new API
-v2.0 which is currently in beta. Since trunk (to be libcloud v0.18.0), the
-driver uses new API v2.0 by default.
+v2.0. Since trunk (to be libcloud v0.18.0), the driver uses the correct API
+based on the initialization with the Client ID (key) and Access Token (secret)
+for v1.0 or the Personal Access Token (key) in v2.0.
 
 Instantiating a driver using API v2.0
 -------------------------------------

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f451f210/docs/dns/drivers/digital_ocean.rst
----------------------------------------------------------------------
diff --git a/docs/dns/drivers/digital_ocean.rst b/docs/dns/drivers/digital_ocean.rst
new file mode 100644
index 0000000..b7ec3a6
--- /dev/null
+++ b/docs/dns/drivers/digital_ocean.rst
@@ -0,0 +1,32 @@
+DigitalOcean Compute Driver Documentation
+=========================================
+
+`DigitalOcean`_ is an American virtual private server provider based in New York
+City with data centers in New York, Amsterdam, San Francisco, London and
+Singapore.
+
+.. figure:: /_static/images/provider_logos/digitalocean.png
+    :align: center
+    :width: 300
+    :target: https://www.digitalocean.com/
+
+Instantiating a driver
+----------------------
+
+DigitalOcean dns driver supports only the v2.0 API requiring a Personal Access
+Token to initialize as the key.
+
+Instantiating the driver
+-------------------------------------
+
+.. literalinclude:: /examples/dns/digitalocean/instantiate_driver.py
+   :language: python
+
+API Docs
+--------
+
+.. autoclass:: libcloud.dns.drivers.digitalocean.DigitalOceanDNSDriver
+    :members:
+    :inherited-members:
+
+.. _`DigitalOcean`: https://www.digitalocean.com/

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f451f210/docs/examples/compute/digitalocean/instantiate_api_v1.0.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/digitalocean/instantiate_api_v1.0.py b/docs/examples/compute/digitalocean/instantiate_api_v1.0.py
index ea498d1..c1b822d 100644
--- a/docs/examples/compute/digitalocean/instantiate_api_v1.0.py
+++ b/docs/examples/compute/digitalocean/instantiate_api_v1.0.py
@@ -2,4 +2,4 @@ from libcloud.compute.types import Provider
 from libcloud.compute.providers import get_driver
 
 cls = get_driver(Provider.DIGITAL_OCEAN)
-driver = cls('client id', 'api key', api_version='v1')
+driver = cls('client id', 'api key')

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f451f210/docs/examples/compute/digitalocean/instantiate_api_v2.0.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/digitalocean/instantiate_api_v2.0.py b/docs/examples/compute/digitalocean/instantiate_api_v2.0.py
index c2c950a..1a29362 100644
--- a/docs/examples/compute/digitalocean/instantiate_api_v2.0.py
+++ b/docs/examples/compute/digitalocean/instantiate_api_v2.0.py
@@ -3,7 +3,4 @@ from libcloud.compute.providers import get_driver
 
 cls = get_driver(Provider.DIGITAL_OCEAN)
 
-driver = cls('access token', api_version='v2')
-# Note: Driver defaults to v2.0 so api_version argument can be omitted and the
-# following is the same
 driver = cls('access token')

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f451f210/docs/examples/dns/digitalocean/instantiate_driver.py
----------------------------------------------------------------------
diff --git a/docs/examples/dns/digitalocean/instantiate_driver.py b/docs/examples/dns/digitalocean/instantiate_driver.py
new file mode 100644
index 0000000..e1b1191
--- /dev/null
+++ b/docs/examples/dns/digitalocean/instantiate_driver.py
@@ -0,0 +1,5 @@
+from libcloud.dns.types import Provider
+from libcloud.dns.providers import get_driver
+
+cls = get_driver(Provider.DIGITAL_OCEAN)
+driver = cls(key='access token')