libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [1/2] git commit: docs: Add info on how to use ex__list_availability_groups method.
Date Thu, 30 Jan 2014 17:27:41 GMT
Updated Branches:
  refs/heads/trunk f7a95f8cf -> ec2bff134


docs: Add info on how to use ex__list_availability_groups method.


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

Branch: refs/heads/trunk
Commit: 62a23d39bd47e6f6bd857b1940c35a8b5056049c
Parents: f7a95f8
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Thu Jan 30 18:11:51 2014 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Thu Jan 30 18:11:51 2014 +0100

----------------------------------------------------------------------
 docs/compute/drivers/cloudsigma.rst                    | 12 ++++++++++++
 docs/examples/compute/cloudsigma/check_avail_groups.py | 11 +++++++++++
 2 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/62a23d39/docs/compute/drivers/cloudsigma.rst
----------------------------------------------------------------------
diff --git a/docs/compute/drivers/cloudsigma.rst b/docs/compute/drivers/cloudsigma.rst
index 241349c..e6d3581 100644
--- a/docs/compute/drivers/cloudsigma.rst
+++ b/docs/compute/drivers/cloudsigma.rst
@@ -171,6 +171,18 @@ in the same availability group as an avoid resource.
 .. literalinclude:: /examples/compute/cloudsigma/create_node_ex_avoid.py
    :language: python
 
+To check which servers and drives share the same physical compute / storage
+host, you can use the
+:meth:`libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_servers_availability_groups`
+and :meth:`libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_drives_availability_groups`
+method as displayed bellow.
+
+.. literalinclude:: /examples/compute/cloudsigma/check_avail_groups.py
+   :language: python
+
+Both of those methods return a ``list``. Servers and drives which share the same
+physical host will be stored under the same index in the returned list.
+
 10. Retrieving the account balance
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/62a23d39/docs/examples/compute/cloudsigma/check_avail_groups.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/cloudsigma/check_avail_groups.py b/docs/examples/compute/cloudsigma/check_avail_groups.py
new file mode 100644
index 0000000..c770007
--- /dev/null
+++ b/docs/examples/compute/cloudsigma/check_avail_groups.py
@@ -0,0 +1,11 @@
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+
+cls = get_driver(Provider.CLOUDSIGMA)
+driver = cls('username', 'password', region='zrh', api_version='2.0')
+
+servers_groups = driver.ex_list_servers_availability_groups()
+drives_groups = driver.ex_list_drives_availability_groups()
+
+print(servers_groups)
+print(drives_groups)


Mime
View raw message