Bug 973102 - API allows creating alert with condition type with incorrect measurementDefinitionID
API allows creating alert with condition type with incorrect measurementDefin...
Status: CLOSED DUPLICATE of bug 973101
Product: RHQ Project
Classification: Other
Component: REST (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: Heiko W. Rupp
Mike Foley
Depends On:
  Show dependency treegraph
Reported: 2013-06-11 05:45 EDT by Libor Zoubek
Modified: 2015-11-01 19:43 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-02 12:06:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Libor Zoubek 2013-06-11 05:45:47 EDT
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 12:06:19 EDT

*** This bug has been marked as a duplicate of bug 973101 ***

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