Skip to content

Configuration V1 REST APIs

This page describes the configuration V1 rest APIs.

REST APIs

The Configuration Service REST APIs are exposed by the org.eclipse.kura.rest.configuration bundle, providing the following REST APIs under the /configuration/v1 path.

Method Path Allowed roles 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

Get all the factory components pids

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"
]

Create component from factory

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.

Delete a component and optionally take a snapshot

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.

List the tracked configurable component Pids

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"
]

Lists all the component configurations of all the ConfigurableComponents

Request: URL - https://<gateway-ip>/services/configuration/v1/configurableComponents/configurations

Response:

[
    {
        "pid": "org.eclipse.kura.clock.ClockService",
        "definition": {
            "ad": [
                {
                    "option": [],
                    "name": "enabled",
                    "description": "Whether or not to enable the ClockService",
                    "id": "enabled",
                    "type": "BOOLEAN",
                    "cardinality": 0,
                    "_default": "true",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "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",
                    "cardinality": 0,
                    "_default": "true",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [
                        {
                            "label": "java-ntp",
                            "value": "java-ntp",
                            "otherAttributes": {}
                        },
                        {
                            "label": "ntpd",
                            "value": "ntpd",
                            "otherAttributes": {}
                        },
                        {
                            "label": "chrony-advanced",
                            "value": "chrony-advanced",
                            "otherAttributes": {}
                        }
                    ],
                    "name": "clock.provider",
                    "description": "Source for setting the system clock. Verify the availabiliy of the selected provider before activate it.",
                    "id": "clock.provider",
                    "type": "STRING",
                    "cardinality": 0,
                    "_default": "java-ntp",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "clock.ntp.host",
                    "description": "The hostname that provides the system time via NTP",
                    "id": "clock.ntp.host",
                    "type": "STRING",
                    "cardinality": 0,
                    "_default": "0.pool.ntp.org",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "clock.ntp.port",
                    "description": "The port number that provides the system time via NTP",
                    "id": "clock.ntp.port",
                    "type": "INTEGER",
                    "cardinality": 0,
                    "min": "1",
                    "max": "65535",
                    "_default": "123",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "clock.ntp.timeout",
                    "description": "The NTP timeout in milliseconds",
                    "id": "clock.ntp.timeout",
                    "type": "INTEGER",
                    "cardinality": 0,
                    "min": "1000",
                    "_default": "10000",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "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",
                    "cardinality": 0,
                    "min": "0",
                    "_default": "0",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "clock.ntp.retry.interval",
                    "description": "When sync fails, interval in seconds between each retry.",
                    "id": "clock.ntp.retry.interval",
                    "type": "INTEGER",
                    "cardinality": 0,
                    "min": "1",
                    "_default": "5",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "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",
                    "cardinality": 0,
                    "_default": "3600",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "RTC File Name",
                    "description": "The RTC File Name. It defaults to /dev/rtc0. This option is not used if chrony-advanced option is selected in clock.provider.",
                    "id": "rtc.filename",
                    "type": "STRING",
                    "cardinality": 0,
                    "_default": "/dev/rtc0",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "Chrony Configuration",
                    "description": "Chrony configuration file.|TextArea",
                    "id": "chrony.advanced.config",
                    "type": "STRING",
                    "cardinality": 0,
                    "required": false,
                    "otherAttributes": {}
                }
            ],
            "icon": [
                {
                    "resource": "ClockService",
                    "size": 32,
                    "otherAttributes": {}
                }
            ],
            "name": "ClockService",
            "description": "ClockService Configuration",
            "id": "org.eclipse.kura.clock.ClockService",
            "otherAttributes": {}
        },
        "properties": {
            "clock.ntp.host": {
                "array": false,
                "type": "String",
                "value": "0.pool.ntp.org"
            },
            "clock.ntp.max-retry": {
                "array": false,
                "type": "Integer",
                "value": 0
            },
            "clock.set.hwclock": {
                "array": false,
                "type": "Boolean",
                "value": true
            },
            "clock.ntp.timeout": {
                "array": false,
                "type": "Integer",
                "value": 10000
            },
            "enabled": {
                "array": false,
                "type": "Boolean",
                "value": false
            },
            "clock.ntp.retry.interval": {
                "array": false,
                "type": "Integer",
                "value": 5
            },
            "kura.service.pid": {
                "array": false,
                "type": "String",
                "value": "org.eclipse.kura.clock.ClockService"
            },
            "service.pid": {
                "array": false,
                "type": "String",
                "value": "org.eclipse.kura.clock.ClockService"
            },
            "clock.ntp.port": {
                "array": false,
                "type": "Integer",
                "value": 123
            },
            "clock.provider": {
                "array": false,
                "type": "String",
                "value": "java-ntp"
            },
            "clock.ntp.refresh-interval": {
                "array": false,
                "type": "Integer",
                "value": 3600
            },
            "rtc.filename": {
                "array": false,
                "type": "String",
                "value": "/dev/rtc1"
            },
            "chrony.advanced.config": {
                "array": false,
                "type": "String",
                "value": ""
            }
        }
    },
  ...
]

