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 2014/07/29 16:48:21 UTC

git commit: Add ex_get_resource_pool_name and ex_get_resource_pools method to the vSphere driver.

Repository: libcloud
Updated Branches:
  refs/heads/trunk 054f29a94 -> 4e741049a


Add ex_get_resource_pool_name and ex_get_resource_pools method to the
vSphere driver.


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

Branch: refs/heads/trunk
Commit: 4e741049ac418c7d6a32facf7c8d5439149fc97e
Parents: 054f29a
Author: Tomaz Muraus <to...@apache.org>
Authored: Tue Jul 29 16:27:16 2014 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Jul 29 16:32:32 2014 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/vsphere.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/4e741049/libcloud/compute/drivers/vsphere.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/vsphere.py b/libcloud/compute/drivers/vsphere.py
index aa9ddd5..29e863e 100644
--- a/libcloud/compute/drivers/vsphere.py
+++ b/libcloud/compute/drivers/vsphere.py
@@ -241,6 +241,26 @@ class VSphereNodeDriver(NodeDriver):
         return True
 
     @wrap_non_libcloud_exceptions
+    def ex_get_resource_pools(self):
+        """
+        Return all the available resource pools.
+
+        :rtype: ``dict``
+        """
+        result = self.connection.client.get_resource_pools()
+        return result
+
+    @wrap_non_libcloud_exceptions
+    def ex_get_resource_pool_name(self, node):
+        """
+        Retrieve resource pool name for the provided node.
+
+        :rtype: ``str``
+        """
+        vm = self._get_vm_for_node(node=node)
+        return vm.get_resource_pool_name()
+
+    @wrap_non_libcloud_exceptions
     def ex_get_node_by_path(self, path):
         """
         Retrieve Node object for a VM with a provided path.