From ce3cfd664e8d070d1fc7e8c4fe42242f4583d473 Mon Sep 17 00:00:00 2001 From: Jagan Premkumar Date: Thu, 19 Jul 2018 08:03:23 -0700 Subject: [PATCH 1/2] Updating fields in the DeviceLifeCycleEventProperties Adding DeviceConnectionStateEventProperties and events --- .../stable/2018-01-01/IotHub.json | 56 ++++++++++++++++--- 1 file changed, 49 insertions(+), 7 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 5463f64bbd3e..5c4e33ceacbf 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 @@ -26,6 +26,24 @@ ], "properties": {} }, + "IotHubDeviceConnectedEventData": { + "description": "Event data for Microsoft.Devices.DeviceConnected event.", + "allOf": [ + { + "$ref": "#/definitions/DeviceConnectionStateEventProperties" + } + ], + "properties": {} + }, + "IotHubDeviceDisconnectedEventData": { + "description": "Event data for Microsoft.Devices.DeviceDisconnected event.", + "allOf": [ + { + "$ref": "#/definitions/DeviceConnectionStateEventProperties" + } + ], + "properties": {} + }, "DeviceLifeCycleEventProperties": { "type": "object", "description": "Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted).", @@ -38,17 +56,31 @@ "type": "string", "description": "Name of the IoT Hub where the device was created or deleted." }, - "opType": { + "twin": { + "description": "Information about the device twin, which is the cloud represenation of application device metadata.", + "$ref" : "#/definitions/DeviceTwinInfo" + } + } + }, + "DeviceConnectionStateEventProperties": { + "type": "object", + "description": "Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected).", + "properties": { + "deviceId": { "type": "string", - "description": "The event type specified for this operation by the IoT Hub." + "description": "The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '." }, - "operationTimestamp": { + "moduleId": { "type": "string", - "description": "The ISO8601 timestamp of the operation." + "description": "The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '." }, - "twin": { - "description": "Information about the device twin, which is the cloud represenation of application device metadata.", - "$ref" : "#/definitions/DeviceTwinInfo" + "hubName": { + "type": "string", + "description": "Name of the IoT Hub where the device was created or deleted." + }, + "deviceConnectionStateEventInfo": { + "description": "Information about the device connection state event.", + "$ref" : "#/definitions/DeviceConnectionStateEventInfo" } } }, @@ -148,6 +180,16 @@ "x-ms-client-name" : "$lastUpdated" } } + }, + "DeviceConnectionStateEventInfo" : { + "type": "object", + "description": "Information about the device connection state event.", + "properties": { + "sequenceNumber": { + "type": "string", + "description": "Sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number." + } + } } } } \ No newline at end of file From 7f85cd9eb76ab96bab808b151e23dc230ad7a0d0 Mon Sep 17 00:00:00 2001 From: Jagan Premkumar Date: Thu, 19 Jul 2018 08:11:21 -0700 Subject: [PATCH 2/2] Fix typos --- .../Microsoft.Devices/stable/2018-01-01/IotHub.json | 4 ++-- 1 file changed, 2 insertions(+), 2 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 5c4e33ceacbf..ca447f11a224 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 @@ -57,7 +57,7 @@ "description": "Name of the IoT Hub where the device was created or deleted." }, "twin": { - "description": "Information about the device twin, which is the cloud represenation of application device metadata.", + "description": "Information about the device twin, which is the cloud representation of application device metadata.", "$ref" : "#/definitions/DeviceTwinInfo" } } @@ -86,7 +86,7 @@ }, "DeviceTwinInfo": { "type": "object", - "description": "Information about the device twin, which is the cloud represenation of application device metadata.", + "description": "Information about the device twin, which is the cloud representation of application device metadata.", "properties": { "authenticationType": { "type": "string",