Class SnmpTrapNorthbounderConfigurationResource

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean

    @Component
    public class SnmpTrapNorthbounderConfigurationResource
    extends OnmsRestService
    implements org.springframework.beans.factory.InitializingBean
    The Class SnmpTrapNorthbounderConfigurationResource.
    Author:
    Alejandro Galue
    • Constructor Detail

      • SnmpTrapNorthbounderConfigurationResource

        public SnmpTrapNorthbounderConfigurationResource()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • getConfiguration

        @GET
        @Produces({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response getConfiguration()
        Gets the configuration.
        Returns:
        the configuration
      • setConfiguration

        @POST
        public javax.ws.rs.core.Response setConfiguration​(SnmpTrapNorthbounderConfig config)
        Sets the configuration.
        Parameters:
        config - the full configuration object
        Returns:
        the response
      • getStatus

        @GET
        @Path("status")
        @Produces("text/plain")
        public javax.ws.rs.core.Response getStatus()
        Gets the status.
        Returns:
        the status
      • getStatus

        @PUT
        @Path("status")
        @Produces("text/plain")
        public javax.ws.rs.core.Response getStatus​(@QueryParam("enabled")
                                                   Boolean enabled)
                                            throws javax.ws.rs.WebApplicationException
        Gets the status.
        Parameters:
        enabled - the enabled
        Returns:
        the status
        Throws:
        javax.ws.rs.WebApplicationException - the web application exception
      • getSnmpTrapSinks

        @GET
        @Path("trapsinks")
        @Produces({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response getSnmpTrapSinks()
        Gets all the SNMP trap sinks.
        Returns:
        the SNMP trap sinks
      • getSnmpTrapSink

        @GET
        @Path("trapsinks/{trapsinkName}")
        @Produces({"application/xml","application/json","application/atom+xml"})
        public SnmpTrapSink getSnmpTrapSink​(@PathParam("trapsinkName")
                                            String trapSinkName)
        Gets the SNMP trap sink.
        Parameters:
        trapSinkName - the trap sink name
        Returns:
        the SNMP trap sink
      • getImportMappings

        @GET
        @Path("trapsinks/{trapsinkName}/import-mappings")
        @Produces({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response getImportMappings​(@PathParam("trapsinkName")
                                                           String trapSinkName)
        Gets the import mappings.
        Parameters:
        trapSinkName - the trap sink name
        Returns:
        the import mappings
      • setSnmpTrapSink

        @POST
        @Path("trapsinks")
        @Consumes({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response setSnmpTrapSink​(SnmpTrapSink snmpTrapSink)
        Sets a SNMP trap sink.

        If there is a trap sunk with the same name, the existing one will be overridden.

        Parameters:
        snmpTrapSink - the SNMP trap sink
        Returns:
        the response
      • setImportMapping

        @POST
        @Path("trapsinks/{trapsinkName}/import-mappings")
        @Consumes({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response setImportMapping​(@PathParam("trapsinkName")
                                                          String trapSinkName,
                                                          SnmpTrapMappingGroup mappingGroup)
        Sets an import mapping.
        Parameters:
        trapSinkName - the trap sink name
        mappingGroup - the mapping group
        Returns:
        the response
      • updateSnmpTrapSink

        @PUT
        @Consumes("application/x-www-form-urlencoded")
        @Path("trapsinks/{trapsinkName}")
        public javax.ws.rs.core.Response updateSnmpTrapSink​(@PathParam("trapsinkName")
                                                            String trapSinkName,
                                                            MultivaluedMapImpl params)
        Update a specific SNMP trap sink.
        Parameters:
        trapSinkName - the trap sink name
        params - the parameters map
        Returns:
        the response
      • updateImportMapping

        @PUT
        @Consumes("application/x-www-form-urlencoded")
        @Path("trapsinks/{trapsinkName}/import-mappings/{mappingName}")
        public javax.ws.rs.core.Response updateImportMapping​(@PathParam("trapsinkName")
                                                             String trapSinkName,
                                                             @PathParam("mappingName")
                                                             String mappingName,
                                                             MultivaluedMapImpl params)
        Update import mapping.
        Parameters:
        trapSinkName - the trap sink name
        mappingName - the mapping name
        params - the parameters map
        Returns:
        the response
      • removeImportMapping

        @DELETE
        @Path("trapsinks/{trapsinkName}/import-mappings/{mappingName}")
        @Produces({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response removeImportMapping​(@PathParam("trapsinkName")
                                                             String trapSinkName,
                                                             @PathParam("mappingName")
                                                             String mappingName)
        Removes the import mapping.
        Parameters:
        trapSinkName - the trap sink name
        mappingName - the mapping name
        Returns:
        the response
      • removeSnmpTrapSink

        @DELETE
        @Path("trapsinks/{trapsinkName}")
        @Produces({"application/xml","application/json","application/atom+xml"})
        public javax.ws.rs.core.Response removeSnmpTrapSink​(@PathParam("trapsinkName")
                                                            String trapSinkName)
        Removes a specific SNMP trap sink.
        Parameters:
        trapSinkName - the trap sink name
        Returns:
        the response