List the configurations of all the ConfigurableComponents that match a filter

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": [
                {
                    "option": [],
                    "name": "enabled",
                    "description": "Whether or not to enable the ClockService",
                    "id": "enabled",
                    "type": "BOOLEAN",
                    "cardinality": 0,
                    "_default": "true",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "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",
                    "cardinality": 0,
                    "_default": "true",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [
                        {
                            "label": "java-ntp",
                            "value": "java-ntp",
                            "otherAttributes": {}
                        },
                        {
                            "label": "ntpd",
                            "value": "ntpd",
                            "otherAttributes": {}
                        },
                        {
                            "label": "chrony-advanced",
                            "value": "chrony-advanced",
                            "otherAttributes": {}
                        }
                    ],
                    "name": "clock.provider",
                    "description": "Source for setting the system clock. Verify the availabiliy of the selected provider before activate it.",
                    "id": "clock.provider",
                    "type": "STRING",
                    "cardinality": 0,
                    "_default": "java-ntp",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "clock.ntp.host",
                    "description": "The hostname that provides the system time via NTP",
                    "id": "clock.ntp.host",
                    "type": "STRING",
                    "cardinality": 0,
                    "_default": "0.pool.ntp.org",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "clock.ntp.port",
                    "description": "The port number that provides the system time via NTP",
                    "id": "clock.ntp.port",
                    "type": "INTEGER",
                    "cardinality": 0,
                    "min": "1",
                    "max": "65535",
                    "_default": "123",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "clock.ntp.timeout",
                    "description": "The NTP timeout in milliseconds",
                    "id": "clock.ntp.timeout",
                    "type": "INTEGER",
                    "cardinality": 0,
                    "min": "1000",
                    "_default": "10000",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "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",
                    "cardinality": 0,
                    "min": "0",
                    "_default": "0",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "clock.ntp.retry.interval",
                    "description": "When sync fails, interval in seconds between each retry.",
                    "id": "clock.ntp.retry.interval",
                    "type": "INTEGER",
                    "cardinality": 0,
                    "min": "1",
                    "_default": "5",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "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",
                    "cardinality": 0,
                    "_default": "3600",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "RTC File Name",
                    "description": "The RTC File Name. It defaults to /dev/rtc0. This option is not used if chrony-advanced option is selected in clock.provider.",
                    "id": "rtc.filename",
                    "type": "STRING",
                    "cardinality": 0,
                    "_default": "/dev/rtc0",
                    "required": true,
                    "otherAttributes": {}
                },
                {
                    "option": [],
                    "name": "Chrony Configuration",
                    "description": "Chrony configuration file.|TextArea",
                    "id": "chrony.advanced.config",
                    "type": "STRING",
                    "cardinality": 0,
                    "required": false,
                    "otherAttributes": {}
                }
            ],
            "icon": [
                {
                    "resource": "ClockService",
                    "size": 32,
                    "otherAttributes": {}
                }
            ],
            "name": "ClockService",
            "description": "ClockService Configuration",
            "id": "org.eclipse.kura.clock.ClockService",
            "otherAttributes": {}
        },
        "properties": {
            "clock.ntp.host": {
                "array": false,
                "type": "String",
                "value": "0.pool.ntp.org"
            },
            "clock.ntp.max-retry": {
                "array": false,
                "type": "Integer",
                "value": 0
            },
            "clock.set.hwclock": {
                "array": false,
                "type": "Boolean",
                "value": true
            },
            "clock.ntp.timeout": {
                "array": false,
                "type": "Integer",
                "value": 10000
            },
            "enabled": {
                "array": false,
                "type": "Boolean",
                "value": false
            },
            "clock.ntp.retry.interval": {
                "array": false,
                "type": "Integer",
                "value": 5
            },
            "kura.service.pid": {
                "array": false,
                "type": "String",
                "value": "org.eclipse.kura.clock.ClockService"
            },
            "service.pid": {
                "array": false,
                "type": "String",
                "value": "org.eclipse.kura.clock.ClockService"
            },
            "clock.ntp.port": {
                "array": false,
                "type": "Integer",
                "value": 123
            },
            "clock.provider": {
                "array": false,
                "type": "String",
                "value": "java-ntp"
            },
            "clock.ntp.refresh-interval": {
                "array": false,
                "type": "Integer",
                "value": 3600
            },
            "rtc.filename": {
                "array": false,
                "type": "String",
                "value": "/dev/rtc1"
            },
            "chrony.advanced.config": {
                "array": false,
                "type": "String",
                "value": ""
            }
        }
    }
]

