Deployment Service

The Deployment Service allows to download files to the gateway and to perform actions on them. In the configuration tab it is possible to specify which is the directory that has to be used to store the downloaded files and the list of actions declared as deployment hooks that will be invoked when a corresponding metric is received with the download request.

2008

The configuration requires to specify two parameters:

  • downloads.directory - The directory to be used to store the downloaded files;
  • deployment.hook.associations - The list of DeploymentHook associations in the form <request_type>=<hook_pid>, where <hook_pid> is the Kura Service Pid of a DeploymentHook instance and <request_type> is the value of the request.type metric received with the request.

REST APIs

The ESF Deployment Agent REST APIs are provided by the com.eurotech.framework.rest.deployment.agent bundle, that is installed by default in ESF 7.0.0.

The com.eurotech.framework.rest.deployment.agent bundle wraps the deployment.agent Java APIs and exposes corresponding REST APIs under the /deploy/v1 path.

Following the available ones:

MethodPathRoles AllowedEncodingRequest ParametersDescription
GET/deployJSONNoneProvides the list of all the deployment packages installed and tracked by the framework.
POST/_installdeployJSONInstallRequest info in message bodyInstalls the deployment package specified in the InstallRequest.
If the request was already issued for the same InstallRequest, it returns the status of the installation process.
DELETE/{name}deployJSONDeployment Package nameUninstalls the deployment package identified by the specified name. If the request was already issued, it reports the status of the uninstallation operation.

/ | GET

Request

URL: https://<gateway-ip>/services/deploy/v1/

Response

[
    {
        "name": "com.eurotech.framework.aws.mqtt.cloudconnection.feature",
        "version": "1.0.102"
    }
]

/_install | POST

Request

URL: https://<gateway-ip>/services/deploy/v1/_install

Request Body:

{
  "url": "http://download.eclipse.org/kura/releases/4.1.0/org.eclipse.kura.demo.heater_1.0.500.dp"
}

Response

"REQUEST_RECEIVED"

/{name} | DELETE

Request

URL: https://<gateway-ip>/services/deploy/v1/org.eclipse.kura.demo.heater

Response

"REQUEST_RECEIVED"