Updating a Digital Twin Adapter
Update the digital twin adapter for your Internet of Things (IoT).
When you update an existing option applied to a digital twin adapter, you change only the value you do not add a new value to the digital twin adapter using this update option. If you want to add a new value you must create a new digital twin adapter and associate the new digital twin adapter OCID to the digital twin instance you want to work with, you can do that when you create a digital twin instance or update a digital twin instance.
Digital Twin Adapter Options
- When to update or re-create a digital twin adapter: Use update for metadata including the
display-name,description,tagsif these options were included initially when you created the digital twin adapter. For mapping logic changes in aenvelope-mappingorinbound-routes, create a new adapter. - Best practices for adapter updates: Apply updates in a new adapter, associate to your test digital twin instance, post sample telemetry, verify
202responses, and downstream values, and then associate the production digital twin instance to the new adapter. - Adapter values: Can be
nullor empty. - Inbound-routes must be valid JSON: Unquoted
${...}values are not supported and will be rejected. JQ Expressions must be inside quoted strings for example,"${(.velocity_kph / 1.609) | floor}" - Limits on inbound routes: Maximum number of inbound routes is 128 inbound routes.
- CLI quoting on Windows: Depending on your operating system or application you are working with, string parameters, quotes and spaces can cause issues. Avoid using quotes that result in unexpected extra arguments, also avoid using spaces. For example, to input OCI CLI parameters use something like this:
--description your-description
The OCI CLI uses hyphen-separated words for the digital twin adapter definitions, the API uses camelCase notation. For example, when using the
oci cli commands envelope-mapping used for the OCI CLI becomes envelopeMapping when using the Python IoT SDK or the IoT API.Use the oci iot digital-twin-adapter update command and required parameters to update a digital twin adapter. You can update the description, free form tags, defined tags, or the display name for a digital twin adapter. Depending on your operating system, you may need different number of slashes, for example on Mac or Linux uses:
file:///inbound-routes.jsonfor more information, seeTo update a digital twin adapter's inbound routes:oci iot digital-twin-adapter update --digital-twin-adapter-id <iot-digital-twin-adapter-OCID> --inbound-routes file://inbound-routes.jsonTo update a digital twin adapter's inbound envelop mapping:oci iot digital-twin-adapter update --digital-twin-adapter-id <iot-digital-twin-adapter-OCID> --inbound-envelop file://inbound-envelop.jsonTo update a digital twin adapter's description:oci iot digital-twin-adapter update --digital-twin-adapter-id <iot-digital-twin-adapter-OCID> --description "<updated-description>"To update a digital twin adapter's free form tags, you can define key value pairs as in this example, or a path to a something liketags.jsonfile as in the example below:oci iot digital-twin-adapter update --digital-twin-adapter-id <iot-digital-twin-adapter-OCID> --freeform-tags '{"<key>": "<value>"}'To update a digital twin adapter's defined tags, use a .json file to define the tags, and include a path something liketags.jsonfile as in the example:oci iot digital-twin-adapter update --digital-twin-adapter-id <iot-digital-twin-adapter-OCID> --defined-tags file://tags.jsonTo update a digital twin adapter's display name:oci iot digital-twin-adapter update --digital-twin-adapter-id <iot-digital-twin-adapter-OCID> --display-name "<updated-display-name>"For a complete list of parameters and values for CLI commands, see CLI Command Reference.
Run the UpdateDigitalTwinAdapter operation to update the digital twin adapter.