Class EventRestService


  • @Component("eventRestService")
    @Path("events")
    public class EventRestService
    extends OnmsRestService
    • Constructor Detail

      • EventRestService

        public EventRestService()
    • Method Detail

      • getEvent

        @GET
        @Produces({"application/xml","application/json","application/atom+xml"})
        @Path("{eventId}")
        @Transactional
        public OnmsEvent getEvent​(@PathParam("eventId")
                                  Integer eventId)

        getEvent

        Parameters:
        eventId - a String object.
        Returns:
        a OnmsEvent object.
      • getCount

        @GET
        @Produces("text/plain")
        @Path("count")
        @Transactional
        public String getCount()
        returns a plaintext string being the number of events
        Returns:
        a String object.
      • getEvents

        @GET
        @Produces({"application/xml","application/json","application/atom+xml"})
        @Transactional
        public OnmsEventCollection getEvents​(@Context
                                             javax.ws.rs.core.UriInfo uriInfo)
                                      throws ParseException
        Returns all the events which match the filter/query in the query parameters
        Returns:
        Collection of OnmsEventCollection (ready to be XML-ified)
        Throws:
        ParseException - if any.
      • getEventsBetween

        @GET
        @Produces({"application/xml","application/json","application/atom+xml"})
        @Path("between")
        @Transactional
        public OnmsEventCollection getEventsBetween​(@Context
                                                    javax.ws.rs.core.UriInfo uriInfo)
                                             throws ParseException
        Returns all the events which match the filter/query in the query parameters
        Returns:
        Collection of OnmsEventCollection (ready to be XML-ified)
        Throws:
        ParseException - if any.
      • updateEvent

        @PUT
        @Path("{eventId}")
        @Consumes("application/x-www-form-urlencoded")
        @Transactional
        public javax.ws.rs.core.Response updateEvent​(@Context
                                                     javax.ws.rs.core.SecurityContext securityContext,
                                                     @PathParam("eventId")
                                                     Integer eventId,
                                                     @FormParam("ack")
                                                     Boolean ack)
        Updates the event with id "eventid" If the "ack" parameter is "true", then acks the events as the current logged in user, otherwise unacks the events
        Parameters:
        eventId - a Integer object.
        ack - a Boolean object.
      • updateEvents

        @PUT
        @Consumes("application/x-www-form-urlencoded")
        @Transactional
        public javax.ws.rs.core.Response updateEvents​(@Context
                                                      javax.ws.rs.core.SecurityContext securityContext,
                                                      MultivaluedMapImpl formProperties)
        Updates all the events that match any filter/query supplied in the form. If the "ack" parameter is "true", then acks the events as the current logged in user, otherwise unacks the events
        Parameters:
        formProperties - Map of the parameters passed in by form encoding
      • publishEvent

        @POST
        @Consumes({"application/xml","application/json","application/atom+xml"})
        @Transactional
        public javax.ws.rs.core.Response publishEvent​(Event event)