Interface DeviceConfigRestService

    • Method Detail

      • getDeviceConfig

        @GET
        @Produces("application/json")
        @Path("{id : \\d+}")
        javax.ws.rs.core.Response getDeviceConfig​(@PathParam("id")
                                                  long id)
        Get device config info for a single item, by DeviceConfig id.
        Parameters:
        id - database id of device config
      • getDeviceConfigs

        @GET
        @Produces("application/json")
        javax.ws.rs.core.Response getDeviceConfigs​(@QueryParam("limit") @DefaultValue("10")
                                                   Integer limit,
                                                   @QueryParam("offset") @DefaultValue("0")
                                                   Integer offset,
                                                   @QueryParam("orderBy") @DefaultValue("lastUpdated")
                                                   String orderBy,
                                                   @QueryParam("order") @DefaultValue("desc")
                                                   String order,
                                                   @QueryParam("deviceName")
                                                   String deviceName,
                                                   @QueryParam("ipAddress")
                                                   String ipAddress,
                                                   @QueryParam("ipInterfaceId")
                                                   Integer ipInterfaceId,
                                                   @QueryParam("configType")
                                                   String configType,
                                                   @QueryParam("status")
                                                   Set<DeviceConfigStatus> statuses,
                                                   @QueryParam("createdAfter")
                                                   Long createdAfter,
                                                   @QueryParam("createdBefore")
                                                   Long createdBefore)
        Gets a list of device configs along with backup schedule information.
        Parameters:
        limit - used for paging; defaults to 10
        offset - used for paging; defaults to 0
        orderBy - used for sorting. Valid values are 'lastUpdated', 'deviceName', 'lastBackup' and 'ipAddress'. Defaults to 'lastUpdated'
        order - used for sorting; valid values are 'asc' and 'desc', defaults to 'desc'
        deviceName - filter results by device name. Should use 'searchTerm' instead.
        ipAddress - filter results by device IP address. Should use 'searchTerm' instead.
        ipInterfaceId - database id of OnmsIpInterface instance. This will retrieve a record history.
        configType - Configuration type, typically 'default' or 'running'
        searchTerm - A search term, currently to search by device name or IP address.
        createdAfter - If set, only return items with saved backup after this date in epoch millis
        createdBefore - If set, only return items with saved backup before this date in epoch millis
        Returns:
        Json response containing a list of device configs in the shape of DeviceConfigDTO
      • getLatestDeviceConfigsForDeviceAndConfigType

        @GET
        @Path("/latest")
        @Produces("application/json")
        javax.ws.rs.core.Response getLatestDeviceConfigsForDeviceAndConfigType​(@QueryParam("limit") @DefaultValue("10")
                                                                               Integer limit,
                                                                               @QueryParam("offset") @DefaultValue("0")
                                                                               Integer offset,
                                                                               @QueryParam("orderBy") @DefaultValue("lastUpdated")
                                                                               String orderBy,
                                                                               @QueryParam("order") @DefaultValue("desc")
                                                                               String order,
                                                                               @QueryParam("search")
                                                                               String searchTerm,
                                                                               @QueryParam("status")
                                                                               Set<DeviceConfigStatus> statuses)
        Gets the most recent device config for each device / config type combination. Typically called by UI to get latest status.
        Parameters:
        limit - used for paging; defaults to 10
        offset - used for paging; defaults to 0
        orderBy - used for sorting. Valid values are 'lastUpdated', 'deviceName', 'lastBackup' and 'ipAddress'. Defaults to 'lastUpdated'
        order - used for sorting; valid values are 'asc' and 'desc', defaults to 'desc'
        searchTerm - A search term, currently to search by device name or IP address.
        statuses - An optional set of DeviceConfigStatus values. If supplied, only return records with any of the given statuses; defaults to returning all values.
      • getDeviceConfigsByInterface

        @GET
        @Path("/interface/{id : \\d+}")
        @Produces("application/json")
        javax.ws.rs.core.Response getDeviceConfigsByInterface​(@PathParam("id")
                                                              Integer ipInterfaceId,
                                                              @QueryParam("configType") @DefaultValue("")
                                                              String configType)
        Get a list of device configs for a given IP interface id. This is a history of configs for a particular device. Returns all config types by default, use 'configType' to filter.
      • deleteDeviceConfig

        @DELETE
        @Path("{id : \\d+}")
        void deleteDeviceConfig​(@PathParam("id")
                                long id)
        Delete a single device config.
        Parameters:
        id -
      • downloadDeviceConfig

        @GET
        @Path("/download")
        javax.ws.rs.core.Response downloadDeviceConfig​(@QueryParam("id") @DefaultValue("")
                                                       String id)
        Download configurations for the given id or comma-separated list of ids. Single configurations will be returned as a single file. Multiple configurations will be returned inside a .tgz file.
      • triggerDeviceConfigBackup

        @POST
        @Path("/backup")
        @Consumes("application/json")
        javax.ws.rs.core.Response triggerDeviceConfigBackup​(List<BackupRequestDTO> backupRequestDtoList)