Get the configuration of the ConfigurableComponent matching a pid

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": [
            {
                "option": [],
                "name": "enabled",
                "description": "Whether or not to enable the ClockService",
                "id": "enabled",
                "type": "BOOLEAN",
                "cardinality": 0,
                "_default": "true",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "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",
                "cardinality": 0,
                "_default": "true",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [
                    {
                        "label": "java-ntp",
                        "value": "java-ntp",
                        "otherAttributes": {}
                    },
                    {
                        "label": "ntpd",
                        "value": "ntpd",
                        "otherAttributes": {}
                    },
                    {
                        "label": "chrony-advanced",
                        "value": "chrony-advanced",
                        "otherAttributes": {}
                    }
                ],
                "name": "clock.provider",
                "description": "Source for setting the system clock. Verify the availabiliy of the selected provider before activate it.",
                "id": "clock.provider",
                "type": "STRING",
                "cardinality": 0,
                "_default": "java-ntp",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "clock.ntp.host",
                "description": "The hostname that provides the system time via NTP",
                "id": "clock.ntp.host",
                "type": "STRING",
                "cardinality": 0,
                "_default": "0.pool.ntp.org",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "clock.ntp.port",
                "description": "The port number that provides the system time via NTP",
                "id": "clock.ntp.port",
                "type": "INTEGER",
                "cardinality": 0,
                "min": "1",
                "max": "65535",
                "_default": "123",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "clock.ntp.timeout",
                "description": "The NTP timeout in milliseconds",
                "id": "clock.ntp.timeout",
                "type": "INTEGER",
                "cardinality": 0,
                "min": "1000",
                "_default": "10000",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "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",
                "cardinality": 0,
                "min": "0",
                "_default": "0",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "clock.ntp.retry.interval",
                "description": "When sync fails, interval in seconds between each retry.",
                "id": "clock.ntp.retry.interval",
                "type": "INTEGER",
                "cardinality": 0,
                "min": "1",
                "_default": "5",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "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",
                "cardinality": 0,
                "_default": "3600",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "RTC File Name",
                "description": "The RTC File Name. It defaults to /dev/rtc0. This option is not used if chrony-advanced option is selected in clock.provider.",
                "id": "rtc.filename",
                "type": "STRING",
                "cardinality": 0,
                "_default": "/dev/rtc0",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "Chrony Configuration",
                "description": "Chrony configuration file.|TextArea",
                "id": "chrony.advanced.config",
                "type": "STRING",
                "cardinality": 0,
                "required": false,
                "otherAttributes": {}
            }
        ],
        "icon": [
            {
                "resource": "ClockService",
                "size": 32,
                "otherAttributes": {}
            }
        ],
        "name": "ClockService",
        "description": "ClockService Configuration",
        "id": "org.eclipse.kura.clock.ClockService",
        "otherAttributes": {}
    },
    "properties": {
        "clock.ntp.host": {
            "array": false,
            "type": "String",
            "value": "0.pool.ntp.org"
        },
        "clock.ntp.max-retry": {
            "array": false,
            "type": "Integer",
            "value": 0
        },
        "clock.set.hwclock": {
            "array": false,
            "type": "Boolean",
            "value": true
        },
        "clock.ntp.timeout": {
            "array": false,
            "type": "Integer",
            "value": 10000
        },
        "enabled": {
            "array": false,
            "type": "Boolean",
            "value": false
        },
        "clock.ntp.retry.interval": {
            "array": false,
            "type": "Integer",
            "value": 5
        },
        "kura.service.pid": {
            "array": false,
            "type": "String",
            "value": "org.eclipse.kura.clock.ClockService"
        },
        "service.pid": {
            "array": false,
            "type": "String",
            "value": "org.eclipse.kura.clock.ClockService"
        },
        "clock.ntp.port": {
            "array": false,
            "type": "Integer",
            "value": 123
        },
        "clock.provider": {
            "array": false,
            "type": "String",
            "value": "java-ntp"
        },
        "clock.ntp.refresh-interval": {
            "array": false,
            "type": "Integer",
            "value": 3600
        },
        "rtc.filename": {
            "array": false,
            "type": "String",
            "value": "/dev/rtc1"
        },
        "chrony.advanced.config": {
            "array": false,
            "type": "String",
            "value": ""
        }
    }
}

