From eef491343f2518c253fbb8c201974723020f7f2f Mon Sep 17 00:00:00 2001 From: Kapil Agarwal Date: Mon, 8 Apr 2019 16:05:33 -0700 Subject: [PATCH 1/2] DeviceTelemetry event grid update --- .../stable/2018-01-01/IotHub.json | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json b/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json index ca447f11a224..838368c36c8f 100644 --- a/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json +++ b/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json @@ -3,8 +3,7 @@ "info": { "version": "2018-01-01", "title": "Schema of Azure IoT Hub events published to Azure Event Grid", - "description": - "Describes the schema of the Azure IoT Hub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent." + "description": "Describes the schema of the Azure IoT Hub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent." }, "paths": {}, "definitions": { @@ -44,6 +43,15 @@ ], "properties": {} }, + "IotHubDeviceTelemetryEventData": { + "description": "Event data for Microsoft.Devices.DeviceTelemetry event.", + "allOf": [ + { + "$ref": "#/definitions/DeviceTelemetryEventProperties" + } + ], + "properties": {} + }, "DeviceLifeCycleEventProperties": { "type": "object", "description": "Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted).", @@ -58,7 +66,7 @@ }, "twin": { "description": "Information about the device twin, which is the cloud representation of application device metadata.", - "$ref" : "#/definitions/DeviceTwinInfo" + "$ref": "#/definitions/DeviceTwinInfo" } } }, @@ -80,7 +88,25 @@ }, "deviceConnectionStateEventInfo": { "description": "Information about the device connection state event.", - "$ref" : "#/definitions/DeviceConnectionStateEventInfo" + "$ref": "#/definitions/DeviceConnectionStateEventInfo" + } + } + }, + "DeviceTelemetryEventProperties": { + "type": "object", + "description": "Schema of the Data property of an EventGridEvent for a device telemetry event (DeviceTelemetry).", + "properties": { + "body": { + "type": "object", + "description": "The content of the message from the device." + }, + "properties": { + "type": "object", + "description": "Application properties are user-defined strings that can be added to the message. These fields are optional." + }, + "systemProperties": { + "type": "object", + "description": "System properties help identify contents and source of the messages." } } }, @@ -118,11 +144,11 @@ "properties": { "desired": { "description": "A portion of the properties that can be written only by the application back-end, and read by the device.", - "$ref" : "#/definitions/DeviceTwinProperties" + "$ref": "#/definitions/DeviceTwinProperties" }, "reported": { "description": "A portion of the properties that can be written only by the device, and read by the application back-end.", - "$ref" : "#/definitions/DeviceTwinProperties" + "$ref": "#/definitions/DeviceTwinProperties" } } }, @@ -160,28 +186,28 @@ "properties": { "metadata": { "description": "Metadata information for the properties JSON document.", - "$ref" : "#/definitions/DeviceTwinMetadata", - "x-ms-client-name" : "$metadata" + "$ref": "#/definitions/DeviceTwinMetadata", + "x-ms-client-name": "$metadata" }, "version": { "type": "number", "description": "Version of device twin properties.", - "x-ms-client-name" : "$version" + "x-ms-client-name": "$version" } } }, - "DeviceTwinMetadata" : { + "DeviceTwinMetadata": { "type": "object", "description": "Metadata information for the properties JSON document.", "properties": { "lastUpdated": { "type": "string", "description": "The ISO8601 timestamp of the last time the properties were updated.", - "x-ms-client-name" : "$lastUpdated" + "x-ms-client-name": "$lastUpdated" } } }, - "DeviceConnectionStateEventInfo" : { + "DeviceConnectionStateEventInfo": { "type": "object", "description": "Information about the device connection state event.", "properties": { From a12469e84f08a9055a3c03c8afc1f66bca9c1371 Mon Sep 17 00:00:00 2001 From: Kapil Agarwal Date: Tue, 9 Apr 2019 12:52:55 -0700 Subject: [PATCH 2/2] Create dictionary structure for properties --- .../Microsoft.Devices/stable/2018-01-01/IotHub.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json b/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json index 838368c36c8f..8153bac5d986 100644 --- a/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json +++ b/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json @@ -102,10 +102,16 @@ }, "properties": { "type": "object", + "additionalProperties": { + "type": "string" + }, "description": "Application properties are user-defined strings that can be added to the message. These fields are optional." }, "systemProperties": { "type": "object", + "additionalProperties": { + "type": "string" + }, "description": "System properties help identify contents and source of the messages." } }