Device Packages

πŸ“˜

This page is a work in progress

This group of REST API allows performing operations on the application packages installed in a (connected) remote device. For ESF and Kura devices, these correspond to OSGi packages. The following operations can be performed on application packages:

  • query the list of available packages from the device;
  • install (or reinstall) a package;
  • uninstall a package.

For more informations about Packages, please read Gateway Management - Packages

Get the Packages installed on a single Device

The following API allows one to get the list of all packages installed on a given remote device:

GET /{scopeId}/devices/{deviceId}/packages

The required path parameters to be used with this call are:

  • {scopeId} is the scopeId of the tenant (account) to which the desired device belongs and can be retrieved from the response of the authentication call; the "_" character can be used for indicating the scopeId of the user currently authenticated with the token;
  • {deviceId} is the id of the desired device.

It is also possible to add the optional timeout query parameter, an integer value which represents the timeout for the request in milliseconds.

Response

The response of this call will contain list of the packages installed on the given device. As an example:

{
  "type": "devicePackages",
  "devicePackage": [
    {
      "name": "org.eclipse.kura.demo.heater",
      "version": "1.0.300",
      "bundleInfos": {
        "bundleInfo": [
          {
            "name": "org.eclipse.kura.demo.heater",
            "version": "1.0.300"
          }
        ]
      }
    }
  ]
}

Download and install a Package

The following API allows one to install or update a package onto the remote device (note that for ESF devices, packages must have been created as OSGi deployment packages):

POST /{scopeId}/devices/{deviceId}/packages/_download

The required path parameters to be used with this call are:

  • {scopeId} is the scopeId of the tenant (account) to which the desired device belongs and can be retrieved from the response of the authentication call; the "_" character can be used for indicating the scopeId of the user currently authenticated with the token;
  • {deviceId} is the id of the desired device.

It is also possible to add the optional timeout query parameter, an integer value which represents the timeout for the request in milliseconds.

Body

This call have a required body parameter that defines an object containing the information about the package to be installed (or reinstalled) on the given device. Note that the URI of the package to be installed, its name and its version are required attributes. As an example:

{
  "uri": "http://download.eclipse.org/kura/releases/4.1.0/org.eclipse.kura.demo.heater_1.0.500.dp",
  "name": "heater",
  "version": "1.0.500",
  "install": true,
  "reboot": false,
  "rebootDelay": 0
}

Response

The response of this call will consist in an HTTP 200 status code in case the request for the package installation has been successfully submitted.

Uninstall a Package

The following API allows one to uninstall an existing package from the remote device:

POST /{scopeId}/devices/{deviceId}/packages/_uninstall

The required path parameters to be used with this call are:

  • {scopeId} is the scopeId of the tenant (account) to which the desired device belongs and can be retrieved from the response of the authentication call; the "_" character can be used for indicating the scopeId of the user currently authenticated with the token;
  • {deviceId} is the id of the desired device.

It is also possible to add the optional timeout query parameter, an integer value which represents the timeout for the request in milliseconds.

Body

This call have a required body parameter that defines an object containing the information about the package to be uninstalled on the given device. Note that the package name and version are required attributes. As an example:

{
  "name": "org.eclipse.kura.demo.heater",
  "version": "1.0.500"
}

Response

The response of this call will consist in an HTTP 200 status code in case the request for the package uninstallation has been successfully submitted.