Get the default configuration of the ConfigurableComponent matching a pid

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": [
            {
                "option": [],
                "name": "enabled",
                "description": "Whether or not to enable the ClockService",
                "id": "enabled",
                "type": "BOOLEAN",
                "cardinality": 0,
                "_default": "true",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "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",
                "cardinality": 0,
                "_default": "true",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [
                    {
                        "label": "java-ntp",
                        "value": "java-ntp",
                        "otherAttributes": {}
                    },
                    {
                        "label": "ntpd",
                        "value": "ntpd",
                        "otherAttributes": {}
                    },
                    {
                        "label": "chrony-advanced",
                        "value": "chrony-advanced",
                        "otherAttributes": {}
                    }
                ],
                "name": "clock.provider",
                "description": "Source for setting the system clock. Verify the availabiliy of the selected provider before activate it.",
                "id": "clock.provider",
                "type": "STRING",
                "cardinality": 0,
                "_default": "java-ntp",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "clock.ntp.host",
                "description": "The hostname that provides the system time via NTP",
                "id": "clock.ntp.host",
                "type": "STRING",
                "cardinality": 0,
                "_default": "0.pool.ntp.org",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "clock.ntp.port",
                "description": "The port number that provides the system time via NTP",
                "id": "clock.ntp.port",
                "type": "INTEGER",
                "cardinality": 0,
                "min": "1",
                "max": "65535",
                "_default": "123",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "clock.ntp.timeout",
                "description": "The NTP timeout in milliseconds",
                "id": "clock.ntp.timeout",
                "type": "INTEGER",
                "cardinality": 0,
                "min": "1000",
                "_default": "10000",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "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",
                "cardinality": 0,
                "min": "0",
                "_default": "0",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "clock.ntp.retry.interval",
                "description": "When sync fails, interval in seconds between each retry.",
                "id": "clock.ntp.retry.interval",
                "type": "INTEGER",
                "cardinality": 0,
                "min": "1",
                "_default": "5",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "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",
                "cardinality": 0,
                "_default": "3600",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "RTC File Name",
                "description": "The RTC File Name. It defaults to /dev/rtc0. This option is not used if chrony-advanced option is selected in clock.provider.",
                "id": "rtc.filename",
                "type": "STRING",
                "cardinality": 0,
                "_default": "/dev/rtc0",
                "required": true,
                "otherAttributes": {}
            },
            {
                "option": [],
                "name": "Chrony Configuration",
                "description": "Chrony configuration file.|TextArea",
                "id": "chrony.advanced.config",
                "type": "STRING",
                "cardinality": 0,
                "required": false,
                "otherAttributes": {}
            }
        ],
        "icon": [
            {
                "resource": "ClockService",
                "size": 32,
                "otherAttributes": {}
            }
        ],
        "name": "ClockService",
        "description": "ClockService Configuration",
        "id": "org.eclipse.kura.clock.ClockService",
        "otherAttributes": {}
    },
    "properties": {
        "clock.ntp.host": {
            "array": false,
            "type": "String",
            "value": "0.pool.ntp.org"
        },
        "clock.provider": {
            "array": false,
            "type": "String",
            "value": "java-ntp"
        },
        "clock.ntp.port": {
            "array": false,
            "type": "Integer",
            "value": 123
        },
        "clock.ntp.max-retry": {
            "array": false,
            "type": "Integer",
            "value": 0
        },
        "clock.ntp.refresh-interval": {
            "array": false,
            "type": "Integer",
            "value": 3600
        },
        "rtc.filename": {
            "array": false,
            "type": "String",
            "value": "/dev/rtc0"
        },
        "clock.set.hwclock": {
            "array": false,
            "type": "Boolean",
            "value": true
        },
        "enabled": {
            "array": false,
            "type": "Boolean",
            "value": true
        },
        "clock.ntp.timeout": {
            "array": false,
            "type": "Integer",
            "value": 10000
        },
        "clock.ntp.retry.interval": {
            "array": false,
            "type": "Integer",
            "value": 5
        }
    }
}

