Bug 1041393 - alert notification of type Resource operations is not correctly rendered by API
Summary: alert notification of type Resource operations is not correctly rendered by API
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: REST
Version: JON 3.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER01
: JON 3.3.0
Assignee: Libor Zoubek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 15:45 UTC by Libor Zoubek
Modified: 2015-11-02 00:43 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2014-12-11 14:02:41 UTC


Attachments (Terms of Use)

Description Libor Zoubek 2013-12-12 15:45:24 UTC
Description of problem:

I tried to create alert with notification of type "Resource operations" and found out it's not correctly rendered by REST API. It's also very likely that notification of above type calling an operation requiring any parameter will not work.


Version-Release number of selected component (if applicable):
JON 3.2.0.GA

How reproducible: always


Steps to Reproduce:
1. create alert definition with notification type "Resource Operations", choose "Specific Resource", pick one, select an operation with parameters and fill parameter values (e.g RHQ Agent and "Get plugin Info" operation)
2. query REST API and verify that it renders your new alert definition with "same amount of information"

GET $RHQ_SERVER:7080/rest/alert/definitions.json?full=true

Actual results:

API returns

{"id":10052,"senderName":"Resource Operations","config":{"selection-mode":"SPECIFIC","selection-specific-resource-id":"10004","operation-definition-id":"10419"}}


Expected results:

inputs for selected operation are missing.

Additional info:

Comment 1 Libor Zoubek 2014-08-06 13:31:45 UTC
in master

commit dad83f3ab84e87e67b4c58d2ce7477a2a782e485
Author: Libor Zoubek <lzoubek@redhat.com>
Date:   Wed Aug 6 15:23:08 2014 +0200

    Bug 1041393 - alert notification of type Resource operations is not
    correctly rendered by API

    AlertNotificationRest extended with extraConfig field where we now output
    notification extra config (in case of Resource Operations alert sender, it's
    input parameters for operation)

    With this commit we now also properly render alert notification config
    (simple property types mapped correctly to JSON/XML, not "just" string
    values)

    This commit fixes ConfigurationHelper#configurationToMap which transforms
    Configuration to generic Map, now it can work without Configuration
    Definition
    - as a fall-back it maps all simple properties to string values.

Comment 2 Jirka Kremser 2014-08-06 16:27:09 UTC
branch:  release/jon3.3.x
link:    https://github.com/rhq-project/rhq/commit/41a68bdf6
time:    2014-08-06 18:25:07 +0200
commit:  41a68bdf6fbac4a7270c654f878513ca4221c8d5
author:  Libor Zoubek - lzoubek@redhat.com
message: Bug 1041393 - alert notification of type Resource operations is not 
         correctly rendered by API

         AlertNotificationRest extended with extraConfig field where we
         now output notification extra config (in case of Resource
         Operations alert sender, it's input parameters for operation)

         With this commit we now also properly render alert notification
         config
         (simple property types mapped correctly to JSON/XML, not "just"
         string values)

         This commit fixes ConfigurationHelper#configurationToMap which
         transforms Configuration to generic Map, now it can work
         without Configuration Definition
         - as a fall-back it maps all simple properties to string
         values.

         (cherry picked from commit
         dad83f3ab84e87e67b4c58d2ce7477a2a782e485) Signed-off-by: Jirka
         Kremser <jkremser@redhat.com>

Comment 3 Simeon Pinder 2014-08-19 23:50:44 UTC
Moving to ON_QA as available to test in the following brew build:

https://brewweb.devel.redhat.com//buildinfo?buildID=379025

Comment 4 Mike Foley 2014-08-22 18:17:18 UTC
i am seeing 404 when trying to view any alert definitions thru the rest api 


JBWEB000065: HTTP Status 404 - /alert/definitions.json
JBWEB000309: type JBWEB000067: Status report
JBWEB000068: message /alert/definitions.json
JBWEB000069: description JBWEB000124: The requested resource is not available.
JBoss Web/7.4.8.Final-redhat-4

Comment 5 Mike Foley 2014-08-22 22:11:03 UTC
ignore comment #4.  pilot error


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