summaryrefslogtreecommitdiff
path: root/ceilometerclient/v2/shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'ceilometerclient/v2/shell.py')
-rw-r--r--ceilometerclient/v2/shell.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/ceilometerclient/v2/shell.py b/ceilometerclient/v2/shell.py
index 22f55e3..757ca46 100644
--- a/ceilometerclient/v2/shell.py
+++ b/ceilometerclient/v2/shell.py
@@ -56,6 +56,10 @@ ORDER_DIRECTIONS = ['asc', 'desc']
COMPLEX_OPERATORS = ['and', 'or']
SIMPLE_OPERATORS = ["=", "!=", "<", "<=", '>', '>=']
+DEFAULT_API_LIMIT = ('API server limits result to <default_api_return_limit> '
+ 'rows if no limit provided. Option is configured in '
+ 'ceilometer.conf [api] group')
+
class NotEmptyAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
@@ -134,7 +138,7 @@ def do_statistics(cc, args):
@utils.arg('-m', '--meter', metavar='<NAME>',
action=NotEmptyAction, help='Name of meter to show samples for.')
@utils.arg('-l', '--limit', metavar='<NUMBER>',
- help='Maximum number of samples to return.')
+ help='Maximum number of samples to return. %s' % DEFAULT_API_LIMIT)
def do_sample_list(cc, args):
"""List the samples (return OldSample objects if -m/--meter is set)."""
if not args.meter:
@@ -261,7 +265,7 @@ def do_sample_create(cc, args={}):
help='key[op]data_type::value; list. data_type is optional, '
'but if supplied must be string, integer, float, or boolean.')
@utils.arg('-l', '--limit', metavar='<NUMBER>',
- help='Maximum number of meters to return.')
+ help='Maximum number of meters to return. %s' % DEFAULT_API_LIMIT)
def do_meter_list(cc, args={}):
"""List the user's meters."""
meters = cc.meters.list(q=options.cli_to_array(args.query),
@@ -1064,7 +1068,8 @@ def do_alarm_history(cc, args={}):
@utils.arg('--meter-links', dest='meter_links', action='store_true',
help='If specified, meter links will be generated.')
@utils.arg('-l', '--limit', metavar='<NUMBER>',
- help='Maximum number of resources to return.')
+ help='Maximum number of resources to return. %s' %
+ DEFAULT_API_LIMIT)
def do_resource_list(cc, args={}):
"""List the resources."""
resources = cc.resources.list(q=options.cli_to_array(args.query),
@@ -1099,7 +1104,7 @@ def do_resource_show(cc, args={}):
@utils.arg('--no-traits', dest='no_traits', action='store_true',
help='If specified, traits will not be printed.')
@utils.arg('-l', '--limit', metavar='<NUMBER>',
- help='Maximum number of events to return.')
+ help='Maximum number of events to return. %s' % DEFAULT_API_LIMIT)
def do_event_list(cc, args={}):
"""List events."""
events = cc.events.list(q=options.cli_to_array(args.query),
@@ -1170,7 +1175,7 @@ def do_trait_list(cc, args={}):
help=('[{field_name: direction}, {field_name: direction}] '
'The direction is one of: ' + str(ORDER_DIRECTIONS) + '.'))
@utils.arg('-l', '--limit', metavar='<LIMIT>',
- help='Maximum number of samples to return.')
+ help='Maximum number of samples to return. %s' % DEFAULT_API_LIMIT)
def do_query_samples(cc, args):
"""Query samples."""
fields = {'filter': args.filter,
@@ -1197,7 +1202,7 @@ def do_query_samples(cc, args):
help=('[{field_name: direction}, {field_name: direction}] '
'The direction is one of: ' + str(ORDER_DIRECTIONS) + '.'))
@utils.arg('-l', '--limit', metavar='<LIMIT>',
- help='Maximum number of alarms to return.')
+ help='Maximum number of alarms to return. %s' % DEFAULT_API_LIMIT)
def do_query_alarms(cc, args):
"""Query Alarms."""
fields = {'filter': args.filter,
@@ -1219,7 +1224,8 @@ def do_query_alarms(cc, args):
help=('[{field_name: direction}, {field_name: direction}] '
'The direction is one of: ' + str(ORDER_DIRECTIONS) + '.'))
@utils.arg('-l', '--limit', metavar='<LIMIT>',
- help='Maximum number of alarm history items to return.')
+ help='Maximum number of alarm history items to return. %s' %
+ DEFAULT_API_LIMIT)
def do_query_alarm_history(cc, args):
"""Query Alarm History."""
fields = {'filter': args.filter,