libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [3/5] libcloud git commit: Added Cloudwatt doc with example
Date Fri, 22 May 2015 15:31:00 GMT
Added Cloudwatt doc with example

Close #525

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


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

Branch: refs/heads/trunk
Commit: 72876fef87960c092bf703d43ba0225ff19a0a44
Parents: 7719312
Author: ZuluPro <montheanthony@hotmail.com>
Authored: Mon May 18 15:27:07 2015 -0400
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Fri May 22 17:21:51 2015 +0200

----------------------------------------------------------------------
 .../_static/images/provider_logos/cloudwatt.png | Bin 0 -> 24813 bytes
 docs/compute/drivers/cloudwatt.rst              |  50 +++++++++++++++++++
 docs/examples/compute/cloudwatt/create_node.py  |   9 ++++
 .../examples/compute/cloudwatt/create_volume.py |   9 ++++
 4 files changed, 68 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/72876fef/docs/_static/images/provider_logos/cloudwatt.png
----------------------------------------------------------------------
diff --git a/docs/_static/images/provider_logos/cloudwatt.png b/docs/_static/images/provider_logos/cloudwatt.png
new file mode 100644
index 0000000..b9abdbc
Binary files /dev/null and b/docs/_static/images/provider_logos/cloudwatt.png differ

http://git-wip-us.apache.org/repos/asf/libcloud/blob/72876fef/docs/compute/drivers/cloudwatt.rst
----------------------------------------------------------------------
diff --git a/docs/compute/drivers/cloudwatt.rst b/docs/compute/drivers/cloudwatt.rst
new file mode 100644
index 0000000..44ec67e
--- /dev/null
+++ b/docs/compute/drivers/cloudwatt.rst
@@ -0,0 +1,50 @@
+Cloudwatt Compute Driver Documentation
+======================================
+
+`Cloudwatt`_ is a public cloud provider based in Boulogne-Billancourt, France
+with one datacenter at Val-de-Reuil
+
+.. figure:: /_static/images/provider_logos/cloudwatt.png
+    :align: center
+    :width: 300
+    :target: https://www.cloudwatt.com/fr/
+
+Cloudwatt driver is based on the OpenStack driver so for more information about
+that and OpenStack specific documentation, please refer to
+:doc:`OpenStack Compute Driver Documentation <openstack>` page.
+
+Instantiating a driver
+----------------------
+
+When you instantiate a driver you need to pass the following arguments to the
+driver constructor:
+
+* ``username`` - your Cloudwatt registered email
+* ``password`` - your Cloudwatt password
+* ``tenant_id`` - your Cloudwatt tenant ID
+* ``tenant_name`` - your Cloudwatt tenant name
+
+Tenant ID and name are foundable in the RC script available with web interface
+at https://console.cloudwatt.com/overrides/access_and_security_overrides/view_credentials/
+
+Examples
+--------
+
+Create instance
+~~~~~~~~~~~~~~~
+
+.. literalinclude:: /examples/compute/cloudwatt/create_node.py
+
+Create volume and attach
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: /examples/compute/cloudwatt/create_volume.py
+
+API Docs
+--------
+
+.. autoclass:: libcloud.compute.drivers.cloudwatt.CloudwattNodeDriver
+    :members:
+    :inherited-members:
+
+.. _`Cloudwatt`: https://www.cloudwatt.com/

http://git-wip-us.apache.org/repos/asf/libcloud/blob/72876fef/docs/examples/compute/cloudwatt/create_node.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/cloudwatt/create_node.py b/docs/examples/compute/cloudwatt/create_node.py
new file mode 100644
index 0000000..0b516d8
--- /dev/null
+++ b/docs/examples/compute/cloudwatt/create_node.py
@@ -0,0 +1,9 @@
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+
+Cloudwatt = get_driver(Provider.CLOUDWATT)
+driver = Cloudwatt('your_email', 'your_password', 'your_tenant_id',
+                   tenant_name='your_tenant_name')
+image = [i for i in driver.list_images() if i.name == 'Debian Wheezy'][0]
+size = [s for s in driver.list_sizes() if s.name == 'n1.cw.standard-1'][0]
+node = driver.create_node(name='yournode', size=size, image=image)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/72876fef/docs/examples/compute/cloudwatt/create_volume.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/cloudwatt/create_volume.py b/docs/examples/compute/cloudwatt/create_volume.py
new file mode 100644
index 0000000..822da7d
--- /dev/null
+++ b/docs/examples/compute/cloudwatt/create_volume.py
@@ -0,0 +1,9 @@
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+
+Cloudwatt = get_driver(Provider.CLOUDWATT)
+driver = Cloudwatt('your_email', 'your_password', 'your_tenant_id',
+                   tenant_name='your_tenant_name')
+node = driver.list_nodes()[0]
+volume = driver.create_volume(10, 'your_volume')
+driver.attach_volume(node, volume)


Mime
View raw message