Update the component configuration identified matching a pid

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,
                "array": false
            }
        }
    }
}

Warning

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",
                "array": false
            },
            "net.interface.enp2s0.config.autoconnect": {
                "type": "boolean",
                "value": false,
                "array": false
            }
        }
    }
}

Update the configuration of multiple configurable components

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,
                    "array": false
                }
            }
        }
    ]
}

List all the available snapshot IDs

Request: URL - https://<gateway-ip>/services/configuration/v1/snapshots

Response:

[
    0,
    1630930775789,
    1630930776355,
    1630930776839,
    1630930797402,
    1630930805305
]

Get the content of a given snapshot

Request: URL - https://<gateway-ip>/services/configuration/v1/snapshots/{id}

Response:

[
    {
        "pid": "org.eclipse.kura.clock.ClockService",
        "properties": {
            "clock.ntp.host": {
                "array": false,
                "type": "String",
                "value": "0.pool.ntp.org"
            },
            "clock.ntp.port": {
                "array": false,
                "type": "Integer",
                "value": 123
            },
            "clock.provider": {
                "array": false,
                "type": "String",
                "value": "java-ntp"
            },
            "clock.ntp.max-retry": {
                "array": false,
                "type": "Integer",
                "value": 0
            },
            "clock.ntp.refresh-interval": {
                "array": false,
                "type": "Integer",
                "value": 3600
            },
            "rtc.filename": {
                "array": false,
                "type": "String",
                "value": "/dev/rtc1"
            },
            "clock.set.hwclock": {
                "array": false,
                "type": "Boolean",
                "value": true
            },
            "clock.ntp.timeout": {
                "array": false,
                "type": "Integer",
                "value": 10000
            },
            "enabled": {
                "array": false,
                "type": "Boolean",
                "value": true
            },
            "clock.ntp.retry.interval": {
                "array": false,
                "type": "Integer",
                "value": 5
            },
            "kura.service.pid": {
                "array": false,
                "type": "String",
                "value": "org.eclipse.kura.clock.ClockService"
            },
            "service.pid": {
                "array": false,
                "type": "String",
                "value": "org.eclipse.kura.clock.ClockService"
            }
        }
    },
  ...
]

Trigger the framework to take and persist a snapshot

Request: URL - https://<gateway-ip>/services/configuration/v1/snapshots/_write

Response:

1631095409516

Rollbacks to the snapshot identified by the provided ID

Request: URL - https://<gateway-ip>/services/configuration/v1/snapshots/_rollback Response:

1631093011618

Upload a snapshot as XML

Request: URL - https://<gateway-ip>/services/configuration/v1/snapshots/_upload

Request body:

<?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>