Bug 967488 - Unable to create alert definition with condition based on operation result
Summary: Unable to create alert definition with condition based on operation result
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: REST
Version: 4.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.8
Assignee: Heiko W. Rupp
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 970756
TreeView+ depends on / blocked
 
Reported: 2013-05-27 09:40 UTC by Libor Zoubek
Modified: 2015-11-02 00:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 970756 (view as bug list)
Environment:
Last Closed: 2013-08-31 10:15:08 UTC
Embargoed:


Attachments (Terms of Use)
shot1.png (51.13 KB, image/png)
2013-05-27 09:40 UTC, Libor Zoubek
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 967742 0 unspecified CLOSED Unable to create alert definition with Drift condition type 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 967744 0 unspecified CLOSED Unable to create alert definition with Event condition type 2021-02-22 00:41:40 UTC

Internal Links: 967742 967744

Description Libor Zoubek 2013-05-27 09:40:51 UTC
Created attachment 753531 [details]
shot1.png

Description of problem: Creating alert definitions via REST API is very unclear to me. I am trying to POST a definition that would trigger an alert when given operation on given resource fails. I am not able to submit correct body to REST API to create such alert def.


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

How reproducible: always


Steps to Reproduce:

I've been trying to send this body:

{'name':'restAlertDef',
'enabled':True,
'dampeningCategory':'NONE',
'conditionMode':'ANY',
'conditions':[{'name':'EQUALS','option':'discovery','category':'CONTROL'}]}


Actual results: see shot1.png attachment about how that condition looks in UI


According to shot1.png .. I tried to send this: 
{'name':'restAlertDef',
'enabled':True,
'dampeningCategory':'NONE',
'conditionMode':'ANY',
'conditions':[{'name':'discovery','option':'SUCCESS','category':'CONTROL'}]}

Actual results: 
REST API returns: Can not construct instance of org.rhq.core.domain.alert.AlertConditionOperator from String value 'EQUAL': value not one of declared Enum instance names\n at [Source: org.apache.catalina.connector.CoyoteInputStream@2bd7b0c6; line: 1, column: 68] (through reference chain: org.rhq.enterprise.server.rest.domain.AlertDefinitionRest[\"conditions\"]->org.rhq.enterprise.server.rest.domain.AlertConditionRest[\"name

Additional info:
The key issue is in "name" property of of condition, because it can be an operation name in when "category" equals "CONTROL", for this case we should also check, if operation by given name exists (if not just list all possible operations), same could apply to "option" value which is valid only if it can be parsed to OperationResult enum.

Comment 1 Heiko W. Rupp 2013-06-04 19:13:50 UTC
master e718326

checking for valid operation names still needs to be implemented. I'll clone this BZ for that purpose.

Comment 2 Heiko W. Rupp 2013-08-31 10:15:08 UTC
Bulk close of old bugs in VERIFIED state.


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