Configuration Service
The ESF Configuration Service is responsible to manage the framework configuration by creating and persisting the framework snapshot. Built on top of the OSGi Configuration Admin and Metatype services, it is also responsible to track and manage the creation and deletion of service instances as well as OSGi component factories.
REST APIs
The ESF configuration service REST APIs are exposed by the com.eurotech.framework.rest.configuration
bundle, providing the following REST APIs under the /configuration/v1
path:
Method | Path | Roles Allowed | Encoding | Request Parameters | Description |
---|---|---|---|---|---|
GET | /factoryComponents | configuration | JSON | None | The method lists all the FactoryComponents Pids tracked by the ConfigurationService |
POST | /factoryComponents | configuration | JSON | FactoryComponentConfiguration object | Creates a new ConfigurableComponent instance by creating a new configuration from a Configuration Admin factory. The FactoryComponentConfiguration object passed as request parameter will provide all the information needed to generate the instance. It links the factory Pid to be used, the target instance Pid, the properties to be used when creating the instance, and if the request should be persisted with a snapshot. |
DELETE | /factoryComponents/{pid}? takeSnapshot ={takeSnapshot} | configuration | JSON | pid = A String representing the pid of the instance generated by a Factory Component that needs to deleted takeSnapshot = an optional (default false) boolean to specify if a new snapshot needs to be created after the delete operation | For the specified Pid and optional takeSnapshot query parameter, the ConfigurationService instance will delete the corresponding ConfigurableComponent instance. |
GET | /configurableComponents | configuration | JSON | None | Lists the tracked configurable component Pids |
GET | /configurableComponents/configurations | configuration | JSON | None | Lists all the component configurations of all the ConfigurableComponents tracked by the ConfigurationService |
GET | /configurableComponents/configurations/byFilter/{filter} | configuration | JSON | filter = A String representing an OSGi filter | Lists the component configurations of all the ConfigurableComponents tracked by the ConfigurationService that match the filter specified |
GET | /configurableComponents/configurations/byPid/{pid} | configuration | JSON | pid = A String representing the pid of a configurable component instance | Provides the ComponentConfiguration of the ConfigurableComponent matching the specified Pid |
GET | /configurableComponents/configurations/byPid/{pid}/_default | configuration | JSON | pid = A String representing the pid of a configurable component instance | Provides the default Component Configuration for the component identified by the specified Pid |
POST | /configurableComponents/configurations/byPid/{pid}/_update | configuration | JSON | pid = A String representing the pid of a configurable component instance ComponentConfigurationUpdateRequest = the updated configuration provided in the request body | Allows to update the component configuration identified by the provided PID |
POST | /configurableComponents/configurations/_update | configuration | JSON | componentConfigurations = the list of updated configurations provided in the request body | Allows to update the configuration of multiple configurable components |
GET | /snapshots | configuration | JSON | None | Lists all the available snapshot IDs managed by the framework |
GET | /snapshots/{id} | configuration | JSON | id = the snapshot Id | Returns the content of a given snapshot tracked by the framework. |
POST | /snapshots/_write | configuration | JSON | None | Triggers the framework to take and persist a snapshot. |
POST | /snapshots/_rollback | configuration | JSON | None | Rollbacks the framework to the last saved snapshot if available. |
POST | /snapshots/{id}/_rollback | configuration | JSON | id = the snapshot Id | Rollbacks the framework to the snapshot identified by the provided ID |
POST | /snapshots/_upload | configuration | Consumes: XML | Framework snapshot in XML form provided in the request body | Uploads a snapshot. The framework will update the component(s) configuration accordingly to the configurations received. |
/factoryComponents | GET
Request
URL: https://<gateway-ip>/services/configuration/v1/factoryComponents
Response
[
"org.eclipse.kura.wire.Conditional",
"org.eclipse.kura.cloudconnection.raw.mqtt.publisher.RawMqttPublisher",
"org.eclipse.kura.misc.cloudcat.CloudCat",
"org.eclipse.kura.core.db.H2DbServer",
"org.eclipse.kura.wire.Fifo",
"org.eclipse.kura.cloudconnection.raw.mqtt.cloud.RawMqttCloudEndpoint",
"org.eclipse.kura.core.keystore.FilesystemKeystoreServiceImpl",
"org.eclipse.kura.cloud.publisher.CloudPublisher",
"org.eclipse.kura.core.db.H2DbService",
"org.eclipse.kura.wire.CloudSubscriber",
"org.eclipse.kura.wire.RegexFilter",
"org.eclipse.kura.wire.Logger",
"org.eclipse.kura.wire.Timer",
"com.eurotech.framework.log.manager.LogManager",
"com.eurotech.framework.log.journald.wire.JournaldWireComponent",
"org.eclipse.kura.cloudconnection.raw.mqtt.subscriber.RawMqttSubscriber",
"org.eclipse.kura.cloud.subscriber.CloudSubscriber",
"org.eclipse.kura.ssl.SslManagerService",
"org.eclipse.kura.core.data.transport.mqtt.MqttDataTransport",
"com.eurotech.framework.log.journald.JournaldLogReader",
"org.eclipse.kura.provisioning.ProvisioningService",
"org.eclipse.kura.wire.CloudPublisher",
"org.eclipse.kura.wire.H2DbWireRecordFilter",
"org.eclipse.kura.cloud.CloudService",
"org.eclipse.kura.data.DataService",
"org.eclipse.kura.wire.H2DbWireRecordStore",
"org.eclipse.kura.wire.Join",
"com.eurotech.framework.log.publisher.LogPublisher"
]
/factoryComponents | POST
Request
URL: https://<gateway-ip>/services/configuration/v1/factoryComponents
Request Body:
{
"factoryPid": "org.eclipse.kura.core.db.H2DbServer",
"pid": "myH2DbServer",
"properties" : [],
"takeSnapshot" : false
}
The request must be provided with the following elements:
- factoryPid: the factory used to generate the new instance
- pid: the new instance process id
- properties: eventual properties that will be used to instantiate the new instance and will override the defaults. A list of string, object pair is needed and can be optionally empty.
- takeSnapshot: specifies if after the creation of a new component a snapshot needs to be taken.
/factoryComponents | DELETE
Request
URL: https://<gateway-ip>/services/configuration/v1/factoryComponents/{pid}?takeSnapshot={takeSnapshot}
- takeSnapshot: can be either true or false. If set to true, after the deletion, the framework will take a snapshot.
/configurableComponents | GET
Request
URL: https://<gateway-ip>/services/configuration/v1/configurableComponents
Response
[
"org.eclipse.kura.clock.ClockService",
"org.eclipse.kura.net.admin.NetworkConfigurationService",
"org.eclipse.kura.position.PositionService",
"com.eurotech.framework.internal.ansible.provider.AnsibleServiceImpl",
"org.eclipse.kura.internal.useradmin.store.RoleRepositoryStoreImpl",
"com.eurotech.framework.internal.ansible.cloud.AnsibleActivityHandler",
"default.diagnostic.publisher",
"org.eclipse.kura.net.admin.FirewallConfigurationService",
"com.eurotech.framework.internal.fail2ban.Fail2BanConfigurator",
"default.log.publisher",
"org.eclipse.kura.wire.graph.WireGraphService",
"com.eurotech.framework.internal.floodingprotection.FloodingProtectionConfigurator",
"org.eclipse.kura.ssl.SslManagerService",
"org.eclipse.kura.http.server.manager.HttpService",
"org.eclipse.kura.cloud.app.command.CommandCloudApp",
"default.ping.publisher",
"org.eclipse.kura.db.H2DbService",
"com.eurotech.framework.diagnostics.DiagnosticsService",
"org.eclipse.kura.core.data.transport.mqtt.MqttDataTransport",
"org.eclipse.kura.deployment.agent",
"DMKeystore",
"LogReaderJournald",
"default.alert.publisher",
"org.eclipse.kura.core.deployment.CloudDeploymentHandlerV2",
"HttpsKeystore",
"com.eurotech.framework.security.aide.AideTamperDetectionServiceConfigurator",
"org.eclipse.kura.provisioning.ProvisioningService",
"LogManagerAuth",
"com.eurotech.framework.security.journald.fss.FssTamperDetectionServiceConfigurator",
"org.eclipse.kura.watchdog.WatchdogService",
"org.eclipse.kura.cloud.CloudService",
"LogManagerActivity",
"org.eclipse.kura.data.DataService",
"LogManagerDefault",
"org.eclipse.kura.web.Console",
"SSLKeystore",
"com.eurotech.framework.net.vpn.client.VpnClient",
"org.eclipse.kura.internal.rest.provider.RestService",
"com.eurotech.framework.reboot.RebootService"
]
/configurableComponents/configurations | GET
Request
URL: https://<gateway-ip>/services/configuration/v1/configurableComponents/configurations
Response
[
{
"pid": "org.eclipse.kura.clock.ClockService",
"definition": {
"ad": [
{
"name": "enabled",
"description": "Whether or not to enable the ClockService",
"id": "enabled",
"type": "BOOLEAN",
"defaultValue": "true",
"required": true
},
{
"name": "clock.set.hwclock",
"description": "Whether or not to sync the system hardware clock after the system time gets set",
"id": "clock.set.hwclock",
"type": "BOOLEAN",
"defaultValue": "true",
"required": true
},
{
"option": [
{
"label": "java-ntp",
"value": "java-ntp"
},
{
"label": "ntpd",
"value": "ntpd"
}
],
"name": "clock.provider",
"description": "Source for setting the system clock",
"id": "clock.provider",
"type": "STRING",
"defaultValue": "java-ntp",
"required": true
},
{
"name": "clock.ntp.host",
"description": "The hostname that provides the system time via NTP",
"id": "clock.ntp.host",
"type": "STRING",
"defaultValue": "0.pool.ntp.org",
"required": true
},
{
"name": "clock.ntp.port",
"description": "The port number that provides the system time via NTP",
"id": "clock.ntp.port",
"type": "INTEGER",
"min": "1",
"max": "65535",
"defaultValue": "123",
"required": true
},
{
"name": "clock.ntp.timeout",
"description": "The NTP timeout in milliseconds",
"id": "clock.ntp.timeout",
"type": "INTEGER",
"min": "1000",
"defaultValue": "10000",
"required": true
},
{
"name": "clock.ntp.max-retry",
"description": "The maximum number of retries for the initial synchronization (with interval clock.ntp.retry.interval). If set to 0 the service will retry forever.",
"id": "clock.ntp.max-retry",
"type": "INTEGER",
"min": "0",
"defaultValue": "0",
"required": true
},
{
"name": "clock.ntp.retry.interval",
"description": "When sync fails, interval in seconds between each retry.",
"id": "clock.ntp.retry.interval",
"type": "INTEGER",
"min": "1",
"defaultValue": "5",
"required": true
},
{
"name": "clock.ntp.refresh-interval",
"description": "Whether or not to sync the clock and if so, the frequency in seconds. If less than zero - no update, if equal to zero - sync once at startup, if greater than zero - the frequency in seconds to perform a new clock sync",
"id": "clock.ntp.refresh-interval",
"type": "INTEGER",
"defaultValue": "3600",
"required": true
},
{
"name": "RTC File Name",
"description": "The RTC File Name. It defaults to /dev/rtc0.",
"id": "rtc.filename",
"type": "STRING",
"defaultValue": "/dev/rtc0",
"required": true
}
],
"icon": [
{
"resource": "ClockService",
"size": 32
}
],
"name": "ClockService",
"description": "ClockService Configuration",
"id": "org.eclipse.kura.clock.ClockService"
},
"properties": {
"clock.ntp.host": {
"value": "0.pool.ntp.org",
"type": "STRING"
},
"clock.ntp.port": {
"value": 123,
"type": "INTEGER"
},
"clock.provider": {
"value": "java-ntp",
"type": "STRING"
},
"clock.ntp.max-retry": {
"value": 0,
"type": "INTEGER"
},
"clock.ntp.refresh-interval": {
"value": 3600,
"type": "INTEGER"
},
"rtc.filename": {
"value": "/dev/rtc0",
"type": "STRING"
},
"clock.set.hwclock": {
"value": true,
"type": "BOOLEAN"
},
"clock.ntp.timeout": {
"value": 10000,
"type": "INTEGER"
},
"enabled": {
"value": true,
"type": "BOOLEAN"
},
"clock.ntp.retry.interval": {
"value": 5,
"type": "INTEGER"
},
"kura.service.pid": {
"value": "org.eclipse.kura.clock.ClockService",
"type": "STRING"
},
"service.pid": {
"value": "org.eclipse.kura.clock.ClockService",
"type": "STRING"
}
}
},
...
]
/configurableComponents/configurations/byFilter/{filter} | GET
Request
URL: https://<gateway-ip>/services/configuration/v1/configurableComponents/configurations/byFilter/(service.pid=org.eclipse.kura.clock.ClockService)
Response
[
{
"pid": "org.eclipse.kura.clock.ClockService",
"definition": {
"ad": [
{
"name": "enabled",
"description": "Whether or not to enable the ClockService",
"id": "enabled",
"type": "BOOLEAN",
"defaultValue": "true",
"required": true
},
{
"name": "clock.set.hwclock",
"description": "Whether or not to sync the system hardware clock after the system time gets set",
"id": "clock.set.hwclock",
"type": "BOOLEAN",
"defaultValue": "true",
"required": true
},
{
"option": [
{
"label": "java-ntp",
"value": "java-ntp"
},
{
"label": "ntpd",
"value": "ntpd"
}
],
"name": "clock.provider",
"description": "Source for setting the system clock",
"id": "clock.provider",
"type": "STRING",
"defaultValue": "java-ntp",
"required": true
},
{
"name": "clock.ntp.host",
"description": "The hostname that provides the system time via NTP",
"id": "clock.ntp.host",
"type": "STRING",
"defaultValue": "0.pool.ntp.org",
"required": true
},
{
"name": "clock.ntp.port",
"description": "The port number that provides the system time via NTP",
"id": "clock.ntp.port",
"type": "INTEGER",
"min": "1",
"max": "65535",
"defaultValue": "123",
"required": true
},
{
"name": "clock.ntp.timeout",
"description": "The NTP timeout in milliseconds",
"id": "clock.ntp.timeout",
"type": "INTEGER",
"min": "1000",
"defaultValue": "10000",
"required": true
},
{
"name": "clock.ntp.max-retry",
"description": "The maximum number of retries for the initial synchronization (with interval clock.ntp.retry.interval). If set to 0 the service will retry forever.",
"id": "clock.ntp.max-retry",
"type": "INTEGER",
"min": "0",
"defaultValue": "0",
"required": true
},
{
"name": "clock.ntp.retry.interval",
"description": "When sync fails, interval in seconds between each retry.",
"id": "clock.ntp.retry.interval",
"type": "INTEGER",
"min": "1",
"defaultValue": "5",
"required": true
},
{
"name": "clock.ntp.refresh-interval",
"description": "Whether or not to sync the clock and if so, the frequency in seconds. If less than zero - no update, if equal to zero - sync once at startup, if greater than zero - the frequency in seconds to perform a new clock sync",
"id": "clock.ntp.refresh-interval",
"type": "INTEGER",
"defaultValue": "3600",
"required": true
},
{
"name": "RTC File Name",
"description": "The RTC File Name. It defaults to /dev/rtc0.",
"id": "rtc.filename",
"type": "STRING",
"defaultValue": "/dev/rtc0",
"required": true
}
],
"icon": [
{
"resource": "ClockService",
"size": 32
}
],
"name": "ClockService",
"description": "ClockService Configuration",
"id": "org.eclipse.kura.clock.ClockService"
},
"properties": {
"clock.ntp.host": {
"value": "0.pool.ntp.org",
"type": "STRING"
},
"clock.ntp.port": {
"value": 123,
"type": "INTEGER"
},
"clock.provider": {
"value": "java-ntp",
"type": "STRING"
},
"clock.ntp.max-retry": {
"value": 0,
"type": "INTEGER"
},
"clock.ntp.refresh-interval": {
"value": 3600,
"type": "INTEGER"
},
"rtc.filename": {
"value": "/dev/rtc0",
"type": "STRING"
},
"clock.set.hwclock": {
"value": true,
"type": "BOOLEAN"
},
"clock.ntp.timeout": {
"value": 10000,
"type": "INTEGER"
},
"enabled": {
"value": true,
"type": "BOOLEAN"
},
"clock.ntp.retry.interval": {
"value": 5,
"type": "INTEGER"
},
"kura.service.pid": {
"value": "org.eclipse.kura.clock.ClockService",
"type": "STRING"
},
"service.pid": {
"value": "org.eclipse.kura.clock.ClockService",
"type": "STRING"
}
}
}
]
/configurableComponents/configurations/byPid/{pid} | GET
Request
URL: https://<gateway-ip>/services/configuration/v1/configurableComponents/configurations/byPid/org.eclipse.kura.clock.ClockService
Response
{
"pid": "org.eclipse.kura.clock.ClockService",
"definition": {
"ad": [
{
"name": "enabled",
"description": "Whether or not to enable the ClockService",
"id": "enabled",
"type": "BOOLEAN",
"defaultValue": "true",
"required": true
},
{
"name": "clock.set.hwclock",
"description": "Whether or not to sync the system hardware clock after the system time gets set",
"id": "clock.set.hwclock",
"type": "BOOLEAN",
"defaultValue": "true",
"required": true
},
{
"option": [
{
"label": "java-ntp",
"value": "java-ntp"
},
{
"label": "ntpd",
"value": "ntpd"
}
],
"name": "clock.provider",
"description": "Source for setting the system clock",
"id": "clock.provider",
"type": "STRING",
"defaultValue": "java-ntp",
"required": true
},
{
"name": "clock.ntp.host",
"description": "The hostname that provides the system time via NTP",
"id": "clock.ntp.host",
"type": "STRING",
"defaultValue": "0.pool.ntp.org",
"required": true
},
{
"name": "clock.ntp.port",
"description": "The port number that provides the system time via NTP",
"id": "clock.ntp.port",
"type": "INTEGER",
"min": "1",
"max": "65535",
"defaultValue": "123",
"required": true
},
{
"name": "clock.ntp.timeout",
"description": "The NTP timeout in milliseconds",
"id": "clock.ntp.timeout",
"type": "INTEGER",
"min": "1000",
"defaultValue": "10000",
"required": true
},
{
"name": "clock.ntp.max-retry",
"description": "The maximum number of retries for the initial synchronization (with interval clock.ntp.retry.interval). If set to 0 the service will retry forever.",
"id": "clock.ntp.max-retry",
"type": "INTEGER",
"min": "0",
"defaultValue": "0",
"required": true
},
{
"name": "clock.ntp.retry.interval",
"description": "When sync fails, interval in seconds between each retry.",
"id": "clock.ntp.retry.interval",
"type": "INTEGER",
"min": "1",
"defaultValue": "5",
"required": true
},
{
"name": "clock.ntp.refresh-interval",
"description": "Whether or not to sync the clock and if so, the frequency in seconds. If less than zero - no update, if equal to zero - sync once at startup, if greater than zero - the frequency in seconds to perform a new clock sync",
"id": "clock.ntp.refresh-interval",
"type": "INTEGER",
"defaultValue": "3600",
"required": true
},
{
"name": "RTC File Name",
"description": "The RTC File Name. It defaults to /dev/rtc0.",
"id": "rtc.filename",
"type": "STRING",
"defaultValue": "/dev/rtc0",
"required": true
}
],
"icon": [
{
"resource": "ClockService",
"size": 32
}
],
"name": "ClockService",
"description": "ClockService Configuration",
"id": "org.eclipse.kura.clock.ClockService"
},
"properties": {
"clock.ntp.host": {
"value": "0.pool.ntp.org",
"type": "STRING"
},
"clock.ntp.port": {
"value": 123,
"type": "INTEGER"
},
"clock.provider": {
"value": "java-ntp",
"type": "STRING"
},
"clock.ntp.max-retry": {
"value": 0,
"type": "INTEGER"
},
"clock.ntp.refresh-interval": {
"value": 3600,
"type": "INTEGER"
},
"rtc.filename": {
"value": "/dev/rtc0",
"type": "STRING"
},
"clock.set.hwclock": {
"value": true,
"type": "BOOLEAN"
},
"clock.ntp.timeout": {
"value": 10000,
"type": "INTEGER"
},
"enabled": {
"value": true,
"type": "BOOLEAN"
},
"clock.ntp.retry.interval": {
"value": 5,
"type": "INTEGER"
},
"kura.service.pid": {
"value": "org.eclipse.kura.clock.ClockService",
"type": "STRING"
},
"service.pid": {
"value": "org.eclipse.kura.clock.ClockService",
"type": "STRING"
}
}
}
/configurableComponents/configurations/byPid/{pid}/_default | GET
Request
URL: https://<gateway-ip>/services/configuration/v1/configurableComponents/configurations/byPid/org.eclipse.kura.clock.ClockService/_default
Response
{
"pid": "org.eclipse.kura.clock.ClockService",
"definition": {
"ad": [
{
"name": "enabled",
"description": "Whether or not to enable the ClockService",
"id": "enabled",
"type": "BOOLEAN",
"defaultValue": "true",
"required": true
},
{
"name": "clock.set.hwclock",
"description": "Whether or not to sync the system hardware clock after the system time gets set",
"id": "clock.set.hwclock",
"type": "BOOLEAN",
"defaultValue": "true",
"required": true
},
{
"option": [
{
"label": "java-ntp",
"value": "java-ntp"
},
{
"label": "ntpd",
"value": "ntpd"
}
],
"name": "clock.provider",
"description": "Source for setting the system clock",
"id": "clock.provider",
"type": "STRING",
"defaultValue": "java-ntp",
"required": true
},
{
"name": "clock.ntp.host",
"description": "The hostname that provides the system time via NTP",
"id": "clock.ntp.host",
"type": "STRING",
"defaultValue": "0.pool.ntp.org",
"required": true
},
{
"name": "clock.ntp.port",
"description": "The port number that provides the system time via NTP",
"id": "clock.ntp.port",
"type": "INTEGER",
"min": "1",
"max": "65535",
"defaultValue": "123",
"required": true
},
{
"name": "clock.ntp.timeout",
"description": "The NTP timeout in milliseconds",
"id": "clock.ntp.timeout",
"type": "INTEGER",
"min": "1000",
"defaultValue": "10000",
"required": true
},
{
"name": "clock.ntp.max-retry",
"description": "The maximum number of retries for the initial synchronization (with interval clock.ntp.retry.interval). If set to 0 the service will retry forever.",
"id": "clock.ntp.max-retry",
"type": "INTEGER",
"min": "0",
"defaultValue": "0",
"required": true
},
{
"name": "clock.ntp.retry.interval",
"description": "When sync fails, interval in seconds between each retry.",
"id": "clock.ntp.retry.interval",
"type": "INTEGER",
"min": "1",
"defaultValue": "5",
"required": true
},
{
"name": "clock.ntp.refresh-interval",
"description": "Whether or not to sync the clock and if so, the frequency in seconds. If less than zero - no update, if equal to zero - sync once at startup, if greater than zero - the frequency in seconds to perform a new clock sync",
"id": "clock.ntp.refresh-interval",
"type": "INTEGER",
"defaultValue": "3600",
"required": true
},
{
"name": "RTC File Name",
"description": "The RTC File Name. It defaults to /dev/rtc0.",
"id": "rtc.filename",
"type": "STRING",
"defaultValue": "/dev/rtc0",
"required": true
}
],
"icon": [
{
"resource": "ClockService",
"size": 32
}
],
"name": "ClockService",
"description": "ClockService Configuration",
"id": "org.eclipse.kura.clock.ClockService"
},
"properties": {
"clock.ntp.host": {
"value": "0.pool.ntp.org",
"type": "STRING"
},
"clock.provider": {
"value": "java-ntp",
"type": "STRING"
},
"clock.ntp.port": {
"value": 123,
"type": "INTEGER"
},
"clock.ntp.max-retry": {
"value": 0,
"type": "INTEGER"
},
"clock.ntp.refresh-interval": {
"value": 3600,
"type": "INTEGER"
},
"rtc.filename": {
"value": "/dev/rtc0",
"type": "STRING"
},
"clock.set.hwclock": {
"value": true,
"type": "BOOLEAN"
},
"enabled": {
"value": true,
"type": "BOOLEAN"
},
"clock.ntp.timeout": {
"value": 10000,
"type": "INTEGER"
},
"clock.ntp.retry.interval": {
"value": 5,
"type": "INTEGER"
}
}
}
/configurableComponents/configurations/byPid/{pid}/_update | POST
Request
URL: https://<gateway-ip>/services/configuration/v1/configurableComponents/configurations/byPid/org.eclipse.kura.clock.ClockService/_update
Request Body:
{
"takeSnapshot":true,
"componentConfigurationRequest": {
"properties": {
"enabled": {
"type": "BOOLEAN",
"value": false
}
}
}
}
Network configuration changes
Every service may need a different set of parameters and combination of them to reach the desired result. For the NetworkAdminService, for example, the following configuration is required to disable a specific network interface (enp2s0) and prevent re-enabling at reboot. Please verify offline the REST APIs executed and the different deploying scenarios before distributing updates to the fleet of devices.
{ "takeSnapshot":true, "componentConfigurationRequest": { "properties": { "net.interface.enp2s0.config.ip4.status": { "type": "STRING", "value": "netIPv4StatusDisabled" }, "net.interface.enp2s0.config.autoconnect": { "type": "BOOLEAN", "value": false } } } }
/configurableComponents/configurations/_update | POST
Request
URL: https://<gateway-ip>/services/configuration/v1/configurableComponents/configurations/_update
Request Body:
{
"takeSnapshot": true,
"componentConfigurations": [
{
"pid": "org.eclipse.kura.clock.ClockService",
"properties": {
"enabled": {
"type": "BOOLEAN",
"value": false
}
}
}
]
}
/snapshots | GET
Request
URL: https://<gateway-ip>/services/configuration/v1/snapshots
Response
[
0,
1630930775789,
1630930776355,
1630930776839,
1630930797402,
1630930805305
]
/snapshots/{id} | GET
Request
URL: https://<gateway-ip>/services/configuration/v1/snapshots/{id}
Response
[
{
"pid": "org.eclipse.kura.clock.ClockService",
"properties": {
"clock.ntp.host": {
"type": "STRING",
"value": "0.pool.ntp.org"
},
"clock.ntp.port": {
"type": "INTEGER",
"value": 123
},
"clock.provider": {
"type": "STRING",
"value": "java-ntp"
},
"clock.ntp.max-retry": {
"type": "INTEGER",
"value": 0
},
"clock.ntp.refresh-interval": {
"type": "INTEGER",
"value": 3600
},
"rtc.filename": {
"type": "STRING",
"value": "/dev/rtc1"
},
"clock.set.hwclock": {
"type": "BOOLEAN",
"value": true
},
"clock.ntp.timeout": {
"type": "INTEGER",
"value": 10000
},
"enabled": {
"type": "BOOLEAN",
"value": true
},
"clock.ntp.retry.interval": {
"type": "INTEGER",
"value": 5
},
"kura.service.pid": {
"type": "STRING",
"value": "org.eclipse.kura.clock.ClockService"
},
"service.pid": {
"type": "STRING",
"value": "org.eclipse.kura.clock.ClockService"
}
}
},
...
]
/snapshots/_write | POST
Request
URL: https://<gateway-ip>/services/configuration/v1/snapshots/_write
Response
1631095409516
/snapshots/_rollback | POST
Request
URL: https://<gateway-ip>/services/configuration/v1/snapshots/_rollback
Response
1631093011618
/snapshots/{id}/_rollback | POST
Request
URL: https://<gateway-ip>/services/configuration/v1/snapshots/1631095409516/_rollback
/snapshots/_upload | POST
Request
URL: https://<gateway-ip>/services/configuration/v1/snapshots/_upload
<?xml version="1.0" encoding="UTF-8"?><esf:configurations xmlns:esf="http://eurotech.com/esf/2.0" xmlns:ocd="http://www.osgi.org/xmlns/metatype/v1.2.0">
<esf:configuration pid="org.eclipse.kura.clock.ClockService">
<esf:properties>
<esf:property array="false" encrypted="false" name="clock.ntp.host" type="String">
<esf:value>0.pool.ntp.org</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="clock.ntp.port" type="Integer">
<esf:value>123</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="clock.provider" type="String">
<esf:value>java-ntp</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="clock.ntp.max-retry" type="Integer">
<esf:value>0</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="clock.ntp.refresh-interval" type="Integer">
<esf:value>3600</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="rtc.filename" type="String">
<esf:value>/dev/rtc1</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="clock.set.hwclock" type="Boolean">
<esf:value>true</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="clock.ntp.timeout" type="Integer">
<esf:value>10000</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="enabled" type="Boolean">
<esf:value>true</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="clock.ntp.retry.interval" type="Integer">
<esf:value>5</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="kura.service.pid" type="String">
<esf:value>org.eclipse.kura.clock.ClockService</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="service.pid" type="String">
<esf:value>org.eclipse.kura.clock.ClockService</esf:value>
</esf:property>
</esf:properties>
</esf:configuration>
</esf:configurations>
Updated about 3 years ago