Device Bundles
This page is a work in progress
This group of REST API allows performing operations on the application services on the remote device. Application services correspond to OSGi service bundles in ESF and Kura devices.
For more informations about Bundles, please read Gateway Management - Bundles
Get the Bundles installed on a single Device
The following API allows one to return the list of available services installed on the given device:
GET /{scopeId}/devices/{deviceId}/bundles
The required path parameters to be used with this call are:
{scopeId}
is thescopeId
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 thescopeId
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:
GET /{scopeId}/devices/{deviceId}/bundles?timeout={timeoutValue}
Response
The response of this call represents the list of bundles installed on the given device. As an example:
{
"type": "deviceBundles",
"bundle": [
{
"id": 0,
"name": "org.eclipse.osgi",
"state": "ACTIVE",
"version": "3.12.50.v20170928-1321"
},
{
"id": 1,
"name": "org.eclipse.equinox.cm",
"state": "ACTIVE",
"version": "1.2.0.v20170105-1446"
}
]
}
Start the desired Bundle on a single Device
The following API allows starting a given OSGi bundle on the device (the OSGi framework on the remote device will immediately attempt to start the bundle):
POST /{scopeId}/devices/{deviceId}/bundles/{bundleId}/_start
The required path parameters to be used with this call are:
{scopeId}
is thescopeId
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 thescopeId
of the user currently authenticated with the token;{deviceId}
is the id of the desired device;{bundleId}
is the id of the bundle to start; this id must be known a priori, and can be retrieved using the GET call that returns the list of available services installed on the device.
It is also possible to add the optional timeout
query parameter, an integer value which represents the timeout for the request in milliseconds:
POST /{scopeId}/devices/{deviceId}/bundles/{bundleId}/_start?timeout={timeoutValue}
Response
The response of this call will consist in an HTTP 200
status code in case the bundle is successfully started.
Stop the desired Bundle on a single Device
The following API allows stopping a given OSGi bundle on the device:
POST /{scopeId}/devices/{deviceId}/bundles/{bundleId}/_stop
The required path parameters to be used with this call are:
{scopeId}
is thescopeId
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 thescopeId
of the user currently authenticated with the token;{deviceId}
is the id of the desired device;{bundleId}
is the id of the bundle to start; this id must be known a priori, and can be retrieved using the GET call that returns the list of available services installed on the device.
It is also possible to add the optional timeout
query parameter, an integer value which represents the timeout for the request in milliseconds:
POST /{scopeId}/devices/{deviceId}/bundles/{bundleId}/_stop?timeout={timeoutValue}
Response
The response of this call will consist in an HTTP 200
status code in case the bundle is successfully stopped.
Updated about 5 years ago