Bug 973101

Summary: API allows creating alert with condition type with incorrect measurementDefinitionID
Product: [Other] RHQ Project Reporter: Libor Zoubek <lzoubek>
Component: RESTAssignee: Heiko W. Rupp <hrupp>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.8CC: theute
Target Milestone: ---   
Target Release: RHQ 4.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-26 08:32:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Libor Zoubek 2013-06-11 09:45:20 UTC
Description of problem: 

I did a mistake when writing my tests, and I was sending scheduleId instead of measurementDefinitionId when creating alert with condition where measurementDef is required.


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


How reproducible:


Steps to Reproduce:
1. do POST /rest/alert/definitions?resourceId=10001
with body

{"dampeningCategory": "NONE", "conditions": [{"category": "BASELINE", "threshold": "0.2", "measurementDefinition": <MID>, "option": "max", "comparator": "<"}], "conditionMode": "ALL", "enabled": true, "name": "rest-condition-incorrect-mdef"}

where <MID> is measurementDefinnitionId valid ID, but not related to 10001's resource type (it's measurementDef for different resource type)


Actual results: alert with such condition is created -it's invalid and such alert would never get triggered


Expected results: server must reject condition with such measurementDefId


Additional info:

Comment 1 Heiko W. Rupp 2013-09-02 16:06:19 UTC
*** Bug 973102 has been marked as a duplicate of this bug. ***

Comment 2 Heiko W. Rupp 2013-09-03 10:29:20 UTC
master 399d058

Comment 3 Heiko W. Rupp 2014-03-26 08:32:01 UTC
Bulk closing now that 4.10 is out.

If you think an issue is not resolved, please open a new BZ and link to the existing one.