Ack parameter in event, alarm and notification REST services is always null.
Description
Acceptance / Success Criteria
Lucidchart Diagrams
Activity
Rui Deyllot October 5, 2011 at 10:32 AM
There's no particular reason. I'm just experimenting the features.
I understand your assumption. However the REST documentation in the wiki says that the ack must be included in the url of the REST call, not in a XML file. And the update methods in the source code are PUT methods (I don't know if they were POST methods before since I only started using OpenNMS since 1.8.5).
I was just interested in informing you guys of the possibility to change the @FormParam to @QueryParam to synchronize the behaviour of this REST services with what's in the wiki.
Benjamin Reed October 5, 2011 at 9:07 AM
Is there a reason not to use the acknowledgement REST service? That's what it's for. I assume it's a @FormParam because it's expecting it (the particular event, alarm, or notification) to be POSTed as a full XML file...
I've been looking around the OpenNMS source code and noticed that when you try to acknowledge an event/alarm/notification through their respective REST services, instead of the acknowledgement REST service, it fails in the if condition in the code: if(ack==null)
That's because the methods updateEvent, updateAlarm and update Notification have the boolean paramater "ack" as a @FormParam instead of a @QueryParam.
@FormParam is for POST methods. That's why it works in the AcknowledgementRestService class.
I change the parameter to @QueryParam in the classes EventRestService, AlarmRestService and NotificationRestService and it worked for me.