Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1284454 - Creating rates via REST API - should verify arguments
Creating rates via REST API - should verify arguments
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API (Show other bugs)
5.5.0
Unspecified Unspecified
medium Severity medium
: GA
: 5.6.0
Assigned To: Marcel Hild
Taras Lehinevych
rest:chargeback
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-23 06:47 EST by Taras Lehinevych
Modified: 2016-08-02 21:32 EDT (History)
5 users (show)

See Also:
Fixed In Version: 5.6.0.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-29 11:10:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 RHBA-2016:1348 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 14:50:04 EDT

  None (edit)
Description Taras Lehinevych 2015-11-23 06:47:30 EST
Description of problem:
You are able to add rate with any arguments via REST API what could cause the unexpected error in UI.

Version-Release number of selected component (if applicable):
5.5.0.11

How reproducible:
100%

Steps to Reproduce:
1. Add rate via REST API with arguments
   {
    'description': 'test_rate',
    'rate': 1,
    'chargeback_rate_id':2 
   }
   chargeback_rate_id corresponds to the id of Storage Default chargeback rates 
2. Go to Cloud Intelligence -> Chargebacks -> Rates -> Storage
3. Click on Default chargeback rates

Actual results:
The rate is added successfully and after step 3 you will get page with "Unexpected error encountered"

Expected results:
Error message about incorrect arguments should be returned when you try to add rate, the result of step 3 shouldn't be page with error message 

Additional info:
Also you are able to add the rate with chargeback_rate_id argument which doesn't exist or not specify it at all.

The issue could be reproduced by using the cfme_tests tools. The code is below.

from utils.api import API
api = API ('https://ip_address/api/', auth=('login','password'))
data = {
        'description': 'test_rate_',
        'rate': 1, 
        'chargeback_rate_id':12 }

api.collections.rates.action.create(data)
Comment 2 Marcel Hild 2016-01-15 09:20:09 EST
https://github.com/ManageIQ/manageiq/pull/6100
Comment 3 Taras Lehinevych 2016-04-20 07:44:58 EDT
Hi there, 

The verification of the fields (group and source) presence works correctly. 
However, I'm able to add the rate to not existed chargeback (I'm not getting any error message, adding was successful) and if you query the rates collection, just added rate won't be present there.

I believe we should verify the chargeback_rate_id field.

Thanks, 
-Taras
Comment 4 Marcel Hild 2016-04-20 08:37:32 EDT
@taras, good catch.
My guess is, that you should open another BZ for this, so it can be prioritized again.
If you feel, this is still part of this issue, it should be assigned to gtanzill, so he can assign it to one of his team.
Comment 5 Taras Lehinevych 2016-04-20 12:12:28 EDT
Thanks. I'll create a separate BZ.

Verified in 5.6.0.1-beta2
Comment 7 errata-xmlrpc 2016-06-29 11:10:51 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.

https://access.redhat.com/errata/RHBA-2016:1348

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