summaryrefslogtreecommitdiff
path: root/cinderclient/v3/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-07-26 00:24:59 +0000
committerGerrit Code Review <review@openstack.org>2017-07-26 00:24:59 +0000
commit48fe3cce36b9ca7148972f92f2865e6d92a57225 (patch)
treeaa2849a8cee284cb76a228ff1916bea1d42ab702 /cinderclient/v3/shell.py
parent8daff0334e9a1869b3f82161b78677ebdf07af33 (diff)
parenta570f26d97cde31d1dfb734fd2f8d2fff7a054f5 (diff)
downloadpython-cinderclient-48fe3cce36b9ca7148972f92f2865e6d92a57225.tar.gz
Merge "Support volume summary command"
Diffstat (limited to 'cinderclient/v3/shell.py')
-rw-r--r--cinderclient/v3/shell.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/cinderclient/v3/shell.py b/cinderclient/v3/shell.py
index 29f888a..d44abcc 100644
--- a/cinderclient/v3/shell.py
+++ b/cinderclient/v3/shell.py
@@ -610,6 +610,27 @@ def do_metadata(cs, args):
reverse=True))
+@api_versions.wraps('3.12')
+@utils.arg('--all-tenants',
+ dest='all_tenants',
+ metavar='<0|1>',
+ nargs='?',
+ type=int,
+ const=1,
+ default=utils.env('ALL_TENANTS', default=0),
+ help='Shows details for all tenants. Admin only.')
+def do_summary(cs, args):
+ """Get volumes summary."""
+ all_tenants = args.all_tenants
+ info = cs.volumes.summary(all_tenants)
+
+ formatters = ['total_size', 'total_count']
+ if cs.api_version >= api_versions.APIVersion("3.36"):
+ formatters.append('metadata')
+
+ utils.print_dict(info['volume-summary'], formatters=formatters)
+
+
@api_versions.wraps('3.11')
def do_group_type_list(cs, args):
"""Lists available 'group types'. (Admin only will see private types)"""