summaryrefslogtreecommitdiff
path: root/cinderclient/v2/shell.py
diff options
context:
space:
mode:
authorMitsuhiro Tanino <mitsuhiro.tanino@hds.com>2015-01-02 16:25:17 -0500
committerMitsuhiro Tanino <mitsuhiro.tanino@hds.com>2015-01-05 16:04:43 -0500
commit1d38426680f8bd5cc4d8d35aa7c02ec6ba8bf4ef (patch)
treeac5541c1f53ff60cdb60425741ed49761363a098 /cinderclient/v2/shell.py
parent59177814a45b067cc47259817f8d9ff96e8d104b (diff)
downloadpython-cinderclient-1d38426680f8bd5cc4d8d35aa7c02ec6ba8bf4ef.tar.gz
Add command to show pool information for backends
An admin-api extension to show pool info was supported at commit https://review.openstack.org/#/c/119938/. This change adds a command to show pool information for backends using the admin-api. This change also closes the gap for end users. Partial-Bug: 1403902 Change-Id: I20e0828c5403b73bc44d07eebf08e2aa2deb428a
Diffstat (limited to 'cinderclient/v2/shell.py')
-rw-r--r--cinderclient/v2/shell.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py
index a0f6977..99ad245 100644
--- a/cinderclient/v2/shell.py
+++ b/cinderclient/v2/shell.py
@@ -1948,3 +1948,21 @@ def do_cgsnapshot_delete(cs, args):
if failure_count == len(args.cgsnapshot):
raise exceptions.CommandError("Unable to delete any of specified "
"cgsnapshots.")
+
+
+@utils.arg('--detail',
+ action='store_true',
+ help='Show detailed information about pools.')
+@utils.service_type('volumev2')
+def do_get_pools(cs, args):
+ """Show pool information for backends. Admin only."""
+ pools = cs.volumes.get_pools(args.detail)
+ infos = dict()
+ infos.update(pools._info)
+
+ for info in infos['pools']:
+ backend = dict()
+ backend['name'] = info['name']
+ if args.detail:
+ backend.update(info['capabilities'])
+ utils.print_dict(backend)