summaryrefslogtreecommitdiff
path: root/glanceclient/v1/shell.py
diff options
context:
space:
mode:
authorFei Long Wang <flwang@catalyst.net.nz>2015-04-15 16:45:30 +1200
committerFei Long Wang <flwang@catalyst.net.nz>2015-05-06 14:58:44 +1200
commit116fac8ae81a154f64be8e3b9629cedf7d4eaad1 (patch)
tree5a8a8662da2a879ce5496073100ff20529692ccd /glanceclient/v1/shell.py
parent9fac2a557ee14b597ac52144a0d35c0854024f01 (diff)
downloadpython-glanceclient-116fac8ae81a154f64be8e3b9629cedf7d4eaad1.tar.gz
Add parameter 'changes-since' for image-list of v1
Now Glance /images/detail API of v1 supports parameter 'changes-since' to query deleted images. But it's missed in client. This patch will add the parameter. Related-Bug: #1432701 Change-Id: Id38e3a78b4b2ef680ea04d35e32beb4b9c8efa00
Diffstat (limited to 'glanceclient/v1/shell.py')
-rw-r--r--glanceclient/v1/shell.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py
index e0a373a..9900482 100644
--- a/glanceclient/v1/shell.py
+++ b/glanceclient/v1/shell.py
@@ -40,6 +40,9 @@ _bool_strict = functools.partial(strutils.bool_from_string, strict=True)
help='Filter images to those that have this name.')
@utils.arg('--status', metavar='<STATUS>',
help='Filter images to those that have this status.')
+@utils.arg('--changes-since', metavar='<CHANGES_SINCE>',
+ help='Filter images to those that changed since the given time'
+ ', which will include the deleted images.')
@utils.arg('--container-format', metavar='<CONTAINER_FORMAT>',
help='Filter images to those that have this container format. '
+ CONTAINER_FORMATS)
@@ -80,10 +83,13 @@ _bool_strict = functools.partial(strutils.bool_from_string, strict=True)
def do_image_list(gc, args):
"""List images you can access."""
filter_keys = ['name', 'status', 'container_format', 'disk_format',
- 'size_min', 'size_max', 'is_public']
+ 'size_min', 'size_max', 'is_public', 'changes_since']
filter_items = [(key, getattr(args, key)) for key in filter_keys]
filters = dict([item for item in filter_items if item[1] is not None])
+ if 'changes_since' in filters:
+ filters['changes-since'] = filters.pop('changes_since')
+
if args.properties:
property_filter_items = [p.split('=', 1) for p in args.properties]
if any(len(pair) != 2 for pair in property_filter_items):