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
This commit is contained in:
Brian Waldon
2012-06-07 14:01:50 -07:00
parent 2822748bc1
commit 7f48506781
10 changed files with 316 additions and 133 deletions
+8
View File
@@ -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)