diff options
| author | liyingjun <liyingjun1988@gmail.com> | 2015-10-14 11:05:02 +0800 |
|---|---|---|
| committer | liyingjun <liyingjun1988@gmail.com> | 2015-10-21 08:24:58 +0800 |
| commit | 9471115a9a516049684755d7582338c83b3ca1f5 (patch) | |
| tree | 5748e5b796b00954f6506fa78297f8587f151ae2 /openstackclient/compute | |
| parent | 69be668534bb84871c23bf1ec041b9e5afcd1596 (diff) | |
| download | python-openstackclient-9471115a9a516049684755d7582338c83b3ca1f5.tar.gz | |
Support pagination params for flavor list
Missing 'marker' and 'limit' params for `openstack flavor list` shell
command. It would be nice to have this when there are many flavors.
Closes-bug: #1505874
Change-Id: I088ac5d24f0d7595f5cbce14f063e296a449eb26
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/flavor.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/openstackclient/compute/v2/flavor.py b/openstackclient/compute/v2/flavor.py index 3458cf79..7474580b 100644 --- a/openstackclient/compute/v2/flavor.py +++ b/openstackclient/compute/v2/flavor.py @@ -181,6 +181,15 @@ class ListFlavor(lister.Lister): action='store_true', default=False, help='List additional fields in output') + parser.add_argument( + '--marker', + metavar="<marker>", + help='The last flavor ID of the previous page') + parser.add_argument( + '--limit', + type=int, + metavar="<limit>", + help='Maximum number of flavors to display') return parser def take_action(self, parsed_args): @@ -202,7 +211,9 @@ class ListFlavor(lister.Lister): # and flavors from their own projects only. is_public = None if parsed_args.all else parsed_args.public - data = compute_client.flavors.list(is_public=is_public) + data = compute_client.flavors.list(is_public=is_public, + marker=parsed_args.marker, + limit=parsed_args.limit) if parsed_args.long: columns = columns + ( |
