From 8b8b3bce9c1c7a276dc5c49ff9c97ac3eb9b9de1 Mon Sep 17 00:00:00 2001 From: renatobalestrin-msft <116303108+renatobalestrin-msft@users.noreply.github.com> Date: Tue, 7 Nov 2023 20:04:18 -0300 Subject: [PATCH] Submit PNP models for Device Update GA+ (#549) Co-authored-by: Rido --- dtmi/azure/iot/deviceupdate-2.json | 167 ++++++++++++++++++ .../iot/deviceupdatecontractmodel-3.json | 15 ++ dtmi/azure/iot/deviceupdatemodel-3.json | 22 +++ 3 files changed, 204 insertions(+) create mode 100644 dtmi/azure/iot/deviceupdate-2.json create mode 100644 dtmi/azure/iot/deviceupdatecontractmodel-3.json create mode 100644 dtmi/azure/iot/deviceupdatemodel-3.json diff --git a/dtmi/azure/iot/deviceupdate-2.json b/dtmi/azure/iot/deviceupdate-2.json new file mode 100644 index 000000000..38b37d0b5 --- /dev/null +++ b/dtmi/azure/iot/deviceupdate-2.json @@ -0,0 +1,167 @@ +{ + "@context": "dtmi:dtdl:context;2", + "@id": "dtmi:azure:iot:deviceUpdate;2", + "@type": "Interface", + "displayName": "Device Update Interface version 2", + "description": "Device Update interface version 2 is used to send update action and metadata to devices and receive update status from devices.", + "contents": [ + { + "@type": "Property", + "name": "agent", + "schema": "dtmi:azure:iot:deviceUpdate:agentMetadata;2" + }, + { + "@type": "Property", + "name": "service", + "schema": "dtmi:azure:iot:deviceUpdate:serviceMetadata;2", + "writable": true + } + ], + "schemas": [ + { + "@id": "dtmi:azure:iot:deviceUpdate:agentMetadata;2", + "@type": "Object", + "fields": [ + { + "name": "state", + "schema": "integer" + }, + { + "name": "installedUpdateId", + "schema": "string" + }, + { + "name": "workflow", + "schema": "dtmi:azure:iot:deviceUpdate:workflowMetadata;2" + }, + { + "name": "lastInstallResult", + "schema": "dtmi:azure:iot:deviceUpdate:installResultMetadata;2" + }, + { + "name": "compatPropertyNames", + "schema": "string" + }, + { + "name": "deviceProperties", + "schema": { + "@type": "Map", + "mapKey": { + "name": "devicePropertyName", + "schema": "string" + }, + "mapValue": { + "name": "devicePropertyValue", + "schema": "string" + } + } + } + ] + }, + { + "@id": "dtmi:azure:iot:deviceUpdate:serviceMetadata;2", + "@type": "Object", + "fields": [ + { + "name": "workflow", + "schema": "dtmi:azure:iot:deviceUpdate:workflowMetadata;2" + }, + { + "name": "rootKeyPackageUrl", + "schema": "string" + }, + { + "name": "updateManifest", + "schema": "string" + }, + { + "name": "updateManifestSignature", + "schema": "string" + }, + { + "name": "fileUrls", + "schema": { + "@type": "Map", + "mapKey": { + "name": "fileId", + "schema": "string" + }, + "mapValue": { + "name": "downloadUri", + "schema": "string" + } + } + } + ] + }, + { + "@id": "dtmi:azure:iot:deviceUpdate:workflowMetadata;2", + "@type": "Object", + "fields": [ + { + "name": "action", + "schema": "integer" + }, + { + "name": "id", + "schema": "string" + }, + { + "name": "retryTimestamp", + "schema": "dateTime" + } + ] + }, + { + "@id": "dtmi:azure:iot:deviceUpdate:installResultMetadata;2", + "@type": "Object", + "fields": [ + { + "name": "resultCode", + "schema": "integer" + }, + { + "name": "extendedResultCodes", + "schema": "string" + }, + { + "name": "resultDetails", + "schema": "string" + }, + { + "name": "stepResults", + "schema": { + "@type": "Map", + "mapKey": { + "name": "stepIndex", + "schema": "string", + "comment": "The string format is step_{index}. For example, step_0, step_1, etc." + }, + "mapValue": { + "name": "stepResult", + "schema": "dtmi:azure:iot:deviceUpdate:stepResultMetadata;2" + } + } + } + ] + }, + { + "@id": "dtmi:azure:iot:deviceUpdate:stepResultMetadata;2", + "@type": "Object", + "fields": [ + { + "name": "resultCode", + "schema": "integer" + }, + { + "name": "extendedResultCodes", + "schema": "string" + }, + { + "name": "resultDetails", + "schema": "string" + } + ] + } + ] +} diff --git a/dtmi/azure/iot/deviceupdatecontractmodel-3.json b/dtmi/azure/iot/deviceupdatecontractmodel-3.json new file mode 100644 index 000000000..a1e16d5dd --- /dev/null +++ b/dtmi/azure/iot/deviceupdatecontractmodel-3.json @@ -0,0 +1,15 @@ +{ + "@context": "dtmi:dtdl:context;2", + "@id": "dtmi:azure:iot:deviceUpdateContractModel;3", + "@type": "Interface", + "displayName": "Device Update Base Model version 3", + "description": "Device Update Base Model version 3 supports device update interface version 2 and update manifest version 5.", + "contents": [ + { + "@type": "Component", + "schema": "dtmi:azure:iot:deviceUpdate;2", + "name": "deviceUpdate", + "displayName": "Device Update Interface version 2" + } + ] +} diff --git a/dtmi/azure/iot/deviceupdatemodel-3.json b/dtmi/azure/iot/deviceupdatemodel-3.json new file mode 100644 index 000000000..bfb9a483c --- /dev/null +++ b/dtmi/azure/iot/deviceupdatemodel-3.json @@ -0,0 +1,22 @@ +{ + "@context": "dtmi:dtdl:context;2", + "@id": "dtmi:azure:iot:deviceUpdateModel;3", + "@type": "Interface", + "displayName": "Device Update Model version 3", + "description": "Device Update Model version 3 supports device update contract model version 3, device information interface version 1 and diagnostic interface version 1.", + "extends": "dtmi:azure:iot:deviceUpdateContractModel;3", + "contents": [ + { + "@type": "Component", + "schema": "dtmi:azure:iot:diagnosticInformation;1", + "name": "diagnosticInformation", + "displayName": "Diagnostic Information Interface version 1" + }, + { + "@type": "Component", + "schema": "dtmi:azure:DeviceManagement:DeviceInformation;1", + "name": "deviceInformation", + "displayName": "Device Information" + } + ] +}