Bug 1540254 - unable to access the metric_rollups subcollection
Summary: unable to access the metric_rollups subcollection
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: GA
: 5.10.0
Assignee: Gregg Tanzillo
QA Contact: Parthvi Vala
URL:
Whiteboard: api:rest:services
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-30 15:53 UTC by Martin Kourim
Modified: 2019-02-07 23:01 UTC (History)
4 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-07 23:01:05 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:0212 0 None None None 2019-02-07 23:01:11 UTC

Description Martin Kourim 2018-01-30 15:53:51 UTC
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

Comment 2 Gregg Tanzillo 2018-01-31 14:58:40 UTC
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?

Comment 3 Jillian Tullo 2018-01-31 16:10:24 UTC
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).

Comment 5 CFME Bot 2018-02-14 13:56:21 UTC
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(-)

Comment 7 Parthvi Vala 2019-01-03 07:40:57 UTC
FIXED. Verified on 5.10.0.30.20181218191323_900a416.

Comment 8 errata-xmlrpc 2019-02-07 23:01:05 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://access.redhat.com/errata/RHSA-2019:0212


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