summaryrefslogtreecommitdiff
path: root/glanceclient/v2/shell.py
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-06-07 14:01:50 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-06-07 14:43:00 -0700
commit7f48506781ea1a50ed7760c41a34474f91979f06 (patch)
treee86f05e35811c5ae458d8bc1994c1b49474b79e7 /glanceclient/v2/shell.py
parent2822748bc134724c43f327041428557b7bfc3e3a (diff)
downloadpython-glanceclient-7f48506781ea1a50ed7760c41a34474f91979f06.tar.gz
Add 'explain' command to v2 that describes schemas
At its core, this is adding the ability to finx a schema through published links and convert it to a usable object. Related to bp glance-client-v2 Change-Id: I7b38ad091c6b0ad80197eb789503cf73989893e5
Diffstat (limited to 'glanceclient/v2/shell.py')
-rw-r--r--glanceclient/v2/shell.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py
index b12b1b9..90c2ea8 100644
--- a/glanceclient/v2/shell.py
+++ b/glanceclient/v2/shell.py
@@ -21,3 +21,11 @@ def do_image_list(gc, args):
images = gc.images.list()
columns = ['ID', 'Name']
utils.print_list(images, columns)
+
+
+@utils.arg('name', metavar='<NAME>', help='Name of model to describe.')
+def do_explain(gc, args):
+ """Describe a specific model."""
+ schema = gc.schemas.get(args.name)
+ columns = ['Name', 'Description']
+ utils.print_list(schema.properties, columns)