Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Sequence diagrams updated

...

LISA is an alternative to the Packager Thunder Plugin used to retrieve ipkg packages, see https://github.com/rdkcentral/rdkservices/blob/master/Packager/doc/PackagerPlugin.md   

Comparison of LISA with RDK Packager API 

Existing Packager API (RDK services github)Proposed Packager API (DAC RDK wiki)LISA API
install (package, version, architecture)install (id, type, URL, token, listener) → (id, task, success)install (type, id, version, URL, appName, category), → (status, handle)

remove (id, listener) → (id, task, success)uninstall (type, id, version, uninstallType), → (status, handle)


operationStatus→ (handle, status, details)

cancel (task, listener) → (success)cancel (handle) → (status)

isInstalled (id) → (success)-

getInstallProgress (task) → ( percent)getProgress (handle) → (status, percent)

getInstalled() → (applications)getList (filter) → (array of {type, id, version, metadata})

getPackageInfo(id) → (metadata)getMetadata(type, id, version) → (metadata)

-setMetadata(type, id, version, tag, metadata)

getAvaialbleSpace() → (space)getStorageDetails() → (path, quota, size, persistentStoragePath, persistentStorageQuota, persistentStorageSize)
synchronize()
-

Data Types

LISA is able to handle the following data:

...

Result payload: {"handle":"<string>"}

parameter and errorsvalues
errors
  • "WrongParams" - request not accepted because of wrong parameters
  • "TooManyRequests" - too many requests (e.g. another installation is ongoing)
  • "AlreadyInstalled" - application is already installed, uninstall first
  • "Initializing" - LISA is performing initialization, wait for operationStatus event
handlehandle to refer with the following requests
  • uninstall

Uninstall the application: remove application files and - optionally - persistent storage and db entry. Non-blocking operation, handle should be used for tracking the request.

...

Result payload: {"handle":"<string>"}

parameters and errorsvalues
uninstallType
  • "full" - full removal of all application-related data (db entry, application storage, persistent storage). If other versions are still available, the persistent storage and app record will not be removed. Only the installed_apps row will be removed. In fact, the "full" uninstallType reverts to "upgrade". 
  • "upgrade" - only removes given version of the application, persistent storage is not deleted, neither is the app record in apps table.
    • remark: to allow cleanup of this storage dir and app record at a later point in time, you can call uninstall() without specifying a version and with installType=full.
errors
  • "WrongParams" - request not accepted because of wrong parameters
  • "TooManyRequests" - too many requests (e.g. another installation or uninstallation is ongoing)
  • "Initializing" - LISA is performing initialization, wait for operationStatus event
handlehandle to refer with the following requests
  • download

Download arbitrary application's resource, e.g. icon. Resource are stored per application id/version. Asynchronous operation, handle should be used for tracking the request. If the resource of given resKey already exists it is replaced by the newly downloaded resource. If the resKey is unique, but the requested resource file already exists on the filesystem, the file should be stored under a different, unique filename, created by appending a suffix to the existing filename.

...

Result payload: {"handle":"<string>"}

parameters and errorsvalues
resKey
  • key to access given resource file from db entry
errors
  • "WrongParams" - request not accepted because of wrong parameters
  • "TooManyRequests" - too many requests (e.g. another installation or uninstallation is ongoing)
  • "Initializing" - LISA is performing initialization, wait for operationStatus event
handlehandle to refer with the following requests
  • reset

Deletes the content of the database and/or persistent storage and/or all resources for the application. Synchronous operation, returns response on success or failure. Optional parameters type, id, version are used to filter the applications on which the reset will be performed. If they are not given, the reset operation affects all the data. Synchronous operation, returns a response on success or failure. 

...

Response payload: {"status":"<string>"}

parameters and errorsvalues
version
  • parameter is required only when "resetType"="resources"
resetType
  • "full" - deletes all persistent data used by LISA: drops db tables, deletes the content of [APPS] [APPS_STORAGE]
  • "storage" - deletes the content of persistent storage
  • "resources" - deletes all downloaded resources for given application version
errors
  • "WrongParams" - request not accepted because of wrong parameters
  • "FilesystemError" -  file operation failed
  • "Initializing" - LISA is performing initialization, wait for operationStatus event
  • getStorageDetails

Returns information on the storage usage. Depending on provided parameters: overall storage usage, application id storage or application id/version storage. Synchronous operation, returns a response on success or failure. Notes on implementation:

...

Result payload: {"storage":"<storagePayload>"}

parameters and errorsvalues
type
  • optional parameter, if provided, then the details on a storage for applications of given type is returned. This filtering parameter is logically ANDed with the other optional parameters if they are provided.
id
  • optional parameter, if provided, then the details on a storage for applications of given id is returned. Can be only present if "type" parameter is also provided. This filtering parameter is logically ANDed with the other optional parameters if they are provided.
version
  • optional parameter, if provided, then the details on a storage for applications of given id/version is returned. Can be only present if "type" and "id" parameters are also provided. This filtering parameter is logically ANDed with the other parameters.
  • if version is empty but id and type are filled in, the storageDetails result will only show the storage datapath and no actual app path.
