Class DefaultDeviceConfigRestService

    • Method Detail

      • getDeviceConfig

        public javax.ws.rs.core.Response getDeviceConfig​(long id)
        Get device config info for a single item, by DeviceConfig id.
        Specified by:
        getDeviceConfig in interface DeviceConfigRestService
        Parameters:
        id - database id of device config
      • getDeviceConfigs

        public javax.ws.rs.core.Response getDeviceConfigs​(Integer limit,
                                                          Integer offset,
                                                          String orderBy,
                                                          String order,
                                                          String deviceName,
                                                          String ipAddress,
                                                          Integer ipInterfaceId,
                                                          String configType,
                                                          Set<DeviceConfigStatus> statuses,
                                                          Long createdAfter,
                                                          Long createdBefore)
        Gets a list of device configs along with backup schedule information.
        Specified by:
        getDeviceConfigs in interface DeviceConfigRestService
        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'
        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

        public javax.ws.rs.core.Response getLatestDeviceConfigsForDeviceAndConfigType​(Integer limit,
                                                                                      Integer offset,
                                                                                      String orderBy,
                                                                                      String order,
                                                                                      String searchTerm,
                                                                                      Set<DeviceConfigStatus> statuses)
        Gets the most recent device config for each device / config type combination. Typically called by UI to get latest status.
        Specified by:
        getLatestDeviceConfigsForDeviceAndConfigType in interface DeviceConfigRestService
        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

        public javax.ws.rs.core.Response getDeviceConfigsByInterface​(Integer ipInterfaceId,
                                                                     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.
        Specified by:
        getDeviceConfigsByInterface in interface DeviceConfigRestService
      • downloadDeviceConfig

        public javax.ws.rs.core.Response downloadDeviceConfig​(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.
        Specified by:
        downloadDeviceConfig in interface DeviceConfigRestService
      • createDownloadFileName

        public static String createDownloadFileName​(String deviceName,
                                                    String ipAddress,
                                                    String configType,
                                                    Date createdTime)