repository/shared/repository.service.ts
constructor(inventory: InventoryService, inventoryBinary: InventoryBinaryService, operation: OperationService, alert: AlertService, event: EventService, operationRealtime: OperationRealtimeService, eventBinary: EventBinaryService, advancedSoftwareService: AdvancedSoftwareService)
|
|||||||||||||||||||||||||||
Parameters :
|
cleanUp | ||||||
cleanUp(mosToDelete: IIdentified[])
|
||||||
Parameters :
Returns :
void
|
Async create | |||||||||
create(modal: ModalModel, type: RepositoryType)
|
|||||||||
Parameters :
Returns :
unknown
|
Async createFirmwareOrSoftware | |||||||||
createFirmwareOrSoftware(modal: ModalModel, type: RepositoryType)
|
|||||||||
Parameters :
Returns :
Promise<RepositoryCategory>
|
Async createFirmwareUpdateOperation | ||||||||||||
createFirmwareUpdateOperation(device: IManagedObject, selectedOption: SelectedRepositoryBinary)
|
||||||||||||
Prepares a firmware update operation for given device and the selected repository binary, and sends it to the device.
Parameters :
Returns :
Promise<IOperation>
|
createOrUpdateRepositoryEntry | |||||||||
createOrUpdateRepositoryEntry(modal: ModalModel, type: RepositoryType)
|
|||||||||
Parameters :
Returns :
Promise<IResult<RepositoryCategory>>
|
createRepositoryBinary | |||||||||||||||
createRepositoryBinary(modal: ModalModel, binaryURL: string, type: RepositoryType, parent: RepositoryCategory)
|
|||||||||||||||
Parameters :
Returns :
Promise<IResult<FirmwareBinary | SoftwareBinary | FirmwarePatchBinary>>
|
Async createSoftwareUpdateOperation | ||||||||||||
createSoftwareUpdateOperation(device: IManagedObject, changes: DeviceSoftwareChange[])
|
||||||||||||
Prepares a software update operation for given device and the list of changes, and sends it to the device.
Parameters :
Returns :
Promise<IOperation>
|
createTextBasedConfigurationReloadOperation | ||||||||
createTextBasedConfigurationReloadOperation(device: IManagedObject)
|
||||||||
Prepares a configuration download operation for given device and its current configuration. Supports c8y_SendConfiguration operation.
Parameters :
Returns :
IOperation
|
createTextBasedConfigurationUpdateOperation | ||||||||||||
createTextBasedConfigurationUpdateOperation(device: IManagedObject, config: string)
|
||||||||||||
Prepares a configuration update operation for the given device. Supports c8y_Configuration operation.
Parameters :
Returns :
IOperation
|
delete | ||||||
delete(entity: IIdentified)
|
||||||
Parameters :
Returns :
Promise<IResult<undefined>>
|
errorMsg |
errorMsg()
|
Returns :
void
|
Async fetchAllItemsFromList | ||||||
fetchAllItemsFromList(firstPage)
|
||||||
Fetches all items from the list starting with the provided page.
Parameters :
Returns :
unknown
|
getBaseVersionFromMO | ||||||
getBaseVersionFromMO(mo: RepositoryBinary)
|
||||||
Parameters :
Returns :
string
|
getBaseVersionsCount$ | ||||||
getBaseVersionsCount$(entry: IManagedObject)
|
||||||
Parameters :
Returns :
Observable<number>
|
Async getBinary | ||||||
getBinary(binaryId: IdReference)
|
||||||
Parameters :
Returns :
Promise<IFetchResponse>
|
Async getBinaryFile | ||||||||||||
getBinaryFile(binaryUrl: string, options: literal type)
|
||||||||||||
Returns a binary object as File.
Parameters :
Returns :
Promise<File>
|
getBinaryName$ | ||||||
getBinaryName$(binaryUrl: string)
|
||||||
Parameters :
Returns :
Observable<string>
|
Async getBinaryText | ||||||||||||
getBinaryText(binaryUrl: string, options: literal type)
|
||||||||||||
Returns a binary object as text.
Parameters :
Returns :
Promise<string>
|
Async getConfigFileOperationList | ||||||||||||
getConfigFileOperationList(deviceId: string | number, operationType: string)
|
||||||||||||
Gets a list of operations for the given device Id, and operation type.
Parameters :
Returns :
Promise<IOperation[]>
|
Async getConfigSnapshot | ||||||||||||
getConfigSnapshot(device: IManagedObject, configurationType: string)
|
||||||||||||
Gets latest uploaded configuration snapshot for the given device, and configuration type.
Parameters :
|
getConfigurationTypeQuery | ||||||||||||
getConfigurationTypeQuery(device: IManagedObject, configurationType: string)
|
||||||||||||
Generates an inventory query object which can be used to find configuration repository entries matching the type of provided device and specified configuration type.
Parameters :
Returns :
object
|
Async getDeviceSoftwareChangesFromOperation | ||||||||||||
getDeviceSoftwareChangesFromOperation(operation: IOperation, device: IManagedObject)
|
||||||||||||
Extracts the list of device software changes from given operation in the context of given device.
Parameters :
Returns :
Promise<DeviceSoftwareChange[]>
|
getDeviceSoftwareList | ||||||||
getDeviceSoftwareList(device: IManagedObject)
|
||||||||
Gets the list of software installed in the device in the uniform format. Supports c8y_SoftwareList and c8y_Software fragments.
Parameters :
Returns :
DeviceSoftware[]
|
getDeviceTypeQuery | ||||||||||||
getDeviceTypeQuery(repositoryType: RepositoryType, device: IManagedObject)
|
||||||||||||
Generates an inventory query object which can be used to find repository entries of specified type matching the type of provided device.
Parameters :
Returns :
object
|
getDownloadConfigurationFileOperation | |||||||||||||||||||||||||
getDownloadConfigurationFileOperation(device: IManagedObject, configurationType: string, configSnapshot: ConfigurationSnapshot, isLegacy: boolean)
|
|||||||||||||||||||||||||
Prepares a configuration file download operation for given device and configuration type.
Parameters :
Returns :
IOperation
|
getFirmwareUpdateOperation | ||||||||||||
getFirmwareUpdateOperation(device: IManagedObject, selectedOption: SelectedRepositoryBinary)
|
||||||||||||
Prepares a firmware update operation for given device and selected version. Supports c8y_Firmware operation.
Parameters :
Returns :
IOperation
|
Async getFirstMatchingOperation | ||||||||
getFirstMatchingOperation(filtersList: any[])
|
||||||||
Iterates over the list of filters and queries the operations. If a query returns at least one operation, the first one will be returned. Otherwise the next query will be performed. If none of the queries returns any operation, null will be returned.
Parameters :
Returns :
Promise<IOperation>
|
Async getLastConfigUpdateOperation | ||||||||
getLastConfigUpdateOperation(deviceId: string | number)
|
||||||||
Gets the last configuration update operation for given device. Looks for c8y_Configuration and c8y_SendConfiguration operations.
Parameters :
Returns :
Promise<IOperation>
|
Async getLastFirmwareUpdateOperation | ||||||||
getLastFirmwareUpdateOperation(deviceId: string | number)
|
||||||||
Gets the last firmware update operation for given device. Looks for c8y_Firmware operations.
Parameters :
Returns :
Promise<IOperation>
|
Async getLastSoftwareUpdateOperation | ||||||||
getLastSoftwareUpdateOperation(deviceId: string | number)
|
||||||||
Gets the last software update operation for given device. Looks for c8y_SoftwareUpdate, c8y_SoftwareList, or c8y_Software operations.
Parameters :
Returns :
Promise<IOperation>
|
Async getLatestConfigurationEvent | ||||||||||||
getLatestConfigurationEvent(deviceId: string | number, type: string)
|
||||||||||||
Gets a single event with latest creationTime for the given device Id and event type.
Parameters :
Returns :
Promise<IEvent | undefined>
|
Async getLatestMatchingOperation | ||||||||
getLatestMatchingOperation(filtersList: any[])
|
||||||||
Iterates over the list of filters and queries the operations. It compares the operations retrieved by the queries by 'creationTime' and return the latest one. If none of the queries returns any operation, null will be returned.
Parameters :
Returns :
Promise<IOperation>
|
Async getLegacyConfigSnapshot | ||||
getLegacyConfigSnapshot(deviceId)
|
||||
Parameters :
Returns :
unknown
|
getPatchVersionsCount$ | |||||||||
getPatchVersionsCount$(entry: IManagedObject, baseVersion: FirmwareBinary)
|
|||||||||
Parameters :
Returns :
Observable<number>
|
getRepositoryBinaryMoByVersion | |||||||||||||||||||
as it doesn't support 'missing url' case | |||||||||||||||||||
getRepositoryBinaryMoByVersion(deviceRepositoryFragment: DeviceFirmware | DeviceSoftware, type: RepositoryType, undefined: literal type)
|
|||||||||||||||||||
Gets base or patch version managed object.
Parameters :
Returns :
Promise<IManagedObject>
|
getRepositoryEntryMO$ | ||||||||
getRepositoryEntryMO$(mo: IManagedObject)
|
||||||||
Gets top level repository entry managed object for base or patch version.
Parameters :
Returns :
Observable<IManagedObject | undefined>
|
Async getSnapshotsFromRepository | |||||||||
getSnapshotsFromRepository(device, configurationType)
|
|||||||||
Gets all available snapshots from the repository for the given device.
Parameters :
Returns :
unknown
|
getSoftwareTypeQuery | ||||||||||||
getSoftwareTypeQuery(device: IManagedObject, query?: object)
|
||||||||||||
Generates an inventory query object which can be used to find repository entries matching the predefined software types provided in the device.
Parameters :
Returns :
object
|
Async getSoftwareUpdateOperation | ||||||||||||
getSoftwareUpdateOperation(device: IManagedObject, changes: DeviceSoftwareChange[])
|
||||||||||||
Prepares a software update operation for given device and changes. Returned operation type depends on device's supported operations. Supports c8y_SoftwareUpdate, c8y_SoftwareList, and c8y_Software operations.
Parameters :
Returns :
Promise<IOperation>
|
getUploadConfigurationFileOperation | ||||||||||||||||||||
getUploadConfigurationFileOperation(device: IManagedObject, configurationType: string, isLegacy: boolean)
|
||||||||||||||||||||
Prepares a configuration file upload operation for given device and configuration type.
Parameters :
Returns :
IOperation
|
isLegacyEntry | ||||||
isLegacyEntry(entry: Partial
|
||||||
Parameters :
Returns :
boolean
|
isPatch | ||||||
isPatch(mo: RepositoryBinary)
|
||||||
Parameters :
Returns :
boolean
|
Async isSoftwareInstalledOnDevice | ||||||||||||
isSoftwareInstalledOnDevice(deviceId: string | number, software: DeviceSoftware)
|
||||||||||||
Checks if a device already have a given software installed
Parameters :
Returns :
Promise<boolean>
|
Async linkBinary | |||||||||
linkBinary(repositoryBinary: FirmwareBinary | SoftwareBinary, binary: IManagedObjectBinary)
|
|||||||||
Parameters :
Returns :
unknown
|
listAllVersions | |||||||||||||||
listAllVersions(entry: Partial
|
|||||||||||||||
Lists all versions (base and patch ones) of given top level entry. Versions are ordered by creation time (assuming the earlier created, the older the version).
Parameters :
Returns :
any
|
listBaseVersionAndPatches | ||||||||||||||||||||
listBaseVersionAndPatches(entry: IManagedObject, baseVersion: IManagedObject, params: object)
|
||||||||||||||||||||
Lists patch versions of given base version under the entry including the base version. Versions are ordered by creation time (assuming the earlier created, the older the version). In terms of legacy base version the entry gets transformed to fit the needed data model.
Parameters :
Returns :
any
|
listBaseVersions | |||||||||||||||
listBaseVersions(entry: Partial
|
|||||||||||||||
Lists base versions of given top level entry. Versions are ordered by creation time (assuming the earlier created, the older the version).
Parameters :
Returns :
any
|
listChildren | ||||||||||||||||
listChildren(entry: Partial
|
||||||||||||||||
Parameters :
Returns :
any
|
listPatchVersions | ||||||||||||||||||||
listPatchVersions(entry: IManagedObject, baseVersion: FirmwareBinary | string, params: object)
|
||||||||||||||||||||
Lists patch versions of given base version under the entry. Versions are ordered by creation time (assuming the earlier created, the older the version).
Parameters :
Returns :
any
|
listRepositoryEntries | ||||||||||||
listRepositoryEntries(type: RepositoryType, options?: literal type)
|
||||||||||||
Lists repository entries of given type.
Parameters :
Returns :
any
|
observeOperation | ||||||||
observeOperation(operation: IOperation)
|
||||||||
Returns an observable to track progress of given operation. Fails the observable when the operation returns FAILED status. Completes the observable when the operation returns SUCCESSFUL status.
Parameters :
Returns :
Observable<IOperation>
|
prepareRepositoryBinaryMO | ||||||||||||
prepareRepositoryBinaryMO(modal: ModalModel, binaryURL: string, type: RepositoryType)
|
||||||||||||
Parameters :
|
Async save | ||||||||||||||||
save(data: ModalModel, type: RepositoryType, mo: Partial
|
||||||||||||||||
Parameters :
Returns :
unknown
|
saveBinary | ||||||
saveBinary(file: File)
|
||||||
Parameters :
Returns :
Promise<IResult<IManagedObjectBinary>>
|
Readonly dateFrom |
Default value : new Date(0)
|
Readonly dateTo |
Default value : new Date(Date.now() + 86400000)
|