summaryrefslogtreecommitdiff
path: root/openstackclient/image
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-02-02 01:15:25 +0800
committerTang Chen <chen.tang@easystack.cn>2016-02-03 14:04:50 +0800
commit499369329c493f9734248393ff19a82b5e224078 (patch)
treedaf96200c419209314d485be0cfbacada85eaab6 /openstackclient/image
parent581280386533f8780a8d2e73495d3eff38c9ad50 (diff)
downloadpython-openstackclient-499369329c493f9734248393ff19a82b5e224078.tar.gz
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
Diffstat (limited to 'openstackclient/image')
-rw-r--r--openstackclient/image/v2/image.py11
1 files changed, 11 insertions, 0 deletions
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='<marker>',
+ 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 = (