From 499369329c493f9734248393ff19a82b5e224078 Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Tue, 2 Feb 2016 01:15:25 +0800 Subject: Add --marker option to "image list" command Users could specify the last image (name or ID) of the previous page with --marker option to control the start image of the output. Change-Id: Idca0235ee83b1226b00c89cf3d38500fa898b7d0 Closes-Bug: #1540988 --- openstackclient/image/v2/image.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'openstackclient/image') diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index 67d0e7f3..3f162181 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -437,6 +437,14 @@ class ListImage(command.Lister): type=int, help="Maximum number of images to display.", ) + parser.add_argument( + '--marker', + metavar='', + default=None, + help="The last image (name or ID) of the previous page. Display " + "list of images after marker. Display all images if not " + "specified." + ) return parser def take_action(self, parsed_args): @@ -451,6 +459,9 @@ class ListImage(command.Lister): kwargs['shared'] = True if parsed_args.limit: kwargs['limit'] = parsed_args.limit + if parsed_args.marker: + kwargs['marker'] = utils.find_resource(image_client.images, + parsed_args.marker).id if parsed_args.long: columns = ( -- cgit v1.2.1