summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stachowski <peter@tesora.com>2014-06-04 17:06:09 -0400
committerPeter Stachowski <peter@tesora.com>2014-06-04 17:06:09 -0400
commit71cace23fc32a0a820d84eda0d2260e2a1ed94c6 (patch)
tree82876faadf9d2fb3f273bc139480c631670dc1d4
parent68a6424256b0053fe554c1cf2101e95d60fe1c14 (diff)
downloadpython-troveclient-71cace23fc32a0a820d84eda0d2260e2a1ed94c6.tar.gz
Added optional marker/limit to list command
The trove client did not allow you to pass in a marker or limit for list instances. These arguments are now allowed, and the resulting list filtered accordingly. Both arguments are optional. Change-Id: I7cb697d57d11f72c0349fbe50c48d8b33593721b Closes-Bug: #1294950
-rw-r--r--troveclient/v1/shell.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py
index 75f9127..05e35ac 100644
--- a/troveclient/v1/shell.py
+++ b/troveclient/v1/shell.py
@@ -102,10 +102,16 @@ def do_flavor_show(cs, args):
# Instance related calls
+@utils.arg('--limit', metavar='<limit>', type=int, default=None,
+ help='Limit the number of results displayed.')
+@utils.arg('--marker', metavar='<ID>', type=str, default=None,
+ help='Begin displaying the results for IDs greater than the '
+ 'specified marker. When used with --limit, set this to '
+ 'the last ID displayed in the previous run.')
@utils.service_type('database')
def do_list(cs, args):
"""Lists all the instances."""
- instances = cs.instances.list()
+ instances = cs.instances.list(limit=args.limit, marker=args.marker)
for instance in instances:
setattr(instance, 'flavor_id', instance.flavor['id'])