diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-07-26 00:24:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-07-26 00:24:59 +0000 |
| commit | 48fe3cce36b9ca7148972f92f2865e6d92a57225 (patch) | |
| tree | aa2849a8cee284cb76a228ff1916bea1d42ab702 /cinderclient/v3/shell.py | |
| parent | 8daff0334e9a1869b3f82161b78677ebdf07af33 (diff) | |
| parent | a570f26d97cde31d1dfb734fd2f8d2fff7a054f5 (diff) | |
| download | python-cinderclient-48fe3cce36b9ca7148972f92f2865e6d92a57225.tar.gz | |
Merge "Support volume summary command"
Diffstat (limited to 'cinderclient/v3/shell.py')
| -rw-r--r-- | cinderclient/v3/shell.py | 21 |
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)""" |
