summaryrefslogtreecommitdiff
path: root/cinderclient/v2/shell.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-11-11 19:37:39 +0000
committerGerrit Code Review <review@openstack.org>2015-11-11 19:37:39 +0000
commit2ca2b96723aa41e81da37628386f01727ecbb2cb (patch)
tree763a9cd817a5766da7262952b653b6eec3c2d4b9 /cinderclient/v2/shell.py
parentcb08ce33eb74cb95702081846280a194823d86ae (diff)
parent428d2ebb7ff16f643016d54807fbfa71ab348037 (diff)
downloadpython-cinderclient-2ca2b96723aa41e81da37628386f01727ecbb2cb.tar.gz
Merge "Implement cinder type-show"
Diffstat (limited to 'cinderclient/v2/shell.py')
-rw-r--r--cinderclient/v2/shell.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py
index 9b2ac88..9940d24 100644
--- a/cinderclient/v2/shell.py
+++ b/cinderclient/v2/shell.py
@@ -66,6 +66,11 @@ def _find_volume_snapshot(cs, snapshot):
return utils.find_resource(cs.volume_snapshots, snapshot)
+def _find_vtype(cs, vtype):
+ """Gets a volume type by name or ID."""
+ return utils.find_resource(cs.volume_types, vtype)
+
+
def _find_backup(cs, backup):
"""Gets a backup by name or ID."""
return utils.find_resource(cs.backups, backup)
@@ -828,6 +833,20 @@ def do_type_default(cs, args):
_print_volume_type_list([vtype])
+@utils.arg('volume_type',
+ metavar='<volume_type>',
+ help='Name or ID of the volume type.')
+@utils.service_type('volumev2')
+def do_type_show(cs, args):
+ """Show volume type details."""
+ vtype = _find_vtype(cs, args.volume_type)
+ info = dict()
+ info.update(vtype._info)
+
+ info.pop('links', None)
+ utils.print_dict(info)
+
+
@utils.arg('id',
metavar='<id>',
help='ID of the volume type.')