-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support updating referenced WoT ThingModel minor version for Ditto Things #1843
Comments
Idea: Provide a "dry run" option to get a preview of what the "migrated" thing would look like. |
This proposal introduces an enhanced model migration endpoint for Eclipse Ditto, aimed at supporting large-scale updates across IoT devices with varying configurations and states. The endpoint enables model migration using a high-level Thing definition URL, combined with precise RQL-based filtering and conditional patching. This approach allows users to selectively apply updates based on specific conditions within each feature, avoiding unnecessary changes and enhancing control over the migration process. Key Features
The endpoint accepts a single Thing definition URL, simplifying the input and eliminating the need to specify each individual feature’s definition.
Users can specify an RQL query in the filter parameter to select devices based on attributes, feature presence, or other conditions.
The migrationPayload supports feature-specific patchConditions using RQL expressions, enabling granular control over updates.
The endpoint provides options to control whether missing features should be added (addMissingFeatures) and whether properties in newly added features should be initialized (initializeProperties). Proposed Endpoint SpecificationEndpoint: POST /things/update-definition
Example Payload json
this granular patch-conditions will serve also the implementation of #1927 |
Currently, the WoT ThingModel is only taken into account when creating new Things in Ditto. In this case, a JSON skeleton of the Thing based on the WoT TM is created.
Over time, a WoT ThingModel might however evolve, e.g. new
properties
, newactions
or newsubmodels
, etc. are added.Those evolvements can be categorised in:
In my experience, non-breaking evolvements can happen very regularly, as the (exposed) functionality of IoT devices evolves quickly over time.
For such non-breaking evolvements, Ditto shall provide means to "migrate" existing things to a newer MINOR version of referenced WoT ThingModels.
Concretely, the following steps would have be done when updating the minor version of a WoT ThingModel in a Ditto thing's
definition
:definition
of a Thing is modified (either viaModifyDefinition
or viaMergeThing
for the"definition"
)definition
fields with the updated "submodel" models<old model version>,<new model version>
:<old model version>
<new model version>
default
valueThe algorithm might still not be "complete" - but in a nutshell, we have to handle:
attributes
with default values for new TM "properties"properties
with default values for new TM "properties"definition
sdefinition
if all was successfuldefinition
The text was updated successfully, but these errors were encountered: