Class ScheduledOutagesRestService


  • @Component("scheduledOutagesRestService")
    @Path("sched-outages")
    public class ScheduledOutagesRestService
    extends OnmsRestService

    ScheduledOutagesRestService class.

    • GET /sched-outages
      to get a list of configured scheduled outages.
    • POST /sched-outages
      to add a new outage (or update an existing one).
    • GET /sched-outages/{outageName}
      to get the details of a specific outage.
    • DELETE /sched-outages/{outageName}
      to delete a specific outage.
    • PUT /sched-outages/{outageName}/collectd/{package}
      to add a specific outage to a collectd's package.
    • PUT /sched-outages/{outageName}/pollerd/{package}
      to add a specific outage to a pollerd's package.
    • PUT /sched-outages/{outageName}/threshd/{package}
      to add a specific outage to a threshd's package.
    • PUT /sched-outages/{outageName}/notifd
      to add a specific outage to the notifications.
    • DELETE /sched-outages/{outageName}/collectd/{package}
      to remove a specific outage from a collectd's package.
    • DELETE /sched-outages/{outageName}/pollerd/{package}
      to remove a specific outage from a pollerd's package.
    • DELETE /sched-outages/{outageName}/threshd/{package}
      to remove a specific outage from a threshd's package.
    • DELETE /sched-outages/{outageName}/notifd
      to remove a specific outage from the notifications.

    Node and Interface status (the requests return true or false):

    • GET /sched-outages/{outageName}/nodeInOutage/{nodeId}
      to check if a node (with a specific nodeId) is currently on outage for a specific scheduled outage calendar.
    • GET /sched-outages/{outageName}/interfaceInOutage/{ipAddr}
      to check if an interface (with a specific IP address) is currently on outage for a specific scheduled outage calendar.
    • GET /sched-outages/nodeInOutage/{nodeId}
      to check if a node (with a specific nodeId) is currently in outage.
    • GET /sched-outages/interfaceInOutage/{ipAddr}
      to check if an interface (with a specific IP address) is currently on outage.
    Author:
    Alejandro Galue
    • Field Detail

      • m_eventProxy

        @Autowired
        @Qualifier("eventProxy")
        protected EventProxy m_eventProxy
    • Constructor Detail

      • ScheduledOutagesRestService

        public ScheduledOutagesRestService()
    • Method Detail

      • getOutages

        @GET
        @Produces({"application/xml","application/json","application/atom+xml"})
        public Outages getOutages()
      • saveOrUpdateOutage

        @POST
        @Consumes({"application/xml","application/json"})
        public javax.ws.rs.core.Response saveOrUpdateOutage​(@Context
                                                            javax.ws.rs.core.UriInfo uriInfo,
                                                            Outage newOutage)
      • deleteOutage

        @DELETE
        @Path("{outageName}")
        public javax.ws.rs.core.Response deleteOutage​(@PathParam("outageName")
                                                      String outageName)
      • addOutageToCollector

        @PUT
        @Path("{outageName}/collectd/{packageName}")
        public javax.ws.rs.core.Response addOutageToCollector​(@PathParam("outageName")
                                                              String outageName,
                                                              @PathParam("packageName")
                                                              String packageName)
      • removeOutageFromCollector

        @DELETE
        @Path("{outageName}/collectd/{packageName}")
        public javax.ws.rs.core.Response removeOutageFromCollector​(@PathParam("outageName")
                                                                   String outageName,
                                                                   @PathParam("packageName")
                                                                   String packageName)
      • addOutageToPoller

        @PUT
        @Path("{outageName}/pollerd/{packageName}")
        public javax.ws.rs.core.Response addOutageToPoller​(@PathParam("outageName")
                                                           String outageName,
                                                           @PathParam("packageName")
                                                           String packageName)
      • removeOutageFromPoller

        @DELETE
        @Path("{outageName}/pollerd/{packageName}")
        public javax.ws.rs.core.Response removeOutageFromPoller​(@PathParam("outageName")
                                                                String outageName,
                                                                @PathParam("packageName")
                                                                String packageName)
      • addOutageToThresholder

        @PUT
        @Path("{outageName}/threshd/{packageName}")
        public javax.ws.rs.core.Response addOutageToThresholder​(@PathParam("outageName")
                                                                String outageName,
                                                                @PathParam("packageName")
                                                                String packageName)
      • removeOutageFromThresholder

        @DELETE
        @Path("{outageName}/threshd/{packageName}")
        public javax.ws.rs.core.Response removeOutageFromThresholder​(@PathParam("outageName")
                                                                     String outageName,
                                                                     @PathParam("packageName")
                                                                     String packageName)
      • addOutageToNotifications

        @PUT
        @Path("{outageName}/notifd")
        public javax.ws.rs.core.Response addOutageToNotifications​(@PathParam("outageName")
                                                                  String outageName)
      • removeOutageFromNotifications

        @DELETE
        @Path("{outageName}/notifd")
        public javax.ws.rs.core.Response removeOutageFromNotifications​(@PathParam("outageName")
                                                                       String outageName)
      • isNodeInOutage

        @GET
        @Path("{outageName}/nodeInOutage/{nodeId}")
        @Produces("text/plain")
        public String isNodeInOutage​(@PathParam("outageName")
                                     String outageName,
                                     @PathParam("nodeId")
                                     Integer nodeId)
      • isNodeInOutage

        @GET
        @Path("nodeInOutage/{nodeId}")
        @Produces("text/plain")
        public String isNodeInOutage​(@PathParam("nodeId")
                                     int nodeId)
      • isInterfaceInOutage

        @GET
        @Path("{outageName}/interfaceInOutage/{ipAddr}")
        @Produces("text/plain")
        public String isInterfaceInOutage​(@PathParam("outageName")
                                          String outageName,
                                          @PathParam("ipAddr")
                                          String ipAddr)
      • isInterfaceInOutage

        @GET
        @Path("interfaceInOutage/{ipAddr}")
        @Produces("text/plain")
        public String isInterfaceInOutage​(@PathParam("ipAddr")
                                          String ipAddr)