errors
  • "WrongParams" - request not accepted because of wrong parameters
  • "FilesystemError" -  file operation failed
  • "Initializing" - LISA is performing initialization, wait for operationStatus event
storagePayload

{"apps":{"path":"<string>", "quotaKB":"<string>", "usedKB":"<string>"}, "persistent":{"path":"<string>", "quotaKB":"<string>", "usedKB":"<string>"}}

  • getList

Returns a list of installed applications filtered using optional filtering criteria: type, id, version, appName, category. Synchronous operation, returns a response on success or failure.

...

Resultpayload: {"apps":"<appsPayload>"}

parameters and errorsvalues
type
  • optional parameter to filter apps only of given type. This filtering parameter is logically ANDed with the other optional parameters if they are provided.
id
  • optional parameter to filter apps only of given id. This filtering parameter is logically ANDed with the other optional parameters if they are provided.
version
  • optional parameter to filter apps only of given version. This filtering parameter is logically ANDed with the other optional parameters if they are provided.
appName
  • optional parameter to filter apps only of given name. This filtering parameter is logically ANDed with the other optional parameters if they are provided.
category
  • optional parameter to filter apps only of given category. This filtering parameter is logically ANDed with the other optional parameters if they are provided.
status
  • "WrongParams" - request not accepted because of wrong parameters
  • "Initializing" - LISA is performing initialization, wait for operationStatus event
appsPayload

{"apps":["app":{"type":"<string>", "id":"<string>", "installed":[{"version":"<string>", "appName":"<string>", "category":"<string>","url":"<string>"}]}]}

  • remark: if no actual versions of an app are installed and only the app row + data storage path remains, then the installed [] will be empty or omitted in above result. Such situation happens when uninstall the only version of an installed app with uninstallType=upgrade.
  • setAuxMetadata

Set an arbitrary key: value metadata for a given application. The existing metadata object is replaced (overwritten) by the provided object. Synchronous operation, returns a response on success or failure. 

Request payload: {"type":"application/vnd.rdk-app.dac.native", "id":"<string>", "version":"<string>","auxMetadata":<auxMetadataPayload>}

Result payload: {}

parameters and errorsvalues
errors
  • "WrongParams" - request not accepted because of wrong parameters
  • "WrongMetadata" - request not accepted because of wrong format of metadata object
  • "Initializing" - LISA is performing initialization, wait for operationStatus event
auxMetadataPayload

[{"<string>":"<string>"}]

  • getMetadata

Get all metadata stored for given application version. Synchronous operation, returns a response on success or failure. 

...

Response payload: {"status":"<string>","metadata":}

parameters and errorsvalues
errors
  • "WrongParams" - request not accepted because of wrong parameters
  • "Initializing" - LISA is performing initialization, wait for operationStatus event
metadataPayload

{"appName":"<string>", "category":"<string>","url":"<string>","resources":[{"<string>":"<string>"}]},"auxMetadata":<auxMetadataPayload>}

  • "resources" - array referring downloaded resources; contains "resKey": "file name" mappings
  • cancel

Cancel previous asynchronous request.

...

Response payload: {"status":"<string>"}

parameters and errorsvalues
handle
  • a handle returned earlier by install, uninstall or download request.
errors
  • "WrongHandle" - the handle is not correct, e.g. the operation has finished
  • "Error" - operation cannot be canceled
  • getProgress

Get estimated progress of an asynchronous operation.

...

Response payload: {"status":"<string>", "progress":<number>}

parameters and errorsvalues
handle
  • a handle returned earlier by install, uninstall or download request.
status
  • "Ok" - operation successful
  • "WrongHandle" - the handle is not correct, e.g. the operation has finished
progress
  • estimated progress, an integer value 0-100

Events

  • operationStatus

Notification sent on the completion of asynchronous operation.

payload: {"handle":"<string>", "status":"<string>", "details":"<string>"}

parameters and errorsvalues
handle
  • a handle returned earlier by install, uninstall or download request.
  • empty string on Initialization notification
status
  • "Success" - operation successful
  • "Failed" - operation failed
details
  • optional parameter, providing more details on the operation status. 

Download progress tracking

...

draw.io Diagram
bordertrue
diagramNameLISA sequence diagram - Initializationinitialization
simpleViewerfalse
width200
linksauto
tbstyletop
lboxtrue
diagramWidth219
revision1

...

draw.io Diagram
400
bordertrue
diagramNameLISA sequence diagram - cleanupmaintenance
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth560
revision1

Install

draw.io Diagram
bordertrue
diagramNameLISA sequence diagram -

...

install
simpleViewerfalse
width

...

linksauto
tbstyletop
lboxtrue
diagramWidth1422
revision1

Uninstall

draw.io Diagram
bordertrue
diagramNameLISA sequence diagram -

...

uninstall
simpleViewerfalse
width

...

linksauto
tbstyletop
lboxtrue
diagramWidth847
revision

...

Download

...

2

Download

...


LISA implementation

LISA should be implemented as Thunder plugin, and containarized as depicted in Thunder Integration into OneMW.

...