diff options
author | Zuul <zuul@review.opendev.org> | 2022-02-16 19:32:15 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-02-16 19:32:15 +0000 |
commit | 683b694fff00c86652df24c36eb00b9c8ab9c78e (patch) | |
tree | a14204b33f9815c3a301cafbb2977890b7cf25f8 /glanceclient/v2 | |
parent | 3f001f5f11941203cc6c2d8505e84ab31891bd0e (diff) | |
parent | 282ce9c209d60ecb496e3e66126b71791fe6a1d4 (diff) | |
download | python-glanceclient-683b694fff00c86652df24c36eb00b9c8ab9c78e.tar.gz |
Merge "Add an optional parameter --detail"
Diffstat (limited to 'glanceclient/v2')
-rw-r--r-- | glanceclient/v2/images.py | 7 | ||||
-rw-r--r-- | glanceclient/v2/shell.py | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/glanceclient/v2/images.py b/glanceclient/v2/images.py index b412c42..eeb5ee1 100644 --- a/glanceclient/v2/images.py +++ b/glanceclient/v2/images.py @@ -323,6 +323,13 @@ class Controller(object): return body, resp @utils.add_req_id_to_object() + def get_stores_info_detail(self): + """Get available stores info from discovery endpoint.""" + url = '/v2/info/stores/detail' + resp, body = self.http_client.get(url) + return body, resp + + @utils.add_req_id_to_object() def delete_from_store(self, store_id, image_id): """Delete image data from specific store.""" url = ('/v2/stores/%(store)s/%(image)s' % {'store': store_id, diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py index 4f7ffd9..d936ca5 100644 --- a/glanceclient/v2/shell.py +++ b/glanceclient/v2/shell.py @@ -583,11 +583,15 @@ def do_import_info(gc, args): else: utils.print_dict(import_info) - +@utils.arg('--detail', default=False, action='store_true', + help='Shows details of stores. Admin only.') def do_stores_info(gc, args): """Print available backends from Glance.""" try: - stores_info = gc.images.get_stores_info() + if args.detail: + stores_info = gc.images.get_stores_info_detail() + else: + stores_info = gc.images.get_stores_info() except exc.HTTPNotFound: utils.exit('Multi Backend support is not enabled') else: |