summaryrefslogtreecommitdiff
path: root/openstackclient/volume/v1
diff options
context:
space:
mode:
authorHuanxuan Ao <huanxuan.ao@easystack.cn>2016-08-12 12:29:45 +0800
committerHuanxuan Ao <huanxuan.ao@easystack.cn>2016-09-11 11:23:25 +0800
commit6986a32e1cd6d0c0bdf973e5d4e4bcb3d1f45235 (patch)
treeaca99b79e0de3165e39ce8e4376a695ad558fe5e /openstackclient/volume/v1
parent676a0e9696ba7550132e4501bdbf3160608faed6 (diff)
downloadpython-openstackclient-6986a32e1cd6d0c0bdf973e5d4e4bcb3d1f45235.tar.gz
Add "--limit" and "--marker" options to "volume list" command
Add ``--limit`` option to ``volume list`` command in volume v1, add ``--limit`` and ``--marker`` options to ``volume list`` command in volume v2. Change-Id: I327a252aa83ed84166da99cf6aa80334e0e6dd44 Partial-Bug: #1612484
Diffstat (limited to 'openstackclient/volume/v1')
-rw-r--r--openstackclient/volume/v1/volume.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/openstackclient/volume/v1/volume.py b/openstackclient/volume/v1/volume.py
index 820673bb..6db6a5f2 100644
--- a/openstackclient/volume/v1/volume.py
+++ b/openstackclient/volume/v1/volume.py
@@ -220,6 +220,13 @@ class ListVolume(command.Lister):
default=False,
help=_('List additional fields in output'),
)
+ parser.add_argument(
+ '--limit',
+ type=int,
+ action=parseractions.NonNegativeAction,
+ metavar='<limit>',
+ help=_('Maximum number of volumes to display'),
+ )
return parser
def take_action(self, parsed_args):
@@ -295,7 +302,10 @@ class ListVolume(command.Lister):
'status': parsed_args.status,
}
- data = volume_client.volumes.list(search_opts=search_opts)
+ data = volume_client.volumes.list(
+ search_opts=search_opts,
+ limit=parsed_args.limit,
+ )
return (column_headers,
(utils.get_item_properties(