Bug 1258908 - [RFE] Impose mandatory limit on the number of results returned in an API response
Summary: [RFE] Impose mandatory limit on the number of results returned in an API resp...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-ceilometer
Version: 8.0 (Liberty)
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ga
: 8.0 (Liberty)
Assignee: Eoghan Glynn
QA Contact: Yurii Prokulevych
URL:
Whiteboard: https://blueprints.launchpad.net/ceil...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-01 13:55 UTC by Eoghan Glynn
Modified: 2016-04-07 21:06 UTC (History)
4 users (show)

Fixed In Version: openstack-ceilometer-5.0.0-1.el7ost
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-07 21:06:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:0603 0 normal SHIPPED_LIVE Red Hat OpenStack Platform 8 Enhancement Advisory 2016-04-08 00:53:53 UTC

Description Eoghan Glynn 2015-09-01 13:55:40 UTC
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 10:19:14 UTC
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 10:23:21 UTC
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 08:00:25 UTC
Verified according test plan.
ceilometer*-5.0.2-1.el7ost.noarch

Comment 8 errata-xmlrpc 2016-04-07 21:06:23 UTC
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.

https://rhn.redhat.com/errata/RHEA-2016-0603.html


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