Description of problem: Attempt to access the metric_rollups subcollection of a service resource fails with { "error": { "kind": "bad_request", "message": "Must specify resource_type, capture_interval, start_date", "klass": "Api::BadRequestError" } } Version-Release number of selected component (if applicable): 5.9.0.18 How reproducible: 100% Steps to Reproduce: 1. create service, e.g. POST /api/services { "name": "myservice01" } 2. request the metric_rollups subcollection GET /api/services/:id/metric_rollups
I think this is the expect response based on the request. If I recall correctly, we went out of our way to force passing the interval and time range in the request to ensure a response in a reasonable amount of time without killing the server. Jillian, can you confirm?
Yes, this is the expected response. For the subcollection you will need to specify capture_interval and start_date. I will create a PR though that will not show `resource_type` as required for the subcollection (because it is already known based off of the collection).
https://github.com/ManageIQ/manageiq-api/pull/308
New commit detected on ManageIQ/manageiq-api/master: https://github.com/ManageIQ/manageiq-api/commit/28046ba68b197d4ddd9213bcbbe85f148f976c2c commit 28046ba68b197d4ddd9213bcbbe85f148f976c2c Author: Jillian Tullo <jtullo> AuthorDate: Wed Jan 31 13:07:01 2018 -0500 Commit: Jillian Tullo <jtullo> CommitDate: Wed Jan 31 13:35:42 2018 -0500 Do not require resource_type for metric_rollups subcollection resource_type is set by the controller when the request is made based off of the collection that has been specified. This returns a more appropriate error message Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1540254 lib/services/api/metric_rollups_service.rb | 8 ++++---- spec/lib/services/api/metric_rollups_service_spec.rb | 6 +++--- spec/requests/services_spec.rb | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 7 deletions(-)
FIXED. Verified on 5.10.0.30.20181218191323_900a416.
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://access.redhat.com/errata/RHSA-2019:0212