Bug 1258908 - [RFE] Impose mandatory limit on the number of results returned in an API response
[RFE] Impose mandatory limit on the number of results returned in an API resp...
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-ceilometer (Show other bugs)
8.0 (Liberty)
Unspecified Unspecified
medium Severity unspecified
: ga
: 8.0 (Liberty)
Assigned To: Eoghan Glynn
Yurii Prokulevych
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2015-09-01 09:55 EDT by Eoghan Glynn
Modified: 2016-04-07 17:06 EDT (History)
4 users (show)

See Also:
Fixed In Version: openstack-ceilometer-5.0.0-1.el7ost
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-04-07 17:06:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:0603 normal SHIPPED_LIVE Red Hat OpenStack Platform 8 Enhancement Advisory 2016-04-07 20:53:53 EDT

  None (edit)
Description Eoghan Glynn 2015-09-01 09:55:40 EDT
Where a limit is not explicitly specified on a ceilometer API query, a reasonable default value should be applied in order to avoid returning an infeasibly large result set.
Comment 3 Chris Dent 2015-09-10 06:19:14 EDT
We can test this by manipulating a new configuration setting in the api group: default_api_return_limit

The default value is 100.

So we need to test:

* that default is used when there are more than 100 results
* that changing the config has the expected result
* that passing an explicit limit on a query overrides the config value

We need a query that will return more than 100 results, these instructions assume we already have an installation running, with at least one instance and a short polling interval, as described in https://bugzilla.redhat.com/show_bug.cgi?id=1258912

Once that has been running we can make queries about the resource:

* confirm the default is being followed:

   brick:~ $ ceilometer sample-list -q resource_id=$INSTANCE|grep -c $INSTANCE 100

* confirm there are more results than that and the limit can be override:

   brick:~ $ ceilometer sample-list -q resource_id=$INSTANCE  --limit 9999|grep -c $INSTANCE 1845

* confirm changing the config changes the limit:

   * change /etc/ceilometer/ceilometer.conf to set 'default_api_return_limit' in the 'api' section to 10
   * restart the ceilometer api (if using mod wsgi, reload the httpd service)

   brick:~ $ ceilometer sample-list -q resource_id=$INSTANCE|grep -c $INSTANCE 10

Making other types of queries (meter-list, resource-list) will confirm the feature is in use on other query types. Note, however, that at the time of this writing I've just discovered a bug in python-ceilometerclient that prevents the --limit keyword from working on meter-list and resource-list (and perhaps others). I'll report that bug and by the time this testing scenario needs to be used it ought to be fixed.
Comment 4 Chris Dent 2015-09-10 06:23:21 EDT
I was using ceilometerclient 1.4.0, the --limit problem is corrected in 1.5.0 (released 2015.09.09)
Comment 6 Yurii Prokulevych 2016-02-11 03:00:25 EST
Verified according test plan.
Comment 8 errata-xmlrpc 2016-04-07 17:06:23 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.