From e6493e249d093c7e891a212ac434ca82200ee635 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 14 Feb 2022 14:04:39 -0800 Subject: [PATCH 01/95] adding readme --- docs/specs/readme.md | 3 ++- docs/specs/subblocks.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 docs/specs/subblocks.md diff --git a/docs/specs/readme.md b/docs/specs/readme.md index b199b86f1d..7995e3d538 100644 --- a/docs/specs/readme.md +++ b/docs/specs/readme.md @@ -12,6 +12,7 @@ - [MQTT Client](mqtt_client.md) - [Point Mapping](point_mapping.md) - [Proxy](proxy.md) -- [Sequences](sequences/) (for example _writeback_ and _state_ sequences) +- [Sequences](sequences/) (device-to-cloud API) +- [Subblocks](subblocks.md) (core-to-apps API) - [Site Model](site_model.md) - [Tech Stack](tech_stack.md) diff --git a/docs/specs/subblocks.md b/docs/specs/subblocks.md new file mode 100644 index 0000000000..7a6bd6f216 --- /dev/null +++ b/docs/specs/subblocks.md @@ -0,0 +1,4 @@ +# Subblocks API + +Defined the high-level API between UDMI core services and anciliary applications. +These messages are similar to those From b7875f49f2c503ed0b313c66c4e5e981f0c2231f Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 14 Feb 2022 14:42:19 -0800 Subject: [PATCH 02/95] Adding initial subblock documentation --- docs/specs/subblocks.md | 35 +++++++++++++++++++++-- schema/config_pointset.json | 12 ++++++++ schema/state_pointset.json | 12 ++++++++ tests/config_pointset.tests/example.json | 27 ++++++++++++++++++ tests/config_pointset.tests/example.out | 0 tests/state_pointset.tests/example.json | 36 ++++++++++++++++++++++++ tests/state_pointset.tests/example.out | 0 7 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 tests/config_pointset.tests/example.json create mode 100644 tests/config_pointset.tests/example.out create mode 100644 tests/state_pointset.tests/example.json create mode 100644 tests/state_pointset.tests/example.out diff --git a/docs/specs/subblocks.md b/docs/specs/subblocks.md index 7a6bd6f216..48e9c8abc3 100644 --- a/docs/specs/subblocks.md +++ b/docs/specs/subblocks.md @@ -1,4 +1,35 @@ +[**UDMI**](../../) / [**Docs**](../) / [**Specs**](./) / [Subblocks](#) + # Subblocks API -Defined the high-level API between UDMI core services and anciliary applications. -These messages are similar to those +Defined the high-level API between UDMI core services and ancillary applications. +These messages are similar to those used for device communication, but are distinctly +different in some cases (esp. when dealing with state/config). + +For each subblock, there's a few basic message exchanges. +* Telemetry (from device): Streaming telemetry. This is essentially a raw feed from the device itself. +* State (from device): Device state for this subblock. Unlike a + [comprehensive device state message](../../tests/state.tests/example.json) + this message contains information _only_ for a single subblock. +* Config (for device): Device config for this subblock. Unlike a + [comprehensive device config message](../../tests/config.tests/example.json) + this message contains information _only_ for a single subblock. + +## Pointset + +* [Telemetry](../../tests/event_pointset.tests/example.json) +* [State](../../tests/state_pointset.tests/example.json) +* [Config](../../tests/config_pointset.tests/example.json) + +## Discovery + +* Telemetry +* State +* Config + +## Blobs + +* Telemetry +* State +* Config + diff --git a/schema/config_pointset.json b/schema/config_pointset.json index 9ca2ce60c3..c6facd0851 100644 --- a/schema/config_pointset.json +++ b/schema/config_pointset.json @@ -5,6 +5,18 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { + "timestamp": { + "description": "RFC 3339 timestamp the configuration was generated", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, + "version": { + "description": "Major version of the UDMI schema", + "type": "integer", + "minimum": 1, + "maximum": 1 + }, "state_etag": { "description": "The `state_etag` of the last _state_ message sent by the device. [Writeback documentation](../docs/specs/sequences/writeback.md)", "type": "string", diff --git a/schema/state_pointset.json b/schema/state_pointset.json index 20a4828313..398a180701 100644 --- a/schema/state_pointset.json +++ b/schema/state_pointset.json @@ -5,6 +5,18 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { + "timestamp": { + "description": "RFC 3339 timestamp the configuration was generated", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, + "version": { + "description": "Major version of the UDMI schema", + "type": "integer", + "minimum": 1, + "maximum": 1 + }, "state_etag": { "description": "An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. [Additional information on implementation](../docs/specs/sequences/writeback.md)", "type": "string", diff --git a/tests/config_pointset.tests/example.json b/tests/config_pointset.tests/example.json new file mode 100644 index 0000000000..3c1dababc8 --- /dev/null +++ b/tests/config_pointset.tests/example.json @@ -0,0 +1,27 @@ +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "pointset": { + "state_etag": "2a8b718", + "set_value_expiry": "2018-08-26T21:49:29.364Z", + "points": { + "room_temperature": { + "set_value": 37.3 + }, + "hallway_temperature": { + "set_value": 37.3 + }, + "hallway_lights": { + "set_value": false + }, + "entryway_lock": { + "set_value": "locked" + }, + "scale_sensor": { + "set_value": 82 + }, + "rocket_motor": { + } + } + } +} diff --git a/tests/config_pointset.tests/example.out b/tests/config_pointset.tests/example.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state_pointset.tests/example.json b/tests/state_pointset.tests/example.json new file mode 100644 index 0000000000..e0a0d45185 --- /dev/null +++ b/tests/state_pointset.tests/example.json @@ -0,0 +1,36 @@ +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "state_etag": "2a8b718", + "points": { + "room_temperature": { + "value_state": "applied" + }, + "hallway_temperature": { + "value_state": "overridden" + }, + "hallway_lights": { + "value_state": "updating" + }, + "entryway_lock": { + "value_state": "failure", + "status": { + "message": "Failure to confirm point", + "category": "state.pointset.points.config.failure", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 600 + } + }, + "scale_sensor": { + "value_state": "invalid", + "status": { + "message": "Point is not writable", + "category": "state.pointset.points.config.invalid", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 600 + } + }, + "rocket_motor": { + } + } +} diff --git a/tests/state_pointset.tests/example.out b/tests/state_pointset.tests/example.out new file mode 100644 index 0000000000..e69de29bb2 From a13ba8b5e1402927112f4684f02a98fc0c1dbfa2 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 14 Feb 2022 14:49:46 -0800 Subject: [PATCH 03/95] Updating docs --- docs/specs/subblocks.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/specs/subblocks.md b/docs/specs/subblocks.md index 48e9c8abc3..2060e54430 100644 --- a/docs/specs/subblocks.md +++ b/docs/specs/subblocks.md @@ -2,11 +2,13 @@ # Subblocks API -Defined the high-level API between UDMI core services and ancillary applications. -These messages are similar to those used for device communication, but are distinctly -different in some cases (esp. when dealing with state/config). +The _Subblocks API_ defines the high-level API between UDMI core services and ancillary +applications. These messages are similar to those used for device communication, but are +specifically segmented by designated _subblocks_ that partition functionality into atomic +chunks. Specficialy, the subblock _state_/_config_ are a limited form of the overall +device _state_/_config_, and only expose the relevant pieces. -For each subblock, there's a few basic message exchanges. +For each subblock, there's a few typical message exchanges: * Telemetry (from device): Streaming telemetry. This is essentially a raw feed from the device itself. * State (from device): Device state for this subblock. Unlike a [comprehensive device state message](../../tests/state.tests/example.json) @@ -15,12 +17,22 @@ For each subblock, there's a few basic message exchanges. [comprehensive device config message](../../tests/config.tests/example.json) this message contains information _only_ for a single subblock. -## Pointset +In all cases, the _Subblock API_ messages encode the relevant subblock ID { pointset, discovery, ... } +in the [message envelope's](../../tests/envelope.tests/example.json) _subFolder_ field. +The _subType_ field encodes the relevant { event, config, state }. + +## [Pointset](../messages/pointset.md) * [Telemetry](../../tests/event_pointset.tests/example.json) * [State](../../tests/state_pointset.tests/example.json) * [Config](../../tests/config_pointset.tests/example.json) +## System + +* Telemetry +* State +* Config + ## Discovery * Telemetry From 3302f346acf353f539cc3dd60699fddaadd14c3b Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 14 Feb 2022 15:30:20 -0800 Subject: [PATCH 04/95] Clean up examples --- tests/config.tests/errors.out | 2 +- tests/config_pointset.tests/example.json | 40 +++++++++++------------- tests/envelope.tests/example.json | 3 +- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/tests/config.tests/errors.out b/tests/config.tests/errors.out index 7980d98384..2ee84745e8 100644 --- a/tests/config.tests/errors.out +++ b/tests/config.tests/errors.out @@ -3,7 +3,7 @@ Validating 1 schemas Against input config.tests/errors.json 5 schema violations found instance type (string) does not match any allowed primitive type (allowed: ["integer"]) - object instance has properties which are not allowed by the schema: ["config_etag","id","properties","timestamp","version"] + object instance has properties which are not allowed by the schema: ["config_etag","id","properties"] object instance has properties which are not allowed by the schema: ["object_type"] object instance has properties which are not allowed by the schema: ["points","properties","type"] string "2a8b71dwqhdhdddddddddddddddddddddddddddddddddddddddddd8" is too long (length: 55, maximum allowed: 32) diff --git a/tests/config_pointset.tests/example.json b/tests/config_pointset.tests/example.json index 3c1dababc8..df57209ed4 100644 --- a/tests/config_pointset.tests/example.json +++ b/tests/config_pointset.tests/example.json @@ -1,27 +1,25 @@ { "version": 1, "timestamp": "2018-08-26T21:39:29.364Z", - "pointset": { - "state_etag": "2a8b718", - "set_value_expiry": "2018-08-26T21:49:29.364Z", - "points": { - "room_temperature": { - "set_value": 37.3 - }, - "hallway_temperature": { - "set_value": 37.3 - }, - "hallway_lights": { - "set_value": false - }, - "entryway_lock": { - "set_value": "locked" - }, - "scale_sensor": { - "set_value": 82 - }, - "rocket_motor": { - } + "state_etag": "2a8b718", + "set_value_expiry": "2018-08-26T21:49:29.364Z", + "points": { + "room_temperature": { + "set_value": 37.3 + }, + "hallway_temperature": { + "set_value": 37.3 + }, + "hallway_lights": { + "set_value": false + }, + "entryway_lock": { + "set_value": "locked" + }, + "scale_sensor": { + "set_value": 82 + }, + "rocket_motor": { } } } diff --git a/tests/envelope.tests/example.json b/tests/envelope.tests/example.json index b48f45a49a..f85d01ef02 100644 --- a/tests/envelope.tests/example.json +++ b/tests/envelope.tests/example.json @@ -3,5 +3,6 @@ "deviceRegistryId": "test_registry", "deviceNumId": "921302198324", "deviceId": "FCU-2", - "subFolder": "pointset" + "subFolder": "pointset", + "subType": "event" } From 18191d18f03f6ef3a62d470280411faab6b0685c Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 14 Feb 2022 15:35:29 -0800 Subject: [PATCH 05/95] Minor docs tweaks --- docs/specs/subblocks.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/specs/subblocks.md b/docs/specs/subblocks.md index 2060e54430..4b008c745f 100644 --- a/docs/specs/subblocks.md +++ b/docs/specs/subblocks.md @@ -9,13 +9,18 @@ chunks. Specficialy, the subblock _state_/_config_ are a limited form of the ove device _state_/_config_, and only expose the relevant pieces. For each subblock, there's a few typical message exchanges: -* Telemetry (from device): Streaming telemetry. This is essentially a raw feed from the device itself. +* Telemetry (from device): Streaming telemetry. This is essentially a raw feed from the device itself, + and will always be segmented by subblock (e.g. for a + [pointset event](../../tests/event_pointset.tests/example.json)). Streaming telemetry + is sent device-to-cloud. * State (from device): Device state for this subblock. Unlike a [comprehensive device state message](../../tests/state.tests/example.json) - this message contains information _only_ for a single subblock. + this message contains information _only_ for a single subblock. Used for reporting any 'sticky' + state from a device, sent device-to-cloud. * Config (for device): Device config for this subblock. Unlike a [comprehensive device config message](../../tests/config.tests/example.json) - this message contains information _only_ for a single subblock. + this message contains information _only_ for a single subblock. Used for writing configuration + changes to a device, sent cloud-to-device. In all cases, the _Subblock API_ messages encode the relevant subblock ID { pointset, discovery, ... } in the [message envelope's](../../tests/envelope.tests/example.json) _subFolder_ field. From ba7edf5066ea72deee972a11f6ab8787556f6ba3 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 14 Feb 2022 17:16:18 -0800 Subject: [PATCH 06/95] Update formatting --- docs/specs/subblocks.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/specs/subblocks.md b/docs/specs/subblocks.md index 4b008c745f..f56b912906 100644 --- a/docs/specs/subblocks.md +++ b/docs/specs/subblocks.md @@ -4,23 +4,23 @@ The _Subblocks API_ defines the high-level API between UDMI core services and ancillary applications. These messages are similar to those used for device communication, but are -specifically segmented by designated _subblocks_ that partition functionality into atomic +Specifically segmented by designated _subblocks_ that partition functionality into atomic chunks. Specficialy, the subblock _state_/_config_ are a limited form of the overall device _state_/_config_, and only expose the relevant pieces. For each subblock, there's a few typical message exchanges: -* Telemetry (from device): Streaming telemetry. This is essentially a raw feed from the device itself, +* **Telemetry**: Streaming telemetry. This is essentially a raw feed from the device itself, and will always be segmented by subblock (e.g. for a [pointset event](../../tests/event_pointset.tests/example.json)). Streaming telemetry - is sent device-to-cloud. -* State (from device): Device state for this subblock. Unlike a + is sent from the device, so will be _received by_ a client app. +* **State**: Device state for this subblock. Unlike a [comprehensive device state message](../../tests/state.tests/example.json) this message contains information _only_ for a single subblock. Used for reporting any 'sticky' - state from a device, sent device-to-cloud. -* Config (for device): Device config for this subblock. Unlike a + state from a device, so will be _received by_ a client app. +* **Config**: Device config for this subblock. Unlike a [comprehensive device config message](../../tests/config.tests/example.json) this message contains information _only_ for a single subblock. Used for writing configuration - changes to a device, sent cloud-to-device. + changes to a device, so will be _sent from_ a client app. In all cases, the _Subblock API_ messages encode the relevant subblock ID { pointset, discovery, ... } in the [message envelope's](../../tests/envelope.tests/example.json) _subFolder_ field. @@ -28,25 +28,25 @@ The _subType_ field encodes the relevant { event, config, state }. ## [Pointset](../messages/pointset.md) -* [Telemetry](../../tests/event_pointset.tests/example.json) -* [State](../../tests/state_pointset.tests/example.json) -* [Config](../../tests/config_pointset.tests/example.json) +* [**Telemetry**](../../tests/event_pointset.tests/example.json) +* [**State**](../../tests/state_pointset.tests/example.json) +* [**Config**](../../tests/config_pointset.tests/example.json) ## System -* Telemetry -* State -* Config +* **Telemetry** +* **State** +* **Config** ## Discovery -* Telemetry -* State -* Config +* **Telemetry** +* **State** +* **Config** ## Blobs -* Telemetry -* State -* Config +* **Telemetry** +* **State** +* **Config** From 03208924b58b05ef380b5f72fda2144c0f878c65 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 7 Mar 2022 14:29:47 -0800 Subject: [PATCH 07/95] Updating subBlock documentation --- docs/specs/subblocks.md | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/docs/specs/subblocks.md b/docs/specs/subblocks.md index f56b912906..f4c57c1fa6 100644 --- a/docs/specs/subblocks.md +++ b/docs/specs/subblocks.md @@ -2,14 +2,27 @@ # Subblocks API -The _Subblocks API_ defines the high-level API between UDMI core services and ancillary +The _Subblocks API_ defines a high-level interface between UDMI core services and ancillary applications. These messages are similar to those used for device communication, but are Specifically segmented by designated _subblocks_ that partition functionality into atomic chunks. Specficialy, the subblock _state_/_config_ are a limited form of the overall device _state_/_config_, and only expose the relevant pieces. -For each subblock, there's a few typical message exchanges: -* **Telemetry**: Streaming telemetry. This is essentially a raw feed from the device itself, +The basic mode of this interface is a "read only" subscription to a PubSub topic (normally +`udmi_target`) that then provides a complete view of updates as they flow through the system. +For example, a cloud-to-device _config_ update would be published on this topic as a "update +to device config." This level of visability should be sufficient to completely mirror the +visible state of the system (barring issues like loss-of-message etc...). + +The various _subblocks_ are detailed below. Each _subblock_ (or _subFolder_ if you're looking +at the PubSub _message envelope_), has several basic _subTypes_ that manifest themselves from +different sources: + +* **Model**: Model-based description of this device. Unlike the other messages, this exists + independent of any actual physical device, and will be injected by the syste through something + like the `registrar` tool. The _model_ is typically also refleced in a _site\_model_ as a + static set of files somewhere. +* **Event**: Streaming telemetry. This is essentially a raw feed from the device itself, and will always be segmented by subblock (e.g. for a [pointset event](../../tests/event_pointset.tests/example.json)). Streaming telemetry is sent from the device, so will be _received by_ a client app. @@ -24,29 +37,33 @@ For each subblock, there's a few typical message exchanges: In all cases, the _Subblock API_ messages encode the relevant subblock ID { pointset, discovery, ... } in the [message envelope's](../../tests/envelope.tests/example.json) _subFolder_ field. -The _subType_ field encodes the relevant { event, config, state }. +The _subType_ field encodes the relevant type { _event_, _config_, _state_, _model_ }. ## [Pointset](../messages/pointset.md) -* [**Telemetry**](../../tests/event_pointset.tests/example.json) +* [**Model**](../../tests/model_pointset.tests/example.json) +* [**Event**](../../tests/event_pointset.tests/example.json) * [**State**](../../tests/state_pointset.tests/example.json) * [**Config**](../../tests/config_pointset.tests/example.json) ## System -* **Telemetry** +* **Model** +* **Event** * **State** * **Config** ## Discovery -* **Telemetry** +* **Model** +* **Event** * **State** * **Config** ## Blobs -* **Telemetry** +* **Model** +* **Event** * **State** * **Config** From 9bc15411026ef10184baec96df457bd2a0f44f60 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 7 Mar 2022 14:39:45 -0800 Subject: [PATCH 08/95] Add pointset model example --- tests/model_pointset.tests/example.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/model_pointset.tests/example.json diff --git a/tests/model_pointset.tests/example.json b/tests/model_pointset.tests/example.json new file mode 100644 index 0000000000..2f7fa7be3a --- /dev/null +++ b/tests/model_pointset.tests/example.json @@ -0,0 +1,15 @@ +{ + "points": { + "return_air_temperature_sensor": { + "units": "Degrees-Celsius", + "baseline_value": 20, + "baseline_tolerance": 2 + }, + "room_setpoint": { + "writeable": true, + "units": "Degrees-Celsius", + "baseline_value": 20, + "baseline_state": "applied" + } + } +} From 0e24b2e66fb8931f2f069ce77957a8bfc1315b2f Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 7 Mar 2022 14:43:30 -0800 Subject: [PATCH 09/95] Updating docs --- docs/specs/#use_cases.md# | 1 + docs/specs/subblocks.md | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 docs/specs/#use_cases.md# diff --git a/docs/specs/#use_cases.md# b/docs/specs/#use_cases.md# new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/docs/specs/#use_cases.md# @@ -0,0 +1 @@ + diff --git a/docs/specs/subblocks.md b/docs/specs/subblocks.md index f4c57c1fa6..8e9158e87d 100644 --- a/docs/specs/subblocks.md +++ b/docs/specs/subblocks.md @@ -41,10 +41,18 @@ The _subType_ field encodes the relevant type { _event_, _config_, _state_, _mod ## [Pointset](../messages/pointset.md) -* [**Model**](../../tests/model_pointset.tests/example.json) -* [**Event**](../../tests/event_pointset.tests/example.json) -* [**State**](../../tests/state_pointset.tests/example.json) -* [**Config**](../../tests/config_pointset.tests/example.json) +A _pointset_ covers the structures necessary to model a device _point_ with associated data readings. +This is typically what is thought of as 'device telemetry' and represents the expected end value of +the device-to-cloud connection. + +* [**Model**](../../tests/model_pointset.tests/example.json): Expected model for what the device should + be reporting. +* [**Event**](../../tests/event_pointset.tests/example.json): Streaming telemetry events from the device + containing the actual data points. +* [**State**](../../tests/state_pointset.tests/example.json): State of the device points, indicating any + sticky errors or status of any cloud-to-device config. +* [**Config**](../../tests/config_pointset.tests/example.json): Configuration of the device points, + indicating the expected points, cloud-to-device control, etc... ## System From 2a1e0b37720732312feae87f9773f6072e717fa3 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Tue, 15 Mar 2022 14:57:36 -0700 Subject: [PATCH 10/95] Squash commit --- .gencode_hash.txt | 66 +- .github/workflows/testing.yml | 7 +- bin/loop_sequences | 9 +- bin/sequencer | 4 +- bin/test_sequencer | 2 + docs/cloud/gcp/readme.md | 5 +- docs/readme.md | 4 +- docs/specs/categories.md | 18 +- docs/specs/compliance.md | 23 +- docs/specs/discovery.md | 66 +- docs/specs/entries.md | 7 +- docs/specs/readme.md | 11 +- docs/specs/sequences/discovery.md | 113 ++ docs/tools/sequencer.md | 2 +- etc/sequence.out | 4 +- gencode/docs/config.html | 589 ++++++- gencode/docs/event_discovery.html | 1272 ++++++++++++++- gencode/docs/event_pointset.html | 2 +- gencode/docs/metadata.html | 16 +- gencode/docs/state.html | 1425 ++++++++++++++++- gencode/java/udmi/schema/Ancillary.java | 39 + .../udmi/schema/BlobEnumerationEvent.java | 60 + gencode/java/udmi/schema/Config.java | 13 +- gencode/java/udmi/schema/Discovery.java | 121 -- gencode/java/udmi/schema/DiscoveryConfig.java | 62 + gencode/java/udmi/schema/DiscoveryEvent.java | 112 ++ gencode/java/udmi/schema/DiscoveryState.java | 62 + gencode/java/udmi/schema/Event.java | 8 +- gencode/java/udmi/schema/Families.java | 39 + .../udmi/schema/FamilyDiscoveryConfig.java | 79 + .../udmi/schema/FamilyDiscoveryEvent.java | 14 +- .../udmi/schema/FamilyDiscoveryState.java | 71 + gencode/java/udmi/schema/Firmware.java | 2 +- gencode/java/udmi/schema/GatewayConfig.java | 1 - gencode/java/udmi/schema/GatewayState.java | 5 - .../udmi/schema/PointEnumerationEvent.java | 117 ++ .../udmi/schema/PointPointsetMetadata.java | 10 +- .../java/udmi/schema/PointPointsetState.java | 18 +- gencode/java/udmi/schema/PointsetState.java | 12 +- gencode/java/udmi/schema/State.java | 13 +- gencode/java/udmi/schema/SystemState.java | 4 +- gencode/python/udmi/schema/__init__.py | 8 +- gencode/python/udmi/schema/config.py | 5 + .../python/udmi/schema/config_discovery.py | 44 + .../udmi/schema/config_discovery_family.py | 50 + gencode/python/udmi/schema/event.py | 4 +- gencode/python/udmi/schema/event_discovery.py | 25 +- .../udmi/schema/event_discovery_blob.py | 42 + .../udmi/schema/event_discovery_family.py | 4 - .../udmi/schema/event_discovery_point.py | 101 ++ .../udmi/schema/metadata_pointset_point.py | 8 +- gencode/python/udmi/schema/state.py | 5 + gencode/python/udmi/schema/state_discovery.py | 44 + .../udmi/schema/state_discovery_family.py | 47 + gencode/python/udmi/schema/state_pointset.py | 5 + gencode/python/udmi/schema/state_system.py | 8 +- pubber/pubber.iml | 4 +- .../main/java/daq/pubber/AbstractPoint.java | 3 + .../src/main/java/daq/pubber/BasicPoint.java | 14 +- pubber/src/main/java/daq/pubber/Pubber.java | 106 +- .../main/java/daq/pubber/RandomBoolean.java | 8 + .../src/main/java/daq/pubber/RandomPoint.java | 11 +- schema/common.json | 3 + schema/config.json | 3 + schema/config_discovery.json | 21 + schema/config_discovery_family.json | 28 + schema/config_gateway.json | 3 - schema/event_discovery.json | 46 +- schema/event_discovery_blob.json | 17 + schema/event_discovery_family.json | 7 +- schema/event_discovery_point.json | 43 + schema/event_pointset_point.json | 2 +- schema/metadata_pointset_point.json | 2 +- schema/state.json | 3 + schema/state_discovery.json | 21 + schema/state_discovery_family.json | 22 + schema/state_gateway.json | 3 - schema/state_pointset.json | 4 + schema/state_pointset_point.json | 2 +- schema/state_system.json | 2 +- tests/config.tests/continuous.json | 15 + .../continuous.out} | 0 tests/config.tests/discovery.json | 15 + tests/config.tests/discovery.out | 0 tests/config.tests/enumeration.json | 13 + tests/config.tests/enumeration.out | 0 tests/config.tests/implicit.json | 16 + tests/config.tests/implicit.out | 0 tests/config.tests/periodic.json | 17 + tests/config.tests/periodic.out | 0 tests/event_discovery.json/empty.out | 5 - tests/event_discovery.json/errors.out | 9 - tests/event_discovery.json/example.json | 19 - tests/event_discovery.tests/continuous.json | 24 + tests/event_discovery.tests/continuous.out | 0 tests/event_discovery.tests/discovery.json | 24 + tests/event_discovery.tests/discovery.out | 0 .../empty.json | 0 tests/event_discovery.tests/empty.out | 5 + tests/event_discovery.tests/enumeration.json | 86 + tests/event_discovery.tests/enumeration.out | 0 .../errors.json | 2 +- tests/event_discovery.tests/errors.out | 9 + tests/event_discovery.tests/implicit.json | 37 + tests/event_discovery.tests/implicit.out | 0 tests/event_discovery.tests/point_error.json | 31 + tests/event_discovery.tests/point_error.out | 0 tests/event_discovery.tests/scan_error.json | 30 + tests/event_discovery.tests/scan_error.out | 0 tests/metadata.tests/example.json | 2 +- tests/state.tests/continuous.json | 24 + tests/state.tests/continuous.out | 0 tests/state.tests/discovery.json | 25 + tests/state.tests/discovery.out | 0 tests/state.tests/enumeration.json | 28 + tests/state.tests/enumeration.out | 0 tests/state.tests/example.json | 12 +- tests/state.tests/periodic.json | 25 + tests/state.tests/periodic.out | 0 tests/state.tests/scan_bad.json | 24 + tests/state.tests/scan_bad.out | 5 + tests/state.tests/scan_error.json | 30 + tests/state.tests/scan_error.out | 0 tests/state.tests/scan_stop.json | 24 + tests/state.tests/scan_stop.out | 0 .../runConfigurations/BaselineValidator.xml | 0 .../BaselineValidator_broken_config.xml | 2 +- .../runConfigurations/ConfigValidator.xml | 11 +- .../runConfigurations/DiscoveryValidator.xml | 22 + .../runConfigurations/WritebackValidator.xml | 2 +- .../WritebackValidator_system_last_update.xml | 2 +- .../WritebackValidator_writeback_states.xml | 2 +- validator/build.gradle | 2 +- .../daq/mqtt/registrar/LocalDevice.java | 2 +- .../daq/mqtt/validator/CleanDateFormat.java | 3 +- .../daq/mqtt/validator/PointValidator.java | 1 - .../daq/mqtt/validator/SequenceValidator.java | 75 +- .../validator/{validations => }/SkipTest.java | 2 +- .../google/daq/mqtt/validator/Validator.java | 124 +- .../validations/DiscoveryValidator.java | 42 + 140 files changed, 5620 insertions(+), 513 deletions(-) create mode 100644 docs/specs/sequences/discovery.md create mode 100644 gencode/java/udmi/schema/Ancillary.java create mode 100644 gencode/java/udmi/schema/BlobEnumerationEvent.java delete mode 100644 gencode/java/udmi/schema/Discovery.java create mode 100644 gencode/java/udmi/schema/DiscoveryConfig.java create mode 100644 gencode/java/udmi/schema/DiscoveryEvent.java create mode 100644 gencode/java/udmi/schema/DiscoveryState.java create mode 100644 gencode/java/udmi/schema/Families.java create mode 100644 gencode/java/udmi/schema/FamilyDiscoveryConfig.java create mode 100644 gencode/java/udmi/schema/FamilyDiscoveryState.java create mode 100644 gencode/java/udmi/schema/PointEnumerationEvent.java create mode 100644 gencode/python/udmi/schema/config_discovery.py create mode 100644 gencode/python/udmi/schema/config_discovery_family.py create mode 100644 gencode/python/udmi/schema/event_discovery_blob.py create mode 100644 gencode/python/udmi/schema/event_discovery_point.py create mode 100644 gencode/python/udmi/schema/state_discovery.py create mode 100644 gencode/python/udmi/schema/state_discovery_family.py create mode 100644 schema/config_discovery.json create mode 100644 schema/config_discovery_family.json create mode 100644 schema/event_discovery_blob.json create mode 100644 schema/event_discovery_point.json create mode 100644 schema/state_discovery.json create mode 100644 schema/state_discovery_family.json create mode 100644 tests/config.tests/continuous.json rename tests/{event_discovery.json/example.out => config.tests/continuous.out} (100%) create mode 100644 tests/config.tests/discovery.json create mode 100644 tests/config.tests/discovery.out create mode 100644 tests/config.tests/enumeration.json create mode 100644 tests/config.tests/enumeration.out create mode 100644 tests/config.tests/implicit.json create mode 100644 tests/config.tests/implicit.out create mode 100644 tests/config.tests/periodic.json create mode 100644 tests/config.tests/periodic.out delete mode 100644 tests/event_discovery.json/empty.out delete mode 100644 tests/event_discovery.json/errors.out delete mode 100644 tests/event_discovery.json/example.json create mode 100644 tests/event_discovery.tests/continuous.json create mode 100644 tests/event_discovery.tests/continuous.out create mode 100644 tests/event_discovery.tests/discovery.json create mode 100644 tests/event_discovery.tests/discovery.out rename tests/{event_discovery.json => event_discovery.tests}/empty.json (100%) create mode 100644 tests/event_discovery.tests/empty.out create mode 100644 tests/event_discovery.tests/enumeration.json create mode 100644 tests/event_discovery.tests/enumeration.out rename tests/{event_discovery.json => event_discovery.tests}/errors.json (95%) create mode 100644 tests/event_discovery.tests/errors.out create mode 100644 tests/event_discovery.tests/implicit.json create mode 100644 tests/event_discovery.tests/implicit.out create mode 100644 tests/event_discovery.tests/point_error.json create mode 100644 tests/event_discovery.tests/point_error.out create mode 100644 tests/event_discovery.tests/scan_error.json create mode 100644 tests/event_discovery.tests/scan_error.out create mode 100644 tests/state.tests/continuous.json create mode 100644 tests/state.tests/continuous.out create mode 100644 tests/state.tests/discovery.json create mode 100644 tests/state.tests/discovery.out create mode 100644 tests/state.tests/enumeration.json create mode 100644 tests/state.tests/enumeration.out create mode 100644 tests/state.tests/periodic.json create mode 100644 tests/state.tests/periodic.out create mode 100644 tests/state.tests/scan_bad.json create mode 100644 tests/state.tests/scan_bad.out create mode 100644 tests/state.tests/scan_error.json create mode 100644 tests/state.tests/scan_error.out create mode 100644 tests/state.tests/scan_stop.json create mode 100644 tests/state.tests/scan_stop.out create mode 100644 validator/.idea/runConfigurations/BaselineValidator.xml create mode 100644 validator/.idea/runConfigurations/DiscoveryValidator.xml rename validator/src/main/java/com/google/daq/mqtt/validator/{validations => }/SkipTest.java (80%) create mode 100644 validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java diff --git a/.gencode_hash.txt b/.gencode_hash.txt index ddc28740e5..d0f9fbec05 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,69 +1,81 @@ -f2bdc1264c53c504d170399fd11d2ac15fa0eee62f35ef8892a0d6b23a3bcc1b gencode/docs/config.html +d821da14e66bbcc229c0ad47d7b36e08aaab566a89e6e4f0cc3a6a03578209f1 gencode/docs/config.html 7f4f659da86796660d8ed610bb74bb2e6cff6688a1e92b2019b20ebc34227033 gencode/docs/envelope.html -99a1cc3cb90112a06997feae86f27f6e4fb415b56746257a4bd08a205d616fef gencode/docs/event_discovery.html -8e3be05180ede024f0376e9f4102406f603f72b125df2b923043aa8b7b0637cc gencode/docs/event_pointset.html +3c676f3ee1929db2a973f33cdac54b246bf4413df65d35a1288fd323811d917b gencode/docs/event_discovery.html +44a33225964713ba8b6fd4661fff52f75dc0e9d11919e1535020dfab7bfc77b7 gencode/docs/event_pointset.html 5d173e050b2583b442636153559fe3bd2fb26efe85ff6db01cc0123bcff9b266 gencode/docs/event_system.html a82821e72af6d0ee35800e6262eb9bb05256309b98aed2dad1a368fd2d6882bb gencode/docs/index.html -b23269bf0f609ca6d0f0ebc3f6412d78777fad1975963f9e5479a2728b0f918d gencode/docs/metadata.html +715451ecedd871a76fedac8ac90ed5c53e12c9ec34796b7cd976637b4a55bdd2 gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js -b5b3ddf1cc14131e868cefae4530a8a60fea1f344a8bcb0375ebddb0ba80def9 gencode/docs/state.html +98009226a4219f8770f2fb0e0329e376dfc586b210ac86d4e51dd8d6174b90d3 gencode/docs/state.html +68f8919d59556c7c781958baaac0b8cc629b6c4ce86e6ffd0171d23536747ec6 gencode/java/udmi/schema/Ancillary.java d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/udmi/schema/Asset.java 0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java 724ad8db7982f4d703c05245119dc7f7ff731d2141dd861893b55684e3cd6224 gencode/java/udmi/schema/BlobBlobsetConfig.java 7f54da38284a1010de1a2590381022fa16d27fd141d76d1ba6eb471de4d94781 gencode/java/udmi/schema/BlobBlobsetState.java +60279d5d9aa911f25e934aabee3ca06c64a36cd438fe9b255df391c04d540814 gencode/java/udmi/schema/BlobEnumerationEvent.java d2c5b5aae8db27b68104fc83a1f38de0a3f1b5d683f2b13599adf24e96c7d124 gencode/java/udmi/schema/BlobsetConfig.java b6ff9b8739a9c3bb6972f73db6fc54f451189c13b273e58bc11cb3d82c74ad40 gencode/java/udmi/schema/BlobsetState.java 90d6e869087d4dfdc2c29c7f51872e630ad8135542dd432629bf4edac807053a gencode/java/udmi/schema/CloudMetadata.java -c6a74b140cd4098269fe1f3a296a05e38dffc69604e2708cc154b40607e46418 gencode/java/udmi/schema/Config.java -09903b8d8897e2478b0acb3a346050adc166a21694ff32a763b247e0d065090b gencode/java/udmi/schema/Discovery.java +d7b178ce5b178f4ce651d534314312dc898721b64c2dbbbafe0a834401e20623 gencode/java/udmi/schema/Config.java +3d9a243dcdc6dce31a2b0671d473c60d4cc972087025c7e099f8b4bf85a800da gencode/java/udmi/schema/DiscoveryConfig.java +b6f1a52b71e4c64518756b4468821b576adc8209286ef47a94b72fb3b87233d1 gencode/java/udmi/schema/DiscoveryEvent.java +b9b1c6dc52c28630021c76d51305cb2fe634c557f3cf9b8e5c8c8abf456e6216 gencode/java/udmi/schema/DiscoveryState.java 090bbaf1508aa6ca8380af936af990673f300eb5a940c9e8ab94deb64efa2b7b gencode/java/udmi/schema/Entry.java 8ba08bd70eadd32129e2101a8b8dfd1ed90a4592822ab055db90e845c7e91dbb gencode/java/udmi/schema/Envelope.java -82826aecc86ea17cb978913a260fdc79ee0476a27a519cc608bc80595212cbb8 gencode/java/udmi/schema/Event.java -ac5fef42349b983a9f64bd875bc530cbee7bbb79a7f690bb49ac8a977ec89e78 gencode/java/udmi/schema/FamilyDiscoveryEvent.java -bb91a167bca6f92c779d60dbf1ce1372b9a198f49978deb8ec7ebcd6632aa80b gencode/java/udmi/schema/Firmware.java -571f619caf71690dbe39c3a5264983221836b4541ee2a65363f859f379dc44a1 gencode/java/udmi/schema/GatewayConfig.java +e9f5c77be81486b6b8c6d88f70f2d50583d8c3fafa2ac09ead80f44b8d5e751e gencode/java/udmi/schema/Event.java +70ac42b1f93211420e8b40add27a4388dffcaaac60ead45852412aa815520605 gencode/java/udmi/schema/Families.java +aa0885ca43ab38c7597eacc38b7c512940a1a9fa061abd47d02c28e66b6fd93e gencode/java/udmi/schema/FamilyDiscoveryConfig.java +ae4a645f199c8e24b3303463d428ca17af7603ae9ae9238397a6a82e752ab454 gencode/java/udmi/schema/FamilyDiscoveryEvent.java +0afc15acd72874e5a0c47f546abc0c4569f5bc37838fdcac77bc7bd55cc53a6d gencode/java/udmi/schema/FamilyDiscoveryState.java +47eb74677159f66303e85b39c9a73ab24993dc8ceae241ef7566a52fdf814ec7 gencode/java/udmi/schema/Firmware.java +60a8115ae1acae7c199b63180823198d38ec50d57b48dd85aca1ccc865058f85 gencode/java/udmi/schema/GatewayConfig.java 4e9a913d5cf47a5901a63ec005115c58884e06c2cd6ba6bb786ffbb7c7fdaf74 gencode/java/udmi/schema/GatewayMetadata.java -48291db2ee86d93cd190a8da68d87114ee718632347bcafa22cecd5056130f81 gencode/java/udmi/schema/GatewayState.java +c1f0e51c41fb044e1d1bb5f975e5e686be3fb36eaf716da6ba7d9980897d45a0 gencode/java/udmi/schema/GatewayState.java a10ca7383711269fbd2bb5ed8de9438f71673c47dd68de7bbd32bf8ba79913d6 gencode/java/udmi/schema/Level.java f53c891932643871f93368cfe797cac6fd4ed0f64e71c893f275cd7184cb8019 gencode/java/udmi/schema/LocalnetConfig.java fc2bf2d94a9cbfb600a381c7b3dad66850b2646a388183848e913de1b102a40f gencode/java/udmi/schema/LocalnetMetadata.java 2df4ae32d0bbecc21f7c3f6a416a195baa766a6210cfa8abca4a7bb45b9c7961 gencode/java/udmi/schema/Location.java 0fab3af2aa9435d56c12a493a57e0fd131ded128ffafddd4de228bce682211f4 gencode/java/udmi/schema/Metadata.java 5e1c5411fae4d7c47391ceb5d19ae864fcd484df75ac6b6db39fd2d12647dec8 gencode/java/udmi/schema/Physical_tag.java +0868f0a9beb671dd08f066e7e7e796531fe151307a0b853b1f1a1aafe50ee746 gencode/java/udmi/schema/PointEnumerationEvent.java 2cca321fb2fbc00d2082fd918062f6b02e8f2dbe1359c0fbb6a3f47a946838c7 gencode/java/udmi/schema/PointPointsetConfig.java 8f3fc1cdc2dcd3e524863f4675aebabc450a35f5fd1cdc3fd37289b5cab7f2ec gencode/java/udmi/schema/PointPointsetEvent.java -d4f9bfc449f66a9129215833e5bea26350674847f11d9ae071f77bdfadd683f9 gencode/java/udmi/schema/PointPointsetMetadata.java -5c6bbebb364ced90630bbead29d6f5fc3a8b7e56cbf504f038b9edf380de14cf gencode/java/udmi/schema/PointPointsetState.java +09a99eddb418ef56a4744f94a1d15815e5c460c5e2bd0ea2badfc0662986a853 gencode/java/udmi/schema/PointPointsetMetadata.java +db8d6dd3498019ad12e0f328b6237d07e52f133f8b08858b712611a52c198009 gencode/java/udmi/schema/PointPointsetState.java 3d973f05d67b53fe25cfa1780e13d3a09fea53e64241d9e4c18734d370004fec gencode/java/udmi/schema/PointsetConfig.java cca2ee160ed60a0407cf98f107bc12a948052bc8915322d59b4067421647d6cf gencode/java/udmi/schema/PointsetEvent.java 7987adebea9103a857493bb7698913d0891fcb4a77cec0e208c655953df82243 gencode/java/udmi/schema/PointsetMetadata.java -8386fc832a356acaf507eb86365e9af3e78b5b97475e0ff252a40f8f7005c131 gencode/java/udmi/schema/PointsetState.java +37d1918ba0a79d60497b3ee4827f714054047bfa1e592f95fdd962f00ff6f4ff gencode/java/udmi/schema/PointsetState.java ca2e7566106818ca7e5190c8041eb86f0c9b3251b0bda8c3ea7ce11a0c891a0a gencode/java/udmi/schema/Position.java d9f04c5ce40a5f0045fc4113ed5da9cde354140d70335cf43be68018b53e8477 gencode/java/udmi/schema/Properties.java -42a718a9e957139438ff34f597019f9d246a959413975c487f5114aef754988c gencode/java/udmi/schema/State.java +28db2b1637a78c3c43c5668a13d5288b267583082dc583c6d62bdb0e9eafc73b gencode/java/udmi/schema/State.java b4ea53b14862fa50403cdfc481d55ea2b2eb5e3b3aae43d54c9181114e8fff04 gencode/java/udmi/schema/SubsystemLocalnetMetadata.java cf408aaba1934447f4be520e2486301c0e9a3f3741137975e1161113c193951a gencode/java/udmi/schema/SystemConfig.java bc86dbf424f67009b80f1a9a4b3d856524ed90f66205f5556232c620063508c6 gencode/java/udmi/schema/SystemEvent.java c46848327791cec1f1e62dbee2ad66951af7f61ed3c56eeaa8e563774e305bf4 gencode/java/udmi/schema/SystemMetadata.java -621092023fdccdfe5a6fed74952275eebfd1c93989ecb467207fa2689e29c71f gencode/java/udmi/schema/SystemState.java +6f34676b4827b87fd120b33db0c98d125ecd0430f6d96a87b3bca5277fad5ff8 gencode/java/udmi/schema/SystemState.java 27d6b50dc51b373d24a701728b4d43d31fe841a9a1d77fe3e45dac332674c308 gencode/java/udmi/schema/TargetTestingMetadata.java a77e801f3b07cd8b7042adfe8e5e62d7a83b63a1b449a356fa13c846811ab576 gencode/java/udmi/schema/TestingMetadata.java -5ac0dd4a2b7b107736ee529da2e1786fc12de802de126c199001ff903e979b90 gencode/python/udmi/schema/__init__.py +3b5a12c57a8898b320fe5bc2e4855493d8c3c0ebd6656ed7bf8a0da226f4e741 gencode/python/udmi/schema/__init__.py 704c8f0eec0b87015af8f7e524375f651b3d35f659ec89b4b022f8c1d0813ec5 gencode/python/udmi/schema/common.py -4454929f06e488ba618073fa5c0543866557dcce5957612eb1369dbd252eaa88 gencode/python/udmi/schema/config.py +b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py 191e1926c16b55f4ef350a711f540eef17a0ec60bec8c193c94182786dc3624b gencode/python/udmi/schema/config_blobset.py 7abd40beb86ebd7eaeaacdeba895b95563b79b651ad2cfd73bdcac865c90a3a9 gencode/python/udmi/schema/config_blobset_blob.py +ec6c6ab1fb0f37a29b7ebd162aa77da7f1e261e80da376942a3b39d17ccf1be4 gencode/python/udmi/schema/config_discovery.py +a5edb9ac5ecd5a4459f93ce613691735f299f35718f2e35410206fc91c263dd1 gencode/python/udmi/schema/config_discovery_family.py b461bdc24310ef972faf579b5be577b5af67fb0977d6afb4c42955211b26e3d5 gencode/python/udmi/schema/config_gateway.py 30a3402a54386032928bda5b9e60e5fd9ac47c53b4ffc5679fe24d24901ed660 gencode/python/udmi/schema/config_localnet.py f816f18ba2e9594a351b040425f4efe2f1f0f654307ac8213dc7603fe1402814 gencode/python/udmi/schema/config_pointset.py 3f23e78163fdc4a2638b2691fdf3f45f1547e8f9b605073339b16e76d894d401 gencode/python/udmi/schema/config_pointset_point.py b92059568fc9f8472ea9e01fa96ca4b986e295379ea2c002c02cd71a41683bbb gencode/python/udmi/schema/config_system.py 631371489cb1275517bebcc4040cbc655d18ca147ab540701b3fd9cedba138c5 gencode/python/udmi/schema/envelope.py -14d9f735fb426406984099c307fd05b01b6139c1689d29bf665d8c18f7e8d2e9 gencode/python/udmi/schema/event.py -229222d61a9be5c0532ed4c7b7a28f56807944f47d78961bb6fcd49f25622034 gencode/python/udmi/schema/event_discovery.py -19a631dfa90ff85abbe414a9f1c60f943c3551e671480ba491231ed2e951611f gencode/python/udmi/schema/event_discovery_family.py +1eb9019b9d0b4ff7de2df8beb625a4f89292d636ece0c02f160495c537bd6c2c gencode/python/udmi/schema/event.py +f74b62b11bbbd37ea8968ead811dc2534c4996a3dcfd3671807988b7874de347 gencode/python/udmi/schema/event_discovery.py +3ea3e50436e6b87fbcd773361f4a5cd1662b554a1f3eba47c1670c7f82a765ea gencode/python/udmi/schema/event_discovery_blob.py +ad33b91a7fabb4eed7e49c30a983a2106c96330facbe0f376f94d06e2263d6d0 gencode/python/udmi/schema/event_discovery_family.py +266c36a6174c959017894de6051f7d6071ac59ed3f049df9cbb49b894c11c84e gencode/python/udmi/schema/event_discovery_point.py ddf849bfeb2b87d071cefd5e6feacabc57375a7fff6d72b6d42ffb89f33c859b gencode/python/udmi/schema/event_pointset.py 44aff1bc930dbdbadd51ac3fe0e7d9c83ad84a6a9f9d1c809b3fce66cbcd5e00 gencode/python/udmi/schema/event_pointset_point.py 23f790f5d6b3802d3806de65e8277dd1b624245d51bc2a83e2027d96dacaa201 gencode/python/udmi/schema/event_system.py @@ -73,15 +85,17 @@ c5434d7d243b1c14f948129ec4c05e7545801e56112f44523ad335878b26e651 gencode/python 752cf1f2ef9af6e98041abbe884867635218974d7a0d7eb3002e1d4d7e48f228 gencode/python/udmi/schema/metadata_localnet.py 8c8c26a54dcb7589b66dc5488abe9fbd7bc850ee60e02dfc242af06722640487 gencode/python/udmi/schema/metadata_localnet_subsystem.py e83d9f37f175d1724ed85e68f3f091c2310462eaf7adef83575d34f2a8b8a918 gencode/python/udmi/schema/metadata_pointset.py -96f4a64fd18b5661e906fd138d4230d38039bea3b8e656fd76d80ffa8c993b50 gencode/python/udmi/schema/metadata_pointset_point.py +b0dc5e2a58d41ad30853aff922496f1fdc14c1eee9661669c47662822c6268ad gencode/python/udmi/schema/metadata_pointset_point.py 833b546d9a312ebdd20a0e0f8903b86e5c5d0f66f30c19958b312cc0c17f65d9 gencode/python/udmi/schema/metadata_system.py 207e41740284137eea08b6b5f36dcfdc4d3e92c717d5c65834f09e229b0b0058 gencode/python/udmi/schema/metadata_testing.py d11882163bbc419da1ee4309062795b2e2fad31a6359927e1897e00b1e3ada55 gencode/python/udmi/schema/metadata_testing_target.py a58f8c98e837a5b56126ca0f410e02f1e9cfcd80a8cb429e0ef522defab1f690 gencode/python/udmi/schema/properties.py -22de8885b5c90d3220a7b66139dbeadcf2cb42395cf88a32a11848ddd2273be3 gencode/python/udmi/schema/state.py +32bc70a30e37e89cfae14b44add18d546a6f9e00a3ec3519ede9c7486114d39c gencode/python/udmi/schema/state.py c8c8ecae303d9c96fb7a97106d722b32db8c3728a44a46db028cf0376d9dc79f gencode/python/udmi/schema/state_blobset.py a5a914cb5d74c29671a4d29dfa6c700b3fec27d695d607e28814ad31307e82da gencode/python/udmi/schema/state_blobset_blob.py +26443a1f6d0be3469ff93aa7fdb4e6682e0439a3b29a8e237998dcebec5f6901 gencode/python/udmi/schema/state_discovery.py +187400078dfc89912062ca1ad92f61e32d28126ae56119d83e6767d58cda1117 gencode/python/udmi/schema/state_discovery_family.py fc40816c3483ede5ad4e4a74a8b494a3582085cdd1f49da4155e40f6ae7dae32 gencode/python/udmi/schema/state_gateway.py -9f3800d0bce73b99a4a8ad70dbfaee63f1a2c9fcf3324f9a5a5870b0421e0aa3 gencode/python/udmi/schema/state_pointset.py +8bac9baabe83e2bf682b6376fee1eba2564a34c867f47f0c73eda44d6b3d8bb1 gencode/python/udmi/schema/state_pointset.py 837ecc89c477abe3a1faf837733ca05475774891b55353d84ca231d90a1fbf31 gencode/python/udmi/schema/state_pointset_point.py -dfe9adb63aa939b36944a23769c9b1b5072cf2f9f7bd7de994451b156c41fd8d gencode/python/udmi/schema/state_system.py +adaf946039dd6ebe29a2f2efc1441ba5509156fe4bbad08492d572e106adc0a6 gencode/python/udmi/schema/state_system.py diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 4db18029f0..8bf12b5c97 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -66,13 +66,12 @@ jobs: if: "${{ env.GCP_TARGET_PROJECT != '' }}" run: | bin/test_sequencer $GCP_TARGET_PROJECT - fgrep 'RESULT ' /tmp/test_log.txt | sed -e 's/.*sequencer RESULT/RESULT/' > /tmp/results.txt - diff /tmp/results.txt etc/sequence.out && echo No output diff detected. - - name: validation logs + diff -u /tmp/results.txt etc/sequence.out && echo No output diff detected. + - name: sequencer logs if: ${{ always() }} run: more `find out/devices/ -type f` - name: pubber logs if: ${{ always() }} run: | - echo Pubber output logs: cat pubber.out || true + more `find out/groups/ -type f` diff --git a/bin/loop_sequences b/bin/loop_sequences index 0a091cd41b..3f598b6a6f 100755 --- a/bin/loop_sequences +++ b/bin/loop_sequences @@ -37,7 +37,8 @@ JAVA_CMD="java -cp $JARFILE org.junit.runner.JUnitCore" rm -rf out/devices/$device_id exit_code=0 -for test_class in ConfigValidator WritebackValidator; do +for test_class in DiscoveryValidator ConfigValidator WritebackValidator; do + rm -f out/*.json CLASS=com.google.daq.mqtt.validator.validations.$test_class echo $JAVA_CMD $CLASS timeout 5m $JAVA_CMD $CLASS @@ -47,6 +48,12 @@ for test_class in ConfigValidator WritebackValidator; do echo Sequence test $test_class exited with error code $result exit_code=$result fi + + mkdir -p out/groups/$test_class/ + for file in out/*.json; do + # Format output so it looks nice... + jq < $file > out/groups/$test_class/${file#out/} + done done echo Done with test sequence execution, exit $exit_code. diff --git a/bin/sequencer b/bin/sequencer index f4e7262092..3bcd784341 100755 --- a/bin/sequencer +++ b/bin/sequencer @@ -38,6 +38,6 @@ bin/loop_sequences 2>&1 | tee $TEST_LOG echo # Sort by test name (6th field) -fgrep 'RESULT ' $TEST_LOG | sort -k 6 +fgrep 'RESULT ' $TEST_LOG | sort -k 6 | tee /tmp/sequencer.out -echo SUMMARY `fgrep 'RESULT ' $TEST_LOG | awk '{print $3, $2}' | sort | awk '{print $2}'` +echo SUMMARY `awk '{print $5}' < /tmp/sequencer.out` diff --git a/bin/test_sequencer b/bin/test_sequencer index 05e21df2bf..90e38b7bf3 100755 --- a/bin/test_sequencer +++ b/bin/test_sequencer @@ -48,6 +48,8 @@ fi bin/sequencer $site_path $project_id $device_id $serial_no +sed -e 's/.*sequencer RESULT/RESULT/' < /tmp/sequencer.out > /tmp/results.txt + pids=`ps ax | fgrep pubber | fgrep java | awk '{print $1}'` echo Killing pubber pids $pids kill $pids diff --git a/docs/cloud/gcp/readme.md b/docs/cloud/gcp/readme.md index b40de695ae..46fb9bedbd 100644 --- a/docs/cloud/gcp/readme.md +++ b/docs/cloud/gcp/readme.md @@ -3,7 +3,6 @@ # GCP - [Cloud Setup](cloud_setup.md) - basic cloud project and IoT core configuration -- [Dashboards & Infrastructure Setup](dashboard.md) - Infrastructure (cloud functions) - and dashboard -- [UDMI terraform configuration files](../../../cloud/gcp/readme.md) - This configuration can be used to automate the creation of UDMI related infrastructure on GCP +- [Dashboards & Infrastructure Setup](dashboard.md) - Infrastructure (cloud functions) and dashboard +- [UDMI terraform configuration files](terraform.md) - Aautomate the creation of UDMI cloud components diff --git a/docs/readme.md b/docs/readme.md index 5583530cc7..1efb08f4b2 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -4,10 +4,10 @@ ## Contents -- [**Specification**](specs/) +- [**Specifications**](specs/) - [**Messages**](messages/) - [**Guides**](guides/) -- [**Cloud**](cloud/) +- [**Cloud Platforms**](cloud/) - [**Tools**](tools/) - [**Schema**](https://github.com/faucetsdn/udmi/tree/master/schema) ([_🧬Interactive viewer_](../gencode/docs/)) diff --git a/docs/specs/categories.md b/docs/specs/categories.md index 61845917f5..357e03120f 100644 --- a/docs/specs/categories.md +++ b/docs/specs/categories.md @@ -5,7 +5,8 @@ Categories are assembled in a hierarical fashion to represent the intended level of detail (more specific is better). E.g. a complete system config parsing message would be categorized as `system.config.parse`, while a system config entry of -unspecified category would be just `system.config`. +unspecified category would be just `system.config`. Some categories come with +implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy below. * _system_: Basic system operation * _base_: Baseline system operational messages @@ -13,12 +14,13 @@ unspecified category would be just `system.config`. * _ready_: System is fully ready for operation * _comms_: Baseline message handling * _config_: Configuration message handling - * _receive_: Receiving of a config message - * _parse_: Parsing of a receved message + * _receive_: Receiving a config message + * _parse_: Parsing a receved message * _apply_: Application of a parsed config message * _pointset_: Handling managing data point conditions - * _point_: Conditions relating to a specific point, the affected _point_ name should be included in the entry message - * _invalid_: A `config` parameter for the point is invalid in some way - * _applied_: The `set_value` for a point has been implied - * _overridden_: The reported value has been overridden locally - * _updating_: The point is in the process of updating + * _point_: Conditions relating to a specific point, the entry `message` field should + start with "Point _pointname_" followed by descriptive information. + * _applied_ (**INFO**): The `set_value` for a point has been implied + * _updating_ (**NOTICE**): The point is in the process of updating + * _overridden_ (**WARNING**): The reported value has been overridden locally + * _invalid_ (**ERROR**): A `config` parameter for the point is invalid in some way diff --git a/docs/specs/compliance.md b/docs/specs/compliance.md index 39928ec7fe..49e07fc707 100644 --- a/docs/specs/compliance.md +++ b/docs/specs/compliance.md @@ -23,10 +23,10 @@ device and can be used for defining requirements. * **Software Defined Building** * **Native UDMI** * `Payloads` - Native configuration of UDMI payloads - not dependant on manual creation of MQTT message structures - * `Dynamic Point Mapping` - Dynamic configuration of points via config + * `Dynamic Point Mapping` - Dynamic configuration of points via config * **Connection** * `MQTT 3.1.1 support` - Device supports MQTT 3.1.1 - * `MQTT/TLS Support` - Device supports connection to an MQTT broker with TLS encryption and at least TLS v1.2 + * `MQTT/TLS Support` - Device supports connection to an MQTT broker with TLS encryption and at least TLS v1.2 * `Server certificate validation` - Device validates MQTT broker server certificates * `JWT Certificates` - Device supports use of JWT for authentication with an MQTT broker * `GCP IoT Core support` - Device is able to successfully connect to GCP IoT Core @@ -35,8 +35,10 @@ device and can be used for defining requirements. * **Endpoint** * `Configurable private keys` - Possible to upload private keys onto the device for MQTT authentication * `Client certificate Rotation` - Device can rotate between multiple private keys to use for MQTT broker connection - * `Endpoint remote configuration ` - Device can be remotely reconfigured to a different GCP Project/MQTT Broker - * `Config subscription` - Device subscribes to config topic + * `Endpoint remote configuration ` - Device can be remotely reconfigured to a different GCP Project/MQTT Broker +* **Base** + * `Config subscription` - Device subscribes to config topic + * `State last update` - last_update field in state is timestamp of last configuration * **Pointset** * **Datapoints mapping** * `Datapoint mapping` - Map internal data points to UDMI data points @@ -56,10 +58,9 @@ device and can be used for defining requirements. * `Frequency` - State update sent at a frequency > {X}s * `Rate Limiting` - Device publishes state no more than 1 state update per second * `State after configuration` - Device publishes state update after receiving new configuration - * `State last update` - last_update field in state is timestamp of last configuration * **Monitoring** * **System Status** - * `Publishes status` - Device publishes status fields + * `Publishes status` - Device publishes status fields * `status schema` - Status blocks are valid according to the schema * `min_loglevel` - Configurable min log level for publishing status/logging information * **Log entries** @@ -76,19 +77,19 @@ device and can be used for defining requirements. * **Unwriteable and overridden points** * `Value not applied` - points which are unwriteable or overridden are not updated and state is set to failure * **Status** - * `state.pointset.points.config.failure` - point status for failure to apply + * `pointset.points.failure` - point status for failure to apply * **Invalid writeback** * `Value not applied` - Invalid writeback (e.g. out of range) is reported * **Status** - * `state.pointset.points.config.invalid` - point status for invalid writeback + * `pointset.points.invalid` - point status for invalid writeback * **State etag** * `State etags` - Device implements state etags and rejects config updates with invalid etags * **Status** - * **state.pointset.points.config.invalid** + * `pointset.points.invalid` * **Config Expiry** * `Config Expiry` - Device implements configuration expiry * **Status** - * `state.pointset.points.config.invalid` - status for invalid expiry + * `pointset.points.invalid` - status for invalid expiry ## Testing @@ -99,4 +100,4 @@ The [registar](../tools/registrar.md#tool-execution) tool can be used to validat [metadata](metadata.md) and [site models](site_model.md). [DAQ](https://github.com/faucetsdn/daq) can be used to run some automated [UDMI -tests](https://github.com/faucetsdn/daq/blob/master/docs/cloud_tests.md) on devices \ No newline at end of file +tests](https://github.com/faucetsdn/daq/blob/master/docs/cloud_tests.md) on devices diff --git a/docs/specs/discovery.md b/docs/specs/discovery.md index 787e2b102c..0273c8464d 100644 --- a/docs/specs/discovery.md +++ b/docs/specs/discovery.md @@ -1,23 +1,61 @@ [**UDMI**](../../) / [**Docs**](../) / [**Specs**](./) / [Discovery](#) -# Discovery and Enumeration +# Discovery -There's two related processes that are used to extract the -'as built' state of a system, detailing the physical actualities -of a physical system: +Discovery consists of two related processesd to describe the 'as built' +state of a system: _scanning_ and _enumeration_. For devices, the overall +[discovery sequence](sequences/discovery.md) describes the exact sequence +of device messages employed in each case. Each process can be +executed independently, or together (known as _scan enumeration_): -* _discovery_ refers to the process of determining what devices -exist, and any correlation between address families. This is -essentially extrinsic to a device itself. +* _scanning_ scans for existing devices +exist, and returns a correlation between their address families. This is +information about how the device is indexed in the world around it. -* _enumeration_ refers to the listing of properties/points of a given -target device. This is essentially information intrinsic to a -device. +* _enumeration_ lists the properties of a given target device. Providing +information intrinsic to a device and the capabilities it provides. -These two stages occur hand-in-hand, but are distinct constructs that -can be executed independently (i.e., there can be _discovery_ without -_enumeration_, and _enumeration_ without _discovery_). +Backend services will receive a streaming set of +[_discovery enumeration messages_](../../tests/event_discovery.tests/enumeration.json) that +follow the appropriate [_discovery event schema_](../../gencode/docs/event_discovery.html). -## Discovery +## Scanning + +_Scanning_ is the process of scanning a network and identifying the various +entities thereof. Often (but not always), this comes along with a correlation +of various address families (e.g. IPv4 address associated with a particular MAC): + +* mac (_82:CC:18:9A:45:1C_): Low-level hardware identifier for network connection +* ipv4 (_10.27.38.123_): Assigned IPv4 device network address +* ipv6 (_fe80::8e8c:bc72_): Assigned IPv6 device network address +* bacnet (_92EA09_): The device's BACnet mac-address +* iot (_AHU-32_): Device designation as used in cloud-native processing +* host (_ahu-2.acme.com_): DNS hostname for a device + +Scanning results can only describe a subset of the complete picture (e.g. only the +_MAC_ and _IPv4_ address), and it is up to the back-end systems to properly link/infer complete +relationships. Some systems may only care about singular entries (e.g. just discovering +what IoT devices are there, but not caring about any association). + +Discovery is a process that can be explicitly requested through UDMI for on-prem +devices that support the capability (e.g. an [IoT Gateway](gateway.md)), or it +can be done automatically by a device itself (e.g. on a predefined interval). Depending +on device capabilities and system configuration, the scanning process may also +trigger discovered device enumeration. ## Enumeration + +_Enumeration_ is the process for listing _all_ the parameters available from a device +(rather than just the ones in its designated reporting set). This information can +either come directly from a device (_self_ enumeration) or as the result of a discovery +scan (_scan_ enumeration). Both report the same kind of content, but the mechanism +(and message source) are different: one comes from the device itself, the other by proxy. + +Within an enumeration message, there's a number of different kinds of information that can +be reported: + * `points`: A listing of all the data points that a device has to offer. The normal + `pointset` _config_/_state_/_event_ messages only operate on a curated subset of all + the available points, while this enumeration lists _all_ of them. + * `blobs`: A listing of all the data blobs that a device knows how to handle. This could + be components like firmware updates, key rotation, etc... Some blobs will be standardized + across the system, while others will be device-specific. diff --git a/docs/specs/entries.md b/docs/specs/entries.md index 163031f120..c8bcc4ce42 100644 --- a/docs/specs/entries.md +++ b/docs/specs/entries.md @@ -17,7 +17,7 @@ General indication of the severity of the message, using standard categorization | 400 | WARNING | Something is not right that should be investigated. | | 500 | ERROR | Something bad that needs immediate attention. | -## Categories +## Category The entry _category_ is a dot-separated string providing a semantic hierarchy for a given message. [Canonical categories](categories.md) correspond to expected values for log and status entries. These @@ -27,10 +27,11 @@ are designed to be automatically categorized and processed by backend systems. The entry _message_ is a single sentence of human-readable output describing what went wrong. This will likely be directly exposed to a system operator to give them high-level information on -how to triage, diganose, or rectify the situation. +how to triage, diganose, or rectify the situation. Exact messages are not prescribed, although some +specific categories will have guiding principles (e.g. prepend point _message_ with "Point _pointname_"). ## Detail -More detail used for specifically diagnosing the error. E.g. a complete stack-trace or parsing +The entry _detail_ is use for specifically diagnosing the error. E.g. a complete stack-trace or parsing message that details exactly where the error occured. This would be used for detailed debugging by a domain expert. diff --git a/docs/specs/readme.md b/docs/specs/readme.md index 752e6f93e0..ef1b3d50fa 100644 --- a/docs/specs/readme.md +++ b/docs/specs/readme.md @@ -3,16 +3,17 @@ # Specs - [UDMI Compliance](compliance.md) -- [Discovery and Enumeration](discovery.md) -- [Connection Models](connecting.md) -- [Gateways](gateway.md) +- [Tech Stack](tech_stack.md) +- [Discovery](discovery.md) - [Messages](../messages/) - [Message Walk](message_walk.md) -- [Metadata](metadata.md) +- [Sequences](sequences/) +- [Connection Models](connecting.md) +- [IoT Gateway](gateway.md) - [MQTT Client](mqtt_client.md) - [Point Mapping](point_mapping.md) - [Proxy](proxy.md) -- [Sequences](sequences/) (for example _writeback_ and _state_ sequences) - [Site Model](site_model.md) +- [Metadata](metadata.md) - [Tech Stack](tech_stack.md) - [Log/Status Entries](entries.md) diff --git a/docs/specs/sequences/discovery.md b/docs/specs/sequences/discovery.md new file mode 100644 index 0000000000..3c68dc724b --- /dev/null +++ b/docs/specs/sequences/discovery.md @@ -0,0 +1,113 @@ +[**UDMI**](../../../) / [**Docs**](../../) / [**Specs**](../) / [**Sequences**](./) / [Discovery](#) + +# Discovery Sequences + +The basic discovery device message sequence follows a standard config/state call/response mechanism, with +slightly different parameters for each different mode of operation. During the process, there's two major +device's involved: the _enumerated_ node (the thing with the `points` that are being described), and the +_discovery_ node (the thing that is doing the scan, which does not exist in the _self enumeration_ case). + +There's a few basic modes for the discovery _scan_ capability: + +* [Sporadic Scan](#sporadic-scan): A single scan request to discover potentially unknown on-network devices. +* [Periodic Scan](#periodic-scan): Periodically scan for unknown devices on the network. +* [Continuous Scan](#continuous-scan): Passively look for discovery information and report as noticed. + +Likewise, a few different ways discovery _enumeration_ can happen: + +* [Self Enumeration](#self-enumeration): An enumeration request for a single directly connected device. +* [Scan Enumeration](#scan-enumeration): Enumerate device capabilities as part of a discovery scan. + +These represent the most common use cases, but they are not necessarily mutually exclusive, e.g. +a _continuous scan_ **may** or **may not** include _implicit enumeration_ results. + +## Sporadic Scan + +a _sporadic scan_ is used to trigger an on-prem agent (often an IoT Gateway) to scan the local network for devices. +Depending on the system, this might encompass a number of different network protocols (e.g. BACnet, IPv4, etc...). + +* [_start config_](../../../tests/config.tests/discovery.json): Starts a discovery scan, triggered + by the `generation` timestamp (defined and not-the-same as the previous scan generation). +* [_start state_](../../../tests/state.tests/discovery.json): Indicates the device is actively + scanning, with `generation` should match that of _config_, and the `active` as `true`. +* [_discovery event_](../../../tests/event_discovery.tests/discovery.json): Streaming results + for scanned devices (keyed by matchhing `generation` field): one _event_ for each unique device scanned. +* [_stop state_](../../../tests/state.tests/scan_stop.json): Once complete, the _active_ field is `false` + (or removed). Ideally the `generation` field would remain to indicate the last scan performed. + +At this point, the _config_ `generation` entry can be removed with no effect, or updated to initiate a new scan. + +## Periodic Scan + +A _periodic scan_ is like a _sporadic scan_ except that the scan automatically occurs due to a predefined +interval (rather than individual tirgger _config_s). This allows for repeated scans without any _config_ changes. + +* [_start config_](../../../tests/config.tests/periodic.json): Sets up a periodic scan, as defined by the + `scan_interval_sec` parameter. +* Loop over the { _start_, _discovery_, _stop_ } sequence as per a _sporadic scan_: + * The `generation` value each loop will be updated to uniquely identify the current loop. + * Unlike the _sporadic_ case, the `generation` field will be greater than or equal to the _config_ specification. + * Loop terminates when either the `generation` or `scan_interval_sec` parameter is removed from _config_. + +Note that the _scanning_ should occur at intervals directly determined by the _config_ `generation` timestamp plus +integral increments of the scan _interval_, i.e. _Ts = Tc + N*Ti_, so that there is no clock drift. E.g., it +should be possible to setup a schema to scan every day exactly at midnight. + +## Continuous Scan + +A _continuous scan_ is the mode for a system that can passivly monitor traffic and deduce scan results, so +there is no need for a _sporadic_/_periodic_ scan. This might be a system that monitors network ARP requests, +or transient BACnet traffic. + +* [_start config_](../../../tests/config.tests/continuous.json): There is no `generation` marker, since + scanning is always happening. The `scan_interval_sec` triggers the capability (see below). +* [_start state_](../../../tests/state.tests/continuous.json): Indicates that scanning is `active`, but no `generation`. +* [_discovery event_](../../../tests/event_discovery.tests/continuous.json): Events as per normal, except no `generation`. + +For this case, there is no _stop state_ message since the scan never stops: The process silently stops when the +`scan_interval_sec` parameter is removed from the config. Addionally, the `scan_interval_sec` field indicates the +duration within which a scan result for a given device should _not_ be repeated. E.g., if a device is passivly +detected every _30 sec_, but the scan interval is _60 sec_, then the result would only be reported for +(approximately) every other detection. + +## Self Enumeration + +_Self enumeration_ is used for a device that is already registered in the cloud systems (no scan required), +and can be explicitly directed to enumrate itself. This also applies to all direct-connect (not proxy) devices +(which likely can't be scanned anyway) + +* [_start config_](../../../tests/config.tests/enumeration.json): `generation` paramerter in the `system` + block starts the self enumeration process (rather than the `discovery` block). +* [_start state_](../../../tests/state.tests/enumeration.json): The `system` block indicates the `generation` + of enumeration that is currently being processed. +* [_discovery event_](../../../tests/event_discovery.tests/enumeration.json): The results do not have a `family` block, + rather, the device id is determined from the envelope's `deviceId` field. + +With self enumeration there is no specific _stop state_, as the system deterministally sends a single device's +_discovery event_ corresponding to the _config_ trigger. + +## Scan Enumeration + +_Scan enumeration_ comes bundled with a discovery _scan_ of some kind, triggered by the `enumeration` field +in the [_start config_](../../../tests/config.tests/periodic.json) indicates that the system should also +then automatically enumerates each device encountered. + +* [_start config_](../../../tests/config.tests/implicit.json): Initiates the scan, along with an added + `enumerate` field indicating that the system should enumerate each device it encounters. +* [_start state_](../../../tests/state.tests/discovery.json): Same as base scan case. +* [_discovery event_](../../../tests/event_discovery.tests/implicit.json): Same as _scan_ result, except + includes enumeration fields (typically discovered `points`). +* [_stop state_](../../../tests/state.tests/scan_stop.json): Same as base scan case. + +## Error Handling + +There's different ways to report errors, depending on the scope of the error. + +* [_scan error_](../../../tests/state.tests/scan_error.json): Exemplifies how a device should report an error +potentially affecting all _devices_ or points during a scan. +* [_self error_](../../../tests/state.tests/enumeration.json): Detils status while processing _self_ enumeration + that potentially affects all _points_. +* [_point error_](../../../tests/event_discovery.tests/point_error.json): Details how an _individual_ point error + should be reported during (_self_ or _scan_) enumeration. +* [_scan enumeration error_](../../../tests/event_discovery.tests/scan_error.json): Details how a _scan_ enumeration + error that affects all points should be reported (i.e. while trying to enumerate the scanned device). diff --git a/docs/tools/sequencer.md b/docs/tools/sequencer.md index af4b97c213..35239c593f 100644 --- a/docs/tools/sequencer.md +++ b/docs/tools/sequencer.md @@ -77,7 +77,7 @@ BUILD SUCCESSFUL in 4s 2 actionable tasks: 2 executed -rw-r--r-- 1 username primarygroup 34284160 May 24 22:14 build/libs/validator-1.0-SNAPSHOT-all.jar Done with validator build. -java -cp validator/build/libs/validator-1.0-SNAPSHOT-all.jar org.junit.runner.JUnitCore com.google.daq.mqtt.validator.validations.BaselineValidator +java -cp validator/build/libs/validator-1.0-SNAPSHOT-all.jar org.junit.runner.JUnitCore com.google.daq.mqtt.validator.validations.WritebackValidator JUnit version 4.13.1 Writing results to /home/username/udmi/out/devices/FAUX-01/RESULT.log Validating device FAUX-01 serial sequencer-29581 diff --git a/etc/sequence.out b/etc/sequence.out index c45a837a86..601f4a3e6e 100644 --- a/etc/sequence.out +++ b/etc/sequence.out @@ -1,6 +1,8 @@ RESULT pass broken_config Sequence complete RESULT pass extra_config Sequence complete +RESULT pass self_enumeration Sequence complete RESULT pass system_last_update Sequence complete RESULT pass valid_serial_no Sequence complete -RESULT skip writeback_states Missing 'invalid' target specification RESULT pass valid_serial_no Sequence complete +RESULT pass valid_serial_no Sequence complete +RESULT skip writeback_states Missing 'invalid' target specification diff --git a/gencode/docs/config.html b/gencode/docs/config.html index 2ba00b82c2..12802e314c 100644 --- a/gencode/docs/config.html +++ b/gencode/docs/config.html @@ -215,7 +215,7 @@

+ aria-expanded="" aria-controls="gateway_proxy_ids" onclick="setAnchor('#gateway_proxy_ids')">proxy_ids

@@ -296,6 +296,593 @@

Each item of this array must be:

+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Configuration for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Configuration for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generational marker for controlling discovery

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Period, in seconds, for automatic scanning

+
+ + + +

Value must be greater or equal to 0

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Scan duration, in seconds

+
+ + + +

Value must be greater or equal to 0

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates implicit enumeration of discovered devices

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Address family results for a scan. Not included for device enumeration messages.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$ +
+ + Type: object
+

Configuration for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generational marker for controlling discovery

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Period, in seconds, for automatic scanning

+
+ + + +

Value must be greater or equal to 0

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Scan duration, in seconds

+
+ + + +

Value must be greater or equal to 0

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates implicit enumeration of discovered devices

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gencode/docs/event_discovery.html b/gencode/docs/event_discovery.html index ee79181173..44b9d358f6 100644 --- a/gencode/docs/event_discovery.html +++ b/gencode/docs/event_discovery.html @@ -13,15 +13,15 @@ - Discovery + Discovery Event -

Discovery

+

Discovery Event

Type: object
-

Discovery Documentation

+

Discovery result with implicit enumeration

No Additional Properties @@ -88,18 +88,309 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - version

Type: enum (of integer)
+ version
Type: integer

Major version of the UDMI schema

-
-

Must be one of:

-
  • 1
-
+ + + + +

Value must be greater or equal to 1 and lesser or equal to 1

+ + +
+
+ + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The event's discovery scan trigger's generation timestamp

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
@@ -109,7 +400,7 @@

Must be one of:

+ aria-expanded="" aria-controls="families" onclick="setAnchor('#families')">families

@@ -126,7 +417,7 @@

/> families

Type: object
-

Collection of address families identifying the scan target

+

Address family results for a scan. Not included for device enumeration messages.

No Additional Properties @@ -139,7 +430,7 @@

+ aria-expanded="" aria-controls="families_pattern1" onclick="setAnchor('#families_pattern1')">^iot|bacnet|ipv4|ipv6|ethmac$ Pattern Property

@@ -150,7 +441,7 @@

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ + Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$
Type: object
- +

Discovery information for an individual protocol family.

+
No Additional Properties @@ -213,7 +505,8 @@

/> idType: string
-Must match regular expression: ^[-_.:/0-9a-zA-Z]+$ +

Device id in the namespace of the given family

+
Must match regular expression: ^[-_.:0-9a-zA-Z]+$ @@ -224,18 +517,26 @@

-
+
+ + + + + + + +
-
+

- +

-
+
Type: object
+

Collection of data points available for this device.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-zA-Z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$ +
+ + Type: string
+ event_discovery_point.json#
Type: object
+

Object representation for for a single point enumeration

+
+ + No Additional Properties + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: array of string
+

List of possible enumerated values for the point

+
+ + + + + +

Each item of this array must be:

+
+
+ + + Type: string
+ + + + + + + +
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Current or default unit for this point

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Current or default type for this point

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Reference parameter for this point (e.g. BACnet object)

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates if this point is writable or not

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Human-readable description of this point

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Arbitrary blob of json associated with this point

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Collection of data blobs recognized by this device.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+

Object representation for for a single blob enumeration

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Description of this blob

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicating if this blob is part of the device's firmware set

+
+ diff --git a/gencode/docs/event_pointset.html b/gencode/docs/event_pointset.html index 63f9ec07fc..a8b34a2b8c 100644 --- a/gencode/docs/event_pointset.html +++ b/gencode/docs/event_pointset.html @@ -256,7 +256,7 @@

Examples:

24.1
 
-
true
+
"running"
 
4
 
diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 4a101d9306..bcb321aca7 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -1955,18 +1955,18 @@

-
+
-
+

- +

-
+
Type: boolean
+ writable
Type: boolean

Indicates if this point is writable (else read-only)

diff --git a/gencode/docs/state.html b/gencode/docs/state.html index 2329525578..4b9e1335cd 100644 --- a/gencode/docs/state.html +++ b/gencode/docs/state.html @@ -256,7 +256,7 @@

/> firmware

Type: object
-

Information about the physical device firmware

+

Information about the device firmware

No Additional Properties @@ -740,7 +740,7 @@

+ aria-expanded="" aria-controls="gateway_error_ids" onclick="setAnchor('#gateway_error_ids')">error_ids

@@ -814,6 +814,1111 @@

Each item of this array must be:

+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

State for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+

State for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generational marker for controlling discovery

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates if the discovery process is currently active

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Status information about the discovery operation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Discovery protocol families

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$ +
+ + Type: object
+

State for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generational marker for controlling discovery

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates if the discovery process is currently active

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Status information about the discovery operation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1542,6 +2647,305 @@

Must be at most 32 characters long

+

+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Optional status information about pointset

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
@@ -1732,21 +3136,8 @@

/> value_state

Type: enum (of string)
-
-

Optional enumeration indicating the state of the points value. Valid value_state settings include:
-* : No set_value config has been specified, the source is device-native.
-* applied: The set_value config has been successfully applied.
-* overridden: The config setting is being overridden by another source.
-* invalid: A problem has been identified with the config setting.
-* failure: The config is fine, but a problem has been encountered applying the setting.
-When the value state indicates an error state, an assosciated status entry should be included

- -
-
- -
+

Optional enumeration indicating the state of the points value.

+

Must be one of:

  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
diff --git a/gencode/java/udmi/schema/Ancillary.java b/gencode/java/udmi/schema/Ancillary.java new file mode 100644 index 0000000000..a1b456b1c6 --- /dev/null +++ b/gencode/java/udmi/schema/Ancillary.java @@ -0,0 +1,39 @@ + +package udmi.schema; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Arbitrary blob of json associated with this point + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + +}) +@Generated("jsonschema2pojo") +public class Ancillary { + + + @Override + public int hashCode() { + int result = 1; + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Ancillary) == false) { + return false; + } + Ancillary rhs = ((Ancillary) other); + return true; + } + +} diff --git a/gencode/java/udmi/schema/BlobEnumerationEvent.java b/gencode/java/udmi/schema/BlobEnumerationEvent.java new file mode 100644 index 0000000000..e0e1249510 --- /dev/null +++ b/gencode/java/udmi/schema/BlobEnumerationEvent.java @@ -0,0 +1,60 @@ + +package udmi.schema; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Blob Enumeration Event + *

+ * Object representation for for a single blob enumeration + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "description", + "firmware_set" +}) +@Generated("jsonschema2pojo") +public class BlobEnumerationEvent { + + /** + * Description of this blob + * + */ + @JsonProperty("description") + @JsonPropertyDescription("Description of this blob") + public String description; + /** + * Indicating if this blob is part of the device's firmware set + * + */ + @JsonProperty("firmware_set") + @JsonPropertyDescription("Indicating if this blob is part of the device's firmware set") + public Boolean firmware_set; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); + result = ((result* 31)+((this.firmware_set == null)? 0 :this.firmware_set.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof BlobEnumerationEvent) == false) { + return false; + } + BlobEnumerationEvent rhs = ((BlobEnumerationEvent) other); + return (((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.firmware_set == rhs.firmware_set)||((this.firmware_set!= null)&&this.firmware_set.equals(rhs.firmware_set)))); + } + +} diff --git a/gencode/java/udmi/schema/Config.java b/gencode/java/udmi/schema/Config.java index 793acd331f..69f95c3117 100644 --- a/gencode/java/udmi/schema/Config.java +++ b/gencode/java/udmi/schema/Config.java @@ -21,6 +21,7 @@ "version", "system", "gateway", + "discovery", "localnet", "blobset", "pointset" @@ -62,6 +63,15 @@ public class Config { @JsonProperty("gateway") @JsonPropertyDescription("Configuration for gateways. Only required for devices which are acting as [gateways](../docs/specs/gateway.md)") public GatewayConfig gateway; + /** + * Discovery Config + *

+ * Configuration for [discovery](../docs/specs/discovery.md) + * + */ + @JsonProperty("discovery") + @JsonPropertyDescription("Configuration for [discovery](../docs/specs/discovery.md)") + public DiscoveryConfig discovery; /** * Localnet Config *

@@ -93,6 +103,7 @@ public class Config { public int hashCode() { int result = 1; result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); + result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); result = ((result* 31)+((this.pointset == null)? 0 :this.pointset.hashCode())); result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); result = ((result* 31)+((this.blobset == null)? 0 :this.blobset.hashCode())); @@ -111,7 +122,7 @@ public boolean equals(Object other) { return false; } Config rhs = ((Config) other); - return ((((((((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system)))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.blobset == rhs.blobset)||((this.blobset!= null)&&this.blobset.equals(rhs.blobset))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + return (((((((((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system)))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.blobset == rhs.blobset)||((this.blobset!= null)&&this.blobset.equals(rhs.blobset))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); } } diff --git a/gencode/java/udmi/schema/Discovery.java b/gencode/java/udmi/schema/Discovery.java deleted file mode 100644 index eb4016162c..0000000000 --- a/gencode/java/udmi/schema/Discovery.java +++ /dev/null @@ -1,121 +0,0 @@ - -package udmi.schema; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import javax.annotation.processing.Generated; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonValue; - - -/** - * Discovery - *

- * [Discovery Documentation](../docs/specs/discovery.md) - * - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "timestamp", - "version", - "families" -}) -@Generated("jsonschema2pojo") -public class Discovery { - - /** - * RFC 3339 timestamp the discover telemetry event was generated - * (Required) - * - */ - @JsonProperty("timestamp") - @JsonPropertyDescription("RFC 3339 timestamp the discover telemetry event was generated") - public Date timestamp; - /** - * Major version of the UDMI schema - * (Required) - * - */ - @JsonProperty("version") - @JsonPropertyDescription("Major version of the UDMI schema") - public Discovery.Version version; - /** - * Collection of address families identifying the scan target - * (Required) - * - */ - @JsonProperty("families") - @JsonPropertyDescription("Collection of address families identifying the scan target") - public Object families; - - @Override - public int hashCode() { - int result = 1; - result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); - result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); - result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Discovery) == false) { - return false; - } - Discovery rhs = ((Discovery) other); - return ((((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families)))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); - } - - - /** - * Major version of the UDMI schema - * - */ - @Generated("jsonschema2pojo") - public enum Version { - - _1("1"); - private final String value; - private final static Map CONSTANTS = new HashMap(); - - static { - for (Discovery.Version c: values()) { - CONSTANTS.put(c.value, c); - } - } - - Version(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - @JsonValue - public String value() { - return this.value; - } - - @JsonCreator - public static Discovery.Version fromValue(String value) { - Discovery.Version constant = CONSTANTS.get(value); - if (constant == null) { - throw new IllegalArgumentException(value); - } else { - return constant; - } - } - - } - -} diff --git a/gencode/java/udmi/schema/DiscoveryConfig.java b/gencode/java/udmi/schema/DiscoveryConfig.java new file mode 100644 index 0000000000..86868ce5bd --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryConfig.java @@ -0,0 +1,62 @@ + +package udmi.schema; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Discovery Config + *

+ * Configuration for [discovery](../docs/specs/discovery.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "enumeration", + "families" +}) +@Generated("jsonschema2pojo") +public class DiscoveryConfig { + + /** + * Family Discovery Config + *

+ * Configuration for [discovery](../docs/specs/discovery.md) + * + */ + @JsonProperty("enumeration") + @JsonPropertyDescription("Configuration for [discovery](../docs/specs/discovery.md)") + public FamilyDiscoveryConfig enumeration; + /** + * Address family results for a scan. Not included for device enumeration messages. + * + */ + @JsonProperty("families") + @JsonPropertyDescription("Address family results for a scan. Not included for device enumeration messages.") + public Object families; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.enumeration == null)? 0 :this.enumeration.hashCode())); + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DiscoveryConfig) == false) { + return false; + } + DiscoveryConfig rhs = ((DiscoveryConfig) other); + return (((this.enumeration == rhs.enumeration)||((this.enumeration!= null)&&this.enumeration.equals(rhs.enumeration)))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families)))); + } + +} diff --git a/gencode/java/udmi/schema/DiscoveryEvent.java b/gencode/java/udmi/schema/DiscoveryEvent.java new file mode 100644 index 0000000000..679bc3e2ad --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryEvent.java @@ -0,0 +1,112 @@ + +package udmi.schema; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Discovery Event + *

+ * [Discovery result](../docs/specs/discovery.md) with implicit enumeration + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "generation", + "status", + "families", + "points", + "blobs" +}) +@Generated("jsonschema2pojo") +public class DiscoveryEvent { + + /** + * RFC 3339 timestamp the discover telemetry event was generated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the discover telemetry event was generated") + public Date timestamp; + /** + * Major version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Major version of the UDMI schema") + public Integer version; + /** + * The event's discovery scan trigger's generation timestamp + * (Required) + * + */ + @JsonProperty("generation") + @JsonPropertyDescription("The event's discovery scan trigger's generation timestamp") + public Date generation; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + /** + * Address family results for a scan. Not included for device enumeration messages. + * + */ + @JsonProperty("families") + @JsonPropertyDescription("Address family results for a scan. Not included for device enumeration messages.") + public Families families; + /** + * Collection of data points available for this device. + * + */ + @JsonProperty("points") + @JsonPropertyDescription("Collection of data points available for this device.") + public Map points; + /** + * Collection of data blobs recognized by this device. + * + */ + @JsonProperty("blobs") + @JsonPropertyDescription("Collection of data blobs recognized by this device.") + public HashMap blobs; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); + result = ((result* 31)+((this.blobs == null)? 0 :this.blobs.hashCode())); + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + result = ((result* 31)+((this.status == null)? 0 :this.status.hashCode())); + result = ((result* 31)+((this.points == null)? 0 :this.points.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DiscoveryEvent) == false) { + return false; + } + DiscoveryEvent rhs = ((DiscoveryEvent) other); + return ((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.blobs == rhs.blobs)||((this.blobs!= null)&&this.blobs.equals(rhs.blobs))))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + } + +} diff --git a/gencode/java/udmi/schema/DiscoveryState.java b/gencode/java/udmi/schema/DiscoveryState.java new file mode 100644 index 0000000000..cf8a554a00 --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryState.java @@ -0,0 +1,62 @@ + +package udmi.schema; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Discovery State + *

+ * State for [discovery](../docs/specs/discovery.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "enumeration", + "families" +}) +@Generated("jsonschema2pojo") +public class DiscoveryState { + + /** + * Family Discovery State + *

+ * State for [discovery](../docs/specs/discovery.md) + * + */ + @JsonProperty("enumeration") + @JsonPropertyDescription("State for [discovery](../docs/specs/discovery.md)") + public FamilyDiscoveryState enumeration; + /** + * Discovery protocol families + * + */ + @JsonProperty("families") + @JsonPropertyDescription("Discovery protocol families") + public Object families; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.enumeration == null)? 0 :this.enumeration.hashCode())); + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DiscoveryState) == false) { + return false; + } + DiscoveryState rhs = ((DiscoveryState) other); + return (((this.enumeration == rhs.enumeration)||((this.enumeration!= null)&&this.enumeration.equals(rhs.enumeration)))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families)))); + } + +} diff --git a/gencode/java/udmi/schema/Event.java b/gencode/java/udmi/schema/Event.java index 160e7075cc..15926e009e 100644 --- a/gencode/java/udmi/schema/Event.java +++ b/gencode/java/udmi/schema/Event.java @@ -42,14 +42,14 @@ public class Event { @JsonPropertyDescription("A set of points reporting telemetry data. [Pointset Event Documentation](../docs/messages/pointset.md#telemetry)") public PointsetEvent pointset; /** - * Discovery + * Discovery Event *

- * [Discovery Documentation](../docs/specs/discovery.md) + * [Discovery result](../docs/specs/discovery.md) with implicit enumeration * */ @JsonProperty("discovery") - @JsonPropertyDescription("[Discovery Documentation](../docs/specs/discovery.md)") - public Discovery discovery; + @JsonPropertyDescription("[Discovery result](../docs/specs/discovery.md) with implicit enumeration") + public DiscoveryEvent discovery; @Override public int hashCode() { diff --git a/gencode/java/udmi/schema/Families.java b/gencode/java/udmi/schema/Families.java new file mode 100644 index 0000000000..a32487353f --- /dev/null +++ b/gencode/java/udmi/schema/Families.java @@ -0,0 +1,39 @@ + +package udmi.schema; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Address family results for a scan. Not included for device enumeration messages. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + +}) +@Generated("jsonschema2pojo") +public class Families { + + + @Override + public int hashCode() { + int result = 1; + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Families) == false) { + return false; + } + Families rhs = ((Families) other); + return true; + } + +} diff --git a/gencode/java/udmi/schema/FamilyDiscoveryConfig.java b/gencode/java/udmi/schema/FamilyDiscoveryConfig.java new file mode 100644 index 0000000000..11b86ffd25 --- /dev/null +++ b/gencode/java/udmi/schema/FamilyDiscoveryConfig.java @@ -0,0 +1,79 @@ + +package udmi.schema; + +import java.util.Date; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Family Discovery Config + *

+ * Configuration for [discovery](../docs/specs/discovery.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "generation", + "scan_interval_sec", + "scan_duration_sec", + "enumerate" +}) +@Generated("jsonschema2pojo") +public class FamilyDiscoveryConfig { + + /** + * Generational marker for controlling discovery + * + */ + @JsonProperty("generation") + @JsonPropertyDescription("Generational marker for controlling discovery") + public Date generation; + /** + * Period, in seconds, for automatic scanning + * + */ + @JsonProperty("scan_interval_sec") + @JsonPropertyDescription("Period, in seconds, for automatic scanning") + public Integer scan_interval_sec; + /** + * Scan duration, in seconds + * + */ + @JsonProperty("scan_duration_sec") + @JsonPropertyDescription("Scan duration, in seconds") + public Integer scan_duration_sec; + /** + * Indicates implicit enumeration of discovered devices + * + */ + @JsonProperty("enumerate") + @JsonPropertyDescription("Indicates implicit enumeration of discovered devices") + public Boolean enumerate; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); + result = ((result* 31)+((this.scan_interval_sec == null)? 0 :this.scan_interval_sec.hashCode())); + result = ((result* 31)+((this.enumerate == null)? 0 :this.enumerate.hashCode())); + result = ((result* 31)+((this.scan_duration_sec == null)? 0 :this.scan_duration_sec.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof FamilyDiscoveryConfig) == false) { + return false; + } + FamilyDiscoveryConfig rhs = ((FamilyDiscoveryConfig) other); + return (((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.scan_interval_sec == rhs.scan_interval_sec)||((this.scan_interval_sec!= null)&&this.scan_interval_sec.equals(rhs.scan_interval_sec))))&&((this.enumerate == rhs.enumerate)||((this.enumerate!= null)&&this.enumerate.equals(rhs.enumerate))))&&((this.scan_duration_sec == rhs.scan_duration_sec)||((this.scan_duration_sec!= null)&&this.scan_duration_sec.equals(rhs.scan_duration_sec)))); + } + +} diff --git a/gencode/java/udmi/schema/FamilyDiscoveryEvent.java b/gencode/java/udmi/schema/FamilyDiscoveryEvent.java index 7e950cca7f..d13ccaa8c4 100644 --- a/gencode/java/udmi/schema/FamilyDiscoveryEvent.java +++ b/gencode/java/udmi/schema/FamilyDiscoveryEvent.java @@ -4,38 +4,36 @@ import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; import com.fasterxml.jackson.annotation.JsonPropertyOrder; /** * Family Discovery Event *

- * + * Discovery information for an individual protocol family. * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "id", - "group" + "id" }) @Generated("jsonschema2pojo") public class FamilyDiscoveryEvent { /** - * + * Device id in the namespace of the given family * (Required) * */ @JsonProperty("id") + @JsonPropertyDescription("Device id in the namespace of the given family") public String id; - @JsonProperty("group") - public String group; @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); - result = ((result* 31)+((this.group == null)? 0 :this.group.hashCode())); return result; } @@ -48,7 +46,7 @@ public boolean equals(Object other) { return false; } FamilyDiscoveryEvent rhs = ((FamilyDiscoveryEvent) other); - return (((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.group == rhs.group)||((this.group!= null)&&this.group.equals(rhs.group)))); + return ((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))); } } diff --git a/gencode/java/udmi/schema/FamilyDiscoveryState.java b/gencode/java/udmi/schema/FamilyDiscoveryState.java new file mode 100644 index 0000000000..a7590aa8ef --- /dev/null +++ b/gencode/java/udmi/schema/FamilyDiscoveryState.java @@ -0,0 +1,71 @@ + +package udmi.schema; + +import java.util.Date; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Family Discovery State + *

+ * State for [discovery](../docs/specs/discovery.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "generation", + "active", + "status" +}) +@Generated("jsonschema2pojo") +public class FamilyDiscoveryState { + + /** + * Generational marker for controlling discovery + * + */ + @JsonProperty("generation") + @JsonPropertyDescription("Generational marker for controlling discovery") + public Date generation; + /** + * Indicates if the discovery process is currently active + * + */ + @JsonProperty("active") + @JsonPropertyDescription("Indicates if the discovery process is currently active") + public Boolean active; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); + result = ((result* 31)+((this.active == null)? 0 :this.active.hashCode())); + result = ((result* 31)+((this.status == null)? 0 :this.status.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof FamilyDiscoveryState) == false) { + return false; + } + FamilyDiscoveryState rhs = ((FamilyDiscoveryState) other); + return ((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.active == rhs.active)||((this.active!= null)&&this.active.equals(rhs.active))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status)))); + } + +} diff --git a/gencode/java/udmi/schema/Firmware.java b/gencode/java/udmi/schema/Firmware.java index 7d2a4c5318..c5fb6bb14f 100644 --- a/gencode/java/udmi/schema/Firmware.java +++ b/gencode/java/udmi/schema/Firmware.java @@ -9,7 +9,7 @@ /** - * Information about the physical device firmware + * Information about the device firmware * */ @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/gencode/java/udmi/schema/GatewayConfig.java b/gencode/java/udmi/schema/GatewayConfig.java index fcfe5dc6ec..3a5c2c2634 100644 --- a/gencode/java/udmi/schema/GatewayConfig.java +++ b/gencode/java/udmi/schema/GatewayConfig.java @@ -25,7 +25,6 @@ public class GatewayConfig { /** * An array of all the device IDs which are bound to the device - * (Required) * */ @JsonProperty("proxy_ids") diff --git a/gencode/java/udmi/schema/GatewayState.java b/gencode/java/udmi/schema/GatewayState.java index 022ceb605b..51d355f1f8 100644 --- a/gencode/java/udmi/schema/GatewayState.java +++ b/gencode/java/udmi/schema/GatewayState.java @@ -22,11 +22,6 @@ @Generated("jsonschema2pojo") public class GatewayState { - /** - * - * (Required) - * - */ @JsonProperty("error_ids") public List error_ids = new ArrayList(); diff --git a/gencode/java/udmi/schema/PointEnumerationEvent.java b/gencode/java/udmi/schema/PointEnumerationEvent.java new file mode 100644 index 0000000000..51774ff877 --- /dev/null +++ b/gencode/java/udmi/schema/PointEnumerationEvent.java @@ -0,0 +1,117 @@ + +package udmi.schema; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Point Enumeration Event + *

+ * Object representation for for a single point enumeration + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "possible_values", + "units", + "type", + "ref", + "writable", + "description", + "status", + "ancillary" +}) +@Generated("jsonschema2pojo") +public class PointEnumerationEvent { + + /** + * List of possible enumerated values for the point + * + */ + @JsonProperty("possible_values") + @JsonPropertyDescription("List of possible enumerated values for the point") + public List possible_values = new ArrayList(); + /** + * Current or default unit for this point + * + */ + @JsonProperty("units") + @JsonPropertyDescription("Current or default unit for this point") + public String units; + /** + * Current or default type for this point + * + */ + @JsonProperty("type") + @JsonPropertyDescription("Current or default type for this point") + public String type; + /** + * Reference parameter for this point (e.g. BACnet object) + * + */ + @JsonProperty("ref") + @JsonPropertyDescription("Reference parameter for this point (e.g. BACnet object)") + public String ref; + /** + * Indicates if this point is writable or not + * + */ + @JsonProperty("writable") + @JsonPropertyDescription("Indicates if this point is writable or not") + public Boolean writable; + /** + * Human-readable description of this point + * + */ + @JsonProperty("description") + @JsonPropertyDescription("Human-readable description of this point") + public String description; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + /** + * Arbitrary blob of json associated with this point + * + */ + @JsonProperty("ancillary") + @JsonPropertyDescription("Arbitrary blob of json associated with this point") + public Ancillary ancillary; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.ref == null)? 0 :this.ref.hashCode())); + result = ((result* 31)+((this.possible_values == null)? 0 :this.possible_values.hashCode())); + result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); + result = ((result* 31)+((this.units == null)? 0 :this.units.hashCode())); + result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); + result = ((result* 31)+((this.ancillary == null)? 0 :this.ancillary.hashCode())); + result = ((result* 31)+((this.writable == null)? 0 :this.writable.hashCode())); + result = ((result* 31)+((this.status == null)? 0 :this.status.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PointEnumerationEvent) == false) { + return false; + } + PointEnumerationEvent rhs = ((PointEnumerationEvent) other); + return (((((((((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref)))&&((this.possible_values == rhs.possible_values)||((this.possible_values!= null)&&this.possible_values.equals(rhs.possible_values))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.ancillary == rhs.ancillary)||((this.ancillary!= null)&&this.ancillary.equals(rhs.ancillary))))&&((this.writable == rhs.writable)||((this.writable!= null)&&this.writable.equals(rhs.writable))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status)))); + } + +} diff --git a/gencode/java/udmi/schema/PointPointsetMetadata.java b/gencode/java/udmi/schema/PointPointsetMetadata.java index bb131bad73..4083811251 100644 --- a/gencode/java/udmi/schema/PointPointsetMetadata.java +++ b/gencode/java/udmi/schema/PointPointsetMetadata.java @@ -21,7 +21,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "units", - "writeable", + "writable", "baseline_value", "baseline_tolerance", "baseline_state", @@ -45,9 +45,9 @@ public class PointPointsetMetadata { * Indicates if this point is writable (else read-only) * */ - @JsonProperty("writeable") + @JsonProperty("writable") @JsonPropertyDescription("Indicates if this point is writable (else read-only)") - public Boolean writeable; + public Boolean writable; /** * Represents the expected baseline value of the point * @@ -114,10 +114,10 @@ public int hashCode() { result = ((result* 31)+((this.min_loglevel == null)? 0 :this.min_loglevel.hashCode())); result = ((result* 31)+((this.baseline_state == null)? 0 :this.baseline_state.hashCode())); result = ((result* 31)+((this.units == null)? 0 :this.units.hashCode())); - result = ((result* 31)+((this.writeable == null)? 0 :this.writeable.hashCode())); result = ((result* 31)+((this.baseline_tolerance == null)? 0 :this.baseline_tolerance.hashCode())); result = ((result* 31)+((this.cov_increment == null)? 0 :this.cov_increment.hashCode())); result = ((result* 31)+((this.sample_limit_sec == null)? 0 :this.sample_limit_sec.hashCode())); + result = ((result* 31)+((this.writable == null)? 0 :this.writable.hashCode())); return result; } @@ -130,7 +130,7 @@ public boolean equals(Object other) { return false; } PointPointsetMetadata rhs = ((PointPointsetMetadata) other); - return (((((((((((this.sample_rate_sec == rhs.sample_rate_sec)||((this.sample_rate_sec!= null)&&this.sample_rate_sec.equals(rhs.sample_rate_sec)))&&((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref))))&&((this.baseline_value == rhs.baseline_value)||((this.baseline_value!= null)&&this.baseline_value.equals(rhs.baseline_value))))&&((this.min_loglevel == rhs.min_loglevel)||((this.min_loglevel!= null)&&this.min_loglevel.equals(rhs.min_loglevel))))&&((this.baseline_state == rhs.baseline_state)||((this.baseline_state!= null)&&this.baseline_state.equals(rhs.baseline_state))))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.writeable == rhs.writeable)||((this.writeable!= null)&&this.writeable.equals(rhs.writeable))))&&((this.baseline_tolerance == rhs.baseline_tolerance)||((this.baseline_tolerance!= null)&&this.baseline_tolerance.equals(rhs.baseline_tolerance))))&&((this.cov_increment == rhs.cov_increment)||((this.cov_increment!= null)&&this.cov_increment.equals(rhs.cov_increment))))&&((this.sample_limit_sec == rhs.sample_limit_sec)||((this.sample_limit_sec!= null)&&this.sample_limit_sec.equals(rhs.sample_limit_sec)))); + return (((((((((((this.sample_rate_sec == rhs.sample_rate_sec)||((this.sample_rate_sec!= null)&&this.sample_rate_sec.equals(rhs.sample_rate_sec)))&&((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref))))&&((this.baseline_value == rhs.baseline_value)||((this.baseline_value!= null)&&this.baseline_value.equals(rhs.baseline_value))))&&((this.min_loglevel == rhs.min_loglevel)||((this.min_loglevel!= null)&&this.min_loglevel.equals(rhs.min_loglevel))))&&((this.baseline_state == rhs.baseline_state)||((this.baseline_state!= null)&&this.baseline_state.equals(rhs.baseline_state))))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.baseline_tolerance == rhs.baseline_tolerance)||((this.baseline_tolerance!= null)&&this.baseline_tolerance.equals(rhs.baseline_tolerance))))&&((this.cov_increment == rhs.cov_increment)||((this.cov_increment!= null)&&this.cov_increment.equals(rhs.cov_increment))))&&((this.sample_limit_sec == rhs.sample_limit_sec)||((this.sample_limit_sec!= null)&&this.sample_limit_sec.equals(rhs.sample_limit_sec))))&&((this.writable == rhs.writable)||((this.writable!= null)&&this.writable.equals(rhs.writable)))); } diff --git a/gencode/java/udmi/schema/PointPointsetState.java b/gencode/java/udmi/schema/PointPointsetState.java index fea3f5da09..fd3b3fdabc 100644 --- a/gencode/java/udmi/schema/PointPointsetState.java +++ b/gencode/java/udmi/schema/PointPointsetState.java @@ -35,17 +35,11 @@ public class PointPointsetState { @JsonPropertyDescription("If specified, indicates a programmed point unit. If empty, means unspecified or matches configured point.") public String units; /** - * Optional enumeration indicating the state of the points value. Valid `value_state` settings include: - * * __: No `set_value` _config_ has been specified, the source is device-native. - * * _applied_: The `set_value` _config_ has been successfully applied. - * * _overridden_: The _config_ setting is being overridden by another source. - * * _invalid_: A problem has been identified with the _config_ setting. - * * _failure_: The _config_ is fine, but a problem has been encountered applying the setting. - * When the value state indicates an error state, an assosciated status entry should be included + * Optional enumeration indicating the state of the points value. * */ @JsonProperty("value_state") - @JsonPropertyDescription("Optional enumeration indicating the state of the points value. Valid `value_state` settings include:\n* __: No `set_value` _config_ has been specified, the source is device-native.\n* _applied_: The `set_value` _config_ has been successfully applied.\n* _overridden_: The _config_ setting is being overridden by another source.\n* _invalid_: A problem has been identified with the _config_ setting.\n* _failure_: The _config_ is fine, but a problem has been encountered applying the setting.\nWhen the value state indicates an error state, an assosciated status entry should be included") + @JsonPropertyDescription("Optional enumeration indicating the state of the points value.") public PointPointsetState.Value_state value_state; /** * Entry @@ -79,13 +73,7 @@ public boolean equals(Object other) { /** - * Optional enumeration indicating the state of the points value. Valid `value_state` settings include: - * * __: No `set_value` _config_ has been specified, the source is device-native. - * * _applied_: The `set_value` _config_ has been successfully applied. - * * _overridden_: The _config_ setting is being overridden by another source. - * * _invalid_: A problem has been identified with the _config_ setting. - * * _failure_: The _config_ is fine, but a problem has been encountered applying the setting. - * When the value state indicates an error state, an assosciated status entry should be included + * Optional enumeration indicating the state of the points value. * */ @Generated("jsonschema2pojo") diff --git a/gencode/java/udmi/schema/PointsetState.java b/gencode/java/udmi/schema/PointsetState.java index 54f7e06a96..ba20bf7397 100644 --- a/gencode/java/udmi/schema/PointsetState.java +++ b/gencode/java/udmi/schema/PointsetState.java @@ -18,6 +18,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "state_etag", + "status", "points" }) @Generated("jsonschema2pojo") @@ -30,6 +31,14 @@ public class PointsetState { @JsonProperty("state_etag") @JsonPropertyDescription("An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. [Additional information on implementation](../docs/specs/sequences/writeback.md)") public java.lang.String state_etag; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; /** * Collection of point names, defining the representative point set for this device. * (Required) @@ -43,6 +52,7 @@ public class PointsetState { public int hashCode() { int result = 1; result = ((result* 31)+((this.state_etag == null)? 0 :this.state_etag.hashCode())); + result = ((result* 31)+((this.status == null)? 0 :this.status.hashCode())); result = ((result* 31)+((this.points == null)? 0 :this.points.hashCode())); return result; } @@ -56,7 +66,7 @@ public boolean equals(Object other) { return false; } PointsetState rhs = ((PointsetState) other); - return (((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag)))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + return ((((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag)))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); } } diff --git a/gencode/java/udmi/schema/State.java b/gencode/java/udmi/schema/State.java index beb2154a50..0e251b2ee1 100644 --- a/gencode/java/udmi/schema/State.java +++ b/gencode/java/udmi/schema/State.java @@ -21,6 +21,7 @@ "version", "system", "gateway", + "discovery", "blobset", "pointset" }) @@ -62,6 +63,15 @@ public class State { @JsonProperty("gateway") @JsonPropertyDescription("[Gateway Documentation](../docs/specs/gateway.md)") public GatewayState gateway; + /** + * Discovery State + *

+ * State for [discovery](../docs/specs/discovery.md) + * + */ + @JsonProperty("discovery") + @JsonPropertyDescription("State for [discovery](../docs/specs/discovery.md)") + public DiscoveryState discovery; /** * Blobset State *

@@ -84,6 +94,7 @@ public class State { public int hashCode() { int result = 1; result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); + result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); result = ((result* 31)+((this.pointset == null)? 0 :this.pointset.hashCode())); result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); result = ((result* 31)+((this.blobset == null)? 0 :this.blobset.hashCode())); @@ -101,7 +112,7 @@ public boolean equals(Object other) { return false; } State rhs = ((State) other); - return (((((((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system)))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.blobset == rhs.blobset)||((this.blobset!= null)&&this.blobset.equals(rhs.blobset))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + return ((((((((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system)))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.blobset == rhs.blobset)||((this.blobset!= null)&&this.blobset.equals(rhs.blobset))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); } } diff --git a/gencode/java/udmi/schema/SystemState.java b/gencode/java/udmi/schema/SystemState.java index 4964628af6..b1acde391d 100644 --- a/gencode/java/udmi/schema/SystemState.java +++ b/gencode/java/udmi/schema/SystemState.java @@ -44,12 +44,12 @@ public class SystemState { @JsonPropertyDescription("The serial number of the physical device") public String serial_no; /** - * Information about the physical device firmware + * Information about the device firmware * (Required) * */ @JsonProperty("firmware") - @JsonPropertyDescription("Information about the physical device firmware") + @JsonPropertyDescription("Information about the device firmware") public Firmware firmware; /** * Time from the `timestamp` field of the last successfully parsed `config` message (not the timestamp the message was received/processed). diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index dbbc341e4c..cd79841be4 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -2,6 +2,8 @@ from .config import Config from .config_blobset import BlobsetConfig from .config_blobset_blob import BlobBlobsetConfig +from .config_discovery import DiscoveryConfig +from .config_discovery_family import FamilyDiscoveryConfig from .config_gateway import GatewayConfig from .config_localnet import LocalnetConfig from .config_pointset import PointsetConfig @@ -9,8 +11,10 @@ from .config_system import SystemConfig from .envelope import Envelope from .event import Event -from .event_discovery import Discovery +from .event_discovery import DiscoveryEvent +from .event_discovery_blob import BlobEnumerationEvent from .event_discovery_family import FamilyDiscoveryEvent +from .event_discovery_point import PointEnumerationEvent from .event_pointset import PointsetEvent from .event_pointset_point import PointPointsetEvent from .event_system import SystemEvent @@ -28,6 +32,8 @@ from .state import State from .state_blobset import BlobsetState from .state_blobset_blob import BlobBlobsetState +from .state_discovery import DiscoveryState +from .state_discovery_family import FamilyDiscoveryState from .state_gateway import GatewayState from .state_pointset import PointsetState from .state_pointset_point import PointPointsetState diff --git a/gencode/python/udmi/schema/config.py b/gencode/python/udmi/schema/config.py index 80d4174f29..939b0a72c8 100644 --- a/gencode/python/udmi/schema/config.py +++ b/gencode/python/udmi/schema/config.py @@ -1,6 +1,7 @@ """Generated class for config.json""" from .config_system import SystemConfig from .config_gateway import GatewayConfig +from .config_discovery import DiscoveryConfig from .config_localnet import LocalnetConfig from .config_blobset import BlobsetConfig from .config_pointset import PointsetConfig @@ -14,6 +15,7 @@ def __init__(self): self.version = None self.system = None self.gateway = None + self.discovery = None self.localnet = None self.blobset = None self.pointset = None @@ -27,6 +29,7 @@ def from_dict(source): result.version = source.get('version') result.system = SystemConfig.from_dict(source.get('system')) result.gateway = GatewayConfig.from_dict(source.get('gateway')) + result.discovery = DiscoveryConfig.from_dict(source.get('discovery')) result.localnet = LocalnetConfig.from_dict(source.get('localnet')) result.blobset = BlobsetConfig.from_dict(source.get('blobset')) result.pointset = PointsetConfig.from_dict(source.get('pointset')) @@ -58,6 +61,8 @@ def to_dict(self): result['system'] = self.system.to_dict() # 4 if self.gateway: result['gateway'] = self.gateway.to_dict() # 4 + if self.discovery: + result['discovery'] = self.discovery.to_dict() # 4 if self.localnet: result['localnet'] = self.localnet.to_dict() # 4 if self.blobset: diff --git a/gencode/python/udmi/schema/config_discovery.py b/gencode/python/udmi/schema/config_discovery.py new file mode 100644 index 0000000000..785b91e477 --- /dev/null +++ b/gencode/python/udmi/schema/config_discovery.py @@ -0,0 +1,44 @@ +"""Generated class for config_discovery.json""" +from .config_discovery_family import FamilyDiscoveryConfig +from .config_discovery_family import FamilyDiscoveryConfig + + +class DiscoveryConfig: + """Generated schema class""" + + def __init__(self): + self.enumeration = None + self.families = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryConfig() + result.enumeration = FamilyDiscoveryConfig.from_dict(source.get('enumeration')) + result.families = FamilyDiscoveryConfig.map_from(source.get('families')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryConfig.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.enumeration: + result['enumeration'] = self.enumeration.to_dict() # 4 + if self.families: + result['families'] = FamilyDiscoveryConfig.expand_dict(self.families) # 2 + return result diff --git a/gencode/python/udmi/schema/config_discovery_family.py b/gencode/python/udmi/schema/config_discovery_family.py new file mode 100644 index 0000000000..4da0e51934 --- /dev/null +++ b/gencode/python/udmi/schema/config_discovery_family.py @@ -0,0 +1,50 @@ +"""Generated class for config_discovery_family.json""" + + +class FamilyDiscoveryConfig: + """Generated schema class""" + + def __init__(self): + self.generation = None + self.scan_interval_sec = None + self.scan_duration_sec = None + self.enumerate = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = FamilyDiscoveryConfig() + result.generation = source.get('generation') + result.scan_interval_sec = source.get('scan_interval_sec') + result.scan_duration_sec = source.get('scan_duration_sec') + result.enumerate = source.get('enumerate') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = FamilyDiscoveryConfig.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.generation: + result['generation'] = self.generation # 5 + if self.scan_interval_sec: + result['scan_interval_sec'] = self.scan_interval_sec # 5 + if self.scan_duration_sec: + result['scan_duration_sec'] = self.scan_duration_sec # 5 + if self.enumerate: + result['enumerate'] = self.enumerate # 5 + return result diff --git a/gencode/python/udmi/schema/event.py b/gencode/python/udmi/schema/event.py index 426354f05c..f341a38aaa 100644 --- a/gencode/python/udmi/schema/event.py +++ b/gencode/python/udmi/schema/event.py @@ -1,7 +1,7 @@ """Generated class for event.json""" from .event_system import SystemEvent from .event_pointset import PointsetEvent -from .event_discovery import Discovery +from .event_discovery import DiscoveryEvent class Event: @@ -19,7 +19,7 @@ def from_dict(source): result = Event() result.system = SystemEvent.from_dict(source.get('system')) result.pointset = PointsetEvent.from_dict(source.get('pointset')) - result.discovery = Discovery.from_dict(source.get('discovery')) + result.discovery = DiscoveryEvent.from_dict(source.get('discovery')) return result @staticmethod diff --git a/gencode/python/udmi/schema/event_discovery.py b/gencode/python/udmi/schema/event_discovery.py index 477b73ba1b..f049294450 100644 --- a/gencode/python/udmi/schema/event_discovery.py +++ b/gencode/python/udmi/schema/event_discovery.py @@ -1,23 +1,34 @@ """Generated class for event_discovery.json""" +from .common import Entry from .event_discovery_family import FamilyDiscoveryEvent +from .event_discovery_point import PointEnumerationEvent +from .event_discovery_blob import BlobEnumerationEvent -class Discovery: +class DiscoveryEvent: """Generated schema class""" def __init__(self): self.timestamp = None self.version = None + self.generation = None + self.status = None self.families = None + self.points = None + self.blobs = None @staticmethod def from_dict(source): if not source: return None - result = Discovery() + result = DiscoveryEvent() result.timestamp = source.get('timestamp') result.version = source.get('version') + result.generation = source.get('generation') + result.status = Entry.from_dict(source.get('status')) result.families = FamilyDiscoveryEvent.map_from(source.get('families')) + result.points = PointEnumerationEvent.map_from(source.get('points')) + result.blobs = BlobEnumerationEvent.map_from(source.get('blobs')) return result @staticmethod @@ -26,7 +37,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = Discovery.from_dict(source[key]) + result[key] = DiscoveryEvent.from_dict(source[key]) return result @staticmethod @@ -42,6 +53,14 @@ def to_dict(self): result['timestamp'] = self.timestamp # 5 if self.version: result['version'] = self.version # 5 + if self.generation: + result['generation'] = self.generation # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 if self.families: result['families'] = FamilyDiscoveryEvent.expand_dict(self.families) # 2 + if self.points: + result['points'] = PointEnumerationEvent.expand_dict(self.points) # 2 + if self.blobs: + result['blobs'] = BlobEnumerationEvent.expand_dict(self.blobs) # 2 return result diff --git a/gencode/python/udmi/schema/event_discovery_blob.py b/gencode/python/udmi/schema/event_discovery_blob.py new file mode 100644 index 0000000000..f47311c5d4 --- /dev/null +++ b/gencode/python/udmi/schema/event_discovery_blob.py @@ -0,0 +1,42 @@ +"""Generated class for event_discovery_blob.json""" + + +class BlobEnumerationEvent: + """Generated schema class""" + + def __init__(self): + self.description = None + self.firmware_set = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = BlobEnumerationEvent() + result.description = source.get('description') + result.firmware_set = source.get('firmware_set') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = BlobEnumerationEvent.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.description: + result['description'] = self.description # 5 + if self.firmware_set: + result['firmware_set'] = self.firmware_set # 5 + return result diff --git a/gencode/python/udmi/schema/event_discovery_family.py b/gencode/python/udmi/schema/event_discovery_family.py index fd09c8f540..f0a50b3e43 100644 --- a/gencode/python/udmi/schema/event_discovery_family.py +++ b/gencode/python/udmi/schema/event_discovery_family.py @@ -6,7 +6,6 @@ class FamilyDiscoveryEvent: def __init__(self): self.id = None - self.group = None @staticmethod def from_dict(source): @@ -14,7 +13,6 @@ def from_dict(source): return None result = FamilyDiscoveryEvent() result.id = source.get('id') - result.group = source.get('group') return result @staticmethod @@ -37,6 +35,4 @@ def to_dict(self): result = {} if self.id: result['id'] = self.id # 5 - if self.group: - result['group'] = self.group # 5 return result diff --git a/gencode/python/udmi/schema/event_discovery_point.py b/gencode/python/udmi/schema/event_discovery_point.py new file mode 100644 index 0000000000..39632931c9 --- /dev/null +++ b/gencode/python/udmi/schema/event_discovery_point.py @@ -0,0 +1,101 @@ +"""Generated class for event_discovery_point.json""" +from .common import Entry + + +class Object1D746D26: + """Generated schema class""" + + def __init__(self): + pass + + @staticmethod + def from_dict(source): + if not source: + return None + result = Object1D746D26() + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = Object1D746D26.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + return result + + +class PointEnumerationEvent: + """Generated schema class""" + + def __init__(self): + self.possible_values = None + self.units = None + self.type = None + self.ref = None + self.writable = None + self.description = None + self.status = None + self.ancillary = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = PointEnumerationEvent() + result.possible_values = source.get('possible_values') + result.units = source.get('units') + result.type = source.get('type') + result.ref = source.get('ref') + result.writable = source.get('writable') + result.description = source.get('description') + result.status = Entry.from_dict(source.get('status')) + result.ancillary = Object1D746D26.from_dict(source.get('ancillary')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = PointEnumerationEvent.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.possible_values: + result['possible_values'] = self.possible_values # 1 + if self.units: + result['units'] = self.units # 5 + if self.type: + result['type'] = self.type # 5 + if self.ref: + result['ref'] = self.ref # 5 + if self.writable: + result['writable'] = self.writable # 5 + if self.description: + result['description'] = self.description # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + if self.ancillary: + result['ancillary'] = self.ancillary.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/metadata_pointset_point.py b/gencode/python/udmi/schema/metadata_pointset_point.py index 7011bbb291..c8018973a4 100644 --- a/gencode/python/udmi/schema/metadata_pointset_point.py +++ b/gencode/python/udmi/schema/metadata_pointset_point.py @@ -6,7 +6,7 @@ class PointPointsetMetadata: def __init__(self): self.units = None - self.writeable = None + self.writable = None self.baseline_value = None self.baseline_tolerance = None self.baseline_state = None @@ -22,7 +22,7 @@ def from_dict(source): return None result = PointPointsetMetadata() result.units = source.get('units') - result.writeable = source.get('writeable') + result.writable = source.get('writable') result.baseline_value = source.get('baseline_value') result.baseline_tolerance = source.get('baseline_tolerance') result.baseline_state = source.get('baseline_state') @@ -53,8 +53,8 @@ def to_dict(self): result = {} if self.units: result['units'] = self.units # 5 - if self.writeable: - result['writeable'] = self.writeable # 5 + if self.writable: + result['writable'] = self.writable # 5 if self.baseline_value: result['baseline_value'] = self.baseline_value # 5 if self.baseline_tolerance: diff --git a/gencode/python/udmi/schema/state.py b/gencode/python/udmi/schema/state.py index 2efef31711..bc46b3cef6 100644 --- a/gencode/python/udmi/schema/state.py +++ b/gencode/python/udmi/schema/state.py @@ -1,6 +1,7 @@ """Generated class for state.json""" from .state_system import SystemState from .state_gateway import GatewayState +from .state_discovery import DiscoveryState from .state_blobset import BlobsetState from .state_pointset import PointsetState @@ -13,6 +14,7 @@ def __init__(self): self.version = None self.system = None self.gateway = None + self.discovery = None self.blobset = None self.pointset = None @@ -25,6 +27,7 @@ def from_dict(source): result.version = source.get('version') result.system = SystemState.from_dict(source.get('system')) result.gateway = GatewayState.from_dict(source.get('gateway')) + result.discovery = DiscoveryState.from_dict(source.get('discovery')) result.blobset = BlobsetState.from_dict(source.get('blobset')) result.pointset = PointsetState.from_dict(source.get('pointset')) return result @@ -55,6 +58,8 @@ def to_dict(self): result['system'] = self.system.to_dict() # 4 if self.gateway: result['gateway'] = self.gateway.to_dict() # 4 + if self.discovery: + result['discovery'] = self.discovery.to_dict() # 4 if self.blobset: result['blobset'] = self.blobset.to_dict() # 4 if self.pointset: diff --git a/gencode/python/udmi/schema/state_discovery.py b/gencode/python/udmi/schema/state_discovery.py new file mode 100644 index 0000000000..6a116fee6a --- /dev/null +++ b/gencode/python/udmi/schema/state_discovery.py @@ -0,0 +1,44 @@ +"""Generated class for state_discovery.json""" +from .state_discovery_family import FamilyDiscoveryState +from .state_discovery_family import FamilyDiscoveryState + + +class DiscoveryState: + """Generated schema class""" + + def __init__(self): + self.enumeration = None + self.families = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryState() + result.enumeration = FamilyDiscoveryState.from_dict(source.get('enumeration')) + result.families = FamilyDiscoveryState.map_from(source.get('families')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.enumeration: + result['enumeration'] = self.enumeration.to_dict() # 4 + if self.families: + result['families'] = FamilyDiscoveryState.expand_dict(self.families) # 2 + return result diff --git a/gencode/python/udmi/schema/state_discovery_family.py b/gencode/python/udmi/schema/state_discovery_family.py new file mode 100644 index 0000000000..a97ee8cf03 --- /dev/null +++ b/gencode/python/udmi/schema/state_discovery_family.py @@ -0,0 +1,47 @@ +"""Generated class for state_discovery_family.json""" +from .common import Entry + + +class FamilyDiscoveryState: + """Generated schema class""" + + def __init__(self): + self.generation = None + self.active = None + self.status = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = FamilyDiscoveryState() + result.generation = source.get('generation') + result.active = source.get('active') + result.status = Entry.from_dict(source.get('status')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = FamilyDiscoveryState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.generation: + result['generation'] = self.generation # 5 + if self.active: + result['active'] = self.active # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/state_pointset.py b/gencode/python/udmi/schema/state_pointset.py index 1e31a650e5..9c3c377aef 100644 --- a/gencode/python/udmi/schema/state_pointset.py +++ b/gencode/python/udmi/schema/state_pointset.py @@ -1,4 +1,5 @@ """Generated class for state_pointset.json""" +from .common import Entry from .state_pointset_point import PointPointsetState @@ -7,6 +8,7 @@ class PointsetState: def __init__(self): self.state_etag = None + self.status = None self.points = None @staticmethod @@ -15,6 +17,7 @@ def from_dict(source): return None result = PointsetState() result.state_etag = source.get('state_etag') + result.status = Entry.from_dict(source.get('status')) result.points = PointPointsetState.map_from(source.get('points')) return result @@ -38,6 +41,8 @@ def to_dict(self): result = {} if self.state_etag: result['state_etag'] = self.state_etag # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 if self.points: result['points'] = PointPointsetState.expand_dict(self.points) # 2 return result diff --git a/gencode/python/udmi/schema/state_system.py b/gencode/python/udmi/schema/state_system.py index 4229f405ac..0a62531653 100644 --- a/gencode/python/udmi/schema/state_system.py +++ b/gencode/python/udmi/schema/state_system.py @@ -1,7 +1,7 @@ """Generated class for state_system.json""" -class ObjectBF5DA4FA: +class Object55044261: """Generated schema class""" def __init__(self): @@ -11,7 +11,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = ObjectBF5DA4FA() + result = Object55044261() result.version = source.get('version') return result @@ -21,7 +21,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = ObjectBF5DA4FA.from_dict(source[key]) + result[key] = Object55044261.from_dict(source[key]) return result @staticmethod @@ -57,7 +57,7 @@ def from_dict(source): result = SystemState() result.make_model = source.get('make_model') result.serial_no = source.get('serial_no') - result.firmware = ObjectBF5DA4FA.from_dict(source.get('firmware')) + result.firmware = Object55044261.from_dict(source.get('firmware')) result.last_config = source.get('last_config') result.operational = source.get('operational') result.status = Entry.from_dict(source.get('status')) diff --git a/pubber/pubber.iml b/pubber/pubber.iml index f36cc73af4..c5f14be6aa 100644 --- a/pubber/pubber.iml +++ b/pubber/pubber.iml @@ -4,6 +4,9 @@ + + + @@ -107,6 +110,5 @@ - diff --git a/pubber/src/main/java/daq/pubber/AbstractPoint.java b/pubber/src/main/java/daq/pubber/AbstractPoint.java index 0bdf446b95..4b7164fd04 100644 --- a/pubber/src/main/java/daq/pubber/AbstractPoint.java +++ b/pubber/src/main/java/daq/pubber/AbstractPoint.java @@ -1,5 +1,6 @@ package daq.pubber; +import udmi.schema.PointEnumerationEvent; import udmi.schema.PointPointsetConfig; import udmi.schema.PointPointsetEvent; import udmi.schema.PointPointsetState; @@ -20,4 +21,6 @@ public interface AbstractPoint { PointPointsetState getState(); void setConfig(PointPointsetConfig config); + + PointEnumerationEvent enumerate(); } diff --git a/pubber/src/main/java/daq/pubber/BasicPoint.java b/pubber/src/main/java/daq/pubber/BasicPoint.java index 2ecbafead7..4227179a21 100644 --- a/pubber/src/main/java/daq/pubber/BasicPoint.java +++ b/pubber/src/main/java/daq/pubber/BasicPoint.java @@ -1,6 +1,7 @@ package daq.pubber; import udmi.schema.Entry; +import udmi.schema.PointEnumerationEvent; import udmi.schema.PointPointsetConfig; import udmi.schema.PointPointsetEvent; import udmi.schema.PointPointsetState; @@ -22,7 +23,7 @@ public abstract class BasicPoint implements AbstractPoint { * Construct a maybe writable point. * * @param name Point name - * @param writable True if writeable + * @param writable True if writable */ public BasicPoint(String name, boolean writable) { this.name = name; @@ -97,4 +98,15 @@ private Entry notWritableStatus() { entry.message = "Point is not writable"; return entry; } + + @Override + public PointEnumerationEvent enumerate() { + PointEnumerationEvent point = new PointEnumerationEvent(); + point.description = getClass().getSimpleName() + " " + getName(); + point.writable = writable ? true : null; + populateEnumeration(point); + return point; + } + + protected abstract void populateEnumeration(PointEnumerationEvent point); } diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 82499e52da..d95f9e2bae 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -27,11 +27,16 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; +import java.util.stream.Collectors; import org.apache.http.ConnectionClosedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import udmi.schema.Config; +import udmi.schema.DiscoveryConfig; +import udmi.schema.DiscoveryEvent; +import udmi.schema.DiscoveryState; import udmi.schema.Entry; +import udmi.schema.FamilyDiscoveryState; import udmi.schema.Firmware; import udmi.schema.Level; import udmi.schema.Metadata; @@ -53,9 +58,6 @@ public class Pubber { private static final String HOSTNAME = System.getenv("HOSTNAME"); - private static final String POINTSET_TOPIC = "events/pointset"; - private static final String SYSTEM_TOPIC = "events/system"; - private static final String STATE_TOPIC = "state"; private static final String CONFIG_TOPIC = "config"; private static final String ERROR_TOPIC = "errors"; @@ -67,13 +69,22 @@ public class Pubber { private static final String OUT_DIR = "out"; private static final String PUBSUB_SITE = "PubSub"; private static final String SWARM_SUBFOLDER = "swarm"; - private static final Set BOOLEAN_UNITS = ImmutableSet.of("foo"); + private static final Set BOOLEAN_UNITS = ImmutableSet.of("No-units"); private static final double DEFAULT_BASELINE_VALUE = 50; private static final String MESSAGE_CATEGORY_FORMAT = "system.%s.%s"; + private static Map DEFAULT_POINTS = ImmutableMap.of( - "recalcitrant_angle", makePointPointsetMetadaa(true, 50, 50, "Celsius"), - "faulty_finding", makePointPointsetMetadaa(true, 40, 0, "deg"), - "superimposition_reading", makePointPointsetMetadaa(false) + "recalcitrant_angle", makePointPointsetMetadata(true, 50, 50, "Celsius"), + "faulty_finding", makePointPointsetMetadata(true, 40, 0, "deg"), + "superimposition_reading", makePointPointsetMetadata(false) + ); + + private static final Map, String> MESSAGE_TOPIC_MAP = ImmutableMap.of( + State.class, "state", + SystemEvent.class, "events/system", + PointsetEvent.class, "events/pointset", + ExtraPointsetEvent.class, "events/pointset", + DiscoveryEvent.class, "events/discovery" ); private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); @@ -104,17 +115,18 @@ public class Pubber { private PubSubClient pubSubClient; private Consumer onDone; private boolean publishingLog; + private Date lastDiscoveryGeneration = new Date(); - private static PointPointsetMetadata makePointPointsetMetadaa(boolean writeable, int value, double tolerance, String units) { + private static PointPointsetMetadata makePointPointsetMetadata(boolean writable, int value, double tolerance, String units) { PointPointsetMetadata pointMetadata = new PointPointsetMetadata(); - pointMetadata.writeable = writeable; + pointMetadata.writable = writable; pointMetadata.baseline_value = value; pointMetadata.baseline_tolerance = tolerance; pointMetadata.units = units; return pointMetadata; } - private static PointPointsetMetadata makePointPointsetMetadaa(boolean writeable) { + private static PointPointsetMetadata makePointPointsetMetadata(boolean writable) { PointPointsetMetadata pointMetadata = new PointPointsetMetadata(); return pointMetadata; } @@ -229,15 +241,15 @@ private void processDeviceMetadata(Metadata metadata) { } private AbstractPoint makePoint(String name, PointPointsetMetadata point) { - boolean writeable = point.writeable != null && point.writeable; + boolean writable = point.writable != null && point.writable; if (BOOLEAN_UNITS.contains(point.units)) { - return new RandomBoolean(name, writeable); + return new RandomBoolean(name, writable); } else { double baseline_value = convertValue(point.baseline_value, DEFAULT_BASELINE_VALUE); double baseline_tolerance = convertValue(point.baseline_tolerance, baseline_value); double min = baseline_value - baseline_tolerance; double max = baseline_value + baseline_tolerance; - return new RandomPoint(name, writeable, min, max, point.units); + return new RandomPoint(name, writable, min, max, point.units); } } @@ -365,7 +377,7 @@ private synchronized void cancelExecutor() { private void sendMessages() { try { updatePoints(); - sendDeviceMessage(configuration.deviceId); + sendDeviceMessage(); if (stateDirty) { publishStateMessage(); } @@ -534,17 +546,7 @@ private void configHandler(Config config) { } catch (Exception e) { throw new RuntimeException("While writing config " + configOut.getPath(), e); } - final int actualInterval; - if (config != null) { - info(String.format("%s received config %s", getTimestamp(), isoConvert(config.timestamp))); - deviceState.system.last_config = config.timestamp; - actualInterval = updateSystemConfig(config.pointset); - updatePointsetConfig(config.pointset); - } else { - info(getTimestamp() + " defaulting empty config"); - actualInterval = DEFAULT_REPORT_SEC * 1000; - } - maybeRestartExecutor(actualInterval); + processConfigUpdate(config); configLatch.countDown(); publisherConfigLog("apply", null); } catch (Exception e) { @@ -553,6 +555,42 @@ private void configHandler(Config config) { publishStateMessage(); } + private void processConfigUpdate(Config config) { + final int actualInterval; + if (config != null) { + info(String.format("%s received config %s", getTimestamp(), isoConvert(config.timestamp))); + deviceState.system.last_config = config.timestamp; + actualInterval = updateSystemConfig(config.pointset); + updatePointsetConfig(config.pointset); + updateDiscoveryConfig(config.discovery); + } else { + info(getTimestamp() + " defaulting empty config"); + actualInterval = DEFAULT_REPORT_SEC * 1000; + } + maybeRestartExecutor(actualInterval); + } + + private void updateDiscoveryConfig(DiscoveryConfig discovery) { + if (discovery == null || discovery.enumeration == null) { + deviceState.discovery = null; + return; + } + Date enumerationGeneration = discovery.enumeration.generation; + if (!enumerationGeneration.after(lastDiscoveryGeneration)) { + return; + } + lastDiscoveryGeneration = enumerationGeneration; + deviceState.discovery = new DiscoveryState(); + deviceState.discovery.enumeration = new FamilyDiscoveryState(); + deviceState.discovery.enumeration.generation = enumerationGeneration; + info("Discovery enumeration generation " + isoConvert(enumerationGeneration)); + DiscoveryEvent discoveryEvent = new DiscoveryEvent(); + discoveryEvent.generation = enumerationGeneration; + discoveryEvent.points = allPoints.stream().collect(Collectors.toMap(AbstractPoint::getName, + AbstractPoint::enumerate)); + publishDeviceMessage(discoveryEvent); + } + private String getTimestamp() { return isoConvert(new Date()); } @@ -608,13 +646,13 @@ private byte[] getFileBytes(String dataFile) { } } - private void sendDeviceMessage(String deviceId) { + private void sendDeviceMessage() { devicePoints.version = 1; devicePoints.timestamp = new Date(); if ((++deviceMessageCount) % MESSAGE_REPORT_INTERVAL == 0) { info(String.format("%s sending test message #%d", isoConvert(devicePoints.timestamp), deviceMessageCount)); } - publishMessage(deviceId, POINTSET_TOPIC, devicePoints); + publishDeviceMessage(devicePoints); } private void pubberLogMessage(String logMessage, Level level, String timestamp) { @@ -631,7 +669,7 @@ private void publishLogMessage(Entry report) { systemEvent.version = 1; systemEvent.timestamp = new Date(); systemEvent.logentries.add(report); - publishMessage(configuration.deviceId, SYSTEM_TOPIC, systemEvent); + publishDeviceMessage(systemEvent); } private void publishStateMessage() { @@ -642,19 +680,23 @@ private void publishStateMessage() { return; } deviceState.timestamp = new Date(); - String deviceId = configuration.deviceId; info(String.format("update state %s", isoConvert(deviceState.timestamp))); stateDirty = false; - publishMessage(deviceId, STATE_TOPIC, deviceState); + publishDeviceMessage(deviceState); lastStateTimeMs = System.currentTimeMillis(); } - private void publishMessage(String deviceId, String topic, Object message) { + private void publishDeviceMessage(Object message) { if (mqttPublisher == null) { warn("Ignoring publish message b/c connection is shutdown"); return; } - mqttPublisher.publish(deviceId, topic, message); + String topic = MESSAGE_TOPIC_MAP.get(message.getClass()); + if (topic == null) { + error("Unknown message class " + message.getClass()); + return; + } + mqttPublisher.publish(configuration.deviceId, topic, message); String fileName = topic.replace("/", "_") + ".json"; File stateOut = new File(OUT_DIR, fileName); diff --git a/pubber/src/main/java/daq/pubber/RandomBoolean.java b/pubber/src/main/java/daq/pubber/RandomBoolean.java index c9b64ca3af..8d08c5e968 100644 --- a/pubber/src/main/java/daq/pubber/RandomBoolean.java +++ b/pubber/src/main/java/daq/pubber/RandomBoolean.java @@ -1,5 +1,7 @@ package daq.pubber; +import udmi.schema.PointEnumerationEvent; + /** * Represents a random boolean point. */ @@ -17,4 +19,10 @@ Object getValue() { protected boolean validateValue(Object setValue) { return setValue instanceof Boolean; } + + @Override + protected void populateEnumeration(PointEnumerationEvent point) { + point.type = "multistate"; + point.possible_values = null; // Need multi-state values here + } } diff --git a/pubber/src/main/java/daq/pubber/RandomPoint.java b/pubber/src/main/java/daq/pubber/RandomPoint.java index 150ee54688..50c6e0d7ff 100644 --- a/pubber/src/main/java/daq/pubber/RandomPoint.java +++ b/pubber/src/main/java/daq/pubber/RandomPoint.java @@ -1,5 +1,7 @@ package daq.pubber; +import udmi.schema.PointEnumerationEvent; + /** * Represents a randomly generated numerical point. */ @@ -8,12 +10,13 @@ public class RandomPoint extends BasicPoint implements AbstractPoint { private final String name; private final double min; private final double max; + private final String units; /** * Creates a random point generator for data simulation. * * @param name point name - * @param writable indicates if point is writeable + * @param writable indicates if point is writable * @param min minimum value for generated point * @param max maximum value for generated point * @param units units of generated point @@ -23,6 +26,7 @@ public RandomPoint(String name, boolean writable, double min, double max, String this.name = name; this.min = min; this.max = max; + this.units = units; } @Override @@ -42,4 +46,9 @@ protected boolean validateValue(Object setValue) { } return false; } + + @Override + protected void populateEnumeration(PointEnumerationEvent point) { + point.units = units; + } } diff --git a/schema/common.json b/schema/common.json index ccfbec64f8..ff5ba47626 100644 --- a/schema/common.json +++ b/schema/common.json @@ -45,6 +45,9 @@ "timestamp", "level" ] + }, + "families": { + "enum": [ "bacnet", "ipv4", "ipv6" ] } } } diff --git a/schema/config.json b/schema/config.json index 94c8284995..89ca2d7ab3 100644 --- a/schema/config.json +++ b/schema/config.json @@ -27,6 +27,9 @@ "gateway": { "$ref": "file:config_gateway.json#" }, + "discovery": { + "$ref": "file:config_discovery.json#" + }, "localnet": { "$ref": "file:config_localnet.json#" }, diff --git a/schema/config_discovery.json b/schema/config_discovery.json new file mode 100644 index 0000000000..b3970a226d --- /dev/null +++ b/schema/config_discovery.json @@ -0,0 +1,21 @@ +{ + "title": "Discovery Config", + "description": "Configuration for [discovery](../docs/specs/discovery.md)", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "enumeration": { + "$ref": "file:config_discovery_family.json#" + }, + "families": { + "description": "Address family results for a scan. Not included for device enumeration messages.", + "additionalProperties": false, + "patternProperties": { + "^iot|bacnet|ipv4|ipv6|ethmac$": { + "$ref": "file:config_discovery_family.json" + } + } + } + } +} diff --git a/schema/config_discovery_family.json b/schema/config_discovery_family.json new file mode 100644 index 0000000000..37e3c35ba3 --- /dev/null +++ b/schema/config_discovery_family.json @@ -0,0 +1,28 @@ +{ + "title": "Family Discovery Config", + "description": "Configuration for [discovery](../docs/specs/discovery.md)", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "generation": { + "description": "Generational marker for controlling discovery", + "type": "string", + "format": "date-time" + }, + "scan_interval_sec": { + "description": "Period, in seconds, for automatic scanning", + "type": "integer", + "minimum": 0 + }, + "scan_duration_sec": { + "description": "Scan duration, in seconds", + "type": "integer", + "minimum": 0 + }, + "enumerate": { + "description": "Indicates implicit enumeration of discovered devices", + "type": "boolean" + } + } +} diff --git a/schema/config_gateway.json b/schema/config_gateway.json index 5e66117f36..31004203d6 100644 --- a/schema/config_gateway.json +++ b/schema/config_gateway.json @@ -4,9 +4,6 @@ "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, - "required": [ - "proxy_ids" - ], "properties": { "proxy_ids": { "description": "An array of all the device IDs which are bound to the device", diff --git a/schema/event_discovery.json b/schema/event_discovery.json index 086e903fd1..246b916763 100644 --- a/schema/event_discovery.json +++ b/schema/event_discovery.json @@ -1,6 +1,6 @@ { - "title": "Discovery", - "description": "[Discovery Documentation](../docs/specs/discovery.md)", + "title": "Discovery Event", + "description": "[Discovery result](../docs/specs/discovery.md) with implicit enumeration", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, @@ -13,23 +13,53 @@ }, "version": { "description": "Major version of the UDMI schema", - "enum": [ - 1 - ] + "type": "integer", + "minimum": 1, + "maximum": 1 + }, + "generation": { + "description": "The event's discovery scan trigger's generation timestamp", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, + "status": { + "$ref": "file:common.json#/definitions/entry" }, "families": { - "description": "Collection of address families identifying the scan target", + "description": "Address family results for a scan. Not included for device enumeration messages.", + "type": "object", "additionalProperties": false, "patternProperties": { - "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { + "^iot|bacnet|ipv4|ipv6|ethmac$": { "$ref": "file:event_discovery_family.json" } } + }, + "points": { + "description": "Collection of data points available for this device.", + "additionalProperties": false, + "existingJavaType": "java.util.Map", + "patternProperties": { + "^[a-zA-Z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$": { + "$ref": "file:event_discovery_point.json#" + } + } + }, + "blobs": { + "description": "Collection of data blobs recognized by this device.", + "additionalProperties": false, + "existingJavaType": "java.util.HashMap", + "patternProperties": { + "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { + "$ref": "file:event_discovery_blob.json#" + } + } } }, "required": [ "timestamp", "version", - "families" + "generation" ] } diff --git a/schema/event_discovery_blob.json b/schema/event_discovery_blob.json new file mode 100644 index 0000000000..317d26b316 --- /dev/null +++ b/schema/event_discovery_blob.json @@ -0,0 +1,17 @@ +{ + "title": "Blob Enumeration Event", + "description": "Object representation for for a single blob enumeration", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "description": { + "description": "Description of this blob", + "type": "string" + }, + "firmware_set": { + "description": "Indicating if this blob is part of the device's firmware set", + "type": "boolean" + } + } +} diff --git a/schema/event_discovery_family.json b/schema/event_discovery_family.json index 10d5d07d95..9d04cc52fd 100644 --- a/schema/event_discovery_family.json +++ b/schema/event_discovery_family.json @@ -3,13 +3,12 @@ "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, + "description": "Discovery information for an individual protocol family.", "properties": { "id": { "type": "string", - "pattern": "^[-_.:/0-9a-zA-Z]+$" - }, - "group": { - "type": "string" + "pattern": "^[-_.:0-9a-zA-Z]+$", + "description": "Device id in the namespace of the given family" } }, "required": [ diff --git a/schema/event_discovery_point.json b/schema/event_discovery_point.json new file mode 100644 index 0000000000..f68cad9cca --- /dev/null +++ b/schema/event_discovery_point.json @@ -0,0 +1,43 @@ +{ + "title": "Point Enumeration Event", + "description": "Object representation for for a single point enumeration", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "possible_values": { + "description": "List of possible enumerated values for the point", + "type": "array", + "items": { + "type": "string" + } + }, + "units": { + "description": "Current or default unit for this point", + "type": "string" + }, + "type": { + "description": "Current or default type for this point", + "type": "string" + }, + "ref": { + "description": "Reference parameter for this point (e.g. BACnet object)", + "type": "string" + }, + "writable": { + "description": "Indicates if this point is writable or not", + "type": "boolean" + }, + "description": { + "description": "Human-readable description of this point", + "type": "string" + }, + "status": { + "$ref": "file:common.json#/definitions/entry" + }, + "ancillary": { + "description": "Arbitrary blob of json associated with this point", + "type": "object" + } + } +} diff --git a/schema/event_pointset_point.json b/schema/event_pointset_point.json index dd976cd521..deafabfdfd 100644 --- a/schema/event_pointset_point.json +++ b/schema/event_pointset_point.json @@ -7,7 +7,7 @@ "properties": { "present_value": { "description": "The specific point data reading", - "examples": [24.1, true, 4] + "examples": [24.1, "running", 4] } }, "required": [ diff --git a/schema/metadata_pointset_point.json b/schema/metadata_pointset_point.json index 112794f6d4..feb018b4e5 100644 --- a/schema/metadata_pointset_point.json +++ b/schema/metadata_pointset_point.json @@ -9,7 +9,7 @@ "description": "Expected unit configuration for the point", "type": "string" }, - "writeable": { + "writable": { "description": "Indicates if this point is writable (else read-only)", "type": "boolean" }, diff --git a/schema/state.json b/schema/state.json index c9f718cc3f..af9054240f 100644 --- a/schema/state.json +++ b/schema/state.json @@ -28,6 +28,9 @@ "gateway": { "$ref": "file:state_gateway.json#" }, + "discovery": { + "$ref": "file:state_discovery.json#" + }, "blobset": { "$ref": "file:state_blobset.json#" }, diff --git a/schema/state_discovery.json b/schema/state_discovery.json new file mode 100644 index 0000000000..63219a3f78 --- /dev/null +++ b/schema/state_discovery.json @@ -0,0 +1,21 @@ +{ + "title": "Discovery State", + "description": "State for [discovery](../docs/specs/discovery.md)", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "enumeration": { + "$ref": "file:state_discovery_family.json#" + }, + "families": { + "description": "Discovery protocol families", + "additionalProperties": false, + "patternProperties": { + "^iot|bacnet|ipv4|ipv6|ethmac$": { + "$ref": "file:state_discovery_family.json" + } + } + } + } +} diff --git a/schema/state_discovery_family.json b/schema/state_discovery_family.json new file mode 100644 index 0000000000..36a4efd122 --- /dev/null +++ b/schema/state_discovery_family.json @@ -0,0 +1,22 @@ +{ + "title": "Family Discovery State", + "description": "State for [discovery](../docs/specs/discovery.md)", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "generation": { + "description": "Generational marker for controlling discovery", + "type": "string", + "format": "date-time" + }, + "active": { + "type": "boolean", + "description": "Indicates if the discovery process is currently active" + }, + "status": { + "description": "Status information about the discovery operation", + "$ref": "file:common.json#/definitions/entry" + } + } +} diff --git a/schema/state_gateway.json b/schema/state_gateway.json index a7cbf9ba60..e83a2b8a02 100644 --- a/schema/state_gateway.json +++ b/schema/state_gateway.json @@ -4,9 +4,6 @@ "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, - "required": [ - "error_ids" - ], "properties": { "error_ids": { "type": "array", diff --git a/schema/state_pointset.json b/schema/state_pointset.json index 20a4828313..057f89e046 100644 --- a/schema/state_pointset.json +++ b/schema/state_pointset.json @@ -10,6 +10,10 @@ "type": "string", "maxLength": 32 }, + "status": { + "description": "Optional status information about pointset", + "$ref": "file:common.json#/definitions/entry" + }, "points": { "description": "Collection of point names, defining the representative point set for this device.", "additionalProperties": false, diff --git a/schema/state_pointset_point.json b/schema/state_pointset_point.json index bdf539a1c8..b14590e63e 100644 --- a/schema/state_pointset_point.json +++ b/schema/state_pointset_point.json @@ -10,7 +10,7 @@ "type": "string" }, "value_state": { - "description": "Optional enumeration indicating the state of the points value. Valid `value_state` settings include:\n* __: No `set_value` _config_ has been specified, the source is device-native.\n* _applied_: The `set_value` _config_ has been successfully applied.\n* _overridden_: The _config_ setting is being overridden by another source.\n* _invalid_: A problem has been identified with the _config_ setting.\n* _failure_: The _config_ is fine, but a problem has been encountered applying the setting.\nWhen the value state indicates an error state, an assosciated status entry should be included", + "description": "Optional enumeration indicating the state of the points value.", "enum": [ "applied", "updating", diff --git a/schema/state_system.json b/schema/state_system.json index 73900f2252..673eb0787b 100644 --- a/schema/state_system.json +++ b/schema/state_system.json @@ -16,7 +16,7 @@ "examples": ["A1B2C3D4", "00001"] }, "firmware": { - "description": "Information about the physical device firmware", + "description": "Information about the device firmware", "type": "object", "additionalProperties": false, "properties": { diff --git a/tests/config.tests/continuous.json b/tests/config.tests/continuous.json new file mode 100644 index 0000000000..2a8b485b49 --- /dev/null +++ b/tests/config.tests/continuous.json @@ -0,0 +1,15 @@ +// +// MQTT topic: /devices/{device_id}/config +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "discovery": { + "families": { + "bacnet": { + "scan_interval_sec": 600 + } + } + } +} diff --git a/tests/event_discovery.json/example.out b/tests/config.tests/continuous.out similarity index 100% rename from tests/event_discovery.json/example.out rename to tests/config.tests/continuous.out diff --git a/tests/config.tests/discovery.json b/tests/config.tests/discovery.json new file mode 100644 index 0000000000..f8b8471044 --- /dev/null +++ b/tests/config.tests/discovery.json @@ -0,0 +1,15 @@ +// +// MQTT topic: /devices/{device_id}/config +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "discovery": { + "families": { + "bacnet": { + "generation": "2018-08-26T21:00:13Z" + } + } + } +} diff --git a/tests/config.tests/discovery.out b/tests/config.tests/discovery.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/config.tests/enumeration.json b/tests/config.tests/enumeration.json new file mode 100644 index 0000000000..06bb3694d9 --- /dev/null +++ b/tests/config.tests/enumeration.json @@ -0,0 +1,13 @@ +// +// MQTT topic: /devices/{device_id}/config +// where {device_id} is that of the enumerated node +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "discovery": { + "enumeration": { + "generation": "2018-08-26T21:37:12Z" + } + } +} diff --git a/tests/config.tests/enumeration.out b/tests/config.tests/enumeration.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/config.tests/implicit.json b/tests/config.tests/implicit.json new file mode 100644 index 0000000000..1ea09f8b9d --- /dev/null +++ b/tests/config.tests/implicit.json @@ -0,0 +1,16 @@ +// +// MQTT topic: /devices/{device_id}/config +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "discovery": { + "families": { + "bacnet": { + "generation": "2018-08-26T21:00:13Z", + "enumerate": true + } + } + } +} diff --git a/tests/config.tests/implicit.out b/tests/config.tests/implicit.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/config.tests/periodic.json b/tests/config.tests/periodic.json new file mode 100644 index 0000000000..fb0b92cf57 --- /dev/null +++ b/tests/config.tests/periodic.json @@ -0,0 +1,17 @@ +// +// MQTT topic: /devices/{device_id}/config +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "discovery": { + "families": { + "bacnet": { + "generation": "2018-08-26T21:00:13Z", + "scan_interval_sec": 600, + "scan_duration_sec": 60 + } + } + } +} diff --git a/tests/config.tests/periodic.out b/tests/config.tests/periodic.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/event_discovery.json/empty.out b/tests/event_discovery.json/empty.out deleted file mode 100644 index 5a54e24594..0000000000 --- a/tests/event_discovery.json/empty.out +++ /dev/null @@ -1,5 +0,0 @@ -Validating 1 schemas - Validating 1 files against event_discover.json - Against input event_discover.tests/empty.json - 1 schema violations found - object has missing required properties (["families","timestamp","version"]) diff --git a/tests/event_discovery.json/errors.out b/tests/event_discovery.json/errors.out deleted file mode 100644 index 413dfd750a..0000000000 --- a/tests/event_discovery.json/errors.out +++ /dev/null @@ -1,9 +0,0 @@ -Validating 1 schemas - Validating 1 files against event_discover.json - Against input event_discover.tests/errors.json - 5 schema violations found - ECMA 262 regex "^[-_.:/0-9a-zA-Z]+$" does not match input string "92E*A09" - object has missing required properties (["id"]) - object instance has properties which are not allowed by the schema: ["addr"] - object instance has properties which are not allowed by the schema: ["id","points"] - object instance has properties which are not allowed by the schema: ["mac-addr"] diff --git a/tests/event_discovery.json/example.json b/tests/event_discovery.json/example.json deleted file mode 100644 index 7c04d79d71..0000000000 --- a/tests/event_discovery.json/example.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "timestamp": "2018-08-26T21:39:29.364Z", - "families": { - "bacnet": { - "id": "92EA09" - }, - "inet4": { - "id": "192.168.1.2/16" - }, - "inet6": { - "id": "fe80::d05c:1a90:dd9e:a582/64" - }, - "macaddr": { - "group": "vlan182", - "id": "0e:93:32:11:04:82" - } - } -} diff --git a/tests/event_discovery.tests/continuous.json b/tests/event_discovery.tests/continuous.json new file mode 100644 index 0000000000..5b117639d8 --- /dev/null +++ b/tests/event_discovery.tests/continuous.json @@ -0,0 +1,24 @@ +// +// Sent on MQTT topic: /devices/{device_id}/events/discovery +// where {device_id} is that of the discovery node. The +// discovered {device_id} should be taken from the provided families. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "generation": "2018-08-26T22:00:13Z", + "families": { + "bacnet": { + "id": "92EA09" + }, + "ipv4": { + "id": "192.168.1.2" + }, + "ipv6": { + "id": "fe80::d05c:1a90:dd9e:a582" + }, + "ethmac": { + "id": "0e:93:32:11:04:82" + } + } +} diff --git a/tests/event_discovery.tests/continuous.out b/tests/event_discovery.tests/continuous.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/event_discovery.tests/discovery.json b/tests/event_discovery.tests/discovery.json new file mode 100644 index 0000000000..e2b25b8d4a --- /dev/null +++ b/tests/event_discovery.tests/discovery.json @@ -0,0 +1,24 @@ +// +// Sent on MQTT topic: /devices/{device_id}/events/discovery +// where {device_id} is that of the discovery node. The +// discovered {device_id} should be taken from the provided families. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "generation": "2018-08-26T21:00:13Z", + "families": { + "bacnet": { + "id": "92EA09" + }, + "ipv4": { + "id": "192.168.1.2" + }, + "ipv6": { + "id": "fe80::d05c:1a90:dd9e:a582" + }, + "ethmac": { + "id": "0e:93:32:11:04:82" + } + } +} diff --git a/tests/event_discovery.tests/discovery.out b/tests/event_discovery.tests/discovery.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/event_discovery.json/empty.json b/tests/event_discovery.tests/empty.json similarity index 100% rename from tests/event_discovery.json/empty.json rename to tests/event_discovery.tests/empty.json diff --git a/tests/event_discovery.tests/empty.out b/tests/event_discovery.tests/empty.out new file mode 100644 index 0000000000..6b03adeb36 --- /dev/null +++ b/tests/event_discovery.tests/empty.out @@ -0,0 +1,5 @@ +Validating 1 schemas + Validating 1 files against event_discovery.json + Against input event_discovery.tests/empty.json + 1 schema violations found + object has missing required properties (["generation","timestamp","version"]) diff --git a/tests/event_discovery.tests/enumeration.json b/tests/event_discovery.tests/enumeration.json new file mode 100644 index 0000000000..70d01bb990 --- /dev/null +++ b/tests/event_discovery.tests/enumeration.json @@ -0,0 +1,86 @@ +// +// Sent on MQTT topic: /devices/{device_id}/events/discovery +// where {device_id} is that of the enumerated node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:42:12.237Z", + "generation": "2018-08-26T21:37:12Z", + "points": { + // Numerical value with an articulated unit + "sup_flow_actual_avo_1": { + "units": "percent", // with units, type typically defaults to 'number' + "ref": "analog-value_29", // Internal reference used on-prem (e.g. reference to bacnet property) + "writable": true, + "description": "Basic value reading" + }, + // Multi-state enumerated value + "zone_mode_msv_1": { + "possible_values": [ "Deadband Mode", "Heating Mode", "Cooling Mode" ], + "type": "multistate" // enumerated values defining the multistate + }, + // Example boolean value, which is just a degenerate case of multi-state + "ztmp_hi_alm_1": { + "possible_values": [ "Off", "On" ], + "type": "multistate" // enumerated values, can be mapped to inactive/active boolean states + }, + // General-purpose string value, e.g. for a descriptive string + "string_value": { + "type": "string" + }, + // Representation of a point with unknown/arbitrary parameters + "NClass_1": { + "ref": "notification-class_1", + // 'notificaiton-class' is not a UDMI-defined type, so can't be exported outside of object-type + "ancillary": { // arbitrary json not codifed with a UDMI schema + "object-type": "notification-class", + "ack-required": [ + false, + false, + false + ], + "recipient-list": [ + { + "fromTime": { + "hour": 0, + "minute": 0, + "second": 0, + "hundredth": 0 + }, + "toTime": { + "hour": 23, + "minute": 59, + "second": 59, + "hundredth": 99 + }, + "recipient": { + "address": "Address [networkNumber=27000, macAddress=[64,45,41,32,ba,c0]]" + }, + "processIdentifier": 1, + "validDays": [ + true, + true, + true, + true, + true, + true, + true + ], + "issueConfirmedNotifications": true, + "transitions": [ + true, + true, + true + ] + } + ], + "notification-class": 1, + "priority": [ + 128, + 64, + 128 + ] + } + } + } +} diff --git a/tests/event_discovery.tests/enumeration.out b/tests/event_discovery.tests/enumeration.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/event_discovery.json/errors.json b/tests/event_discovery.tests/errors.json similarity index 95% rename from tests/event_discovery.json/errors.json rename to tests/event_discovery.tests/errors.json index acd857e49f..ef1c87c777 100644 --- a/tests/event_discovery.json/errors.json +++ b/tests/event_discovery.tests/errors.json @@ -9,7 +9,7 @@ "ip_v4": { "addr": "192.168.1.2" }, - "mac-addr": { + "mac": { "group": "vlan182", "id": "0e:93:32:11:04:82" } diff --git a/tests/event_discovery.tests/errors.out b/tests/event_discovery.tests/errors.out new file mode 100644 index 0000000000..8ffebfb919 --- /dev/null +++ b/tests/event_discovery.tests/errors.out @@ -0,0 +1,9 @@ +Validating 1 schemas + Validating 1 files against event_discovery.json + Against input event_discovery.tests/errors.json + 5 schema violations found + ECMA 262 regex "^[-_.:0-9a-zA-Z]+$" does not match input string "92E*A09" + object has missing required properties (["generation"]) + object instance has properties which are not allowed by the schema: ["bad_entity_name_"] + object instance has properties which are not allowed by the schema: ["id"] + object instance has properties which are not allowed by the schema: ["ip_v4","mac"] diff --git a/tests/event_discovery.tests/implicit.json b/tests/event_discovery.tests/implicit.json new file mode 100644 index 0000000000..1927b054e0 --- /dev/null +++ b/tests/event_discovery.tests/implicit.json @@ -0,0 +1,37 @@ +// +// Discovery result for a network scan (e.g. BACnet discovery scan), including +// an implicit object point enumeration. +// +// Sent on MQTT topic: /devices/{device_id}/events/discovery +// where {device_id} is that of the discovery node (e.g. gateway). The {device_id} +// of the enumerated node is provided by families.iot.id in the message payload. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "generation": "2018-08-26T21:37:12Z", + "families": { + "iot": { + "id": "AHU-1" + }, + "bacnet": { + "id": "92EA09" + }, + "ipv4": { + "id": "192.168.1.2" + }, + "ipv6": { + "id": "fe80::d05c:1a90:dd9e:a582" + }, + "ethmac": { + "id": "0e:93:32:11:04:82" + } + }, + "points": { + "sup_flow_actual_avo_1": { + "units": "percent", + "ref": "analog-value_29", + "description": "Basic value reading" + } + } +} diff --git a/tests/event_discovery.tests/implicit.out b/tests/event_discovery.tests/implicit.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/event_discovery.tests/point_error.json b/tests/event_discovery.tests/point_error.json new file mode 100644 index 0000000000..a9bda46d81 --- /dev/null +++ b/tests/event_discovery.tests/point_error.json @@ -0,0 +1,31 @@ +// +// Discovery result for a network scan (e.g. BACnet discovery scan), including +// an implicit object point enumeration. +// +// Sent on MQTT topic: /devices/{device_id}/events/discovery +// where {device_id} is that of the discovery node (e.g. gateway). The {device_id} +// of the enumerated node is provided by families.iot.id in the message payload. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "generation": "2018-08-26T21:37:12Z", + "families": { + "iot": { + "id": "AHU-1" + } + }, + "points": { + "sup_flow_actual_avo_1": { + "status": { + "message": "Timeout during point communication", + "category": "discovery.bacnet.timeout", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 600 + } + }, + "another_point": { + "description": "Nothing to see here! All is good." + } + } +} diff --git a/tests/event_discovery.tests/point_error.out b/tests/event_discovery.tests/point_error.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/event_discovery.tests/scan_error.json b/tests/event_discovery.tests/scan_error.json new file mode 100644 index 0000000000..465eab587d --- /dev/null +++ b/tests/event_discovery.tests/scan_error.json @@ -0,0 +1,30 @@ +// +// Sent on MQTT topic: /devices/{device_id}/events/discovery +// where {device_id} is that of the discovery node. The +// discovered {device_id} should be taken from the provided families. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:42:12.237Z", + "generation": "2018-08-26T21:37:12Z", + "families": { + "bacnet": { + "id": "92EA09" + }, + "ipv4": { + "id": "192.168.1.2" + }, + "ipv6": { + "id": "fe80::d05c:1a90:dd9e:a582" + }, + "ethmac": { + "id": "0e:93:32:11:04:82" + } + }, + "status": { + "message": "Could not find all points", + "category": "discovery.enumeration.incomplete", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 600 + } +} diff --git a/tests/event_discovery.tests/scan_error.out b/tests/event_discovery.tests/scan_error.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/metadata.tests/example.json b/tests/metadata.tests/example.json index 15388b231a..25335e88b5 100644 --- a/tests/metadata.tests/example.json +++ b/tests/metadata.tests/example.json @@ -33,7 +33,7 @@ "baseline_tolerance": 2 }, "room_setpoint": { - "writeable": true, + "writable": true, "units": "Degrees-Celsius", "baseline_value": 20, "baseline_state": "applied" diff --git a/tests/state.tests/continuous.json b/tests/state.tests/continuous.json new file mode 100644 index 0000000000..46c3fc8dc1 --- /dev/null +++ b/tests/state.tests/continuous.json @@ -0,0 +1,24 @@ +// +// MQTT topic: /devices/{device_id}/state +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "system": { + "make_model": "ACME Bird Trap", + "firmware": { + "version": "3.2a" + }, + "serial_no": "182732142", + "last_config": "2018-08-26T21:49:29.364Z", + "operational": true + }, + "discovery": { + "families": { + "bacnet": { + "active": true + } + } + } +} diff --git a/tests/state.tests/continuous.out b/tests/state.tests/continuous.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state.tests/discovery.json b/tests/state.tests/discovery.json new file mode 100644 index 0000000000..cdc1a85486 --- /dev/null +++ b/tests/state.tests/discovery.json @@ -0,0 +1,25 @@ +// +// MQTT topic: /devices/{device_id}/state +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "system": { + "make_model": "ACME Bird Trap", + "firmware": { + "version": "3.2a" + }, + "serial_no": "182732142", + "last_config": "2018-08-26T21:49:29.364Z", + "operational": true + }, + "discovery": { + "families": { + "bacnet": { + "generation": "2018-08-26T21:00:13Z", + "active": true + } + } + } +} diff --git a/tests/state.tests/discovery.out b/tests/state.tests/discovery.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state.tests/enumeration.json b/tests/state.tests/enumeration.json new file mode 100644 index 0000000000..270fa3b6ef --- /dev/null +++ b/tests/state.tests/enumeration.json @@ -0,0 +1,28 @@ +// +// MQTT topic: /devices/{device_id}/state +// where {device_id} is that of the enumerated node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "system": { + "make_model": "ACME Bird Trap", + "firmware": { + "version": "3.2a" + }, + "serial_no": "182732142", + "last_config": "2018-08-26T21:49:29.364Z", + "operational": true + }, + "discovery": { + "enumeration": { + "generation": "2018-08-26T21:37:12Z", + "status": { + "message": "Comms channel seems a bit unstable", + "category": "discovery.bacnet.timeout", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 400 + } + } + } +} diff --git a/tests/state.tests/enumeration.out b/tests/state.tests/enumeration.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state.tests/example.json b/tests/state.tests/example.json index 0c8ec7c794..fd9fc2d221 100644 --- a/tests/state.tests/example.json +++ b/tests/state.tests/example.json @@ -17,11 +17,17 @@ } }, "pointset": { + "status": { // Status scoped to overall pointset operation + "message": "Invalid sample time", + "category": "pointset.config", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 800 + }, "points": { "return_air_temperature_sensor": { - "status": { - "message": "Invalid sample time", - "category": "device.config.validate", + "status": { // Status scoped to a specific point in a pointset + "message": "Point return_air_temperature_sensor unable to read value", + "category": "pointset.points.telemetry", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 } diff --git a/tests/state.tests/periodic.json b/tests/state.tests/periodic.json new file mode 100644 index 0000000000..cdc1a85486 --- /dev/null +++ b/tests/state.tests/periodic.json @@ -0,0 +1,25 @@ +// +// MQTT topic: /devices/{device_id}/state +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "system": { + "make_model": "ACME Bird Trap", + "firmware": { + "version": "3.2a" + }, + "serial_no": "182732142", + "last_config": "2018-08-26T21:49:29.364Z", + "operational": true + }, + "discovery": { + "families": { + "bacnet": { + "generation": "2018-08-26T21:00:13Z", + "active": true + } + } + } +} diff --git a/tests/state.tests/periodic.out b/tests/state.tests/periodic.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state.tests/scan_bad.json b/tests/state.tests/scan_bad.json new file mode 100644 index 0000000000..a5644a07d5 --- /dev/null +++ b/tests/state.tests/scan_bad.json @@ -0,0 +1,24 @@ +// +// MQTT topic: /devices/{device_id}/state +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "system": { + "make_model": "ACME Bird Trap", + "firmware": { + "version": "3.2a" + }, + "serial_no": "182732142", + "last_config": "2018-08-26T21:49:29.364Z", + "operational": true + }, + "discovery": { + "families": { + "BACnet": { + "active": true + } + } + } +} diff --git a/tests/state.tests/scan_bad.out b/tests/state.tests/scan_bad.out new file mode 100644 index 0000000000..a4b86cc095 --- /dev/null +++ b/tests/state.tests/scan_bad.out @@ -0,0 +1,5 @@ +Validating 1 schemas + Validating 1 files against state.json + Against input state.tests/scan_bad.json + 1 schema violations found + object instance has properties which are not allowed by the schema: ["BACnet"] diff --git a/tests/state.tests/scan_error.json b/tests/state.tests/scan_error.json new file mode 100644 index 0000000000..31c91903d7 --- /dev/null +++ b/tests/state.tests/scan_error.json @@ -0,0 +1,30 @@ +// +// Device sends on MQTT topic: /devices/{device_id}/state +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "system": { + "make_model": "ACME Bird Trap", + "firmware": { + "version": "3.2a" + }, + "serial_no": "182732142", + "last_config": "2018-08-26T21:49:29.364Z", + "operational": true + }, + "discovery": { + "families": { + "bacnet": { + "generation": "2018-08-26T21:00:13Z", + "status": { + "message": "Timeout during scan", + "category": "discovery.bacnet.timeout", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 600 + } + } + } + } +} diff --git a/tests/state.tests/scan_error.out b/tests/state.tests/scan_error.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state.tests/scan_stop.json b/tests/state.tests/scan_stop.json new file mode 100644 index 0000000000..1cededa044 --- /dev/null +++ b/tests/state.tests/scan_stop.json @@ -0,0 +1,24 @@ +// +// MQTT topic: /devices/{device_id}/state +// where {device_id} is that of the discovery node. +// +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "system": { + "make_model": "ACME Bird Trap", + "firmware": { + "version": "3.2a" + }, + "serial_no": "182732142", + "last_config": "2018-08-26T21:49:29.364Z", + "operational": true + }, + "discovery": { + "families": { + "bacnet": { + "generation": "2018-08-26T21:00:13Z" + } + } + } +} diff --git a/tests/state.tests/scan_stop.out b/tests/state.tests/scan_stop.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/validator/.idea/runConfigurations/BaselineValidator.xml b/validator/.idea/runConfigurations/BaselineValidator.xml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/validator/.idea/runConfigurations/BaselineValidator_broken_config.xml b/validator/.idea/runConfigurations/BaselineValidator_broken_config.xml index e1cc0e02f7..d999a3c80b 100644 --- a/validator/.idea/runConfigurations/BaselineValidator_broken_config.xml +++ b/validator/.idea/runConfigurations/BaselineValidator_broken_config.xml @@ -3,7 +3,7 @@ - diff --git a/validator/.idea/runConfigurations/ConfigValidator.xml b/validator/.idea/runConfigurations/ConfigValidator.xml index b06c037790..ae52e3be0b 100644 --- a/validator/.idea/runConfigurations/ConfigValidator.xml +++ b/validator/.idea/runConfigurations/ConfigValidator.xml @@ -1,11 +1,6 @@ -<<<<<<<< HEAD:validator/.idea/runConfigurations/ConfigValidator.xml -======== - - ->>>>>>>> master:validator/.idea/runConfigurations/WritebackValidator.xml - \ No newline at end of file + diff --git a/validator/.idea/runConfigurations/DiscoveryValidator.xml b/validator/.idea/runConfigurations/DiscoveryValidator.xml new file mode 100644 index 0000000000..39aff383be --- /dev/null +++ b/validator/.idea/runConfigurations/DiscoveryValidator.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/validator/.idea/runConfigurations/WritebackValidator.xml b/validator/.idea/runConfigurations/WritebackValidator.xml index 2c6bb0b230..27dd1df716 100644 --- a/validator/.idea/runConfigurations/WritebackValidator.xml +++ b/validator/.idea/runConfigurations/WritebackValidator.xml @@ -19,4 +19,4 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the configuration was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Major version of the UDMI schema

+
+ + + +

Value must be greater or equal to 1 and lesser or equal to 1

+ + +
+
+
+
diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 77c2e335be..f00ec526c0 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -1452,7 +1452,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - metadata_localnet_subsystem.json

Type: object
+ model_localnet_subsystem.json
Type: object

The type of network

@@ -1648,7 +1648,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - metadata_testing_target.json#

Type: object
+ model_testing_target.json#

Type: object
No Additional Properties @@ -1889,7 +1889,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - metadata_pointset_point.json#

Type: object
+ model_pointset_point.json#
Type: object

Information about a specific point name of the device.

diff --git a/gencode/docs/state.html b/gencode/docs/state.html index 9b33607ab7..1fdac42cd2 100644 --- a/gencode/docs/state.html +++ b/gencode/docs/state.html @@ -3144,6 +3144,92 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the configuration was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Major version of the UDMI schema

+
+ + + +

Value must be greater or equal to 1 and lesser or equal to 1

+ + +
+
+
+
diff --git a/gencode/java/udmi/schema/PointsetConfig.java b/gencode/java/udmi/schema/PointsetConfig.java index 851abcf581..aa9acf459e 100644 --- a/gencode/java/udmi/schema/PointsetConfig.java +++ b/gencode/java/udmi/schema/PointsetConfig.java @@ -18,6 +18,8 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ + "timestamp", + "version", "state_etag", "set_value_expiry", "sample_limit_sec", @@ -27,6 +29,20 @@ @Generated("jsonschema2pojo") public class PointsetConfig { + /** + * RFC 3339 timestamp the configuration was generated + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the configuration was generated") + public Date timestamp; + /** + * Major version of the UDMI schema + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Major version of the UDMI schema") + public Integer version; /** * The `state_etag` of the last _state_ message sent by the device. [Writeback documentation](../docs/specs/sequences/writeback.md) * @@ -69,7 +85,9 @@ public int hashCode() { result = ((result* 31)+((this.sample_rate_sec == null)? 0 :this.sample_rate_sec.hashCode())); result = ((result* 31)+((this.state_etag == null)? 0 :this.state_etag.hashCode())); result = ((result* 31)+((this.set_value_expiry == null)? 0 :this.set_value_expiry.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); result = ((result* 31)+((this.sample_limit_sec == null)? 0 :this.sample_limit_sec.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); result = ((result* 31)+((this.points == null)? 0 :this.points.hashCode())); return result; } @@ -83,7 +101,7 @@ public boolean equals(Object other) { return false; } PointsetConfig rhs = ((PointsetConfig) other); - return ((((((this.sample_rate_sec == rhs.sample_rate_sec)||((this.sample_rate_sec!= null)&&this.sample_rate_sec.equals(rhs.sample_rate_sec)))&&((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag))))&&((this.set_value_expiry == rhs.set_value_expiry)||((this.set_value_expiry!= null)&&this.set_value_expiry.equals(rhs.set_value_expiry))))&&((this.sample_limit_sec == rhs.sample_limit_sec)||((this.sample_limit_sec!= null)&&this.sample_limit_sec.equals(rhs.sample_limit_sec))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + return ((((((((this.sample_rate_sec == rhs.sample_rate_sec)||((this.sample_rate_sec!= null)&&this.sample_rate_sec.equals(rhs.sample_rate_sec)))&&((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag))))&&((this.set_value_expiry == rhs.set_value_expiry)||((this.set_value_expiry!= null)&&this.set_value_expiry.equals(rhs.set_value_expiry))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.sample_limit_sec == rhs.sample_limit_sec)||((this.sample_limit_sec!= null)&&this.sample_limit_sec.equals(rhs.sample_limit_sec))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); } } diff --git a/gencode/java/udmi/schema/PointsetState.java b/gencode/java/udmi/schema/PointsetState.java index ba20bf7397..22c6c3165e 100644 --- a/gencode/java/udmi/schema/PointsetState.java +++ b/gencode/java/udmi/schema/PointsetState.java @@ -1,6 +1,7 @@ package udmi.schema; +import java.util.Date; import java.util.HashMap; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; @@ -17,6 +18,8 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ + "timestamp", + "version", "state_etag", "status", "points" @@ -24,6 +27,20 @@ @Generated("jsonschema2pojo") public class PointsetState { + /** + * RFC 3339 timestamp the configuration was generated + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the configuration was generated") + public Date timestamp; + /** + * Major version of the UDMI schema + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Major version of the UDMI schema") + public Integer version; /** * An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. [Additional information on implementation](../docs/specs/sequences/writeback.md) * @@ -52,6 +69,8 @@ public class PointsetState { public int hashCode() { int result = 1; result = ((result* 31)+((this.state_etag == null)? 0 :this.state_etag.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); result = ((result* 31)+((this.status == null)? 0 :this.status.hashCode())); result = ((result* 31)+((this.points == null)? 0 :this.points.hashCode())); return result; @@ -66,7 +85,7 @@ public boolean equals(Object other) { return false; } PointsetState rhs = ((PointsetState) other); - return ((((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag)))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + return ((((((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag)))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); } } diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index cd79841be4..cda8b2217d 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -15,19 +15,20 @@ from .event_discovery_blob import BlobEnumerationEvent from .event_discovery_family import FamilyDiscoveryEvent from .event_discovery_point import PointEnumerationEvent +from .event_mapping import DiscoveryEvent from .event_pointset import PointsetEvent from .event_pointset_point import PointPointsetEvent from .event_system import SystemEvent from .metadata import Metadata -from .metadata_cloud import CloudMetadata -from .metadata_gateway import GatewayMetadata -from .metadata_localnet import LocalnetMetadata -from .metadata_localnet_subsystem import SubsystemLocalnetMetadata -from .metadata_pointset import PointsetMetadata -from .metadata_pointset_point import PointPointsetMetadata -from .metadata_system import SystemMetadata -from .metadata_testing import TestingMetadata -from .metadata_testing_target import TargetTestingMetadata +from .model_cloud import CloudMetadata +from .model_gateway import GatewayMetadata +from .model_localnet import LocalnetMetadata +from .model_localnet_subsystem import SubsystemLocalnetMetadata +from .model_pointset import PointsetMetadata +from .model_pointset_point import PointPointsetMetadata +from .model_system import SystemMetadata +from .model_testing import TestingMetadata +from .model_testing_target import TargetTestingMetadata from .properties import Properties from .state import State from .state_blobset import BlobsetState diff --git a/gencode/python/udmi/schema/config_pointset.py b/gencode/python/udmi/schema/config_pointset.py index c12c332221..c0415dc1df 100644 --- a/gencode/python/udmi/schema/config_pointset.py +++ b/gencode/python/udmi/schema/config_pointset.py @@ -6,6 +6,8 @@ class PointsetConfig: """Generated schema class""" def __init__(self): + self.timestamp = None + self.version = None self.state_etag = None self.set_value_expiry = None self.sample_limit_sec = None @@ -17,6 +19,8 @@ def from_dict(source): if not source: return None result = PointsetConfig() + result.timestamp = source.get('timestamp') + result.version = source.get('version') result.state_etag = source.get('state_etag') result.set_value_expiry = source.get('set_value_expiry') result.sample_limit_sec = source.get('sample_limit_sec') @@ -42,6 +46,10 @@ def expand_dict(input): def to_dict(self): result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 if self.state_etag: result['state_etag'] = self.state_etag # 5 if self.set_value_expiry: diff --git a/gencode/python/udmi/schema/event_mapping.py b/gencode/python/udmi/schema/event_mapping.py new file mode 100644 index 0000000000..fac601b6a7 --- /dev/null +++ b/gencode/python/udmi/schema/event_mapping.py @@ -0,0 +1,47 @@ +"""Generated class for event_mapping.json""" +from .common import Entry + + +class DiscoveryEvent: + """Generated schema class""" + + def __init__(self): + self.timestamp = None + self.version = None + self.status = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryEvent() + result.timestamp = source.get('timestamp') + result.version = source.get('version') + result.status = Entry.from_dict(source.get('status')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryEvent.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index 03484cf7c2..e54c873205 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -1,10 +1,10 @@ """Generated class for metadata.json""" -from .metadata_cloud import CloudMetadata -from .metadata_system import SystemMetadata -from .metadata_gateway import GatewayMetadata -from .metadata_localnet import LocalnetMetadata -from .metadata_testing import TestingMetadata -from .metadata_pointset import PointsetMetadata +from .model_cloud import CloudMetadata +from .model_system import SystemMetadata +from .model_gateway import GatewayMetadata +from .model_localnet import LocalnetMetadata +from .model_testing import TestingMetadata +from .model_pointset import PointsetMetadata class Metadata: diff --git a/gencode/python/udmi/schema/metadata_cloud.py b/gencode/python/udmi/schema/model_cloud.py similarity index 95% rename from gencode/python/udmi/schema/metadata_cloud.py rename to gencode/python/udmi/schema/model_cloud.py index a764258781..8845ed988c 100644 --- a/gencode/python/udmi/schema/metadata_cloud.py +++ b/gencode/python/udmi/schema/model_cloud.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_cloud.json""" +"""Generated class for model_cloud.json""" class CloudMetadata: diff --git a/gencode/python/udmi/schema/metadata_gateway.py b/gencode/python/udmi/schema/model_gateway.py similarity index 95% rename from gencode/python/udmi/schema/metadata_gateway.py rename to gencode/python/udmi/schema/model_gateway.py index 0034382c40..9b14dcee1c 100644 --- a/gencode/python/udmi/schema/metadata_gateway.py +++ b/gencode/python/udmi/schema/model_gateway.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_gateway.json""" +"""Generated class for model_gateway.json""" class GatewayMetadata: diff --git a/gencode/python/udmi/schema/metadata_localnet.py b/gencode/python/udmi/schema/model_localnet.py similarity index 88% rename from gencode/python/udmi/schema/metadata_localnet.py rename to gencode/python/udmi/schema/model_localnet.py index d6bbb1307b..19bc17ad06 100644 --- a/gencode/python/udmi/schema/metadata_localnet.py +++ b/gencode/python/udmi/schema/model_localnet.py @@ -1,5 +1,5 @@ -"""Generated class for metadata_localnet.json""" -from .metadata_localnet_subsystem import SubsystemLocalnetMetadata +"""Generated class for model_localnet.json""" +from .model_localnet_subsystem import SubsystemLocalnetMetadata class LocalnetMetadata: diff --git a/gencode/python/udmi/schema/metadata_localnet_subsystem.py b/gencode/python/udmi/schema/model_localnet_subsystem.py similarity index 93% rename from gencode/python/udmi/schema/metadata_localnet_subsystem.py rename to gencode/python/udmi/schema/model_localnet_subsystem.py index 97198e9d60..ccec80a68f 100644 --- a/gencode/python/udmi/schema/metadata_localnet_subsystem.py +++ b/gencode/python/udmi/schema/model_localnet_subsystem.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_localnet_subsystem.json""" +"""Generated class for model_localnet_subsystem.json""" class SubsystemLocalnetMetadata: diff --git a/gencode/python/udmi/schema/metadata_pointset.py b/gencode/python/udmi/schema/model_pointset.py similarity index 88% rename from gencode/python/udmi/schema/metadata_pointset.py rename to gencode/python/udmi/schema/model_pointset.py index 7783e7eb98..91bba573ea 100644 --- a/gencode/python/udmi/schema/metadata_pointset.py +++ b/gencode/python/udmi/schema/model_pointset.py @@ -1,5 +1,5 @@ -"""Generated class for metadata_pointset.json""" -from .metadata_pointset_point import PointPointsetMetadata +"""Generated class for model_pointset.json""" +from .model_pointset_point import PointPointsetMetadata class PointsetMetadata: diff --git a/gencode/python/udmi/schema/metadata_pointset_point.py b/gencode/python/udmi/schema/model_pointset_point.py similarity index 97% rename from gencode/python/udmi/schema/metadata_pointset_point.py rename to gencode/python/udmi/schema/model_pointset_point.py index c8018973a4..5b9b37d393 100644 --- a/gencode/python/udmi/schema/metadata_pointset_point.py +++ b/gencode/python/udmi/schema/model_pointset_point.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_pointset_point.json""" +"""Generated class for model_pointset_point.json""" class PointPointsetMetadata: diff --git a/gencode/python/udmi/schema/metadata_system.py b/gencode/python/udmi/schema/model_system.py similarity index 99% rename from gencode/python/udmi/schema/metadata_system.py rename to gencode/python/udmi/schema/model_system.py index 04bc177915..94ba79b70f 100644 --- a/gencode/python/udmi/schema/metadata_system.py +++ b/gencode/python/udmi/schema/model_system.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_system.json""" +"""Generated class for model_system.json""" class Object2CCE4FC0: diff --git a/gencode/python/udmi/schema/metadata_testing.py b/gencode/python/udmi/schema/model_testing.py similarity index 88% rename from gencode/python/udmi/schema/metadata_testing.py rename to gencode/python/udmi/schema/model_testing.py index f78911533e..7f3b287d2d 100644 --- a/gencode/python/udmi/schema/metadata_testing.py +++ b/gencode/python/udmi/schema/model_testing.py @@ -1,5 +1,5 @@ -"""Generated class for metadata_testing.json""" -from .metadata_testing_target import TargetTestingMetadata +"""Generated class for model_testing.json""" +from .model_testing_target import TargetTestingMetadata class TestingMetadata: diff --git a/gencode/python/udmi/schema/metadata_testing_target.py b/gencode/python/udmi/schema/model_testing_target.py similarity index 94% rename from gencode/python/udmi/schema/metadata_testing_target.py rename to gencode/python/udmi/schema/model_testing_target.py index 8c1bfd8f2b..1a02b59550 100644 --- a/gencode/python/udmi/schema/metadata_testing_target.py +++ b/gencode/python/udmi/schema/model_testing_target.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_testing_target.json""" +"""Generated class for model_testing_target.json""" class TargetTestingMetadata: diff --git a/gencode/python/udmi/schema/state_pointset.py b/gencode/python/udmi/schema/state_pointset.py index 9c3c377aef..2d037e21a0 100644 --- a/gencode/python/udmi/schema/state_pointset.py +++ b/gencode/python/udmi/schema/state_pointset.py @@ -7,6 +7,8 @@ class PointsetState: """Generated schema class""" def __init__(self): + self.timestamp = None + self.version = None self.state_etag = None self.status = None self.points = None @@ -16,6 +18,8 @@ def from_dict(source): if not source: return None result = PointsetState() + result.timestamp = source.get('timestamp') + result.version = source.get('version') result.state_etag = source.get('state_etag') result.status = Entry.from_dict(source.get('status')) result.points = PointPointsetState.map_from(source.get('points')) @@ -39,6 +43,10 @@ def expand_dict(input): def to_dict(self): result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 if self.state_etag: result['state_etag'] = self.state_etag # 5 if self.status: diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java index e14271444f..519c429c75 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java @@ -701,7 +701,7 @@ protected String toJsonString(Object message) { throw new RuntimeException("While stringifying message", e); } } - + private T convertTo(Class targetClass, Object message) { if (message == null) { return null; From 37de8a92a425060f18b62a2c86020fa745e55a79 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 7 Apr 2022 08:26:03 -0700 Subject: [PATCH 41/95] Adding missing import --- pubber/src/main/java/daq/pubber/Pubber.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index b65f6b3514..3fcfcf078a 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -39,6 +39,7 @@ import udmi.schema.DiscoveryEvent; import udmi.schema.DiscoveryState; import udmi.schema.Entry; +import udmi.schema.FamilyDiscoveryState; import udmi.schema.Level; import udmi.schema.Metadata; import udmi.schema.PointPointsetConfig; @@ -630,7 +631,7 @@ private void updateDiscoveryConfig(DiscoveryConfig discovery) { AbstractPoint::enumerate)); publishDeviceMessage(discoveryEvent); } - + private String stackTraceString(Throwable e) { OutputStream outputStream = new ByteArrayOutputStream(); try (PrintStream ps = new PrintStream(outputStream)) { From a12f81551743737e0afe688651071e3e6d7eb754 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 7 Apr 2022 08:48:58 -0700 Subject: [PATCH 42/95] Update checks --- etc/sequencer.out | 6 +- pubber/.idea/codeStyles/Project.xml | 582 ++++++++++++++++++++++++++++ 2 files changed, 584 insertions(+), 4 deletions(-) create mode 100644 pubber/.idea/codeStyles/Project.xml diff --git a/etc/sequencer.out b/etc/sequencer.out index 84a54da75b..6f806f8352 100644 --- a/etc/sequencer.out +++ b/etc/sequencer.out @@ -1,8 +1,6 @@ RESULT pass broken_config Sequence complete RESULT pass extra_config Sequence complete -RESULT pass provided_serial_no Sequence complete -RESULT pass provided_serial_no Sequence complete -RESULT pass provided_serial_no Sequence complete -RESULT pass self_enumeration Sequence complete RESULT pass system_last_update Sequence complete +RESULT pass valid_serial_no Sequence complete +RESULT pass valid_serial_no Sequence complete RESULT skip writeback_states Missing 'invalid' target specification diff --git a/pubber/.idea/codeStyles/Project.xml b/pubber/.idea/codeStyles/Project.xml new file mode 100644 index 0000000000..b51387564e --- /dev/null +++ b/pubber/.idea/codeStyles/Project.xml @@ -0,0 +1,582 @@ + + + + + \ No newline at end of file From 69e8031f7dda564e9d09521460a6e3490778f7ae Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 8 Apr 2022 10:56:15 -0700 Subject: [PATCH 43/95] Fix test_schema for empty directories --- bin/test_schema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/test_schema b/bin/test_schema index 9090f7204d..f5c1661a39 100755 --- a/bin/test_schema +++ b/bin/test_schema @@ -62,7 +62,7 @@ fi echo Testing against $subsets for subset in $subsets; do schemaname=${subset%.tests}.json - testfiles=$(cd $testdir/$subset; ls *.json) + testfiles=$(cd $testdir/$subset; ls *.json || true) for testfile in $testfiles; do outfile=${testfile%.json}.out testbase=$testdir/$subset From dac50d22ee5dc4a5cb17866cda9bd5f0de3e3dea Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 13 Apr 2022 15:16:13 -0700 Subject: [PATCH 44/95] Remove extra file --- docs/specs/#use_cases.md# | 1 - 1 file changed, 1 deletion(-) delete mode 100644 docs/specs/#use_cases.md# diff --git a/docs/specs/#use_cases.md# b/docs/specs/#use_cases.md# deleted file mode 100644 index 8b13789179..0000000000 --- a/docs/specs/#use_cases.md# +++ /dev/null @@ -1 +0,0 @@ - From 206e6c8ffa70c531fd7d61437571387a73267d5b Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 14 Apr 2022 07:57:01 -0700 Subject: [PATCH 45/95] Tests cleanup --- .gencode_hash.txt | 12 ++-- gencode/docs/config.html | 6 +- gencode/docs/state.html | 6 +- .../java/udmi/schema/DiscoveryCommand.java | 63 +++++++++++++++++++ gencode/java/udmi/schema/PointsetConfig.java | 6 +- gencode/java/udmi/schema/PointsetState.java | 6 +- gencode/python/udmi/schema/__init__.py | 1 + .../python/udmi/schema/command_discovery.py | 42 +++++++++++++ schema/command_discovery.json | 23 +++++++ schema/config_pointset.json | 6 +- schema/state_pointset.json | 6 +- tests/command_discovery.tests/provision.out | 2 + tests/config.tests/errors.out | 3 +- tests/config.tests/mapping.json | 23 ------- tests/config.tests/proxy.json | 4 +- .../event_mapping.tests/building_config.json | 36 ----------- tests/event_mapping.tests/building_config.out | 0 tests/event_mapping.tests/prediction.json | 13 ---- tests/metadata.tests/gateway.json | 2 +- tests/metadata.tests/proxy.json | 6 +- tests/model_pointset.tests/example.json | 2 +- tests/state.tests/mapping.json | 21 ------- validator/.idea/runConfigurations/Schema.xml | 2 +- .../google/daq/mqtt/validator/Validator.java | 1 - 24 files changed, 164 insertions(+), 128 deletions(-) create mode 100644 gencode/java/udmi/schema/DiscoveryCommand.java create mode 100644 gencode/python/udmi/schema/command_discovery.py create mode 100644 schema/command_discovery.json create mode 100644 tests/command_discovery.tests/provision.out delete mode 100644 tests/config.tests/mapping.json delete mode 100644 tests/event_mapping.tests/building_config.json delete mode 100644 tests/event_mapping.tests/building_config.out delete mode 100644 tests/event_mapping.tests/prediction.json delete mode 100644 tests/state.tests/mapping.json diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 3ea3c61cc5..cabe15dc82 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,4 +1,4 @@ -0e652b4fb4c5b1a6050cb3eb4883862aad704ce231fe28500fe89c8705bd6504 gencode/docs/config.html +9da00f435b13bf779454dc411343f8ecf804ef520403ea5633c107e08242461d gencode/docs/config.html 6371d915647bc852edb7bc446637c2d43d3c3db49661f62d7c27d3d71c6671dd gencode/docs/envelope.html 559379abd267e9719a2bee98e56c21301853b6f69bc37fddc501acc57ce7cd63 gencode/docs/event_discovery.html 987503860562a3971314a98d75890b6c7615fee84bff6bede7010231f469c035 gencode/docs/event_pointset.html @@ -8,7 +8,7 @@ add4d0308ce0688ddcc19e8de74d362847e11b12cb3ff0f9933d42386b02e696 gencode/docs/m 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js -4d5049b07a9e58a97c8c65c2fd68a7ba0fdca06a5ac1782cd29feb4105b47d0d gencode/docs/state.html +891b85eed0ddee056dc8158b82427229aeaa1b2bf3ab2dd36f8f5ba0fdabeb60 gencode/docs/state.html 68f8919d59556c7c781958baaac0b8cc629b6c4ce86e6ffd0171d23536747ec6 gencode/java/udmi/schema/Ancillary.java d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/udmi/schema/Asset.java 0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java @@ -19,6 +19,7 @@ d2c5b5aae8db27b68104fc83a1f38de0a3f1b5d683f2b13599adf24e96c7d124 gencode/java/u b6ff9b8739a9c3bb6972f73db6fc54f451189c13b273e58bc11cb3d82c74ad40 gencode/java/udmi/schema/BlobsetState.java 90d6e869087d4dfdc2c29c7f51872e630ad8135542dd432629bf4edac807053a gencode/java/udmi/schema/CloudMetadata.java 28001569e7902d3aa39aa3749ca08fb8e29460ba97a4b560d266b365bf5f8c46 gencode/java/udmi/schema/Config.java +67ac3441ce6d5d4450741ee7e639174756498e1b3780c2d18ce20562b5a88c26 gencode/java/udmi/schema/DiscoveryCommand.java 3d9a243dcdc6dce31a2b0671d473c60d4cc972087025c7e099f8b4bf85a800da gencode/java/udmi/schema/DiscoveryConfig.java eb3df3042d3c2008e51c35f35074741ba94a5a7fd590b5f1e59bd30ec19b4c2f gencode/java/udmi/schema/DiscoveryEvent.java b9b1c6dc52c28630021c76d51305cb2fe634c557f3cf9b8e5c8c8abf456e6216 gencode/java/udmi/schema/DiscoveryState.java @@ -44,10 +45,10 @@ a4e8f69100ab678a8236f481c558d677bbaea3e76c853bbd9262113d2a9c031d gencode/java/u 8f3fc1cdc2dcd3e524863f4675aebabc450a35f5fd1cdc3fd37289b5cab7f2ec gencode/java/udmi/schema/PointPointsetEvent.java 09a99eddb418ef56a4744f94a1d15815e5c460c5e2bd0ea2badfc0662986a853 gencode/java/udmi/schema/PointPointsetMetadata.java db8d6dd3498019ad12e0f328b6237d07e52f133f8b08858b712611a52c198009 gencode/java/udmi/schema/PointPointsetState.java -0a479bdd401300403c9e7ac5735e3ca29c771ddc96490e623eb4d32543b3f57d gencode/java/udmi/schema/PointsetConfig.java +c6a0571e228490defcb8fba335220b23247aea0e0cb9b657efc1e1e6dbcc0fb3 gencode/java/udmi/schema/PointsetConfig.java f3aea029530d0d8c6f50a75f266fd222d3f5ad92004f40675d6a99c906d22c82 gencode/java/udmi/schema/PointsetEvent.java 7987adebea9103a857493bb7698913d0891fcb4a77cec0e208c655953df82243 gencode/java/udmi/schema/PointsetMetadata.java -4cfd7e5749a6e3d49a5275c7966d1ce687bce62dee2b030a9fc320a118d44754 gencode/java/udmi/schema/PointsetState.java +fc3a9415c04d8a06954dbdbfdff5d68ab113cce3948532c19df555778ffb04fa gencode/java/udmi/schema/PointsetState.java ca2e7566106818ca7e5190c8041eb86f0c9b3251b0bda8c3ea7ce11a0c891a0a gencode/java/udmi/schema/Position.java 6ddce136f5e34e7e8c7d101c8a729f1fdd323befdfa52590ebdf0028f970bdf5 gencode/java/udmi/schema/Properties.java 0a1a025dde88fd46925cbb56f5179ed2803ea97948292809ff328a5201d90a3e gencode/java/udmi/schema/State.java @@ -58,7 +59,8 @@ c46848327791cec1f1e62dbee2ad66951af7f61ed3c56eeaa8e563774e305bf4 gencode/java/u 451217e2cce0ae9224a86f35b3bdea14b36658efe6f94f4a2dff4f4b1dc51cf7 gencode/java/udmi/schema/SystemState.java 27d6b50dc51b373d24a701728b4d43d31fe841a9a1d77fe3e45dac332674c308 gencode/java/udmi/schema/TargetTestingMetadata.java a77e801f3b07cd8b7042adfe8e5e62d7a83b63a1b449a356fa13c846811ab576 gencode/java/udmi/schema/TestingMetadata.java -c7b1951d794ff2f2a27100fdb60b5ddcc3adaa0ce3a8cb2ddf5b41c7e7c31128 gencode/python/udmi/schema/__init__.py +f4810ca551157744e6d3d8fb0c0749ee2bc89c69d427bde67c3d166a6558b844 gencode/python/udmi/schema/__init__.py +6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 704c8f0eec0b87015af8f7e524375f651b3d35f659ec89b4b022f8c1d0813ec5 gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py 191e1926c16b55f4ef350a711f540eef17a0ec60bec8c193c94182786dc3624b gencode/python/udmi/schema/config_blobset.py diff --git a/gencode/docs/config.html b/gencode/docs/config.html index 0010c15f63..c57adbbc0a 100644 --- a/gencode/docs/config.html +++ b/gencode/docs/config.html @@ -1460,13 +1460,13 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - version

Type: integer
-

Major version of the UDMI schema

+ version
Type: string
+

Version of the UDMI schema

-

Value must be greater or equal to 1 and lesser or equal to 1

+
diff --git a/gencode/docs/state.html b/gencode/docs/state.html index 1fdac42cd2..0e2d39b036 100644 --- a/gencode/docs/state.html +++ b/gencode/docs/state.html @@ -3217,13 +3217,13 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - version

Type: integer
-

Major version of the UDMI schema

+ version
Type: string
+

Version of the UDMI schema

-

Value must be greater or equal to 1 and lesser or equal to 1

+
diff --git a/gencode/java/udmi/schema/DiscoveryCommand.java b/gencode/java/udmi/schema/DiscoveryCommand.java new file mode 100644 index 0000000000..2bf4f0061b --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryCommand.java @@ -0,0 +1,63 @@ + +package udmi.schema; + +import java.util.Date; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Discovery Command + *

+ * [Discovery command](../docs/specs/discovery.md) for provisioning + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version" +}) +@Generated("jsonschema2pojo") +public class DiscoveryCommand { + + /** + * RFC 3339 timestamp the discover telemetry event was generated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the discover telemetry event was generated") + public Date timestamp; + /** + * Major version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Major version of the UDMI schema") + public String version; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DiscoveryCommand) == false) { + return false; + } + DiscoveryCommand rhs = ((DiscoveryCommand) other); + return (((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version)))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + +} diff --git a/gencode/java/udmi/schema/PointsetConfig.java b/gencode/java/udmi/schema/PointsetConfig.java index aa9acf459e..d3324f91c9 100644 --- a/gencode/java/udmi/schema/PointsetConfig.java +++ b/gencode/java/udmi/schema/PointsetConfig.java @@ -37,12 +37,12 @@ public class PointsetConfig { @JsonPropertyDescription("RFC 3339 timestamp the configuration was generated") public Date timestamp; /** - * Major version of the UDMI schema + * Version of the UDMI schema * */ @JsonProperty("version") - @JsonPropertyDescription("Major version of the UDMI schema") - public Integer version; + @JsonPropertyDescription("Version of the UDMI schema") + public java.lang.String version; /** * The `state_etag` of the last _state_ message sent by the device. [Writeback documentation](../docs/specs/sequences/writeback.md) * diff --git a/gencode/java/udmi/schema/PointsetState.java b/gencode/java/udmi/schema/PointsetState.java index 22c6c3165e..aaaaf94f2e 100644 --- a/gencode/java/udmi/schema/PointsetState.java +++ b/gencode/java/udmi/schema/PointsetState.java @@ -35,12 +35,12 @@ public class PointsetState { @JsonPropertyDescription("RFC 3339 timestamp the configuration was generated") public Date timestamp; /** - * Major version of the UDMI schema + * Version of the UDMI schema * */ @JsonProperty("version") - @JsonPropertyDescription("Major version of the UDMI schema") - public Integer version; + @JsonPropertyDescription("Version of the UDMI schema") + public java.lang.String version; /** * An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. [Additional information on implementation](../docs/specs/sequences/writeback.md) * diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index cda8b2217d..d116fec621 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -1,3 +1,4 @@ +from .command_discovery import DiscoveryCommand from .common import Common from .config import Config from .config_blobset import BlobsetConfig diff --git a/gencode/python/udmi/schema/command_discovery.py b/gencode/python/udmi/schema/command_discovery.py new file mode 100644 index 0000000000..1d243a5ce5 --- /dev/null +++ b/gencode/python/udmi/schema/command_discovery.py @@ -0,0 +1,42 @@ +"""Generated class for command_discovery.json""" + + +class DiscoveryCommand: + """Generated schema class""" + + def __init__(self): + self.timestamp = None + self.version = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryCommand() + result.timestamp = source.get('timestamp') + result.version = source.get('version') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryCommand.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 + return result diff --git a/schema/command_discovery.json b/schema/command_discovery.json new file mode 100644 index 0000000000..2d8389e6c1 --- /dev/null +++ b/schema/command_discovery.json @@ -0,0 +1,23 @@ +{ + "title": "Discovery Command", + "description": "[Discovery command](../docs/specs/discovery.md) for provisioning", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "timestamp": { + "description": "RFC 3339 timestamp the discover telemetry event was generated", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, + "version": { + "description": "Major version of the UDMI schema", + "type": "string" + } + }, + "required": [ + "timestamp", + "version" + ] +} diff --git a/schema/config_pointset.json b/schema/config_pointset.json index c6facd0851..69061c3bb1 100644 --- a/schema/config_pointset.json +++ b/schema/config_pointset.json @@ -12,10 +12,8 @@ "examples": ["2019-01-17T14:02:29.364Z"] }, "version": { - "description": "Major version of the UDMI schema", - "type": "integer", - "minimum": 1, - "maximum": 1 + "description": "Version of the UDMI schema", + "type": "string" }, "state_etag": { "description": "The `state_etag` of the last _state_ message sent by the device. [Writeback documentation](../docs/specs/sequences/writeback.md)", diff --git a/schema/state_pointset.json b/schema/state_pointset.json index 0702ffe8e7..92e599652f 100644 --- a/schema/state_pointset.json +++ b/schema/state_pointset.json @@ -12,10 +12,8 @@ "examples": ["2019-01-17T14:02:29.364Z"] }, "version": { - "description": "Major version of the UDMI schema", - "type": "integer", - "minimum": 1, - "maximum": 1 + "description": "Version of the UDMI schema", + "type": "string" }, "state_etag": { "description": "An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. [Additional information on implementation](../docs/specs/sequences/writeback.md)", diff --git a/tests/command_discovery.tests/provision.out b/tests/command_discovery.tests/provision.out new file mode 100644 index 0000000000..822eaae055 --- /dev/null +++ b/tests/command_discovery.tests/provision.out @@ -0,0 +1,2 @@ +1 schema violations found + object instance has properties which are not allowed by the schema: ["provision"] diff --git a/tests/config.tests/errors.out b/tests/config.tests/errors.out index f2e2cd1cca..ffb056e087 100644 --- a/tests/config.tests/errors.out +++ b/tests/config.tests/errors.out @@ -1,4 +1,5 @@ -5 schema violations found +6 schema violations found + instance type (integer) does not match any allowed primitive type (allowed: ["string"]) instance type (string) does not match any allowed primitive type (allowed: ["integer"]) object instance has properties which are not allowed by the schema: ["config_etag","id","properties"] object instance has properties which are not allowed by the schema: ["object_type"] diff --git a/tests/config.tests/mapping.json b/tests/config.tests/mapping.json deleted file mode 100644 index 2f739fcdd9..0000000000 --- a/tests/config.tests/mapping.json +++ /dev/null @@ -1,23 +0,0 @@ -// -// This message represents the entire high-level state of a recommendation model. -// -// Note that building id is included as part of the message envelope. -// -{ - "version": "1.3.14", - "timestamp": "2018-08-28T21:39:29.364Z", - "mapping": { - "devices": { - "FCU-123": { - "applied": "2018-08-27T22:39:12.364Z", // Last time a promotion was successfully applied - "requested": "2018-08-27T22:39:12.364Z", // Last time a model export was requested - "status": { - "message": "Update in progress", - "category": "mapping.apply.start", - "timestamp": "2018-08-28T21:39:30.364Z", - "level": 500 - } - } - } - } -} diff --git a/tests/config.tests/proxy.json b/tests/config.tests/proxy.json index 6f56202964..f50523e631 100644 --- a/tests/config.tests/proxy.json +++ b/tests/config.tests/proxy.json @@ -5,9 +5,9 @@ "min_loglevel": 500 }, "localnet": { - "subsystem": { + "families": { "bacnet": { - "local_id": "0x78ce1900" + "local_id": "78ce19" } } }, diff --git a/tests/event_mapping.tests/building_config.json b/tests/event_mapping.tests/building_config.json deleted file mode 100644 index 033e7fb939..0000000000 --- a/tests/event_mapping.tests/building_config.json +++ /dev/null @@ -1,36 +0,0 @@ -// -// This message represents a DBO "buidling_config" entity snippet. -// It could represent data either from an extraction from another system, -// or an output of a promoted staged translation. -// -// The specific building info would be part of the message envelope. -// -{ - "version": "1.3.14", - "timestamp": "2018-08-26T21:39:29.364Z", - "devices": { - "FCU-123": { - "translation": { - "zone_air_temperature_sensor": { - "present_value": "points.temp_1.present_value", - "units": { - "key": "pointset.points.temp_1.units", - "values": { - "degrees_celsius": "degC" - } - } - }, - "supply_air_isolation_damper_command": { - "present_value": "points.damper_1.present_value", - "states": { - "OPEN": "1", - "CLOSED": [ - "2", - "3" - ] - } - } - } - } - } -} diff --git a/tests/event_mapping.tests/building_config.out b/tests/event_mapping.tests/building_config.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/event_mapping.tests/prediction.json b/tests/event_mapping.tests/prediction.json deleted file mode 100644 index 0e2e6ae3fb..0000000000 --- a/tests/event_mapping.tests/prediction.json +++ /dev/null @@ -1,13 +0,0 @@ -// -// This message represents a predictive model for a device. Includes all the -// probabalistic information necessary for an agent (human or otherwise) to -// specify what the actual translation should be. -// -{ - "version": "1.3.14", - "timestamp": "2018-08-26T21:39:29.364Z", - "prediction": { - // Need to include details from staged_equip_response.json - } -} - diff --git a/tests/metadata.tests/gateway.json b/tests/metadata.tests/gateway.json index 0e701903fa..dd5fea1e25 100644 --- a/tests/metadata.tests/gateway.json +++ b/tests/metadata.tests/gateway.json @@ -32,7 +32,7 @@ } }, "localnet": { - "subsystem": { + "families": { "bacnet": { "local_id": "0x991132ec" } diff --git a/tests/metadata.tests/proxy.json b/tests/metadata.tests/proxy.json index 6f20550116..fbcf5e1fb9 100644 --- a/tests/metadata.tests/proxy.json +++ b/tests/metadata.tests/proxy.json @@ -22,9 +22,9 @@ } }, "localnet": { - "subsystem": { + "families": { "bacnet": { - "local_id": "0x82eecd" + "local_id": "82eecd" } } }, @@ -37,7 +37,7 @@ } }, "gateway": { - "subsystem": "bacnet", + "family": "bacnet", "gateway_id": "LTGW-123" } } diff --git a/tests/model_pointset.tests/example.json b/tests/model_pointset.tests/example.json index 2f7fa7be3a..3bcc1234b5 100644 --- a/tests/model_pointset.tests/example.json +++ b/tests/model_pointset.tests/example.json @@ -6,7 +6,7 @@ "baseline_tolerance": 2 }, "room_setpoint": { - "writeable": true, + "writable": true, "units": "Degrees-Celsius", "baseline_value": 20, "baseline_state": "applied" diff --git a/tests/state.tests/mapping.json b/tests/state.tests/mapping.json deleted file mode 100644 index 276e75a932..0000000000 --- a/tests/state.tests/mapping.json +++ /dev/null @@ -1,21 +0,0 @@ -// -// This message represents the entire high-level state of a recommendation model. -// Additional messages would be required to detail specific bits (e.g. what was -// discovered or the actual staged or promoted contents). -// -// Note that building id is included as part of the message envelope. -// -{ - "version": "1.3.14", - "timestamp": "2018-08-26T21:39:29.364Z", - "mapping": { - "devices": { - "FCU-123": { - "discovered": "2018-08-26T21:39:29.364Z", // Timestamp of last received discovery message - "staged": "2018-08-28T21:59:18.364Z", // Timestamp of last recommendation staging - "promoted": "2018-08-28T22:39:12.364Z", // Timestamp of last recommendation promotion - "exported": "2018-08-28T22:39:12.364Z", // Timestamp of last time a device mapping was exported - } - } - } -} diff --git a/validator/.idea/runConfigurations/Schema.xml b/validator/.idea/runConfigurations/Schema.xml index 06e5c0e14c..a245830d0b 100644 --- a/validator/.idea/runConfigurations/Schema.xml +++ b/validator/.idea/runConfigurations/Schema.xml @@ -2,7 +2,7 @@

Config

- - -
- - Type: object
-

The config block controls a device's intended behavior. Config Documentation

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

RFC 3339 timestamp the configuration was generated

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Major version of the UDMI schema

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

System Config Documentation

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: integer Default: 300
-

The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300.

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer Default: 600
-

The rate at which the system should send system event metric updates. 0 indicates no updates.

-
- - - -

Value must be greater or equal to 0 and lesser or equal to 86400

- - -
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Configuration for gateways. Only required for devices which are acting as gateways

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: array of string
-

An array of all the device IDs which are bound to the device

-
- - - - - -

Each item of this array must be:

-
-
- - - Type: string
-Must match regular expression: ^[A-Z]{3}-[1-9][0-9]{0,2}$ - - - - - - -
-

-
Example:
-
[
-    "AHU-22"
-]
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Configuration for discovery

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
-

Configuration for discovery

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Generational marker for controlling discovery

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Period, in seconds, for automatic scanning

-
- - - -

Value must be greater or equal to 0

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Scan duration, in seconds

-
- - - -

Value must be greater or equal to 0

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Indicates implicit enumeration of discovered devices

-
- - - - - - -
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Address family results for a scan. Not included for device enumeration messages.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$ -
- - Type: object
-

Configuration for discovery

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Generational marker for controlling discovery

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Period, in seconds, for automatic scanning

-
- - - -

Value must be greater or equal to 0

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Scan duration, in seconds

-
- - - -

Value must be greater or equal to 0

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Indicates implicit enumeration of discovered devices

-
- - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Used to describe device local network parameters

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
- - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z0-9-]+$ -
- - Type: object
-

The type of network

-
No Additional Properties - - - - - -
-
Examples:
-
"bacnet"
-
-
"modbus"
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

The address of a device on the local network

-
- - - - - -
-
Example:
-
"4148893"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
- - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Pointset Config Documentation

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

RFC 3339 timestamp the configuration was generated

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Version of the UDMI schema

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

The state_etag of the last state message sent by the device. Writeback documentation

-
- - - -

Must be at most 32 characters long

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An expiry for the the device reverts to its operational state, and sends a state update to notify the cloud of the state change. Writeback documentation

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.

-
- - - -

Value must be greater or equal to 0 and lesser or equal to 86400

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Maximum time between samples for the device to send out a complete update. It can send out updates more frequently than this. Default to 600.

-
- - - -

Value must be greater or equal to 1 and lesser or equal to 86400

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

The points defined in this dictionary is the authoritative source indicating the representative points for the device (in both telemetry and state messages). Pointset doumentation

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Mapping for the point to an internal resource (e.g. BACnet object reference)

-
- - - - - -
-
Example:
-
"AI1106.Present_Value"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

If specified, indicates the units the device should report the data in.

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Used for cloud writeback functionality, this field specifies the value for a given point in the device's current units.

-
- - - - - -
-
Example:
-
22.4
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300.

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.

-
- - - -

Value must be greater or equal to 0 and lesser or equal to 86400

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Maximum time between samples for the device to send out a complete update. It can send out updates more frequently than this. Default to 600.

-
- - - -

Value must be greater or equal to 1 and lesser or equal to 86400

- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/gencode/docs/envelope.html b/gencode/docs/envelope.html deleted file mode 100644 index c076fcaa29..0000000000 --- a/gencode/docs/envelope.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - - - - - - - - Envelope - -

Envelope

- - -
- - Type: object
-

The UDMI envelope is not a message itself, per se, but the attributes and other information that is delivered along with a message. Message Envelope Documentation

-
- - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[0-9]+$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[a-zA-Z][-a-zA-Z0-9._+~%]*[a-zA-Z0-9]$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^([.a-z]+:)?[a-z][-a-z0-9]*[a-z0-9]$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: enum (of string)
-
-

Must be one of:

-
  • "update"
  • "discovery"
  • "system"
  • "gateway"
  • "localnet"
  • "pointset"
  • "blobset"
-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: enum (of string)
-
-

Must be one of:

-
  • "event"
  • "command"
  • "state"
  • "config"
  • "model"
-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-

Additional Properties of any type are allowed.

- - Type: object
- - - - - - - -
-
-
-
- - - \ No newline at end of file diff --git a/gencode/docs/event_discovery.html b/gencode/docs/event_discovery.html deleted file mode 100644 index 4ca55f153f..0000000000 --- a/gencode/docs/event_discovery.html +++ /dev/null @@ -1,1510 +0,0 @@ - - - - - - - - - - - - - - - - Discovery Event - -

Discovery Event

- - -
- - Type: object
-

Discovery result with implicit enumeration

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

RFC 3339 timestamp the discover telemetry event was generated

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Major version of the UDMI schema

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

The event's discovery scan trigger's generation timestamp

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Address family results for a scan. Not included for device enumeration messages.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$ -
- - Type: object
-

Discovery information for an individual protocol family.

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Device id in the namespace of the given family

-
Must match regular expression: ^[-_.:0-9A-Z]+$ - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Collection of data points available for this device.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-zA-Z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$ -
- - Type: object
-

Object representation for for a single point enumeration

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: array of string
-

List of possible enumerated values for the point

-
- - - - - -

Each item of this array must be:

-
-
- - - Type: string
- - - - - - - -
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Current or default unit for this point

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Current or default type for this point

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Reference parameter for this point (e.g. BACnet object)

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Indicates if this point is writable or not

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Human-readable description of this point

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Arbitrary blob of json associated with this point

-
- - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Collection of data blobs recognized by this device.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
-

Object representation for for a single blob enumeration

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Description of this blob

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Indicating if this blob is part of the device's firmware set

-
- - - - - - -
-
-
-
-
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/gencode/docs/event_pointset.html b/gencode/docs/event_pointset.html deleted file mode 100644 index 43999b3019..0000000000 --- a/gencode/docs/event_pointset.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - - - - - - - - - Pointset Event - -

Pointset Event

- - -
- - Type: object
-

A set of points reporting telemetry data. Pointset Event Documentation

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

RFC 3339 timestamp the telemetry event was generated

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Major version of the UDMI schema

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Indicates if this is a partial update (only some points may be included)

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Collection of point names, defining the representative point set for this device.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
-

Object representation for for a single point

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
-

The specific point data reading

-
- - - - - -
-
Examples:
-
24.1
-
-
"running"
-
-
4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/gencode/docs/event_system.html b/gencode/docs/event_system.html deleted file mode 100644 index 3ad905234c..0000000000 --- a/gencode/docs/event_system.html +++ /dev/null @@ -1,740 +0,0 @@ - - - - - - - - - - - - - - - - System Event - -

System Event

- - -
- - Type: object
-

Used for system events such as logging. System Event Documentation

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

RFC 3339 timestamp the event payload was generated

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Major version of the UDMI schema

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: array
- - - - - - -

Each item of this array must be:

-
-
- - - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: number
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
- - - - - - - -
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/gencode/docs/index.html b/gencode/docs/index.html deleted file mode 100644 index 2eeb0b7f47..0000000000 --- a/gencode/docs/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - UDMI Schema - - -

UDMI Schema

-
- - - \ No newline at end of file diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html deleted file mode 100644 index f00ec526c0..0000000000 --- a/gencode/docs/metadata.html +++ /dev/null @@ -1,2490 +0,0 @@ - - - - - - - - - - - - - - - - Metadata - -

Metadata

- - -
- - Type: object
-

Metadata is a description about the device: a specification about how the device should be configured and expectations about what the device should be doing. Defined by metadata.json

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

RFC 3339 timestamp the metadata was generated

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Major version of the UDMI schema

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Generic human-readable text describing the device

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Automatically generated field that contains the hash of file contents.

-
Must match regular expression: ^[0-9a-z]{8}$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Information specific to how the device communicates with the cloud.

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: enum (of string)
-

The key type used for cloud communication.

-
-

Must be one of:

-
  • "ES256"
  • "ES256_X509"
  • "RS256"
  • "RS256_X509"
-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Whether the device authenticates via a private key. Typically false for devices which are proxied for by an IoT core gateway

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

If the device functions as an IoT Gateway, proxying for other devices using a single logical connection

-
- - - - - - -
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

High-level system information about the device. System Metadata Documentation

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
-

Properties the expected physical location of the device.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

The site name according to the site model in which a device is installed in

-
Must match regular expression: ^[A-Z]{2}-[A-Z]{3}-[A-Z0-9]{2,9}$ - - - - - -
-
Example:
-
"US-SFO-XYY"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[A-Z0-9-]+$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: number
-

The x coordinate of the device location in a project specific coordinate system

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
-

The y coordinate of the device location in a project specific coordinate system

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
-

The z (height) coordinate of the device location in a project specific coordinate system

-
- - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Information used to print a physical QR code label.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[a-z]+://[-0-9a-zA-Z_$]+$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[A-Z]{2}-[A-Z]{3}-[A-Z0-9]{2,9}$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[a-zA-Z0-9-]+$ - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Gateway Documentation

-
- - No Additional Properties

- -

-
- - - Type: object
- -
-

The following properties are required:

-
  • gateway_id
-
- - - - - -
- - - Type: object
- -
-

The following properties are required:

-
  • proxy_ids
-
- - - - - -
- - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to

-
Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ - - - - - -
-
Example:
-
"GAT-100"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-Must match regular expression: ^[a-z0-9-]+$ - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: array of string
-

Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device

-
- - - - - -

Each item of this array must be:

-
-
- - - Type: string
-Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ - - - - - - -
-

-
Example:
-
[
-    "AHU-22"
-]
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Used to describe device local network parameters

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z0-9-]+$ -
- - Type: object
-

The type of network

-
- - No Additional Properties - - - - - -
-
Examples:
-
"bacnet"
-
-
"modbus"
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

The address of a device on the local network

-
- - - - - -
-
Example:
-
"4148893"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Testing target parameters

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Point name used for testing

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Value used for testing

-
- - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
-

Information about a specific point name of the device.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
-

Information about a specific point name of the device.

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Expected unit configuration for the point

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Indicates if this point is writable (else read-only)

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Represents the expected baseline value of the point

-
- - - - - -
-
Example:
-
22
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
-

Maximum deviation from baseline_value

-
- - - - - -
-
Example:
-
2
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: enum (of string)
-

Expected state when baseline_value is set as the set_value for this point the config message

-
-

Must be one of:

-
  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: number
-

Triggering threshold for partial cov update publishing

-
- - - - - -
-
Example:
-
1
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Mapping for the point to an internal resource (e.g. BACnet object reference)

-
- - - - - -
-
Examples:
-
"AI3.Present_Value"
-
-
"400070"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300.

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.

-
- - - -

Value must be greater or equal to 0 and lesser or equal to 86400

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

Maximum time between samples for the device to send out a complete update. It can send out updates more frequently than this. Default to 600.

-
- - - -

Value must be greater or equal to 1 and lesser or equal to 86400

- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/gencode/docs/schema_doc.css b/gencode/docs/schema_doc.css deleted file mode 100644 index 83897d896b..0000000000 --- a/gencode/docs/schema_doc.css +++ /dev/null @@ -1,180 +0,0 @@ -body { - font: 16px/1.5em "Overpass", "Open Sans", Helvetica, sans-serif; - color: #333; - font-weight: 300; - padding: 40px; -} - -.btn.btn-link { - font-size: 18px; -} - -.jsfh-animated-property { - animation: eclair; - animation-iteration-count: 1; - animation-fill-mode: forwards; - animation-duration: .75s; - -} - -@keyframes eclair { - 0%,100% { - transform: scale(1); - } - 50% { - transform: scale(1.03); - } -} - -.btn.btn-primary { - margin: 10px; -} - -.btn.example-show.collapsed:before { - content: "show" -} - -.btn.example-show:before { - content: "hide" -} - -.description.collapse:not(.show) { - max-height: 100px !important; - overflow: hidden; - - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; -} - -.description.collapsing { - min-height: 100px !important; -} - -.collapse-description-link.collapsed:after { - content: '+ Read More'; -} - -.collapse-description-link:not(.collapsed):after { - content: '- Read Less'; -} - -.badge { - font-size: 100%; - margin-bottom: 0.5rem; - margin-top: 0.5rem; -} - -.badge.value-type { - font-size: 120%; - margin-right: 5px; - margin-bottom: 10px; -} - - -.badge.default-value { - font-size: 120%; - margin-left: 5px; - margin-bottom: 10px; -} - -.badge.restriction { - display: inline-block; -} - -.badge.required-property,.badge.deprecated-property,.badge.pattern-property,.badge.no-additional { - font-size: 100%; - margin-left: 10px; -} - -.accordion div.card:only-child { - border-bottom: 1px solid rgba(0, 0, 0, 0.125); -} - -.examples { - padding: 1rem !important; -} - -.examples pre { - margin-bottom: 0; -} - -.highlight.jumbotron { - padding: 1rem !important; -} - -.generated-by-footer { - margin-top: 1em; - text-align: right; -} - -/* From https://github.com/richleland/pygments-css/blob/master/friendly.css, see https://github.com/trentm/python-markdown2/wiki/fenced-code-blocks */ -.highlight { background: #e9ecef; } /* Changed from #f0f0f0 in the original style to be the same as bootstrap's jumbotron */ -.highlight .hll { background-color: #ffffcc } -.highlight .c { color: #60a0b0; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #007020; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .ch { color: #60a0b0; font-style: italic } /* Comment.Hashbang */ -.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #007020 } /* Comment.Preproc */ -.highlight .cpf { color: #60a0b0; font-style: italic } /* Comment.PreprocFile */ -.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #888888 } /* Generic.Output */ -.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0044DD } /* Generic.Traceback */ -.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #007020 } /* Keyword.Pseudo */ -.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #902000 } /* Keyword.Type */ -.highlight .m { color: #40a070 } /* Literal.Number */ -.highlight .s { color: #4070a0 } /* Literal.String */ -.highlight .na { color: #4070a0 } /* Name.Attribute */ -.highlight .nb { color: #007020 } /* Name.Builtin */ -.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.highlight .no { color: #60add5 } /* Name.Constant */ -.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #007020 } /* Name.Exception */ -.highlight .nf { color: #06287e } /* Name.Function */ -.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ -.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #bb60d5 } /* Name.Variable */ -.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mb { color: #40a070 } /* Literal.Number.Bin */ -.highlight .mf { color: #40a070 } /* Literal.Number.Float */ -.highlight .mh { color: #40a070 } /* Literal.Number.Hex */ -.highlight .mi { color: #40a070 } /* Literal.Number.Integer */ -.highlight .mo { color: #40a070 } /* Literal.Number.Oct */ -.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ -.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ -.highlight .sc { color: #4070a0 } /* Literal.String.Char */ -.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ -.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ -.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ -.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.highlight .sx { color: #c65d09 } /* Literal.String.Other */ -.highlight .sr { color: #235388 } /* Literal.String.Regex */ -.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ -.highlight .ss { color: #517918 } /* Literal.String.Symbol */ -.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ -.highlight .fm { color: #06287e } /* Name.Function.Magic */ -.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ -.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ -.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ -.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ -.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/gencode/docs/schema_doc.min.js b/gencode/docs/schema_doc.min.js deleted file mode 100644 index 0d9c7882d8..0000000000 --- a/gencode/docs/schema_doc.min.js +++ /dev/null @@ -1 +0,0 @@ -function flashElement(t){myElement=document.getElementById(t),myElement.classList.add("jsfh-animated-property"),setTimeout(function(){myElement.classList.remove("jsfh-animated-property")},1e3)}function setAnchor(t){history.pushState({},"",t)}function anchorOnLoad(){let t=window.location.hash.split("?")[0].split("&")[0];"#"===t[0]&&(t=t.substr(1)),t.length>0&&anchorLink(t)}function anchorLink(t){$("#"+t).parents().addBack().filter(".collapse:not(.show), .tab-pane, [role='tab']").each(function(t){if($(this).hasClass("collapse"))$(this).collapse("show");else if($(this).hasClass("tab-pane")){const t=$("a[href='#"+$(this).attr("id")+"']");t&&t.tab("show")}else"tab"===$(this).attr("role")&&$(this).tab("show")}),setTimeout(function(){let e=document.getElementById(t);e&&(e.scrollIntoView({block:"center",behavior:"smooth"}),setTimeout(function(){flashElement(t)},500))},1e3)}$(document).on("click",'a[href^="#"]',function(t){t.preventDefault(),history.pushState({},"",this.href)}); \ No newline at end of file diff --git a/gencode/docs/schema_extras.js b/gencode/docs/schema_extras.js deleted file mode 100644 index 03fe3b7dc0..0000000000 --- a/gencode/docs/schema_extras.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Dynamically remove `.md` extension from links when schema browser is viewed - * on a hosted source. This is targeted at Github pages, which only shows the - * rendered MD files when the `.md` extension is omitted (otherwise raw file is - * presented). A dynamic rewrite ensures all the links in the schema files are - * valid, but pretty when clicked online - */ -function removedHostedMDExtensions(){ - const docsRegex = '^(https.*).md(#.*)?$'; - if (window.location.href.match("https://")) { - var links = document.getElementsByTagName("a"); - for (var link of links){ - var match = link.href.match(docsRegex) - if(match) { - var anchor = (match[2] === undefined ? '' : match[2]); - link.href = `${match[1]}${anchor}` - } - } - } -} diff --git a/gencode/docs/state.html b/gencode/docs/state.html deleted file mode 100644 index 0e2d39b036..0000000000 --- a/gencode/docs/state.html +++ /dev/null @@ -1,4173 +0,0 @@ - - - - - - - - - - - - - - - - State - -

State

- - -
- - Type: object
-

State message, defined by [state.json]

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

RFC 3339 Timestamp the state payload was generated

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Major version of the UDMI schema

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

System State Documentation

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Time from the timestamp field of the last successfully parsed config message (not the timestamp the message was received/processed).

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

The serial number of the physical device

-
- - - - - -
-
Examples:
-
"A1B2C3D4"
-
-
"00001"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^make|model|sku|rev$ -
- - Type: string
- - - - - - - -
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z_]+$ -
- - Type: string
- - - - - - - -
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z_]+$ -
- - Type: string
- - - - - - - -
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Gateway Documentation

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
- - - - - - - -
-
-
-

- -

-
- -
-

Each additional property must conform to the following schema

- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

State for discovery

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
-

State for discovery

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Generational marker for controlling discovery

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Indicates if the discovery process is currently active

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Status information about the discovery operation

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Discovery protocol families

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$ -
- - Type: object
-

State for discovery

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

Generational marker for controlling discovery

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: boolean
-

Indicates if the discovery process is currently active

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Status information about the discovery operation

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
- - - - -

Must be at most 32 characters long

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- - - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

A set of points reporting telemetry data.

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

RFC 3339 timestamp the configuration was generated

-
- - - - - -
-
Example:
-
"2019-01-17T14:02:29.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Version of the UDMI schema

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. Additional information on implementation

-
- - - -

Must be at most 32 characters long

- - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Optional status information about pointset

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Collection of point names, defining the representative point set for this device.

-
No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
-

Object representation for for a single point

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

If specified, indicates a programmed point unit. If empty, means unspecified or matches configured point.

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: enum (of string)
-

Optional enumeration indicating the state of the points value.

-
-

Must be one of:

-
  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
-

Optional status information about this point, subject to log severity level

-
- - No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
- - - - - -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

-
- - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

A device-specific representation of the category an entry pertains to

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ - - - - - -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
-

Timestamp the condition was triggered, or most recently updated

-
- - - - - -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: integer
-

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

-
- - - -

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

- -
-
Example:
-
600
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/gencode/java/udmi/schema/BlobEnumerationEvent.java b/gencode/java/udmi/schema/BlobEnumerationEvent.java deleted file mode 100644 index e0e1249510..0000000000 --- a/gencode/java/udmi/schema/BlobEnumerationEvent.java +++ /dev/null @@ -1,60 +0,0 @@ - -package udmi.schema; - -import javax.annotation.processing.Generated; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyDescription; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -/** - * Blob Enumeration Event - *

- * Object representation for for a single blob enumeration - * - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "description", - "firmware_set" -}) -@Generated("jsonschema2pojo") -public class BlobEnumerationEvent { - - /** - * Description of this blob - * - */ - @JsonProperty("description") - @JsonPropertyDescription("Description of this blob") - public String description; - /** - * Indicating if this blob is part of the device's firmware set - * - */ - @JsonProperty("firmware_set") - @JsonPropertyDescription("Indicating if this blob is part of the device's firmware set") - public Boolean firmware_set; - - @Override - public int hashCode() { - int result = 1; - result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); - result = ((result* 31)+((this.firmware_set == null)? 0 :this.firmware_set.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof BlobEnumerationEvent) == false) { - return false; - } - BlobEnumerationEvent rhs = ((BlobEnumerationEvent) other); - return (((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.firmware_set == rhs.firmware_set)||((this.firmware_set!= null)&&this.firmware_set.equals(rhs.firmware_set)))); - } - -} diff --git a/gencode/java/udmi/schema/DiscoveryEvent.java b/gencode/java/udmi/schema/DiscoveryEvent.java index 9f51ef68bb..1dadd533f1 100644 --- a/gencode/java/udmi/schema/DiscoveryEvent.java +++ b/gencode/java/udmi/schema/DiscoveryEvent.java @@ -2,7 +2,6 @@ package udmi.schema; import java.util.Date; -import java.util.HashMap; import java.util.Map; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; @@ -24,8 +23,7 @@ "generation", "status", "families", - "points", - "blobs" + "points" }) @Generated("jsonschema2pojo") public class DiscoveryEvent { @@ -76,19 +74,11 @@ public class DiscoveryEvent { @JsonProperty("points") @JsonPropertyDescription("Collection of data points available for this device.") public Map points; - /** - * Collection of data blobs recognized by this device. - * - */ - @JsonProperty("blobs") - @JsonPropertyDescription("Collection of data blobs recognized by this device.") - public HashMap blobs; @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); - result = ((result* 31)+((this.blobs == null)? 0 :this.blobs.hashCode())); result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); @@ -106,7 +96,7 @@ public boolean equals(Object other) { return false; } DiscoveryEvent rhs = ((DiscoveryEvent) other); - return ((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.blobs == rhs.blobs)||((this.blobs!= null)&&this.blobs.equals(rhs.blobs))))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + return (((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); } } diff --git a/gencode/java/udmi/schema/SubsystemLocalnetMetadata.java b/gencode/java/udmi/schema/FamilyLocalnetMetadata.java similarity index 64% rename from gencode/java/udmi/schema/SubsystemLocalnetMetadata.java rename to gencode/java/udmi/schema/FamilyLocalnetMetadata.java index c90d159c7e..c4302f226d 100644 --- a/gencode/java/udmi/schema/SubsystemLocalnetMetadata.java +++ b/gencode/java/udmi/schema/FamilyLocalnetMetadata.java @@ -9,31 +9,31 @@ /** - * Subsystem Localnet Metadata + * Family Localnet Metadata *

* The type of network * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "local_id" + "id" }) @Generated("jsonschema2pojo") -public class SubsystemLocalnetMetadata { +public class FamilyLocalnetMetadata { /** * The address of a device on the local network * (Required) * */ - @JsonProperty("local_id") + @JsonProperty("id") @JsonPropertyDescription("The address of a device on the local network") - public String local_id; + public String id; @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.local_id == null)? 0 :this.local_id.hashCode())); + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); return result; } @@ -42,11 +42,11 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof SubsystemLocalnetMetadata) == false) { + if ((other instanceof FamilyLocalnetMetadata) == false) { return false; } - SubsystemLocalnetMetadata rhs = ((SubsystemLocalnetMetadata) other); - return ((this.local_id == rhs.local_id)||((this.local_id!= null)&&this.local_id.equals(rhs.local_id))); + FamilyLocalnetMetadata rhs = ((FamilyLocalnetMetadata) other); + return ((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))); } } diff --git a/gencode/java/udmi/schema/GatewayMetadata.java b/gencode/java/udmi/schema/GatewayMetadata.java index f8731e86ee..1b01b94bff 100644 --- a/gencode/java/udmi/schema/GatewayMetadata.java +++ b/gencode/java/udmi/schema/GatewayMetadata.java @@ -19,35 +19,31 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "gateway_id", - "subsystem", "proxy_ids" }) @Generated("jsonschema2pojo") public class GatewayMetadata { /** - * Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to + * The device ID of the gateway the device is bound to * */ @JsonProperty("gateway_id") - @JsonPropertyDescription("Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to") + @JsonPropertyDescription("The device ID of the gateway the device is bound to") public String gateway_id; - @JsonProperty("subsystem") - public String subsystem; /** - * Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device + * An array of all the device IDs which are bound to the device * */ @JsonProperty("proxy_ids") - @JsonPropertyDescription("Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device") + @JsonPropertyDescription("An array of all the device IDs which are bound to the device") public List proxy_ids = new ArrayList(); @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.subsystem == null)? 0 :this.subsystem.hashCode())); - result = ((result* 31)+((this.proxy_ids == null)? 0 :this.proxy_ids.hashCode())); result = ((result* 31)+((this.gateway_id == null)? 0 :this.gateway_id.hashCode())); + result = ((result* 31)+((this.proxy_ids == null)? 0 :this.proxy_ids.hashCode())); return result; } @@ -60,7 +56,7 @@ public boolean equals(Object other) { return false; } GatewayMetadata rhs = ((GatewayMetadata) other); - return ((((this.subsystem == rhs.subsystem)||((this.subsystem!= null)&&this.subsystem.equals(rhs.subsystem)))&&((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids))))&&((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))); + return (((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))&&((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids)))); } } diff --git a/gencode/java/udmi/schema/LocalnetConfig.java b/gencode/java/udmi/schema/LocalnetConfig.java index eead25c84e..68aca4838e 100644 --- a/gencode/java/udmi/schema/LocalnetConfig.java +++ b/gencode/java/udmi/schema/LocalnetConfig.java @@ -15,25 +15,25 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "subsystem" + "families" }) @Generated("jsonschema2pojo") public class LocalnetConfig { /** - * Subsystem Reference + * Family Reference *

* * (Required) * */ - @JsonProperty("subsystem") - public Object subsystem; + @JsonProperty("families") + public Object families; @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.subsystem == null)? 0 :this.subsystem.hashCode())); + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); return result; } @@ -46,7 +46,7 @@ public boolean equals(Object other) { return false; } LocalnetConfig rhs = ((LocalnetConfig) other); - return ((this.subsystem == rhs.subsystem)||((this.subsystem!= null)&&this.subsystem.equals(rhs.subsystem))); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); } } diff --git a/gencode/java/udmi/schema/LocalnetMetadata.java b/gencode/java/udmi/schema/LocalnetMetadata.java index 02027f99c2..7a691ac711 100644 --- a/gencode/java/udmi/schema/LocalnetMetadata.java +++ b/gencode/java/udmi/schema/LocalnetMetadata.java @@ -16,7 +16,7 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "subsystem" + "families" }) @Generated("jsonschema2pojo") public class LocalnetMetadata { @@ -26,13 +26,13 @@ public class LocalnetMetadata { * (Required) * */ - @JsonProperty("subsystem") - public HashMap subsystem; + @JsonProperty("families") + public HashMap families; @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.subsystem == null)? 0 :this.subsystem.hashCode())); + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); return result; } @@ -45,7 +45,7 @@ public boolean equals(Object other) { return false; } LocalnetMetadata rhs = ((LocalnetMetadata) other); - return ((this.subsystem == rhs.subsystem)||((this.subsystem!= null)&&this.subsystem.equals(rhs.subsystem))); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); } } diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index d116fec621..fc3c7330c2 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -13,30 +13,9 @@ from .envelope import Envelope from .event import Event from .event_discovery import DiscoveryEvent -from .event_discovery_blob import BlobEnumerationEvent from .event_discovery_family import FamilyDiscoveryEvent from .event_discovery_point import PointEnumerationEvent from .event_mapping import DiscoveryEvent from .event_pointset import PointsetEvent from .event_pointset_point import PointPointsetEvent from .event_system import SystemEvent -from .metadata import Metadata -from .model_cloud import CloudMetadata -from .model_gateway import GatewayMetadata -from .model_localnet import LocalnetMetadata -from .model_localnet_subsystem import SubsystemLocalnetMetadata -from .model_pointset import PointsetMetadata -from .model_pointset_point import PointPointsetMetadata -from .model_system import SystemMetadata -from .model_testing import TestingMetadata -from .model_testing_target import TargetTestingMetadata -from .properties import Properties -from .state import State -from .state_blobset import BlobsetState -from .state_blobset_blob import BlobBlobsetState -from .state_discovery import DiscoveryState -from .state_discovery_family import FamilyDiscoveryState -from .state_gateway import GatewayState -from .state_pointset import PointsetState -from .state_pointset_point import PointPointsetState -from .state_system import SystemState diff --git a/gencode/python/udmi/schema/config_localnet.py b/gencode/python/udmi/schema/config_localnet.py index b3c7952636..cca7195cb6 100644 --- a/gencode/python/udmi/schema/config_localnet.py +++ b/gencode/python/udmi/schema/config_localnet.py @@ -1,18 +1,18 @@ """Generated class for config_localnet.json""" -class Object587F40FB: +class Object75D54154: """Generated schema class""" def __init__(self): - self.local_id = None + self.id = None @staticmethod def from_dict(source): if not source: return None - result = Object587F40FB() - result.local_id = source.get('local_id') + result = Object75D54154() + result.id = source.get('id') return result @staticmethod @@ -21,7 +21,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = Object587F40FB.from_dict(source[key]) + result[key] = Object75D54154.from_dict(source[key]) return result @staticmethod @@ -33,8 +33,8 @@ def expand_dict(input): def to_dict(self): result = {} - if self.local_id: - result['local_id'] = self.local_id # 5 + if self.id: + result['id'] = self.id # 5 return result @@ -42,14 +42,14 @@ class LocalnetConfig: """Generated schema class""" def __init__(self): - self.subsystem = None + self.families = None @staticmethod def from_dict(source): if not source: return None result = LocalnetConfig() - result.subsystem = Object587F40FB.map_from(source.get('subsystem')) + result.families = Object75D54154.map_from(source.get('families')) return result @staticmethod @@ -70,6 +70,6 @@ def expand_dict(input): def to_dict(self): result = {} - if self.subsystem: - result['subsystem'] = Object587F40FB.expand_dict(self.subsystem) # 2 + if self.families: + result['families'] = Object75D54154.expand_dict(self.families) # 2 return result diff --git a/gencode/python/udmi/schema/event_discovery.py b/gencode/python/udmi/schema/event_discovery.py index f049294450..7c531ce7ec 100644 --- a/gencode/python/udmi/schema/event_discovery.py +++ b/gencode/python/udmi/schema/event_discovery.py @@ -2,7 +2,6 @@ from .common import Entry from .event_discovery_family import FamilyDiscoveryEvent from .event_discovery_point import PointEnumerationEvent -from .event_discovery_blob import BlobEnumerationEvent class DiscoveryEvent: @@ -15,7 +14,6 @@ def __init__(self): self.status = None self.families = None self.points = None - self.blobs = None @staticmethod def from_dict(source): @@ -28,7 +26,6 @@ def from_dict(source): result.status = Entry.from_dict(source.get('status')) result.families = FamilyDiscoveryEvent.map_from(source.get('families')) result.points = PointEnumerationEvent.map_from(source.get('points')) - result.blobs = BlobEnumerationEvent.map_from(source.get('blobs')) return result @staticmethod @@ -61,6 +58,4 @@ def to_dict(self): result['families'] = FamilyDiscoveryEvent.expand_dict(self.families) # 2 if self.points: result['points'] = PointEnumerationEvent.expand_dict(self.points) # 2 - if self.blobs: - result['blobs'] = BlobEnumerationEvent.expand_dict(self.blobs) # 2 return result diff --git a/gencode/python/udmi/schema/event_discovery_blob.py b/gencode/python/udmi/schema/event_discovery_blob.py deleted file mode 100644 index f47311c5d4..0000000000 --- a/gencode/python/udmi/schema/event_discovery_blob.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Generated class for event_discovery_blob.json""" - - -class BlobEnumerationEvent: - """Generated schema class""" - - def __init__(self): - self.description = None - self.firmware_set = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = BlobEnumerationEvent() - result.description = source.get('description') - result.firmware_set = source.get('firmware_set') - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = BlobEnumerationEvent.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.description: - result['description'] = self.description # 5 - if self.firmware_set: - result['firmware_set'] = self.firmware_set # 5 - return result diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index e54c873205..285f574185 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -2,79 +2,3 @@ from .model_cloud import CloudMetadata from .model_system import SystemMetadata from .model_gateway import GatewayMetadata -from .model_localnet import LocalnetMetadata -from .model_testing import TestingMetadata -from .model_pointset import PointsetMetadata - - -class Metadata: - """Generated schema class""" - - def __init__(self): - self.timestamp = None - self.version = None - self.description = None - self.hash = None - self.cloud = None - self.system = None - self.gateway = None - self.localnet = None - self.testing = None - self.pointset = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = Metadata() - result.timestamp = source.get('timestamp') - result.version = source.get('version') - result.description = source.get('description') - result.hash = source.get('hash') - result.cloud = CloudMetadata.from_dict(source.get('cloud')) - result.system = SystemMetadata.from_dict(source.get('system')) - result.gateway = GatewayMetadata.from_dict(source.get('gateway')) - result.localnet = LocalnetMetadata.from_dict(source.get('localnet')) - result.testing = TestingMetadata.from_dict(source.get('testing')) - result.pointset = PointsetMetadata.from_dict(source.get('pointset')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = Metadata.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.timestamp: - result['timestamp'] = self.timestamp # 5 - if self.version: - result['version'] = self.version # 5 - if self.description: - result['description'] = self.description # 5 - if self.hash: - result['hash'] = self.hash # 5 - if self.cloud: - result['cloud'] = self.cloud.to_dict() # 4 - if self.system: - result['system'] = self.system.to_dict() # 4 - if self.gateway: - result['gateway'] = self.gateway.to_dict() # 4 - if self.localnet: - result['localnet'] = self.localnet.to_dict() # 4 - if self.testing: - result['testing'] = self.testing.to_dict() # 4 - if self.pointset: - result['pointset'] = self.pointset.to_dict() # 4 - return result diff --git a/gencode/python/udmi/schema/model_gateway.py b/gencode/python/udmi/schema/model_gateway.py index 9b14dcee1c..9a34f65031 100644 --- a/gencode/python/udmi/schema/model_gateway.py +++ b/gencode/python/udmi/schema/model_gateway.py @@ -6,7 +6,6 @@ class GatewayMetadata: def __init__(self): self.gateway_id = None - self.subsystem = None self.proxy_ids = None @staticmethod @@ -15,7 +14,6 @@ def from_dict(source): return None result = GatewayMetadata() result.gateway_id = source.get('gateway_id') - result.subsystem = source.get('subsystem') result.proxy_ids = source.get('proxy_ids') return result @@ -39,8 +37,6 @@ def to_dict(self): result = {} if self.gateway_id: result['gateway_id'] = self.gateway_id # 5 - if self.subsystem: - result['subsystem'] = self.subsystem # 5 if self.proxy_ids: result['proxy_ids'] = self.proxy_ids # 1 return result diff --git a/gencode/python/udmi/schema/model_localnet.py b/gencode/python/udmi/schema/model_localnet.py index 19bc17ad06..37a6256fd0 100644 --- a/gencode/python/udmi/schema/model_localnet.py +++ b/gencode/python/udmi/schema/model_localnet.py @@ -1,39 +1 @@ """Generated class for model_localnet.json""" -from .model_localnet_subsystem import SubsystemLocalnetMetadata - - -class LocalnetMetadata: - """Generated schema class""" - - def __init__(self): - self.subsystem = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = LocalnetMetadata() - result.subsystem = SubsystemLocalnetMetadata.map_from(source.get('subsystem')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = LocalnetMetadata.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.subsystem: - result['subsystem'] = SubsystemLocalnetMetadata.expand_dict(self.subsystem) # 2 - return result diff --git a/gencode/python/udmi/schema/model_localnet_subsystem.py b/gencode/python/udmi/schema/model_localnet_subsystem.py deleted file mode 100644 index ccec80a68f..0000000000 --- a/gencode/python/udmi/schema/model_localnet_subsystem.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Generated class for model_localnet_subsystem.json""" - - -class SubsystemLocalnetMetadata: - """Generated schema class""" - - def __init__(self): - self.local_id = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = SubsystemLocalnetMetadata() - result.local_id = source.get('local_id') - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = SubsystemLocalnetMetadata.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.local_id: - result['local_id'] = self.local_id # 5 - return result diff --git a/gencode/python/udmi/schema/model_pointset.py b/gencode/python/udmi/schema/model_pointset.py deleted file mode 100644 index 91bba573ea..0000000000 --- a/gencode/python/udmi/schema/model_pointset.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Generated class for model_pointset.json""" -from .model_pointset_point import PointPointsetMetadata - - -class PointsetMetadata: - """Generated schema class""" - - def __init__(self): - self.points = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = PointsetMetadata() - result.points = PointPointsetMetadata.map_from(source.get('points')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = PointsetMetadata.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.points: - result['points'] = PointPointsetMetadata.expand_dict(self.points) # 2 - return result diff --git a/gencode/python/udmi/schema/model_pointset_point.py b/gencode/python/udmi/schema/model_pointset_point.py deleted file mode 100644 index 5b9b37d393..0000000000 --- a/gencode/python/udmi/schema/model_pointset_point.py +++ /dev/null @@ -1,74 +0,0 @@ -"""Generated class for model_pointset_point.json""" - - -class PointPointsetMetadata: - """Generated schema class""" - - def __init__(self): - self.units = None - self.writable = None - self.baseline_value = None - self.baseline_tolerance = None - self.baseline_state = None - self.cov_increment = None - self.ref = None - self.min_loglevel = None - self.sample_limit_sec = None - self.sample_rate_sec = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = PointPointsetMetadata() - result.units = source.get('units') - result.writable = source.get('writable') - result.baseline_value = source.get('baseline_value') - result.baseline_tolerance = source.get('baseline_tolerance') - result.baseline_state = source.get('baseline_state') - result.cov_increment = source.get('cov_increment') - result.ref = source.get('ref') - result.min_loglevel = source.get('min_loglevel') - result.sample_limit_sec = source.get('sample_limit_sec') - result.sample_rate_sec = source.get('sample_rate_sec') - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = PointPointsetMetadata.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.units: - result['units'] = self.units # 5 - if self.writable: - result['writable'] = self.writable # 5 - if self.baseline_value: - result['baseline_value'] = self.baseline_value # 5 - if self.baseline_tolerance: - result['baseline_tolerance'] = self.baseline_tolerance # 5 - if self.baseline_state: - result['baseline_state'] = self.baseline_state # 5 - if self.cov_increment: - result['cov_increment'] = self.cov_increment # 5 - if self.ref: - result['ref'] = self.ref # 5 - if self.min_loglevel: - result['min_loglevel'] = self.min_loglevel # 5 - if self.sample_limit_sec: - result['sample_limit_sec'] = self.sample_limit_sec # 5 - if self.sample_rate_sec: - result['sample_rate_sec'] = self.sample_rate_sec # 5 - return result diff --git a/gencode/python/udmi/schema/model_testing.py b/gencode/python/udmi/schema/model_testing.py deleted file mode 100644 index 7f3b287d2d..0000000000 --- a/gencode/python/udmi/schema/model_testing.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Generated class for model_testing.json""" -from .model_testing_target import TargetTestingMetadata - - -class TestingMetadata: - """Generated schema class""" - - def __init__(self): - self.targets = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = TestingMetadata() - result.targets = TargetTestingMetadata.map_from(source.get('targets')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = TestingMetadata.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.targets: - result['targets'] = TargetTestingMetadata.expand_dict(self.targets) # 2 - return result diff --git a/gencode/python/udmi/schema/model_testing_target.py b/gencode/python/udmi/schema/model_testing_target.py deleted file mode 100644 index 1a02b59550..0000000000 --- a/gencode/python/udmi/schema/model_testing_target.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Generated class for model_testing_target.json""" - - -class TargetTestingMetadata: - """Generated schema class""" - - def __init__(self): - self.target_point = None - self.target_value = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = TargetTestingMetadata() - result.target_point = source.get('target_point') - result.target_value = source.get('target_value') - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = TargetTestingMetadata.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.target_point: - result['target_point'] = self.target_point # 5 - if self.target_value: - result['target_value'] = self.target_value # 5 - return result diff --git a/gencode/python/udmi/schema/properties.py b/gencode/python/udmi/schema/properties.py deleted file mode 100644 index 55129a4ca7..0000000000 --- a/gencode/python/udmi/schema/properties.py +++ /dev/null @@ -1,46 +0,0 @@ -"""Generated class for properties.json""" - - -class Properties: - """Generated schema class""" - - def __init__(self): - self.key_type = None - self.version = None - self.connect = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = Properties() - result.key_type = source.get('key_type') - result.version = source.get('version') - result.connect = source.get('connect') - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = Properties.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.key_type: - result['key_type'] = self.key_type # 5 - if self.version: - result['version'] = self.version # 5 - if self.connect: - result['connect'] = self.connect # 5 - return result diff --git a/gencode/python/udmi/schema/state.py b/gencode/python/udmi/schema/state.py deleted file mode 100644 index bc46b3cef6..0000000000 --- a/gencode/python/udmi/schema/state.py +++ /dev/null @@ -1,67 +0,0 @@ -"""Generated class for state.json""" -from .state_system import SystemState -from .state_gateway import GatewayState -from .state_discovery import DiscoveryState -from .state_blobset import BlobsetState -from .state_pointset import PointsetState - - -class State: - """Generated schema class""" - - def __init__(self): - self.timestamp = None - self.version = None - self.system = None - self.gateway = None - self.discovery = None - self.blobset = None - self.pointset = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = State() - result.timestamp = source.get('timestamp') - result.version = source.get('version') - result.system = SystemState.from_dict(source.get('system')) - result.gateway = GatewayState.from_dict(source.get('gateway')) - result.discovery = DiscoveryState.from_dict(source.get('discovery')) - result.blobset = BlobsetState.from_dict(source.get('blobset')) - result.pointset = PointsetState.from_dict(source.get('pointset')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = State.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.timestamp: - result['timestamp'] = self.timestamp # 5 - if self.version: - result['version'] = self.version # 5 - if self.system: - result['system'] = self.system.to_dict() # 4 - if self.gateway: - result['gateway'] = self.gateway.to_dict() # 4 - if self.discovery: - result['discovery'] = self.discovery.to_dict() # 4 - if self.blobset: - result['blobset'] = self.blobset.to_dict() # 4 - if self.pointset: - result['pointset'] = self.pointset.to_dict() # 4 - return result diff --git a/gencode/python/udmi/schema/state_blobset.py b/gencode/python/udmi/schema/state_blobset.py deleted file mode 100644 index 442abc89a5..0000000000 --- a/gencode/python/udmi/schema/state_blobset.py +++ /dev/null @@ -1,43 +0,0 @@ -"""Generated class for state_blobset.json""" -from .state_blobset_blob import BlobBlobsetState - - -class BlobsetState: - """Generated schema class""" - - def __init__(self): - self.state_etag = None - self.blobs = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = BlobsetState() - result.state_etag = source.get('state_etag') - result.blobs = BlobBlobsetState.map_from(source.get('blobs')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = BlobsetState.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.state_etag: - result['state_etag'] = self.state_etag # 5 - if self.blobs: - result['blobs'] = BlobBlobsetState.expand_dict(self.blobs) # 2 - return result diff --git a/gencode/python/udmi/schema/state_blobset_blob.py b/gencode/python/udmi/schema/state_blobset_blob.py deleted file mode 100644 index f6b089f5ff..0000000000 --- a/gencode/python/udmi/schema/state_blobset_blob.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Generated class for state_blobset_blob.json""" -from .common import Entry - - -class BlobBlobsetState: - """Generated schema class""" - - def __init__(self): - self.stage = None - self.result = None - self.status = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = BlobBlobsetState() - result.stage = source.get('stage') - result.result = source.get('result') - result.status = Entry.from_dict(source.get('status')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = BlobBlobsetState.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.stage: - result['stage'] = self.stage # 5 - if self.result: - result['result'] = self.result # 5 - if self.status: - result['status'] = self.status.to_dict() # 4 - return result diff --git a/gencode/python/udmi/schema/state_discovery.py b/gencode/python/udmi/schema/state_discovery.py deleted file mode 100644 index 6a116fee6a..0000000000 --- a/gencode/python/udmi/schema/state_discovery.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Generated class for state_discovery.json""" -from .state_discovery_family import FamilyDiscoveryState -from .state_discovery_family import FamilyDiscoveryState - - -class DiscoveryState: - """Generated schema class""" - - def __init__(self): - self.enumeration = None - self.families = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = DiscoveryState() - result.enumeration = FamilyDiscoveryState.from_dict(source.get('enumeration')) - result.families = FamilyDiscoveryState.map_from(source.get('families')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = DiscoveryState.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.enumeration: - result['enumeration'] = self.enumeration.to_dict() # 4 - if self.families: - result['families'] = FamilyDiscoveryState.expand_dict(self.families) # 2 - return result diff --git a/gencode/python/udmi/schema/state_discovery_family.py b/gencode/python/udmi/schema/state_discovery_family.py deleted file mode 100644 index a97ee8cf03..0000000000 --- a/gencode/python/udmi/schema/state_discovery_family.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Generated class for state_discovery_family.json""" -from .common import Entry - - -class FamilyDiscoveryState: - """Generated schema class""" - - def __init__(self): - self.generation = None - self.active = None - self.status = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = FamilyDiscoveryState() - result.generation = source.get('generation') - result.active = source.get('active') - result.status = Entry.from_dict(source.get('status')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = FamilyDiscoveryState.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.generation: - result['generation'] = self.generation # 5 - if self.active: - result['active'] = self.active # 5 - if self.status: - result['status'] = self.status.to_dict() # 4 - return result diff --git a/gencode/python/udmi/schema/state_gateway.py b/gencode/python/udmi/schema/state_gateway.py deleted file mode 100644 index 981aeabc74..0000000000 --- a/gencode/python/udmi/schema/state_gateway.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Generated class for state_gateway.json""" - - -class GatewayState: - """Generated schema class""" - - def __init__(self): - self.devices = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = GatewayState() - result.devices = source.get('devices') - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = GatewayState.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.devices: - result['devices'] = self.devices # 5 - return result diff --git a/gencode/python/udmi/schema/state_pointset.py b/gencode/python/udmi/schema/state_pointset.py deleted file mode 100644 index 2d037e21a0..0000000000 --- a/gencode/python/udmi/schema/state_pointset.py +++ /dev/null @@ -1,56 +0,0 @@ -"""Generated class for state_pointset.json""" -from .common import Entry -from .state_pointset_point import PointPointsetState - - -class PointsetState: - """Generated schema class""" - - def __init__(self): - self.timestamp = None - self.version = None - self.state_etag = None - self.status = None - self.points = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = PointsetState() - result.timestamp = source.get('timestamp') - result.version = source.get('version') - result.state_etag = source.get('state_etag') - result.status = Entry.from_dict(source.get('status')) - result.points = PointPointsetState.map_from(source.get('points')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = PointsetState.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.timestamp: - result['timestamp'] = self.timestamp # 5 - if self.version: - result['version'] = self.version # 5 - if self.state_etag: - result['state_etag'] = self.state_etag # 5 - if self.status: - result['status'] = self.status.to_dict() # 4 - if self.points: - result['points'] = PointPointsetState.expand_dict(self.points) # 2 - return result diff --git a/gencode/python/udmi/schema/state_pointset_point.py b/gencode/python/udmi/schema/state_pointset_point.py deleted file mode 100644 index 5369184964..0000000000 --- a/gencode/python/udmi/schema/state_pointset_point.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Generated class for state_pointset_point.json""" -from .common import Entry - - -class PointPointsetState: - """Generated schema class""" - - def __init__(self): - self.units = None - self.value_state = None - self.status = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = PointPointsetState() - result.units = source.get('units') - result.value_state = source.get('value_state') - result.status = Entry.from_dict(source.get('status')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = PointPointsetState.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.units: - result['units'] = self.units # 5 - if self.value_state: - result['value_state'] = self.value_state # 5 - if self.status: - result['status'] = self.status.to_dict() # 4 - return result diff --git a/gencode/python/udmi/schema/state_system.py b/gencode/python/udmi/schema/state_system.py deleted file mode 100644 index 37f11f2d2a..0000000000 --- a/gencode/python/udmi/schema/state_system.py +++ /dev/null @@ -1,63 +0,0 @@ -"""Generated class for state_system.json""" -from .common import Entry - - -class SystemState: - """Generated schema class""" - - def __init__(self): - self.last_config = None - self.operational = None - self.serial_no = None - self.hardware = None - self.software = None - self.params = None - self.status = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = SystemState() - result.last_config = source.get('last_config') - result.operational = source.get('operational') - result.serial_no = source.get('serial_no') - result.hardware = source.get('hardware') - result.software = source.get('software') - result.params = source.get('params') - result.status = Entry.from_dict(source.get('status')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = SystemState.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.last_config: - result['last_config'] = self.last_config # 5 - if self.operational: - result['operational'] = self.operational # 5 - if self.serial_no: - result['serial_no'] = self.serial_no # 5 - if self.hardware: - result['hardware'] = self.hardware # 1 - if self.software: - result['software'] = self.software # 1 - if self.params: - result['params'] = self.params # 1 - if self.status: - result['status'] = self.status.to_dict() # 4 - return result diff --git a/schema/common.json b/schema/common.json index ff5ba47626..ccfbec64f8 100644 --- a/schema/common.json +++ b/schema/common.json @@ -45,9 +45,6 @@ "timestamp", "level" ] - }, - "families": { - "enum": [ "bacnet", "ipv4", "ipv6" ] } } } diff --git a/schema/config_localnet.json b/schema/config_localnet.json index 15793bbabf..1971f7f455 100644 --- a/schema/config_localnet.json +++ b/schema/config_localnet.json @@ -5,29 +5,29 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { - "subsystem": { - "title": "Subsystem Reference", + "families": { + "title": "Family Reference", "patternProperties": { "^[a-z0-9-]+$": { "additionalProperties": false, "type": "object", - "description": "The type of network", - "examples": ["bacnet", "modbus"], + "description": "The network family", + "examples": ["bacnet", "ipv4"], "properties": { - "local_id": { + "id": { "description": "The address of a device on the local network", "examples": ["4148893"], "type": "string" } }, "required": [ - "local_id" + "id" ] } } } }, "required": [ - "subsystem" + "families" ] } diff --git a/schema/event_discovery.json b/schema/event_discovery.json index be4a3da8e9..a9838c6e9b 100644 --- a/schema/event_discovery.json +++ b/schema/event_discovery.json @@ -44,36 +44,6 @@ "$ref": "file:event_discovery_point.json#" } } - }, - "blobs": { - "description": "Collection of data blobs recognized by this device.", - "additionalProperties": false, - "existingJavaType": "java.util.HashMap", - "patternProperties": { - "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { - "$ref": "file:event_discovery_blob.json#" - } - } - }, - "points": { - "description": "Collection of data points available for this device.", - "additionalProperties": false, - "existingJavaType": "java.util.Map", - "patternProperties": { - "^[a-zA-Z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$": { - "$ref": "file:event_discovery_point.json#" - } - } - }, - "blobs": { - "description": "Collection of data blobs recognized by this device.", - "additionalProperties": false, - "existingJavaType": "java.util.HashMap", - "patternProperties": { - "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { - "$ref": "file:event_discovery_blob.json#" - } - } } }, "required": [ diff --git a/schema/event_discovery_blob.json b/schema/event_discovery_blob.json deleted file mode 100644 index 317d26b316..0000000000 --- a/schema/event_discovery_blob.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "title": "Blob Enumeration Event", - "description": "Object representation for for a single blob enumeration", - "type": "object", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "description": { - "description": "Description of this blob", - "type": "string" - }, - "firmware_set": { - "description": "Indicating if this blob is part of the device's firmware set", - "type": "boolean" - } - } -} diff --git a/schema/model_gateway.json b/schema/model_gateway.json index 998b53dd3f..261f69c681 100644 --- a/schema/model_gateway.json +++ b/schema/model_gateway.json @@ -6,17 +6,13 @@ "additionalProperties": false, "properties": { "gateway_id": { - "description": "Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to", + "description": "The device ID of the gateway the device is bound to", "type": "string", "pattern": "^[A-Z]{2,6}-[0-9]{1,6}$", "examples": ["GAT-100"] }, - "subsystem": { - "type": "string", - "pattern": "^[a-z0-9-]+$" - }, "proxy_ids": { - "description": "Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device", + "description": "An array of all the device IDs which are bound to the device", "type": "array", "items": { "type": "string", diff --git a/schema/model_localnet.json b/schema/model_localnet.json index 70c3cf88fd..8276af1c6e 100644 --- a/schema/model_localnet.json +++ b/schema/model_localnet.json @@ -5,17 +5,17 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { - "subsystem": { + "families": { "additionalProperties": false, - "existingJavaType": "java.util.HashMap", + "existingJavaType": "java.util.HashMap", "patternProperties": { "^[a-z0-9-]+$": { - "$ref": "file:model_localnet_subsystem.json" + "$ref": "file:model_localnet_family.json" } } } }, "required": [ - "subsystem" + "families" ] } diff --git a/schema/model_localnet_subsystem.json b/schema/model_localnet_families.json similarity index 82% rename from schema/model_localnet_subsystem.json rename to schema/model_localnet_families.json index bfeff9b1dd..ac8f88d733 100644 --- a/schema/model_localnet_subsystem.json +++ b/schema/model_localnet_families.json @@ -1,18 +1,18 @@ { - "title": "Subsystem Localnet Metadata", + "title": "Family Localnet Metadata", "type": "object", "description": "The type of network", "examples": ["bacnet", "modbus"], "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { - "local_id": { + "id": { "type": "string", "description": "The address of a device on the local network", "examples": ["4148893"] } }, "required": [ - "local_id" + "id" ] } From 5326a673e67c1de8df421d5f1ebb666e523d1434 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 14 Apr 2022 09:28:10 -0700 Subject: [PATCH 47/95] Gencode --- .gencode_hash.txt | 30 +- gencode/docs/config.html | 2081 ++++++++ gencode/docs/envelope.html | 273 ++ gencode/docs/event_discovery.html | 1332 ++++++ gencode/docs/event_pointset.html | 280 ++ gencode/docs/event_system.html | 740 +++ gencode/docs/index.html | 26 + gencode/docs/metadata.html | 2450 ++++++++++ gencode/docs/schema_doc.css | 180 + gencode/docs/schema_doc.min.js | 1 + gencode/docs/schema_extras.js | 20 + gencode/docs/state.html | 4173 +++++++++++++++++ gencode/python/udmi/schema/__init__.py | 20 + gencode/python/udmi/schema/metadata.py | 76 + gencode/python/udmi/schema/model_localnet.py | 38 + .../udmi/schema/model_localnet_family.py | 38 + gencode/python/udmi/schema/model_pointset.py | 39 + .../udmi/schema/model_pointset_point.py | 74 + gencode/python/udmi/schema/model_testing.py | 39 + .../udmi/schema/model_testing_target.py | 42 + gencode/python/udmi/schema/properties.py | 46 + gencode/python/udmi/schema/state.py | 67 + gencode/python/udmi/schema/state_blobset.py | 43 + .../python/udmi/schema/state_blobset_blob.py | 47 + gencode/python/udmi/schema/state_discovery.py | 44 + .../udmi/schema/state_discovery_family.py | 47 + gencode/python/udmi/schema/state_gateway.py | 38 + gencode/python/udmi/schema/state_pointset.py | 56 + .../udmi/schema/state_pointset_point.py | 47 + gencode/python/udmi/schema/state_system.py | 63 + ...milies.json => model_localnet_family.json} | 0 31 files changed, 12434 insertions(+), 16 deletions(-) create mode 100644 gencode/docs/config.html create mode 100644 gencode/docs/envelope.html create mode 100644 gencode/docs/event_discovery.html create mode 100644 gencode/docs/event_pointset.html create mode 100644 gencode/docs/event_system.html create mode 100644 gencode/docs/index.html create mode 100644 gencode/docs/metadata.html create mode 100644 gencode/docs/schema_doc.css create mode 100644 gencode/docs/schema_doc.min.js create mode 100644 gencode/docs/schema_extras.js create mode 100644 gencode/docs/state.html create mode 100644 gencode/python/udmi/schema/model_localnet_family.py create mode 100644 gencode/python/udmi/schema/model_pointset.py create mode 100644 gencode/python/udmi/schema/model_pointset_point.py create mode 100644 gencode/python/udmi/schema/model_testing.py create mode 100644 gencode/python/udmi/schema/model_testing_target.py create mode 100644 gencode/python/udmi/schema/properties.py create mode 100644 gencode/python/udmi/schema/state.py create mode 100644 gencode/python/udmi/schema/state_blobset.py create mode 100644 gencode/python/udmi/schema/state_blobset_blob.py create mode 100644 gencode/python/udmi/schema/state_discovery.py create mode 100644 gencode/python/udmi/schema/state_discovery_family.py create mode 100644 gencode/python/udmi/schema/state_gateway.py create mode 100644 gencode/python/udmi/schema/state_pointset.py create mode 100644 gencode/python/udmi/schema/state_pointset_point.py create mode 100644 gencode/python/udmi/schema/state_system.py rename schema/{model_localnet_families.json => model_localnet_family.json} (100%) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index cabe15dc82..f7aa720b9a 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,10 +1,10 @@ -9da00f435b13bf779454dc411343f8ecf804ef520403ea5633c107e08242461d gencode/docs/config.html +97695067e507720ef649cca27a0eb9ebf9ba8bebe31898289b7d6586a9ada6db gencode/docs/config.html 6371d915647bc852edb7bc446637c2d43d3c3db49661f62d7c27d3d71c6671dd gencode/docs/envelope.html -559379abd267e9719a2bee98e56c21301853b6f69bc37fddc501acc57ce7cd63 gencode/docs/event_discovery.html +c868a6c3d682b8bd22991797428e1871d072db807f23b94e8b4f48bc3acf4f2d gencode/docs/event_discovery.html 987503860562a3971314a98d75890b6c7615fee84bff6bede7010231f469c035 gencode/docs/event_pointset.html e3fb2b1a96f6fcb06f5af6cff32829abc825065ed52de81c3d379c8c8070fe09 gencode/docs/event_system.html a82821e72af6d0ee35800e6262eb9bb05256309b98aed2dad1a368fd2d6882bb gencode/docs/index.html -add4d0308ce0688ddcc19e8de74d362847e11b12cb3ff0f9933d42386b02e696 gencode/docs/metadata.html +af515ef7866b36ffb7e7a64c2e7f00c636101ede9a88f05aa38c5cc2e6aa55ec gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js @@ -14,14 +14,13 @@ d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/u 0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java 724ad8db7982f4d703c05245119dc7f7ff731d2141dd861893b55684e3cd6224 gencode/java/udmi/schema/BlobBlobsetConfig.java 7f54da38284a1010de1a2590381022fa16d27fd141d76d1ba6eb471de4d94781 gencode/java/udmi/schema/BlobBlobsetState.java -60279d5d9aa911f25e934aabee3ca06c64a36cd438fe9b255df391c04d540814 gencode/java/udmi/schema/BlobEnumerationEvent.java d2c5b5aae8db27b68104fc83a1f38de0a3f1b5d683f2b13599adf24e96c7d124 gencode/java/udmi/schema/BlobsetConfig.java b6ff9b8739a9c3bb6972f73db6fc54f451189c13b273e58bc11cb3d82c74ad40 gencode/java/udmi/schema/BlobsetState.java 90d6e869087d4dfdc2c29c7f51872e630ad8135542dd432629bf4edac807053a gencode/java/udmi/schema/CloudMetadata.java 28001569e7902d3aa39aa3749ca08fb8e29460ba97a4b560d266b365bf5f8c46 gencode/java/udmi/schema/Config.java 67ac3441ce6d5d4450741ee7e639174756498e1b3780c2d18ce20562b5a88c26 gencode/java/udmi/schema/DiscoveryCommand.java 3d9a243dcdc6dce31a2b0671d473c60d4cc972087025c7e099f8b4bf85a800da gencode/java/udmi/schema/DiscoveryConfig.java -eb3df3042d3c2008e51c35f35074741ba94a5a7fd590b5f1e59bd30ec19b4c2f gencode/java/udmi/schema/DiscoveryEvent.java +bc9b7989e6548af57944a244dcc9578c4de82aabb58bea36b7d2957c9f8d058c gencode/java/udmi/schema/DiscoveryEvent.java b9b1c6dc52c28630021c76d51305cb2fe634c557f3cf9b8e5c8c8abf456e6216 gencode/java/udmi/schema/DiscoveryState.java 090bbaf1508aa6ca8380af936af990673f300eb5a940c9e8ab94deb64efa2b7b gencode/java/udmi/schema/Entry.java d5cd62caeb10e69d1c7099019a45f995c9b483061ef0832aac711a790b2023c8 gencode/java/udmi/schema/Envelope.java @@ -30,12 +29,13 @@ e9f5c77be81486b6b8c6d88f70f2d50583d8c3fafa2ac09ead80f44b8d5e751e gencode/java/u aa0885ca43ab38c7597eacc38b7c512940a1a9fa061abd47d02c28e66b6fd93e gencode/java/udmi/schema/FamilyDiscoveryConfig.java ae4a645f199c8e24b3303463d428ca17af7603ae9ae9238397a6a82e752ab454 gencode/java/udmi/schema/FamilyDiscoveryEvent.java 0afc15acd72874e5a0c47f546abc0c4569f5bc37838fdcac77bc7bd55cc53a6d gencode/java/udmi/schema/FamilyDiscoveryState.java +d7aeee0fe20a8dd8d92e43e10d5b563ba4d70cb259f17c5818f3a0a4eed1e2ec gencode/java/udmi/schema/FamilyLocalnetMetadata.java 60a8115ae1acae7c199b63180823198d38ec50d57b48dd85aca1ccc865058f85 gencode/java/udmi/schema/GatewayConfig.java -4e9a913d5cf47a5901a63ec005115c58884e06c2cd6ba6bb786ffbb7c7fdaf74 gencode/java/udmi/schema/GatewayMetadata.java +e87c30201fbfe2670a48e700e4da82a41c1d1623746106c0c0baf2ff4be35b1e gencode/java/udmi/schema/GatewayMetadata.java e0e7739046e834c0f0ca6a70b38b4579618899be3162887a0fa7ab60bbff22a5 gencode/java/udmi/schema/GatewayState.java a5e5adfc187709e8646a11c92e804acfb67743f9d72149008aaca954df3177f6 gencode/java/udmi/schema/Level.java -f53c891932643871f93368cfe797cac6fd4ed0f64e71c893f275cd7184cb8019 gencode/java/udmi/schema/LocalnetConfig.java -fc2bf2d94a9cbfb600a381c7b3dad66850b2646a388183848e913de1b102a40f gencode/java/udmi/schema/LocalnetMetadata.java +07fd4911363437b274c19b024759b04b116152176702da8d4203c4ff4cb55b7f gencode/java/udmi/schema/LocalnetConfig.java +419f04e56922a444c6cc1148796108df2c804cbe139f42b5505c3c48303a573c gencode/java/udmi/schema/LocalnetMetadata.java 2df4ae32d0bbecc21f7c3f6a416a195baa766a6210cfa8abca4a7bb45b9c7961 gencode/java/udmi/schema/Location.java 09b7447c86ae5361019be8f6c12d80465679f5525fc1a4528607642c0d5f035d gencode/java/udmi/schema/Metadata.java a4e8f69100ab678a8236f481c558d677bbaea3e76c853bbd9262113d2a9c031d gencode/java/udmi/schema/Metrics.java @@ -52,14 +52,13 @@ fc3a9415c04d8a06954dbdbfdff5d68ab113cce3948532c19df555778ffb04fa gencode/java/u ca2e7566106818ca7e5190c8041eb86f0c9b3251b0bda8c3ea7ce11a0c891a0a gencode/java/udmi/schema/Position.java 6ddce136f5e34e7e8c7d101c8a729f1fdd323befdfa52590ebdf0028f970bdf5 gencode/java/udmi/schema/Properties.java 0a1a025dde88fd46925cbb56f5179ed2803ea97948292809ff328a5201d90a3e gencode/java/udmi/schema/State.java -b4ea53b14862fa50403cdfc481d55ea2b2eb5e3b3aae43d54c9181114e8fff04 gencode/java/udmi/schema/SubsystemLocalnetMetadata.java 6b8b054c5fa2baef5163d42cd6bf1b0aeb4d07aa881529d81f4ae7dfa4c2906e gencode/java/udmi/schema/SystemConfig.java 8075f2133463e55ac24fccf9391c94698c580b860ad1a0901d5346a2f369030b gencode/java/udmi/schema/SystemEvent.java c46848327791cec1f1e62dbee2ad66951af7f61ed3c56eeaa8e563774e305bf4 gencode/java/udmi/schema/SystemMetadata.java 451217e2cce0ae9224a86f35b3bdea14b36658efe6f94f4a2dff4f4b1dc51cf7 gencode/java/udmi/schema/SystemState.java 27d6b50dc51b373d24a701728b4d43d31fe841a9a1d77fe3e45dac332674c308 gencode/java/udmi/schema/TargetTestingMetadata.java a77e801f3b07cd8b7042adfe8e5e62d7a83b63a1b449a356fa13c846811ab576 gencode/java/udmi/schema/TestingMetadata.java -f4810ca551157744e6d3d8fb0c0749ee2bc89c69d427bde67c3d166a6558b844 gencode/python/udmi/schema/__init__.py +8950b2d9d22cbdf4cc384c36656a163b457e9133c6f4305815c4c3e7f2545d35 gencode/python/udmi/schema/__init__.py 6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 704c8f0eec0b87015af8f7e524375f651b3d35f659ec89b4b022f8c1d0813ec5 gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py @@ -68,14 +67,13 @@ b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python ec6c6ab1fb0f37a29b7ebd162aa77da7f1e261e80da376942a3b39d17ccf1be4 gencode/python/udmi/schema/config_discovery.py a5edb9ac5ecd5a4459f93ce613691735f299f35718f2e35410206fc91c263dd1 gencode/python/udmi/schema/config_discovery_family.py b461bdc24310ef972faf579b5be577b5af67fb0977d6afb4c42955211b26e3d5 gencode/python/udmi/schema/config_gateway.py -30a3402a54386032928bda5b9e60e5fd9ac47c53b4ffc5679fe24d24901ed660 gencode/python/udmi/schema/config_localnet.py +573573ad49760e95ed140c7ff76dd7884aee3c47145f635c7b9e5b8c940dddcb gencode/python/udmi/schema/config_localnet.py 9eab64849e04b25203d5da47856c3f8dda2b96903e4dc43ab932ee35014700bd gencode/python/udmi/schema/config_pointset.py 3f23e78163fdc4a2638b2691fdf3f45f1547e8f9b605073339b16e76d894d401 gencode/python/udmi/schema/config_pointset_point.py 1c178f298884d66c72b295319f3e29b4178b0eaf5201aebd93ba80699e7466d5 gencode/python/udmi/schema/config_system.py 631371489cb1275517bebcc4040cbc655d18ca147ab540701b3fd9cedba138c5 gencode/python/udmi/schema/envelope.py 1eb9019b9d0b4ff7de2df8beb625a4f89292d636ece0c02f160495c537bd6c2c gencode/python/udmi/schema/event.py -f74b62b11bbbd37ea8968ead811dc2534c4996a3dcfd3671807988b7874de347 gencode/python/udmi/schema/event_discovery.py -3ea3e50436e6b87fbcd773361f4a5cd1662b554a1f3eba47c1670c7f82a765ea gencode/python/udmi/schema/event_discovery_blob.py +110a3b4f53c7402a68b928a110c3659ef724022820d15d416b830af091e2ace1 gencode/python/udmi/schema/event_discovery.py ad33b91a7fabb4eed7e49c30a983a2106c96330facbe0f376f94d06e2263d6d0 gencode/python/udmi/schema/event_discovery_family.py 266c36a6174c959017894de6051f7d6071ac59ed3f049df9cbb49b894c11c84e gencode/python/udmi/schema/event_discovery_point.py abe4044d2e3be6693ed39edc8ccaed4eee4eb8acad991e820b21d6ecf3812dd9 gencode/python/udmi/schema/event_mapping.py @@ -84,9 +82,9 @@ ddf849bfeb2b87d071cefd5e6feacabc57375a7fff6d72b6d42ffb89f33c859b gencode/python a27b3b2ace3f301b5fa08a3763f792158f9725a5fbed5cd7b5fac8a6701080e4 gencode/python/udmi/schema/event_system.py 9eb0b155183881c709d853b3f65d26a20042c8daee78179595c5b26eaee9477d gencode/python/udmi/schema/metadata.py defe9fcce671ff4ac1a91b9d60ff2260f60865a13fba29c032ff356b1b79f471 gencode/python/udmi/schema/model_cloud.py -a2893a9ea1f00b27f753636683a71c89b007de4fe44e8726b06eb369473cadf5 gencode/python/udmi/schema/model_gateway.py -49c11b29d2e8358ef77e1190e44d97eaefa22d88c0339b790d79d4f8c8cbe9db gencode/python/udmi/schema/model_localnet.py -de8481d0a1106ca74a5a33777bccb325f92476d92ae353e30fcc755819e537b2 gencode/python/udmi/schema/model_localnet_subsystem.py +b8360e738ff12d348061a9799f777d9c1b75e458ddf6d3db4b7dcc07c3f69c09 gencode/python/udmi/schema/model_gateway.py +89ce7a460f6cba70b067329d2b58814fc2adfee9f783890b148babdceb1f5d2a gencode/python/udmi/schema/model_localnet.py +c1ebc4c6885a3299156300e27cefe63e3b745f595882e0e2be88bb61435d0752 gencode/python/udmi/schema/model_localnet_family.py b0cfc2a86539f3525f2da52d7b0422bb8934348690f25d9ab64c38e7a8a20536 gencode/python/udmi/schema/model_pointset.py 347b1ee16f74b8cdfa83aa4e179af5a5529545daf1736baf401936c7cf9e7809 gencode/python/udmi/schema/model_pointset_point.py cd00563a4e0be9112f6d8af3335acc12b0d3354beab602ab924aac59a0f588e4 gencode/python/udmi/schema/model_system.py diff --git a/gencode/docs/config.html b/gencode/docs/config.html new file mode 100644 index 0000000000..91605d7f68 --- /dev/null +++ b/gencode/docs/config.html @@ -0,0 +1,2081 @@ + + + + + + + + + + + + + + + + Config + +

Config

+ + +
+ + Type: object
+

The config block controls a device's intended behavior. Config Documentation

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the configuration was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Major version of the UDMI schema

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

System Config Documentation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: integer Default: 300
+

The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300.

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer Default: 600
+

The rate at which the system should send system event metric updates. 0 indicates no updates.

+
+ + + +

Value must be greater or equal to 0 and lesser or equal to 86400

+ + +
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Configuration for gateways. Only required for devices which are acting as gateways

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: array of string
+

An array of all the device IDs which are bound to the device

+
+ + + + + +

Each item of this array must be:

+
+
+ + + Type: string
+Must match regular expression: ^[A-Z]{3}-[1-9][0-9]{0,2}$ + + + + + + +
+

+
Example:
+
[
+    "AHU-22"
+]
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Configuration for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Configuration for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generational marker for controlling discovery

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Period, in seconds, for automatic scanning

+
+ + + +

Value must be greater or equal to 0

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Scan duration, in seconds

+
+ + + +

Value must be greater or equal to 0

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates implicit enumeration of discovered devices

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Address family results for a scan. Not included for device enumeration messages.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$ +
+ + Type: object
+

Configuration for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generational marker for controlling discovery

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Period, in seconds, for automatic scanning

+
+ + + +

Value must be greater or equal to 0

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Scan duration, in seconds

+
+ + + +

Value must be greater or equal to 0

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates implicit enumeration of discovered devices

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Used to describe device local network parameters

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z0-9-]+$ +
+ + Type: object
+

The network family

+
No Additional Properties + + + + + +
+
Examples:
+
"bacnet"
+
+
"ipv4"
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The address of a device on the local network

+
+ + + + + +
+
Example:
+
"4148893"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Pointset Config Documentation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the configuration was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Version of the UDMI schema

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The state_etag of the last state message sent by the device. Writeback documentation

+
+ + + +

Must be at most 32 characters long

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An expiry for the the device reverts to its operational state, and sends a state update to notify the cloud of the state change. Writeback documentation

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.

+
+ + + +

Value must be greater or equal to 0 and lesser or equal to 86400

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Maximum time between samples for the device to send out a complete update. It can send out updates more frequently than this. Default to 600.

+
+ + + +

Value must be greater or equal to 1 and lesser or equal to 86400

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

The points defined in this dictionary is the authoritative source indicating the representative points for the device (in both telemetry and state messages). Pointset doumentation

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Mapping for the point to an internal resource (e.g. BACnet object reference)

+
+ + + + + +
+
Example:
+
"AI1106.Present_Value"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

If specified, indicates the units the device should report the data in.

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Used for cloud writeback functionality, this field specifies the value for a given point in the device's current units.

+
+ + + + + +
+
Example:
+
22.4
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300.

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.

+
+ + + +

Value must be greater or equal to 0 and lesser or equal to 86400

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Maximum time between samples for the device to send out a complete update. It can send out updates more frequently than this. Default to 600.

+
+ + + +

Value must be greater or equal to 1 and lesser or equal to 86400

+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/gencode/docs/envelope.html b/gencode/docs/envelope.html new file mode 100644 index 0000000000..c076fcaa29 --- /dev/null +++ b/gencode/docs/envelope.html @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + Envelope + +

Envelope

+ + +
+ + Type: object
+

The UDMI envelope is not a message itself, per se, but the attributes and other information that is delivered along with a message. Message Envelope Documentation

+
+ + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^[0-9]+$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^[a-zA-Z][-a-zA-Z0-9._+~%]*[a-zA-Z0-9]$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^([.a-z]+:)?[a-z][-a-z0-9]*[a-z0-9]$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: enum (of string)
+
+

Must be one of:

+
  • "update"
  • "discovery"
  • "system"
  • "gateway"
  • "localnet"
  • "pointset"
  • "blobset"
+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: enum (of string)
+
+

Must be one of:

+
  • "event"
  • "command"
  • "state"
  • "config"
  • "model"
+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+

Additional Properties of any type are allowed.

+ + Type: object
+ + + + + + + +
+
+
+
+ + + \ No newline at end of file diff --git a/gencode/docs/event_discovery.html b/gencode/docs/event_discovery.html new file mode 100644 index 0000000000..c76f24072b --- /dev/null +++ b/gencode/docs/event_discovery.html @@ -0,0 +1,1332 @@ + + + + + + + + + + + + + + + + Discovery Event + +

Discovery Event

+ + +
+ + Type: object
+

Discovery result with implicit enumeration

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the discover telemetry event was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Major version of the UDMI schema

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The event's discovery scan trigger's generation timestamp

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Address family results for a scan. Not included for device enumeration messages.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$ +
+ + Type: object
+

Discovery information for an individual protocol family.

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Device id in the namespace of the given family

+
Must match regular expression: ^[-_.:0-9A-Z]+$ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Collection of data points available for this device.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-zA-Z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$ +
+ + Type: object
+

Object representation for for a single point enumeration

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: array of string
+

List of possible enumerated values for the point

+
+ + + + + +

Each item of this array must be:

+
+
+ + + Type: string
+ + + + + + + +
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Current or default unit for this point

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Current or default type for this point

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Reference parameter for this point (e.g. BACnet object)

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates if this point is writable or not

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Human-readable description of this point

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Arbitrary blob of json associated with this point

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/gencode/docs/event_pointset.html b/gencode/docs/event_pointset.html new file mode 100644 index 0000000000..43999b3019 --- /dev/null +++ b/gencode/docs/event_pointset.html @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + Pointset Event + +

Pointset Event

+ + +
+ + Type: object
+

A set of points reporting telemetry data. Pointset Event Documentation

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the telemetry event was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Major version of the UDMI schema

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates if this is a partial update (only some points may be included)

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Collection of point names, defining the representative point set for this device.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+

Object representation for for a single point

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+

The specific point data reading

+
+ + + + + +
+
Examples:
+
24.1
+
+
"running"
+
+
4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/gencode/docs/event_system.html b/gencode/docs/event_system.html new file mode 100644 index 0000000000..3ad905234c --- /dev/null +++ b/gencode/docs/event_system.html @@ -0,0 +1,740 @@ + + + + + + + + + + + + + + + + System Event + +

System Event

+ + +
+ + Type: object
+

Used for system events such as logging. System Event Documentation

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the event payload was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Major version of the UDMI schema

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: array
+ + + + + + +

Each item of this array must be:

+
+
+ + + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: number
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+ + + + + + + +
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/gencode/docs/index.html b/gencode/docs/index.html new file mode 100644 index 0000000000..2eeb0b7f47 --- /dev/null +++ b/gencode/docs/index.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + UDMI Schema + + +

UDMI Schema

+
+ + + \ No newline at end of file diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html new file mode 100644 index 0000000000..54d8f8b38c --- /dev/null +++ b/gencode/docs/metadata.html @@ -0,0 +1,2450 @@ + + + + + + + + + + + + + + + + Metadata + +

Metadata

+ + +
+ + Type: object
+

Metadata is a description about the device: a specification about how the device should be configured and expectations about what the device should be doing. Defined by metadata.json

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the metadata was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Major version of the UDMI schema

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generic human-readable text describing the device

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Automatically generated field that contains the hash of file contents.

+
Must match regular expression: ^[0-9a-z]{8}$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Information specific to how the device communicates with the cloud.

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: enum (of string)
+

The key type used for cloud communication.

+
+

Must be one of:

+
  • "ES256"
  • "ES256_X509"
  • "RS256"
  • "RS256_X509"
+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Whether the device authenticates via a private key. Typically false for devices which are proxied for by an IoT core gateway

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

If the device functions as an IoT Gateway, proxying for other devices using a single logical connection

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

High-level system information about the device. System Metadata Documentation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Properties the expected physical location of the device.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The site name according to the site model in which a device is installed in

+
Must match regular expression: ^[A-Z]{2}-[A-Z]{3}-[A-Z0-9]{2,9}$ + + + + + +
+
Example:
+
"US-SFO-XYY"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^[A-Z0-9-]+$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: number
+

The x coordinate of the device location in a project specific coordinate system

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+

The y coordinate of the device location in a project specific coordinate system

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+

The z (height) coordinate of the device location in a project specific coordinate system

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Information used to print a physical QR code label.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^[a-z]+://[-0-9a-zA-Z_$]+$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^[A-Z]{2}-[A-Z]{3}-[A-Z0-9]{2,9}$ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+Must match regular expression: ^[a-zA-Z0-9-]+$ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Gateway Documentation

+
+ + No Additional Properties

+ +

+
+ + + Type: object
+ +
+

The following properties are required:

+
  • gateway_id
+
+ + + + + +
+ + + Type: object
+ +
+

The following properties are required:

+
  • proxy_ids
+
+ + + + + +
+ + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The device ID of the gateway the device is bound to

+
Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ + + + + + +
+
Example:
+
"GAT-100"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: array of string
+

An array of all the device IDs which are bound to the device

+
+ + + + + +

Each item of this array must be:

+
+
+ + + Type: string
+Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ + + + + + + +
+

+
Example:
+
[
+    "AHU-22"
+]
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Used to describe device local network parameters

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z0-9-]+$ +
+ + Type: object
+

The type of network

+
+ + No Additional Properties + + + + + +
+
Examples:
+
"bacnet"
+
+
"modbus"
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The address of a device on the local network

+
+ + + + + +
+
Example:
+
"4148893"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Testing target parameters

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Point name used for testing

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Value used for testing

+
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Information about a specific point name of the device.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+

Information about a specific point name of the device.

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Expected unit configuration for the point

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates if this point is writable (else read-only)

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Represents the expected baseline value of the point

+
+ + + + + +
+
Example:
+
22
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+

Maximum deviation from baseline_value

+
+ + + + + +
+
Example:
+
2
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: enum (of string)
+

Expected state when baseline_value is set as the set_value for this point the config message

+
+

Must be one of:

+
  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: number
+

Triggering threshold for partial cov update publishing

+
+ + + + + +
+
Example:
+
1
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Mapping for the point to an internal resource (e.g. BACnet object reference)

+
+ + + + + +
+
Examples:
+
"AI3.Present_Value"
+
+
"400070"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300.

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.

+
+ + + +

Value must be greater or equal to 0 and lesser or equal to 86400

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

Maximum time between samples for the device to send out a complete update. It can send out updates more frequently than this. Default to 600.

+
+ + + +

Value must be greater or equal to 1 and lesser or equal to 86400

+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/gencode/docs/schema_doc.css b/gencode/docs/schema_doc.css new file mode 100644 index 0000000000..83897d896b --- /dev/null +++ b/gencode/docs/schema_doc.css @@ -0,0 +1,180 @@ +body { + font: 16px/1.5em "Overpass", "Open Sans", Helvetica, sans-serif; + color: #333; + font-weight: 300; + padding: 40px; +} + +.btn.btn-link { + font-size: 18px; +} + +.jsfh-animated-property { + animation: eclair; + animation-iteration-count: 1; + animation-fill-mode: forwards; + animation-duration: .75s; + +} + +@keyframes eclair { + 0%,100% { + transform: scale(1); + } + 50% { + transform: scale(1.03); + } +} + +.btn.btn-primary { + margin: 10px; +} + +.btn.example-show.collapsed:before { + content: "show" +} + +.btn.example-show:before { + content: "hide" +} + +.description.collapse:not(.show) { + max-height: 100px !important; + overflow: hidden; + + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.description.collapsing { + min-height: 100px !important; +} + +.collapse-description-link.collapsed:after { + content: '+ Read More'; +} + +.collapse-description-link:not(.collapsed):after { + content: '- Read Less'; +} + +.badge { + font-size: 100%; + margin-bottom: 0.5rem; + margin-top: 0.5rem; +} + +.badge.value-type { + font-size: 120%; + margin-right: 5px; + margin-bottom: 10px; +} + + +.badge.default-value { + font-size: 120%; + margin-left: 5px; + margin-bottom: 10px; +} + +.badge.restriction { + display: inline-block; +} + +.badge.required-property,.badge.deprecated-property,.badge.pattern-property,.badge.no-additional { + font-size: 100%; + margin-left: 10px; +} + +.accordion div.card:only-child { + border-bottom: 1px solid rgba(0, 0, 0, 0.125); +} + +.examples { + padding: 1rem !important; +} + +.examples pre { + margin-bottom: 0; +} + +.highlight.jumbotron { + padding: 1rem !important; +} + +.generated-by-footer { + margin-top: 1em; + text-align: right; +} + +/* From https://github.com/richleland/pygments-css/blob/master/friendly.css, see https://github.com/trentm/python-markdown2/wiki/fenced-code-blocks */ +.highlight { background: #e9ecef; } /* Changed from #f0f0f0 in the original style to be the same as bootstrap's jumbotron */ +.highlight .hll { background-color: #ffffcc } +.highlight .c { color: #60a0b0; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #60a0b0; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #60a0b0; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #40a070 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #40a070 } /* Literal.Number.Bin */ +.highlight .mf { color: #40a070 } /* Literal.Number.Float */ +.highlight .mh { color: #40a070 } /* Literal.Number.Hex */ +.highlight .mi { color: #40a070 } /* Literal.Number.Integer */ +.highlight .mo { color: #40a070 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287e } /* Name.Function.Magic */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ +.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/gencode/docs/schema_doc.min.js b/gencode/docs/schema_doc.min.js new file mode 100644 index 0000000000..0d9c7882d8 --- /dev/null +++ b/gencode/docs/schema_doc.min.js @@ -0,0 +1 @@ +function flashElement(t){myElement=document.getElementById(t),myElement.classList.add("jsfh-animated-property"),setTimeout(function(){myElement.classList.remove("jsfh-animated-property")},1e3)}function setAnchor(t){history.pushState({},"",t)}function anchorOnLoad(){let t=window.location.hash.split("?")[0].split("&")[0];"#"===t[0]&&(t=t.substr(1)),t.length>0&&anchorLink(t)}function anchorLink(t){$("#"+t).parents().addBack().filter(".collapse:not(.show), .tab-pane, [role='tab']").each(function(t){if($(this).hasClass("collapse"))$(this).collapse("show");else if($(this).hasClass("tab-pane")){const t=$("a[href='#"+$(this).attr("id")+"']");t&&t.tab("show")}else"tab"===$(this).attr("role")&&$(this).tab("show")}),setTimeout(function(){let e=document.getElementById(t);e&&(e.scrollIntoView({block:"center",behavior:"smooth"}),setTimeout(function(){flashElement(t)},500))},1e3)}$(document).on("click",'a[href^="#"]',function(t){t.preventDefault(),history.pushState({},"",this.href)}); \ No newline at end of file diff --git a/gencode/docs/schema_extras.js b/gencode/docs/schema_extras.js new file mode 100644 index 0000000000..03fe3b7dc0 --- /dev/null +++ b/gencode/docs/schema_extras.js @@ -0,0 +1,20 @@ +/** + * Dynamically remove `.md` extension from links when schema browser is viewed + * on a hosted source. This is targeted at Github pages, which only shows the + * rendered MD files when the `.md` extension is omitted (otherwise raw file is + * presented). A dynamic rewrite ensures all the links in the schema files are + * valid, but pretty when clicked online + */ +function removedHostedMDExtensions(){ + const docsRegex = '^(https.*).md(#.*)?$'; + if (window.location.href.match("https://")) { + var links = document.getElementsByTagName("a"); + for (var link of links){ + var match = link.href.match(docsRegex) + if(match) { + var anchor = (match[2] === undefined ? '' : match[2]); + link.href = `${match[1]}${anchor}` + } + } + } +} diff --git a/gencode/docs/state.html b/gencode/docs/state.html new file mode 100644 index 0000000000..0e2d39b036 --- /dev/null +++ b/gencode/docs/state.html @@ -0,0 +1,4173 @@ + + + + + + + + + + + + + + + + State + +

State

+ + +
+ + Type: object
+

State message, defined by [state.json]

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 Timestamp the state payload was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Major version of the UDMI schema

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

System State Documentation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Time from the timestamp field of the last successfully parsed config message (not the timestamp the message was received/processed).

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The serial number of the physical device

+
+ + + + + +
+
Examples:
+
"A1B2C3D4"
+
+
"00001"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^make|model|sku|rev$ +
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z_]+$ +
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z_]+$ +
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Gateway Documentation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + + + + + +
+
+
+

+ +

+
+ +
+

Each additional property must conform to the following schema

+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

State for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+

State for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generational marker for controlling discovery

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates if the discovery process is currently active

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Status information about the discovery operation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Discovery protocol families

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^iot|bacnet|ipv4|ipv6|ethmac$ +
+ + Type: object
+

State for discovery

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Generational marker for controlling discovery

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: boolean
+

Indicates if the discovery process is currently active

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Status information about the discovery operation

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + +

Must be at most 32 characters long

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+ + + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

A set of points reporting telemetry data.

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the configuration was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Version of the UDMI schema

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. Additional information on implementation

+
+ + + +

Must be at most 32 characters long

+ + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Optional status information about pointset

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Collection of point names, defining the representative point set for this device.

+
No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+

Object representation for for a single point

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

If specified, indicates a programmed point unit. If empty, means unspecified or matches configured point.

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: enum (of string)
+

Optional enumeration indicating the state of the points value.

+
+

Must be one of:

+
  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Optional status information about this point, subject to log severity level

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A human-readable one-line description of the entry

+
+ + + + + +
+
Example:
+
"Point is not writable"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

An optional extensive entry which can include more detail, e.g. a complete program stack-trace

+
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

A device-specific representation of the category an entry pertains to

+
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + + + + +
+
Example:
+
"pointset.points.config"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

+
+ + + + + +
+
Example:
+
"2018-08-26T21:39:28.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: integer
+

The status level should conform to the numerical Stackdriver LogEntry levels. The DEFAULT value of 0 is not allowed (lowest value is 100, maximum 800).

+
+ + + +

Value must be greater or equal to 100 and lesser or equal to 800 and a multiple of 1

+ +
+
Example:
+
600
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index fc3c7330c2..3f63310ccc 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -19,3 +19,23 @@ from .event_pointset import PointsetEvent from .event_pointset_point import PointPointsetEvent from .event_system import SystemEvent +from .metadata import Metadata +from .model_cloud import CloudMetadata +from .model_gateway import GatewayMetadata +from .model_localnet import LocalnetMetadata +from .model_localnet_family import FamilyLocalnetMetadata +from .model_pointset import PointsetMetadata +from .model_pointset_point import PointPointsetMetadata +from .model_system import SystemMetadata +from .model_testing import TestingMetadata +from .model_testing_target import TargetTestingMetadata +from .properties import Properties +from .state import State +from .state_blobset import BlobsetState +from .state_blobset_blob import BlobBlobsetState +from .state_discovery import DiscoveryState +from .state_discovery_family import FamilyDiscoveryState +from .state_gateway import GatewayState +from .state_pointset import PointsetState +from .state_pointset_point import PointPointsetState +from .state_system import SystemState diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index 285f574185..e54c873205 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -2,3 +2,79 @@ from .model_cloud import CloudMetadata from .model_system import SystemMetadata from .model_gateway import GatewayMetadata +from .model_localnet import LocalnetMetadata +from .model_testing import TestingMetadata +from .model_pointset import PointsetMetadata + + +class Metadata: + """Generated schema class""" + + def __init__(self): + self.timestamp = None + self.version = None + self.description = None + self.hash = None + self.cloud = None + self.system = None + self.gateway = None + self.localnet = None + self.testing = None + self.pointset = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = Metadata() + result.timestamp = source.get('timestamp') + result.version = source.get('version') + result.description = source.get('description') + result.hash = source.get('hash') + result.cloud = CloudMetadata.from_dict(source.get('cloud')) + result.system = SystemMetadata.from_dict(source.get('system')) + result.gateway = GatewayMetadata.from_dict(source.get('gateway')) + result.localnet = LocalnetMetadata.from_dict(source.get('localnet')) + result.testing = TestingMetadata.from_dict(source.get('testing')) + result.pointset = PointsetMetadata.from_dict(source.get('pointset')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = Metadata.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 + if self.description: + result['description'] = self.description # 5 + if self.hash: + result['hash'] = self.hash # 5 + if self.cloud: + result['cloud'] = self.cloud.to_dict() # 4 + if self.system: + result['system'] = self.system.to_dict() # 4 + if self.gateway: + result['gateway'] = self.gateway.to_dict() # 4 + if self.localnet: + result['localnet'] = self.localnet.to_dict() # 4 + if self.testing: + result['testing'] = self.testing.to_dict() # 4 + if self.pointset: + result['pointset'] = self.pointset.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/model_localnet.py b/gencode/python/udmi/schema/model_localnet.py index 37a6256fd0..e83b150775 100644 --- a/gencode/python/udmi/schema/model_localnet.py +++ b/gencode/python/udmi/schema/model_localnet.py @@ -1 +1,39 @@ """Generated class for model_localnet.json""" +from .model_localnet_family import FamilyLocalnetMetadata + + +class LocalnetMetadata: + """Generated schema class""" + + def __init__(self): + self.families = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = LocalnetMetadata() + result.families = FamilyLocalnetMetadata.map_from(source.get('families')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = LocalnetMetadata.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.families: + result['families'] = FamilyLocalnetMetadata.expand_dict(self.families) # 2 + return result diff --git a/gencode/python/udmi/schema/model_localnet_family.py b/gencode/python/udmi/schema/model_localnet_family.py new file mode 100644 index 0000000000..d0962cb651 --- /dev/null +++ b/gencode/python/udmi/schema/model_localnet_family.py @@ -0,0 +1,38 @@ +"""Generated class for model_localnet_family.json""" + + +class FamilyLocalnetMetadata: + """Generated schema class""" + + def __init__(self): + self.id = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = FamilyLocalnetMetadata() + result.id = source.get('id') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = FamilyLocalnetMetadata.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.id: + result['id'] = self.id # 5 + return result diff --git a/gencode/python/udmi/schema/model_pointset.py b/gencode/python/udmi/schema/model_pointset.py new file mode 100644 index 0000000000..91bba573ea --- /dev/null +++ b/gencode/python/udmi/schema/model_pointset.py @@ -0,0 +1,39 @@ +"""Generated class for model_pointset.json""" +from .model_pointset_point import PointPointsetMetadata + + +class PointsetMetadata: + """Generated schema class""" + + def __init__(self): + self.points = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = PointsetMetadata() + result.points = PointPointsetMetadata.map_from(source.get('points')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = PointsetMetadata.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.points: + result['points'] = PointPointsetMetadata.expand_dict(self.points) # 2 + return result diff --git a/gencode/python/udmi/schema/model_pointset_point.py b/gencode/python/udmi/schema/model_pointset_point.py new file mode 100644 index 0000000000..5b9b37d393 --- /dev/null +++ b/gencode/python/udmi/schema/model_pointset_point.py @@ -0,0 +1,74 @@ +"""Generated class for model_pointset_point.json""" + + +class PointPointsetMetadata: + """Generated schema class""" + + def __init__(self): + self.units = None + self.writable = None + self.baseline_value = None + self.baseline_tolerance = None + self.baseline_state = None + self.cov_increment = None + self.ref = None + self.min_loglevel = None + self.sample_limit_sec = None + self.sample_rate_sec = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = PointPointsetMetadata() + result.units = source.get('units') + result.writable = source.get('writable') + result.baseline_value = source.get('baseline_value') + result.baseline_tolerance = source.get('baseline_tolerance') + result.baseline_state = source.get('baseline_state') + result.cov_increment = source.get('cov_increment') + result.ref = source.get('ref') + result.min_loglevel = source.get('min_loglevel') + result.sample_limit_sec = source.get('sample_limit_sec') + result.sample_rate_sec = source.get('sample_rate_sec') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = PointPointsetMetadata.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.units: + result['units'] = self.units # 5 + if self.writable: + result['writable'] = self.writable # 5 + if self.baseline_value: + result['baseline_value'] = self.baseline_value # 5 + if self.baseline_tolerance: + result['baseline_tolerance'] = self.baseline_tolerance # 5 + if self.baseline_state: + result['baseline_state'] = self.baseline_state # 5 + if self.cov_increment: + result['cov_increment'] = self.cov_increment # 5 + if self.ref: + result['ref'] = self.ref # 5 + if self.min_loglevel: + result['min_loglevel'] = self.min_loglevel # 5 + if self.sample_limit_sec: + result['sample_limit_sec'] = self.sample_limit_sec # 5 + if self.sample_rate_sec: + result['sample_rate_sec'] = self.sample_rate_sec # 5 + return result diff --git a/gencode/python/udmi/schema/model_testing.py b/gencode/python/udmi/schema/model_testing.py new file mode 100644 index 0000000000..7f3b287d2d --- /dev/null +++ b/gencode/python/udmi/schema/model_testing.py @@ -0,0 +1,39 @@ +"""Generated class for model_testing.json""" +from .model_testing_target import TargetTestingMetadata + + +class TestingMetadata: + """Generated schema class""" + + def __init__(self): + self.targets = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = TestingMetadata() + result.targets = TargetTestingMetadata.map_from(source.get('targets')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = TestingMetadata.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.targets: + result['targets'] = TargetTestingMetadata.expand_dict(self.targets) # 2 + return result diff --git a/gencode/python/udmi/schema/model_testing_target.py b/gencode/python/udmi/schema/model_testing_target.py new file mode 100644 index 0000000000..1a02b59550 --- /dev/null +++ b/gencode/python/udmi/schema/model_testing_target.py @@ -0,0 +1,42 @@ +"""Generated class for model_testing_target.json""" + + +class TargetTestingMetadata: + """Generated schema class""" + + def __init__(self): + self.target_point = None + self.target_value = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = TargetTestingMetadata() + result.target_point = source.get('target_point') + result.target_value = source.get('target_value') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = TargetTestingMetadata.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.target_point: + result['target_point'] = self.target_point # 5 + if self.target_value: + result['target_value'] = self.target_value # 5 + return result diff --git a/gencode/python/udmi/schema/properties.py b/gencode/python/udmi/schema/properties.py new file mode 100644 index 0000000000..55129a4ca7 --- /dev/null +++ b/gencode/python/udmi/schema/properties.py @@ -0,0 +1,46 @@ +"""Generated class for properties.json""" + + +class Properties: + """Generated schema class""" + + def __init__(self): + self.key_type = None + self.version = None + self.connect = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = Properties() + result.key_type = source.get('key_type') + result.version = source.get('version') + result.connect = source.get('connect') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = Properties.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.key_type: + result['key_type'] = self.key_type # 5 + if self.version: + result['version'] = self.version # 5 + if self.connect: + result['connect'] = self.connect # 5 + return result diff --git a/gencode/python/udmi/schema/state.py b/gencode/python/udmi/schema/state.py new file mode 100644 index 0000000000..bc46b3cef6 --- /dev/null +++ b/gencode/python/udmi/schema/state.py @@ -0,0 +1,67 @@ +"""Generated class for state.json""" +from .state_system import SystemState +from .state_gateway import GatewayState +from .state_discovery import DiscoveryState +from .state_blobset import BlobsetState +from .state_pointset import PointsetState + + +class State: + """Generated schema class""" + + def __init__(self): + self.timestamp = None + self.version = None + self.system = None + self.gateway = None + self.discovery = None + self.blobset = None + self.pointset = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = State() + result.timestamp = source.get('timestamp') + result.version = source.get('version') + result.system = SystemState.from_dict(source.get('system')) + result.gateway = GatewayState.from_dict(source.get('gateway')) + result.discovery = DiscoveryState.from_dict(source.get('discovery')) + result.blobset = BlobsetState.from_dict(source.get('blobset')) + result.pointset = PointsetState.from_dict(source.get('pointset')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = State.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 + if self.system: + result['system'] = self.system.to_dict() # 4 + if self.gateway: + result['gateway'] = self.gateway.to_dict() # 4 + if self.discovery: + result['discovery'] = self.discovery.to_dict() # 4 + if self.blobset: + result['blobset'] = self.blobset.to_dict() # 4 + if self.pointset: + result['pointset'] = self.pointset.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/state_blobset.py b/gencode/python/udmi/schema/state_blobset.py new file mode 100644 index 0000000000..442abc89a5 --- /dev/null +++ b/gencode/python/udmi/schema/state_blobset.py @@ -0,0 +1,43 @@ +"""Generated class for state_blobset.json""" +from .state_blobset_blob import BlobBlobsetState + + +class BlobsetState: + """Generated schema class""" + + def __init__(self): + self.state_etag = None + self.blobs = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = BlobsetState() + result.state_etag = source.get('state_etag') + result.blobs = BlobBlobsetState.map_from(source.get('blobs')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = BlobsetState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.state_etag: + result['state_etag'] = self.state_etag # 5 + if self.blobs: + result['blobs'] = BlobBlobsetState.expand_dict(self.blobs) # 2 + return result diff --git a/gencode/python/udmi/schema/state_blobset_blob.py b/gencode/python/udmi/schema/state_blobset_blob.py new file mode 100644 index 0000000000..f6b089f5ff --- /dev/null +++ b/gencode/python/udmi/schema/state_blobset_blob.py @@ -0,0 +1,47 @@ +"""Generated class for state_blobset_blob.json""" +from .common import Entry + + +class BlobBlobsetState: + """Generated schema class""" + + def __init__(self): + self.stage = None + self.result = None + self.status = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = BlobBlobsetState() + result.stage = source.get('stage') + result.result = source.get('result') + result.status = Entry.from_dict(source.get('status')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = BlobBlobsetState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.stage: + result['stage'] = self.stage # 5 + if self.result: + result['result'] = self.result # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/state_discovery.py b/gencode/python/udmi/schema/state_discovery.py new file mode 100644 index 0000000000..6a116fee6a --- /dev/null +++ b/gencode/python/udmi/schema/state_discovery.py @@ -0,0 +1,44 @@ +"""Generated class for state_discovery.json""" +from .state_discovery_family import FamilyDiscoveryState +from .state_discovery_family import FamilyDiscoveryState + + +class DiscoveryState: + """Generated schema class""" + + def __init__(self): + self.enumeration = None + self.families = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryState() + result.enumeration = FamilyDiscoveryState.from_dict(source.get('enumeration')) + result.families = FamilyDiscoveryState.map_from(source.get('families')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.enumeration: + result['enumeration'] = self.enumeration.to_dict() # 4 + if self.families: + result['families'] = FamilyDiscoveryState.expand_dict(self.families) # 2 + return result diff --git a/gencode/python/udmi/schema/state_discovery_family.py b/gencode/python/udmi/schema/state_discovery_family.py new file mode 100644 index 0000000000..a97ee8cf03 --- /dev/null +++ b/gencode/python/udmi/schema/state_discovery_family.py @@ -0,0 +1,47 @@ +"""Generated class for state_discovery_family.json""" +from .common import Entry + + +class FamilyDiscoveryState: + """Generated schema class""" + + def __init__(self): + self.generation = None + self.active = None + self.status = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = FamilyDiscoveryState() + result.generation = source.get('generation') + result.active = source.get('active') + result.status = Entry.from_dict(source.get('status')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = FamilyDiscoveryState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.generation: + result['generation'] = self.generation # 5 + if self.active: + result['active'] = self.active # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/state_gateway.py b/gencode/python/udmi/schema/state_gateway.py new file mode 100644 index 0000000000..981aeabc74 --- /dev/null +++ b/gencode/python/udmi/schema/state_gateway.py @@ -0,0 +1,38 @@ +"""Generated class for state_gateway.json""" + + +class GatewayState: + """Generated schema class""" + + def __init__(self): + self.devices = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = GatewayState() + result.devices = source.get('devices') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = GatewayState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.devices: + result['devices'] = self.devices # 5 + return result diff --git a/gencode/python/udmi/schema/state_pointset.py b/gencode/python/udmi/schema/state_pointset.py new file mode 100644 index 0000000000..2d037e21a0 --- /dev/null +++ b/gencode/python/udmi/schema/state_pointset.py @@ -0,0 +1,56 @@ +"""Generated class for state_pointset.json""" +from .common import Entry +from .state_pointset_point import PointPointsetState + + +class PointsetState: + """Generated schema class""" + + def __init__(self): + self.timestamp = None + self.version = None + self.state_etag = None + self.status = None + self.points = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = PointsetState() + result.timestamp = source.get('timestamp') + result.version = source.get('version') + result.state_etag = source.get('state_etag') + result.status = Entry.from_dict(source.get('status')) + result.points = PointPointsetState.map_from(source.get('points')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = PointsetState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 + if self.state_etag: + result['state_etag'] = self.state_etag # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + if self.points: + result['points'] = PointPointsetState.expand_dict(self.points) # 2 + return result diff --git a/gencode/python/udmi/schema/state_pointset_point.py b/gencode/python/udmi/schema/state_pointset_point.py new file mode 100644 index 0000000000..5369184964 --- /dev/null +++ b/gencode/python/udmi/schema/state_pointset_point.py @@ -0,0 +1,47 @@ +"""Generated class for state_pointset_point.json""" +from .common import Entry + + +class PointPointsetState: + """Generated schema class""" + + def __init__(self): + self.units = None + self.value_state = None + self.status = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = PointPointsetState() + result.units = source.get('units') + result.value_state = source.get('value_state') + result.status = Entry.from_dict(source.get('status')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = PointPointsetState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.units: + result['units'] = self.units # 5 + if self.value_state: + result['value_state'] = self.value_state # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/state_system.py b/gencode/python/udmi/schema/state_system.py new file mode 100644 index 0000000000..37f11f2d2a --- /dev/null +++ b/gencode/python/udmi/schema/state_system.py @@ -0,0 +1,63 @@ +"""Generated class for state_system.json""" +from .common import Entry + + +class SystemState: + """Generated schema class""" + + def __init__(self): + self.last_config = None + self.operational = None + self.serial_no = None + self.hardware = None + self.software = None + self.params = None + self.status = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = SystemState() + result.last_config = source.get('last_config') + result.operational = source.get('operational') + result.serial_no = source.get('serial_no') + result.hardware = source.get('hardware') + result.software = source.get('software') + result.params = source.get('params') + result.status = Entry.from_dict(source.get('status')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = SystemState.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.last_config: + result['last_config'] = self.last_config # 5 + if self.operational: + result['operational'] = self.operational # 5 + if self.serial_no: + result['serial_no'] = self.serial_no # 5 + if self.hardware: + result['hardware'] = self.hardware # 1 + if self.software: + result['software'] = self.software # 1 + if self.params: + result['params'] = self.params # 1 + if self.status: + result['status'] = self.status.to_dict() # 4 + return result diff --git a/schema/model_localnet_families.json b/schema/model_localnet_family.json similarity index 100% rename from schema/model_localnet_families.json rename to schema/model_localnet_family.json From bc03a4dec20fd8fd2907dcf62349e908ab65d3a8 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 14 Apr 2022 09:32:59 -0700 Subject: [PATCH 48/95] Fix localdevice --- .../main/java/com/google/daq/mqtt/registrar/LocalDevice.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java b/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java index 022dcbc9d5..8aade84a11 100644 --- a/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java +++ b/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java @@ -500,7 +500,7 @@ public Config deviceConfigObject() { private LocalnetConfig getDeviceLocalnetConfig() { LocalnetConfig localnetConfig = new LocalnetConfig(); - localnetConfig.subsystem = metadata.localnet.subsystem; + localnetConfig.families = metadata.localnet.families; return localnetConfig; } From 823650880481bf9e3079f502e7024f9a14d3acc6 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 14 Apr 2022 09:47:48 -0700 Subject: [PATCH 49/95] Schema tweaking --- schema/model_gateway.json | 4 ++++ tests/config.tests/proxy.json | 2 +- tests/metadata.tests/gateway.json | 2 +- tests/metadata.tests/proxy.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/schema/model_gateway.json b/schema/model_gateway.json index 261f69c681..d7df71ba4e 100644 --- a/schema/model_gateway.json +++ b/schema/model_gateway.json @@ -11,6 +11,10 @@ "pattern": "^[A-Z]{2,6}-[0-9]{1,6}$", "examples": ["GAT-100"] }, + "family": { + "description": "Protocol family used for connecting to the proxy device", + "type": "string" + }, "proxy_ids": { "description": "An array of all the device IDs which are bound to the device", "type": "array", diff --git a/tests/config.tests/proxy.json b/tests/config.tests/proxy.json index f50523e631..de8250c887 100644 --- a/tests/config.tests/proxy.json +++ b/tests/config.tests/proxy.json @@ -7,7 +7,7 @@ "localnet": { "families": { "bacnet": { - "local_id": "78ce19" + "id": "78ce19" } } }, diff --git a/tests/metadata.tests/gateway.json b/tests/metadata.tests/gateway.json index dd5fea1e25..9a7d5003a8 100644 --- a/tests/metadata.tests/gateway.json +++ b/tests/metadata.tests/gateway.json @@ -34,7 +34,7 @@ "localnet": { "families": { "bacnet": { - "local_id": "0x991132ec" + "id": "0x991132ec" } } } diff --git a/tests/metadata.tests/proxy.json b/tests/metadata.tests/proxy.json index fbcf5e1fb9..c15deeaa36 100644 --- a/tests/metadata.tests/proxy.json +++ b/tests/metadata.tests/proxy.json @@ -24,7 +24,7 @@ "localnet": { "families": { "bacnet": { - "local_id": "82eecd" + "id": "82eecd" } } }, From f4e53f0dc882e719438386419c29baa4cc8743de Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 14 Apr 2022 09:56:25 -0700 Subject: [PATCH 50/95] gencode --- .gencode_hash.txt | 6 +-- gencode/docs/metadata.html | 41 +++++++++++++++++++ gencode/java/udmi/schema/GatewayMetadata.java | 13 +++++- gencode/python/udmi/schema/model_gateway.py | 4 ++ 4 files changed, 59 insertions(+), 5 deletions(-) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index f7aa720b9a..363f129912 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -4,7 +4,7 @@ c868a6c3d682b8bd22991797428e1871d072db807f23b94e8b4f48bc3acf4f2d gencode/docs/e 987503860562a3971314a98d75890b6c7615fee84bff6bede7010231f469c035 gencode/docs/event_pointset.html e3fb2b1a96f6fcb06f5af6cff32829abc825065ed52de81c3d379c8c8070fe09 gencode/docs/event_system.html a82821e72af6d0ee35800e6262eb9bb05256309b98aed2dad1a368fd2d6882bb gencode/docs/index.html -af515ef7866b36ffb7e7a64c2e7f00c636101ede9a88f05aa38c5cc2e6aa55ec gencode/docs/metadata.html +19c27c4b2e6573de5f2c8fd828c671e4a72082774a0813f95a257790d8e378a6 gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js @@ -31,7 +31,7 @@ ae4a645f199c8e24b3303463d428ca17af7603ae9ae9238397a6a82e752ab454 gencode/java/u 0afc15acd72874e5a0c47f546abc0c4569f5bc37838fdcac77bc7bd55cc53a6d gencode/java/udmi/schema/FamilyDiscoveryState.java d7aeee0fe20a8dd8d92e43e10d5b563ba4d70cb259f17c5818f3a0a4eed1e2ec gencode/java/udmi/schema/FamilyLocalnetMetadata.java 60a8115ae1acae7c199b63180823198d38ec50d57b48dd85aca1ccc865058f85 gencode/java/udmi/schema/GatewayConfig.java -e87c30201fbfe2670a48e700e4da82a41c1d1623746106c0c0baf2ff4be35b1e gencode/java/udmi/schema/GatewayMetadata.java +d79f50da651f376ec06bfe3b16bc76eae599d313240022894164ddbcc25c081c gencode/java/udmi/schema/GatewayMetadata.java e0e7739046e834c0f0ca6a70b38b4579618899be3162887a0fa7ab60bbff22a5 gencode/java/udmi/schema/GatewayState.java a5e5adfc187709e8646a11c92e804acfb67743f9d72149008aaca954df3177f6 gencode/java/udmi/schema/Level.java 07fd4911363437b274c19b024759b04b116152176702da8d4203c4ff4cb55b7f gencode/java/udmi/schema/LocalnetConfig.java @@ -82,7 +82,7 @@ ddf849bfeb2b87d071cefd5e6feacabc57375a7fff6d72b6d42ffb89f33c859b gencode/python a27b3b2ace3f301b5fa08a3763f792158f9725a5fbed5cd7b5fac8a6701080e4 gencode/python/udmi/schema/event_system.py 9eb0b155183881c709d853b3f65d26a20042c8daee78179595c5b26eaee9477d gencode/python/udmi/schema/metadata.py defe9fcce671ff4ac1a91b9d60ff2260f60865a13fba29c032ff356b1b79f471 gencode/python/udmi/schema/model_cloud.py -b8360e738ff12d348061a9799f777d9c1b75e458ddf6d3db4b7dcc07c3f69c09 gencode/python/udmi/schema/model_gateway.py +1fb8473dd0f2b083ce7daf00a65121893ee5c88ba6999b4950813e4b914a514c gencode/python/udmi/schema/model_gateway.py 89ce7a460f6cba70b067329d2b58814fc2adfee9f783890b148babdceb1f5d2a gencode/python/udmi/schema/model_localnet.py c1ebc4c6885a3299156300e27cefe63e3b745f595882e0e2be88bb61435d0752 gencode/python/udmi/schema/model_localnet_family.py b0cfc2a86539f3525f2da52d7b0422bb8934348690f25d9ab64c38e7a8a20536 gencode/python/udmi/schema/model_pointset.py diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 54d8f8b38c..92113527e6 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -1214,6 +1214,47 @@


"GAT-100"
 
+

+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Protocol family used for connecting to the proxy device

+
+ + + + + +
diff --git a/gencode/java/udmi/schema/GatewayMetadata.java b/gencode/java/udmi/schema/GatewayMetadata.java index 1b01b94bff..b1d03e53c8 100644 --- a/gencode/java/udmi/schema/GatewayMetadata.java +++ b/gencode/java/udmi/schema/GatewayMetadata.java @@ -19,6 +19,7 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "gateway_id", + "family", "proxy_ids" }) @Generated("jsonschema2pojo") @@ -31,6 +32,13 @@ public class GatewayMetadata { @JsonProperty("gateway_id") @JsonPropertyDescription("The device ID of the gateway the device is bound to") public String gateway_id; + /** + * Protocol family used for connecting to the proxy device + * + */ + @JsonProperty("family") + @JsonPropertyDescription("Protocol family used for connecting to the proxy device") + public String family; /** * An array of all the device IDs which are bound to the device * @@ -42,8 +50,9 @@ public class GatewayMetadata { @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.gateway_id == null)? 0 :this.gateway_id.hashCode())); result = ((result* 31)+((this.proxy_ids == null)? 0 :this.proxy_ids.hashCode())); + result = ((result* 31)+((this.family == null)? 0 :this.family.hashCode())); + result = ((result* 31)+((this.gateway_id == null)? 0 :this.gateway_id.hashCode())); return result; } @@ -56,7 +65,7 @@ public boolean equals(Object other) { return false; } GatewayMetadata rhs = ((GatewayMetadata) other); - return (((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))&&((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids)))); + return ((((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids)))&&((this.family == rhs.family)||((this.family!= null)&&this.family.equals(rhs.family))))&&((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))); } } diff --git a/gencode/python/udmi/schema/model_gateway.py b/gencode/python/udmi/schema/model_gateway.py index 9a34f65031..e5826eb9e6 100644 --- a/gencode/python/udmi/schema/model_gateway.py +++ b/gencode/python/udmi/schema/model_gateway.py @@ -6,6 +6,7 @@ class GatewayMetadata: def __init__(self): self.gateway_id = None + self.family = None self.proxy_ids = None @staticmethod @@ -14,6 +15,7 @@ def from_dict(source): return None result = GatewayMetadata() result.gateway_id = source.get('gateway_id') + result.family = source.get('family') result.proxy_ids = source.get('proxy_ids') return result @@ -37,6 +39,8 @@ def to_dict(self): result = {} if self.gateway_id: result['gateway_id'] = self.gateway_id # 5 + if self.family: + result['family'] = self.family # 5 if self.proxy_ids: result['proxy_ids'] = self.proxy_ids # 1 return result From 448b6da80385fe0f12fd426163f2df2a1cb5c63f Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 14 Apr 2022 10:23:12 -0700 Subject: [PATCH 51/95] Fix doc errors --- docs/specs/onboarding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/onboarding.md b/docs/specs/onboarding.md index b71a82bb4f..f1d3c0a182 100644 --- a/docs/specs/onboarding.md +++ b/docs/specs/onboarding.md @@ -69,7 +69,7 @@ that would be possible (including manually, which is the baseline default). * "I am device `78F936`, with points { `room_temp`, `step_size`, and `operation_count` }, and public key `XYZZYZ`" 2. **[Discovery Event](../../tests/event_discovery.tests/enumeration.json)** from _Node_ wraps up the device info into a UDMI-normalized format * "Device `78F936` has points { }, with a public key `XYZZYZ`" -3. **[Mapping Event](../../tests/event_mapping.tests/building_config.json)** from the _Mapper_ (recieved by both _Sink_ and _Agent_) +3. **Mapping Event** from the _Mapper_ (recieved by both _Sink_ and _Agent_) * "Device `78F936` is an `AHU` called `AHU-183`, and `room_temp` is really a `flow_temperatue`" 5. **(Cloud Provision)** from _Agent_ sets up the _Cloud_ layer using the IoT Core API. * "Device `AHU-183` exists and has public key `XYZZYZ`" From 60f3353205cd569df9dd3bd3d302c1a074c4a4a6 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 08:18:16 -0700 Subject: [PATCH 52/95] Adding x1 examples --- tests/config.tests/delta_x1_gateway.json | 13 +++++ tests/config.tests/delta_x1_gateway.out | 0 tests/config.tests/delta_x1_target.json | 65 ++++++++++++++++++++++++ tests/config.tests/delta_x1_target.out | 0 tests/state.tests/delta_x1_gateway.json | 1 + tests/state.tests/delta_x1_gateway.out | 0 tests/state.tests/delta_x1_target.json | 1 + tests/state.tests/delta_x1_target.out | 0 8 files changed, 80 insertions(+) create mode 100644 tests/config.tests/delta_x1_gateway.json create mode 100644 tests/config.tests/delta_x1_gateway.out create mode 100644 tests/config.tests/delta_x1_target.json create mode 100644 tests/config.tests/delta_x1_target.out create mode 100644 tests/state.tests/delta_x1_gateway.json create mode 100644 tests/state.tests/delta_x1_gateway.out create mode 100644 tests/state.tests/delta_x1_target.json create mode 100644 tests/state.tests/delta_x1_target.out diff --git a/tests/config.tests/delta_x1_gateway.json b/tests/config.tests/delta_x1_gateway.json new file mode 100644 index 0000000000..2db793f664 --- /dev/null +++ b/tests/config.tests/delta_x1_gateway.json @@ -0,0 +1,13 @@ +{ + "timestamp" : "2021-11-02T12:22:14Z", + "gateway" : { + "proxy_ids" : [ "TRHC-26" ] + }, + "localnet" : { + "subsystem" : { + "bacnet" : { + "local_id" : "1010112" + } + } + } +} diff --git a/tests/config.tests/delta_x1_gateway.out b/tests/config.tests/delta_x1_gateway.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/config.tests/delta_x1_target.json b/tests/config.tests/delta_x1_target.json new file mode 100644 index 0000000000..34eabb1a9a --- /dev/null +++ b/tests/config.tests/delta_x1_target.json @@ -0,0 +1,65 @@ +{ + "timestamp" : "2021-11-02T12:22:14Z", + "localnet" : { + "subsystem" : { + "bacnet" : { + "local_id" : "1010112" + } + } + }, + "pointset" : { + "points" : { + "cooling_water_valve_percentage_command" : { + "ref" : "AO1104.Present_Value" + }, + "cooling_water_valve_percentage_sensor" : { + "ref" : "AI1108.Present_Value" + }, + "discharge_fan_fault_status" : { + "ref" : "BI1107.Present_Value" + }, + "discharge_fan_percentage_command" : { + "ref" : "AO1106.Present_Value" + }, + "fabric_protection_status" : { + "ref" : "BV108.Present_Value" + }, + "fire_alarm_status" : { + "ref" : "BV1001.Present_Value" + }, + "heating_water_valve_percentage_command" : { + "ref" : "AO1102.Present_Value" + }, + "heating_water_valve_percentage_sensor" : { + "ref" : "AI1103.Present_Value" + }, + "occupancy_status" : { + "ref" : "BV1002.Present_Value" + }, + "optimum_start_status" : { + "ref" : "BV1004.Present_Value" + }, + "zone_air_control_temperature_sensor" : { + "ref" : "AV119.Present_Value" + }, + "zone_air_cooling_temperature_setpoint" : { + "ref" : "AV2.Present_Value" + }, + "zone_air_heating_temperature_setpoint" : { + "ref" : "AV1.Present_Value" + }, + "zone_air_temperature_alarm" : { + "ref" : "BV203.Present_Value" + }, + "zone_air_temperature_high_alarm" : { + "ref" : "BV202.Present_Value" + }, + "zone_air_temperature_low_alarm" : { + "ref" : "BV201.Present_Value" + }, + "zone_air_temperature_setpoint" : { + "ref" : "AV3.Present_Value" + } + } + } +} diff --git a/tests/config.tests/delta_x1_target.out b/tests/config.tests/delta_x1_target.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state.tests/delta_x1_gateway.json b/tests/state.tests/delta_x1_gateway.json new file mode 100644 index 0000000000..94e7b800ed --- /dev/null +++ b/tests/state.tests/delta_x1_gateway.json @@ -0,0 +1 @@ +{"version": 1, "timestamp": "2022-04-01T11:45:31.713329Z", "last_config": "2021/12/03/5 10:50:36.00", "system": {"make_model": "O3-DIN-SRC", "operational": true, "serial_no": "125818/0025", "hardware": {"revision": "1.4a", "reset_count": "4", "last_reset_timestamp": "2022/03/14/1 18:00:13.67", "last_restart_reason": "software-watchdog", "total_dynamic_memory": "250164", "free_dynamic_memory": "44696", "cpu_usage": "45.0549"}, "firmware": {"version": "4.13.0.348 (4130-001)"}, "last_config": "2021-11-02T12:22:14Z"}, "gateway": {"error_ids": {}}, "pointset": {"points": {}}} diff --git a/tests/state.tests/delta_x1_gateway.out b/tests/state.tests/delta_x1_gateway.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state.tests/delta_x1_target.json b/tests/state.tests/delta_x1_target.json new file mode 100644 index 0000000000..6a015f76fa --- /dev/null +++ b/tests/state.tests/delta_x1_target.json @@ -0,0 +1 @@ +{"version": 1, "timestamp": "2022-04-01T11:49:38.552761Z", "system": {"vendor_name": "Delta Controls Inc.", "make_model": "O3-DIN-SRC", "operational": true, "firmware": {"version": "4.13.0.348 (4130-001)"}, "last_config": "2021-11-02T12:22:14Z"}, "pointset": {"points": {"cooling_water_valve_percentage_command": {}, "cooling_water_valve_percentage_sensor": {}, "discharge_fan_fault_status": {}, "discharge_fan_percentage_command": {}, "fabric_protection_status": {}, "fire_alarm_status": {}, "heating_water_valve_percentage_command": {}, "heating_water_valve_percentage_sensor": {}, "occupancy_status": {}, "optimum_start_status": {}, "zone_air_control_temperature_sensor": {}, "zone_air_cooling_temperature_setpoint": {}, "zone_air_heating_temperature_setpoint": {}, "zone_air_temperature_alarm": {}, "zone_air_temperature_high_alarm": {}, "zone_air_temperature_low_alarm": {}, "zone_air_temperature_setpoint": {}}}} diff --git a/tests/state.tests/delta_x1_target.out b/tests/state.tests/delta_x1_target.out new file mode 100644 index 0000000000..e69de29bb2 From 5ce2db778023f80fd29fa248c8a0164ce11b64a8 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 08:24:27 -0700 Subject: [PATCH 53/95] Adding expected out: --- tests/config.tests/delta_x1_gateway.out | 3 +++ tests/config.tests/delta_x1_target.out | 2 ++ tests/state.tests/delta_x1_gateway.out | 1 + tests/state.tests/delta_x1_target.out | 3 +++ 4 files changed, 9 insertions(+) diff --git a/tests/config.tests/delta_x1_gateway.out b/tests/config.tests/delta_x1_gateway.out index e69de29bb2..79298a7943 100644 --- a/tests/config.tests/delta_x1_gateway.out +++ b/tests/config.tests/delta_x1_gateway.out @@ -0,0 +1,3 @@ +2 schema violations found + ECMA 262 regex "^[A-Z]{3}-[1-9][0-9]{0,2}$" does not match input string "TRHC-26" + object has missing required properties (["version"]) diff --git a/tests/config.tests/delta_x1_target.out b/tests/config.tests/delta_x1_target.out index e69de29bb2..81a1e0a21a 100644 --- a/tests/config.tests/delta_x1_target.out +++ b/tests/config.tests/delta_x1_target.out @@ -0,0 +1,2 @@ +1 schema violations found + object has missing required properties (["version"]) diff --git a/tests/state.tests/delta_x1_gateway.out b/tests/state.tests/delta_x1_gateway.out index e69de29bb2..37b277309e 100644 --- a/tests/state.tests/delta_x1_gateway.out +++ b/tests/state.tests/delta_x1_gateway.out @@ -0,0 +1 @@ +Node already has hardware field diff --git a/tests/state.tests/delta_x1_target.out b/tests/state.tests/delta_x1_target.out index e69de29bb2..3e10428e29 100644 --- a/tests/state.tests/delta_x1_target.out +++ b/tests/state.tests/delta_x1_target.out @@ -0,0 +1,3 @@ +2 schema violations found + object has missing required properties (["serial_no"]) + object instance has properties which are not allowed by the schema: ["vendor_name"] From ef3921d52c5670ed6367d9282f82087a5ba529ef Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 08:52:00 -0700 Subject: [PATCH 54/95] Updating errors for X1 examples --- tests/config.tests/delta_x1_gateway.out | 4 +++- tests/config.tests/delta_x1_target.out | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/config.tests/delta_x1_gateway.out b/tests/config.tests/delta_x1_gateway.out index 79298a7943..566079e3a2 100644 --- a/tests/config.tests/delta_x1_gateway.out +++ b/tests/config.tests/delta_x1_gateway.out @@ -1,3 +1,5 @@ -2 schema violations found +4 schema violations found ECMA 262 regex "^[A-Z]{3}-[1-9][0-9]{0,2}$" does not match input string "TRHC-26" + object has missing required properties (["families"]) object has missing required properties (["version"]) + object instance has properties which are not allowed by the schema: ["subsystem"] diff --git a/tests/config.tests/delta_x1_target.out b/tests/config.tests/delta_x1_target.out index 81a1e0a21a..b0a72ba649 100644 --- a/tests/config.tests/delta_x1_target.out +++ b/tests/config.tests/delta_x1_target.out @@ -1,2 +1,4 @@ -1 schema violations found +3 schema violations found + object has missing required properties (["families"]) object has missing required properties (["version"]) + object instance has properties which are not allowed by the schema: ["subsystem"] From ef39f01faf544c1c7554f55dbf354c4ddf602cb8 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 11:11:36 -0700 Subject: [PATCH 55/95] Working self_enumeration test --- pubber/src/main/java/daq/pubber/Pubber.java | 23 ++++++++++++++----- .../validations/DiscoveryValidator.java | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 3fcfcf078a..b04d948356 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.util.ISO8601DateFormat; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -60,6 +61,7 @@ public class Pubber { private static final Logger LOG = LoggerFactory.getLogger(Pubber.class); private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() + .enable(SerializationFeature.INDENT_OUTPUT) .setDateFormat(new ISO8601DateFormat()) .setSerializationInclusion(JsonInclude.Include.NON_NULL); private static final String HOSTNAME = System.getenv("HOSTNAME"); @@ -89,8 +91,8 @@ public class Pubber { ); private static final int MESSAGE_REPORT_INTERVAL = 100; private static final Map> LOG_MAP = ImmutableMap.of( - Level.TRACE, LOG::trace, - Level.DEBUG, LOG::debug, + Level.TRACE, LOG::info, // TODO: Need better way to make debug/trace programmatically visible. + Level.DEBUG, LOG::info, Level.INFO, LOG::info, Level.WARNING, LOG::warn, Level.ERROR, LOG::error @@ -583,6 +585,7 @@ private void configHandler(Config config) { File configOut = new File(OUT_DIR, "config.json"); try { OBJECT_MAPPER.writeValue(configOut, config); + debug("New config:\n" + OBJECT_MAPPER.writeValueAsString(config)); } catch (Exception e) { throw new RuntimeException("While writing config " + configOut.getPath(), e); } @@ -740,6 +743,11 @@ private void publishStateMessage() { info(String.format("update state %s last_config %s", isoConvert(deviceState.timestamp), isoConvert(deviceState.system.last_config))); stateDirty = false; + try { + debug("State update:\n" + OBJECT_MAPPER.writeValueAsString(deviceState)); + } catch (Exception e) { + throw new RuntimeException("While converting new device state", e); + } publishDeviceMessage(deviceState); lastStateTimeMs = System.currentTimeMillis(); } @@ -791,14 +799,17 @@ private void localLog(String message, Level level, String timestamp) { LOG_MAP.get(level).accept(logMessage); } - private void info(String message) { - cloudLog(message, Level.INFO); - } - private void trace(String message) { cloudLog(message, Level.TRACE); } + private void debug(String message) { + cloudLog(message, Level.DEBUG); + } + + private void info(String message) { + cloudLog(message, Level.INFO); + } private void warn(String message) { cloudLog(message, Level.WARNING); } diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index 810c940aed..f0b9e1267f 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -27,7 +27,7 @@ public void self_enumeration() { updateConfig(); untilTrue(() -> deviceState.discovery.enumeration.generation.equals(startTime), "enumeration generation"); - untilUntrue(() -> deviceState.discovery.enumeration.active, "enumeration also not active"); + untilUntrue(() -> deviceState.discovery.enumeration.active, "enumeration still not active"); List events = getReceivedEvents(DiscoveryEvent.class); assertEquals("one event received", 1, events.size()); DiscoveryEvent discoveryEvent = events.get(0); From 23162fb7861620da898def1ff0a7e251e160b796 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 11:20:45 -0700 Subject: [PATCH 56/95] Add all tests in the validations directory --- bin/loop_sequences | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/loop_sequences b/bin/loop_sequences index 8d961cb178..e4fa826afb 100755 --- a/bin/loop_sequences +++ b/bin/loop_sequences @@ -50,12 +50,15 @@ JAVA_CMD="java -cp $JARFILE com.google.daq.mqtt.validator.SequenceTestRunner" rm -rf $site_model/out/devices/$device_id +test_srces=`cd validator/src/main/java/com/google/daq/mqtt/validator/validations; ls *.java` + exit_code=2 for test_name in $test_names; do if [[ $test_name == . ]]; then test_name= fi - for test_class in ConfigValidator WritebackValidator; do + for test_src in $test_srces; do + test_class=${test_src%.java} target=$test_class$test_prefix$test_name CLASS=com.google.daq.mqtt.validator.validations.$target echo $JAVA_CMD $CLASS From d610e09e09c001eb366f82a7d905f0e39243fbba Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 11:24:14 -0700 Subject: [PATCH 57/95] Linty --- pubber/src/main/java/daq/pubber/Pubber.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index b04d948356..49d615c420 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -91,7 +91,7 @@ public class Pubber { ); private static final int MESSAGE_REPORT_INTERVAL = 100; private static final Map> LOG_MAP = ImmutableMap.of( - Level.TRACE, LOG::info, // TODO: Need better way to make debug/trace programmatically visible. + Level.TRACE, LOG::info, // TODO: Make debug/trace programmatically visible. Level.DEBUG, LOG::info, Level.INFO, LOG::info, Level.WARNING, LOG::warn, @@ -810,6 +810,7 @@ private void debug(String message) { private void info(String message) { cloudLog(message, Level.INFO); } + private void warn(String message) { cloudLog(message, Level.WARNING); } From bce110e4abdf42a4e97d1054eb0d54c427c53ce6 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 12:09:02 -0700 Subject: [PATCH 58/95] Add self_enumeration --- etc/sequencer.out | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/sequencer.out b/etc/sequencer.out index 6f806f8352..601f4a3e6e 100644 --- a/etc/sequencer.out +++ b/etc/sequencer.out @@ -1,6 +1,8 @@ RESULT pass broken_config Sequence complete RESULT pass extra_config Sequence complete +RESULT pass self_enumeration Sequence complete RESULT pass system_last_update Sequence complete RESULT pass valid_serial_no Sequence complete RESULT pass valid_serial_no Sequence complete +RESULT pass valid_serial_no Sequence complete RESULT skip writeback_states Missing 'invalid' target specification From 0df73cd305c9c8efaf38ad4132d806019e2aad9a Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 13:36:57 -0700 Subject: [PATCH 59/95] Working on single scan --- .gencode_hash.txt | 26 +-- gencode/docs/metadata.html | 154 +++++++++++++++++- gencode/java/udmi/schema/Discovery.java | 39 +++++ gencode/java/udmi/schema/DiscoveryConfig.java | 5 +- gencode/java/udmi/schema/DiscoveryEvent.java | 2 +- gencode/java/udmi/schema/DiscoveryState.java | 5 +- ....java => FamilyDiscoveryTestingModel.java} | 10 +- gencode/java/udmi/schema/Metadata.java | 4 +- ...gMetadata.java => TargetTestingModel.java} | 8 +- ...TestingMetadata.java => TestingModel.java} | 23 ++- gencode/python/udmi/schema/__init__.py | 5 +- gencode/python/udmi/schema/metadata.py | 4 +- gencode/python/udmi/schema/model_testing.py | 16 +- .../schema/model_testing_discovery_family.py | 35 ++++ .../udmi/schema/model_testing_target.py | 6 +- schema/config_discovery.json | 1 + schema/event_discovery.json | 2 +- schema/model_testing.json | 23 ++- schema/model_testing_discovery_family.json | 8 + schema/model_testing_target.json | 2 +- schema/state_discovery.json | 1 + tests/metadata.tests/example.json | 6 + .../daq/mqtt/validator/PointValidator.java | 6 +- .../validations/DiscoveryValidator.java | 54 ++++++ .../validations/WritebackValidator.java | 8 +- 25 files changed, 382 insertions(+), 71 deletions(-) create mode 100644 gencode/java/udmi/schema/Discovery.java rename gencode/java/udmi/schema/{Families.java => FamilyDiscoveryTestingModel.java} (70%) rename gencode/java/udmi/schema/{TargetTestingMetadata.java => TargetTestingModel.java} (88%) rename gencode/java/udmi/schema/{TestingMetadata.java => TestingModel.java} (56%) create mode 100644 gencode/python/udmi/schema/model_testing_discovery_family.py create mode 100644 schema/model_testing_discovery_family.json diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 8e0a020a46..d7457c7cbc 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -4,7 +4,7 @@ c868a6c3d682b8bd22991797428e1871d072db807f23b94e8b4f48bc3acf4f2d gencode/docs/e 987503860562a3971314a98d75890b6c7615fee84bff6bede7010231f469c035 gencode/docs/event_pointset.html e3fb2b1a96f6fcb06f5af6cff32829abc825065ed52de81c3d379c8c8070fe09 gencode/docs/event_system.html a82821e72af6d0ee35800e6262eb9bb05256309b98aed2dad1a368fd2d6882bb gencode/docs/index.html -19c27c4b2e6573de5f2c8fd828c671e4a72082774a0813f95a257790d8e378a6 gencode/docs/metadata.html +0b1e8450c3a4b106698b2df22be882748708daecf6b4e87236321bf08c4a8cf3 gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js @@ -19,17 +19,18 @@ d2c5b5aae8db27b68104fc83a1f38de0a3f1b5d683f2b13599adf24e96c7d124 gencode/java/u b6ff9b8739a9c3bb6972f73db6fc54f451189c13b273e58bc11cb3d82c74ad40 gencode/java/udmi/schema/BlobsetState.java 90d6e869087d4dfdc2c29c7f51872e630ad8135542dd432629bf4edac807053a gencode/java/udmi/schema/CloudMetadata.java 28001569e7902d3aa39aa3749ca08fb8e29460ba97a4b560d266b365bf5f8c46 gencode/java/udmi/schema/Config.java +b300398d6162a6ff18b8c09a366b8cf999f8c193cb61af1f1740464569c2c1b4 gencode/java/udmi/schema/Discovery.java 67ac3441ce6d5d4450741ee7e639174756498e1b3780c2d18ce20562b5a88c26 gencode/java/udmi/schema/DiscoveryCommand.java -3d9a243dcdc6dce31a2b0671d473c60d4cc972087025c7e099f8b4bf85a800da gencode/java/udmi/schema/DiscoveryConfig.java -bc9b7989e6548af57944a244dcc9578c4de82aabb58bea36b7d2957c9f8d058c gencode/java/udmi/schema/DiscoveryEvent.java -b9b1c6dc52c28630021c76d51305cb2fe634c557f3cf9b8e5c8c8abf456e6216 gencode/java/udmi/schema/DiscoveryState.java +d8a80ab3180d33bfa17564c969018e1d4350a47dbc70c4ae8a5abbfb25cfedc9 gencode/java/udmi/schema/DiscoveryConfig.java +a2cc64094be784208ca37ca3e1ff60572145ae2752ff983bf3df8ea495c748b3 gencode/java/udmi/schema/DiscoveryEvent.java +9962b0eb7d5adf52af6160e9f3131f8eeb52ae9e518954dbb6aead1bcad0245e gencode/java/udmi/schema/DiscoveryState.java 090bbaf1508aa6ca8380af936af990673f300eb5a940c9e8ab94deb64efa2b7b gencode/java/udmi/schema/Entry.java 8f71ecd4c32044eccd74225006887d58827976f699ea03efaa5b7ed1b69849d0 gencode/java/udmi/schema/Envelope.java e9f5c77be81486b6b8c6d88f70f2d50583d8c3fafa2ac09ead80f44b8d5e751e gencode/java/udmi/schema/Event.java -70ac42b1f93211420e8b40add27a4388dffcaaac60ead45852412aa815520605 gencode/java/udmi/schema/Families.java aa0885ca43ab38c7597eacc38b7c512940a1a9fa061abd47d02c28e66b6fd93e gencode/java/udmi/schema/FamilyDiscoveryConfig.java ae4a645f199c8e24b3303463d428ca17af7603ae9ae9238397a6a82e752ab454 gencode/java/udmi/schema/FamilyDiscoveryEvent.java 0afc15acd72874e5a0c47f546abc0c4569f5bc37838fdcac77bc7bd55cc53a6d gencode/java/udmi/schema/FamilyDiscoveryState.java +9959a84eea3e549c142c3edf637c86eb56eca138108ebd51fc2985e45aa41484 gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java d7aeee0fe20a8dd8d92e43e10d5b563ba4d70cb259f17c5818f3a0a4eed1e2ec gencode/java/udmi/schema/FamilyLocalnetMetadata.java 60a8115ae1acae7c199b63180823198d38ec50d57b48dd85aca1ccc865058f85 gencode/java/udmi/schema/GatewayConfig.java d79f50da651f376ec06bfe3b16bc76eae599d313240022894164ddbcc25c081c gencode/java/udmi/schema/GatewayMetadata.java @@ -38,7 +39,7 @@ a5e5adfc187709e8646a11c92e804acfb67743f9d72149008aaca954df3177f6 gencode/java/u 07fd4911363437b274c19b024759b04b116152176702da8d4203c4ff4cb55b7f gencode/java/udmi/schema/LocalnetConfig.java 419f04e56922a444c6cc1148796108df2c804cbe139f42b5505c3c48303a573c gencode/java/udmi/schema/LocalnetMetadata.java 2df4ae32d0bbecc21f7c3f6a416a195baa766a6210cfa8abca4a7bb45b9c7961 gencode/java/udmi/schema/Location.java -09b7447c86ae5361019be8f6c12d80465679f5525fc1a4528607642c0d5f035d gencode/java/udmi/schema/Metadata.java +ceba95d0586f995eacc52defcf91cd91226e88891a01a0761770853de9dcdf5d gencode/java/udmi/schema/Metadata.java a4e8f69100ab678a8236f481c558d677bbaea3e76c853bbd9262113d2a9c031d gencode/java/udmi/schema/Metrics.java 5e1c5411fae4d7c47391ceb5d19ae864fcd484df75ac6b6db39fd2d12647dec8 gencode/java/udmi/schema/Physical_tag.java 0868f0a9beb671dd08f066e7e7e796531fe151307a0b853b1f1a1aafe50ee746 gencode/java/udmi/schema/PointEnumerationEvent.java @@ -58,9 +59,9 @@ ca2e7566106818ca7e5190c8041eb86f0c9b3251b0bda8c3ea7ce11a0c891a0a gencode/java/u c46848327791cec1f1e62dbee2ad66951af7f61ed3c56eeaa8e563774e305bf4 gencode/java/udmi/schema/SystemMetadata.java 451217e2cce0ae9224a86f35b3bdea14b36658efe6f94f4a2dff4f4b1dc51cf7 gencode/java/udmi/schema/SystemState.java dfe4bb7c9ba6e366a967ff475883a8ff33fc558ae51db5c71fafae2323d0f8eb gencode/java/udmi/schema/Target.java -27d6b50dc51b373d24a701728b4d43d31fe841a9a1d77fe3e45dac332674c308 gencode/java/udmi/schema/TargetTestingMetadata.java -a77e801f3b07cd8b7042adfe8e5e62d7a83b63a1b449a356fa13c846811ab576 gencode/java/udmi/schema/TestingMetadata.java -78524f7d4cec1504145c5ce297439af466e38887d1fa704dab6c21164a617ce9 gencode/python/udmi/schema/__init__.py +7d6dd13e368e7f073738fee69c15e18652a9b7d7ac63bde0a200f747e3aa1b1d gencode/java/udmi/schema/TargetTestingModel.java +909e958afe9a2c46f7cd6170c962609105bce9a7f93581f5493ddffe4d689c39 gencode/java/udmi/schema/TestingModel.java +752cd4f6e66fd34f768cd3b1d144b417c06c5c67b6326063aca899e2130f308d gencode/python/udmi/schema/__init__.py 6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 704c8f0eec0b87015af8f7e524375f651b3d35f659ec89b4b022f8c1d0813ec5 gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py @@ -83,7 +84,7 @@ abe4044d2e3be6693ed39edc8ccaed4eee4eb8acad991e820b21d6ecf3812dd9 gencode/python ddf849bfeb2b87d071cefd5e6feacabc57375a7fff6d72b6d42ffb89f33c859b gencode/python/udmi/schema/event_pointset.py 44aff1bc930dbdbadd51ac3fe0e7d9c83ad84a6a9f9d1c809b3fce66cbcd5e00 gencode/python/udmi/schema/event_pointset_point.py a27b3b2ace3f301b5fa08a3763f792158f9725a5fbed5cd7b5fac8a6701080e4 gencode/python/udmi/schema/event_system.py -9eb0b155183881c709d853b3f65d26a20042c8daee78179595c5b26eaee9477d gencode/python/udmi/schema/metadata.py +5052a13ce3b3b7affd607a62a8d919b79b464e1352e03fc35799f22996a4aa7a gencode/python/udmi/schema/metadata.py defe9fcce671ff4ac1a91b9d60ff2260f60865a13fba29c032ff356b1b79f471 gencode/python/udmi/schema/model_cloud.py 1fb8473dd0f2b083ce7daf00a65121893ee5c88ba6999b4950813e4b914a514c gencode/python/udmi/schema/model_gateway.py 89ce7a460f6cba70b067329d2b58814fc2adfee9f783890b148babdceb1f5d2a gencode/python/udmi/schema/model_localnet.py @@ -91,8 +92,9 @@ c1ebc4c6885a3299156300e27cefe63e3b745f595882e0e2be88bb61435d0752 gencode/python b0cfc2a86539f3525f2da52d7b0422bb8934348690f25d9ab64c38e7a8a20536 gencode/python/udmi/schema/model_pointset.py 347b1ee16f74b8cdfa83aa4e179af5a5529545daf1736baf401936c7cf9e7809 gencode/python/udmi/schema/model_pointset_point.py cd00563a4e0be9112f6d8af3335acc12b0d3354beab602ab924aac59a0f588e4 gencode/python/udmi/schema/model_system.py -7f87ba316f65d36f07f19a6fa4af94c59da08b7d0fcabf911da9ec22657ec229 gencode/python/udmi/schema/model_testing.py -861492da04ac8421f07a949faf4e4d1e00074c155b987b4a6adcca471a50da5f gencode/python/udmi/schema/model_testing_target.py +526f2ad011d1525937297514b5846435c43d392d082eae5b1e4bd9771396f286 gencode/python/udmi/schema/model_testing.py +c33a3a0f90612109425fcfaa5f4c88a527960e942b5f4a94d9ff3236adbf90ea gencode/python/udmi/schema/model_testing_discovery_family.py +5c50847e136a033ea511209238bb570499b43fbee6189dae06603132dcb9f01f gencode/python/udmi/schema/model_testing_target.py a58f8c98e837a5b56126ca0f410e02f1e9cfcd80a8cb429e0ef522defab1f690 gencode/python/udmi/schema/properties.py 32bc70a30e37e89cfae14b44add18d546a6f9e00a3ec3519ede9c7486114d39c gencode/python/udmi/schema/state.py c8c8ecae303d9c96fb7a97106d722b32db8c3728a44a46db028cf0376d9dc79f gencode/python/udmi/schema/state_blobset.py diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 92113527e6..694f6e04ab 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -1578,7 +1578,7 @@

+ aria-expanded="" aria-controls="testing_targets" onclick="setAnchor('#testing_targets')">targets

@@ -1694,7 +1694,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Target Testing Metadata + Target Testing Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Target Testing Metadata + Target Testing Model +

+
+
+
+
+ + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+ + + + + + + + +
diff --git a/gencode/java/udmi/schema/Discovery.java b/gencode/java/udmi/schema/Discovery.java new file mode 100644 index 0000000000..bae9804f8c --- /dev/null +++ b/gencode/java/udmi/schema/Discovery.java @@ -0,0 +1,39 @@ + +package udmi.schema; + +import java.util.HashMap; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "families" +}) +@Generated("jsonschema2pojo") +public class Discovery { + + @JsonProperty("families") + public HashMap families; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Discovery) == false) { + return false; + } + Discovery rhs = ((Discovery) other); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); + } + +} diff --git a/gencode/java/udmi/schema/DiscoveryConfig.java b/gencode/java/udmi/schema/DiscoveryConfig.java index 86868ce5bd..489322422d 100644 --- a/gencode/java/udmi/schema/DiscoveryConfig.java +++ b/gencode/java/udmi/schema/DiscoveryConfig.java @@ -1,6 +1,7 @@ package udmi.schema; +import java.util.HashMap; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -30,14 +31,14 @@ public class DiscoveryConfig { */ @JsonProperty("enumeration") @JsonPropertyDescription("Configuration for [discovery](../docs/specs/discovery.md)") - public FamilyDiscoveryConfig enumeration; + public udmi.schema.FamilyDiscoveryConfig enumeration; /** * Address family results for a scan. Not included for device enumeration messages. * */ @JsonProperty("families") @JsonPropertyDescription("Address family results for a scan. Not included for device enumeration messages.") - public Object families; + public HashMap families; @Override public int hashCode() { diff --git a/gencode/java/udmi/schema/DiscoveryEvent.java b/gencode/java/udmi/schema/DiscoveryEvent.java index 1dadd533f1..98898f58bc 100644 --- a/gencode/java/udmi/schema/DiscoveryEvent.java +++ b/gencode/java/udmi/schema/DiscoveryEvent.java @@ -66,7 +66,7 @@ public class DiscoveryEvent { */ @JsonProperty("families") @JsonPropertyDescription("Address family results for a scan. Not included for device enumeration messages.") - public Families families; + public Map families; /** * Collection of data points available for this device. * diff --git a/gencode/java/udmi/schema/DiscoveryState.java b/gencode/java/udmi/schema/DiscoveryState.java index cf8a554a00..6358c95fee 100644 --- a/gencode/java/udmi/schema/DiscoveryState.java +++ b/gencode/java/udmi/schema/DiscoveryState.java @@ -1,6 +1,7 @@ package udmi.schema; +import java.util.HashMap; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -30,14 +31,14 @@ public class DiscoveryState { */ @JsonProperty("enumeration") @JsonPropertyDescription("State for [discovery](../docs/specs/discovery.md)") - public FamilyDiscoveryState enumeration; + public udmi.schema.FamilyDiscoveryState enumeration; /** * Discovery protocol families * */ @JsonProperty("families") @JsonPropertyDescription("Discovery protocol families") - public Object families; + public HashMap families; @Override public int hashCode() { diff --git a/gencode/java/udmi/schema/Families.java b/gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java similarity index 70% rename from gencode/java/udmi/schema/Families.java rename to gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java index a32487353f..89c4ccbe58 100644 --- a/gencode/java/udmi/schema/Families.java +++ b/gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java @@ -7,7 +7,9 @@ /** - * Address family results for a scan. Not included for device enumeration messages. + * Family Discovery Testing Model + *

+ * * */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -15,7 +17,7 @@ }) @Generated("jsonschema2pojo") -public class Families { +public class FamilyDiscoveryTestingModel { @Override @@ -29,10 +31,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof Families) == false) { + if ((other instanceof FamilyDiscoveryTestingModel) == false) { return false; } - Families rhs = ((Families) other); + FamilyDiscoveryTestingModel rhs = ((FamilyDiscoveryTestingModel) other); return true; } diff --git a/gencode/java/udmi/schema/Metadata.java b/gencode/java/udmi/schema/Metadata.java index af48b6cd0a..47303a831f 100644 --- a/gencode/java/udmi/schema/Metadata.java +++ b/gencode/java/udmi/schema/Metadata.java @@ -99,14 +99,14 @@ public class Metadata { @JsonPropertyDescription("Used to describe device local network parameters") public LocalnetMetadata localnet; /** - * Testing Metadata + * Testing Model *

* Testing target parameters * */ @JsonProperty("testing") @JsonPropertyDescription("Testing target parameters") - public TestingMetadata testing; + public TestingModel testing; /** * Pointset Metadata *

diff --git a/gencode/java/udmi/schema/TargetTestingMetadata.java b/gencode/java/udmi/schema/TargetTestingModel.java similarity index 88% rename from gencode/java/udmi/schema/TargetTestingMetadata.java rename to gencode/java/udmi/schema/TargetTestingModel.java index 0137cf64dd..38df3828e3 100644 --- a/gencode/java/udmi/schema/TargetTestingMetadata.java +++ b/gencode/java/udmi/schema/TargetTestingModel.java @@ -9,7 +9,7 @@ /** - * Target Testing Metadata + * Target Testing Model *

* * @@ -20,7 +20,7 @@ "target_value" }) @Generated("jsonschema2pojo") -public class TargetTestingMetadata { +public class TargetTestingModel { /** * Point name used for testing @@ -50,10 +50,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof TargetTestingMetadata) == false) { + if ((other instanceof TargetTestingModel) == false) { return false; } - TargetTestingMetadata rhs = ((TargetTestingMetadata) other); + TargetTestingModel rhs = ((TargetTestingModel) other); return (((this.target_point == rhs.target_point)||((this.target_point!= null)&&this.target_point.equals(rhs.target_point)))&&((this.target_value == rhs.target_value)||((this.target_value!= null)&&this.target_value.equals(rhs.target_value)))); } diff --git a/gencode/java/udmi/schema/TestingMetadata.java b/gencode/java/udmi/schema/TestingModel.java similarity index 56% rename from gencode/java/udmi/schema/TestingMetadata.java rename to gencode/java/udmi/schema/TestingModel.java index c13beda07b..ac01dec472 100644 --- a/gencode/java/udmi/schema/TestingMetadata.java +++ b/gencode/java/udmi/schema/TestingModel.java @@ -9,30 +9,29 @@ /** - * Testing Metadata + * Testing Model *

* Testing target parameters * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "targets" + "targets", + "discovery" }) @Generated("jsonschema2pojo") -public class TestingMetadata { +public class TestingModel { - /** - * - * (Required) - * - */ @JsonProperty("targets") - public HashMap targets; + public HashMap targets; + @JsonProperty("discovery") + public Discovery discovery; @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.targets == null)? 0 :this.targets.hashCode())); + result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); return result; } @@ -41,11 +40,11 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof TestingMetadata) == false) { + if ((other instanceof TestingModel) == false) { return false; } - TestingMetadata rhs = ((TestingMetadata) other); - return ((this.targets == rhs.targets)||((this.targets!= null)&&this.targets.equals(rhs.targets))); + TestingModel rhs = ((TestingModel) other); + return (((this.targets == rhs.targets)||((this.targets!= null)&&this.targets.equals(rhs.targets)))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery)))); } } diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 96b65b97fa..90b27304a8 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -28,8 +28,9 @@ from .model_pointset import PointsetMetadata from .model_pointset_point import PointPointsetMetadata from .model_system import SystemMetadata -from .model_testing import TestingMetadata -from .model_testing_target import TargetTestingMetadata +from .model_testing import TestingModel +from .model_testing_discovery_family import FamilyDiscoveryTestingModel +from .model_testing_target import TargetTestingModel from .properties import Properties from .state import State from .state_blobset import BlobsetState diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index e54c873205..989df45da7 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -3,7 +3,7 @@ from .model_system import SystemMetadata from .model_gateway import GatewayMetadata from .model_localnet import LocalnetMetadata -from .model_testing import TestingMetadata +from .model_testing import TestingModel from .model_pointset import PointsetMetadata @@ -35,7 +35,7 @@ def from_dict(source): result.system = SystemMetadata.from_dict(source.get('system')) result.gateway = GatewayMetadata.from_dict(source.get('gateway')) result.localnet = LocalnetMetadata.from_dict(source.get('localnet')) - result.testing = TestingMetadata.from_dict(source.get('testing')) + result.testing = TestingModel.from_dict(source.get('testing')) result.pointset = PointsetMetadata.from_dict(source.get('pointset')) return result diff --git a/gencode/python/udmi/schema/model_testing.py b/gencode/python/udmi/schema/model_testing.py index 7f3b287d2d..b98c0b18aa 100644 --- a/gencode/python/udmi/schema/model_testing.py +++ b/gencode/python/udmi/schema/model_testing.py @@ -1,19 +1,21 @@ """Generated class for model_testing.json""" -from .model_testing_target import TargetTestingMetadata +from .model_testing_target import TargetTestingModel -class TestingMetadata: +class TestingModel: """Generated schema class""" def __init__(self): self.targets = None + self.discovery = None @staticmethod def from_dict(source): if not source: return None - result = TestingMetadata() - result.targets = TargetTestingMetadata.map_from(source.get('targets')) + result = TestingModel() + result.targets = TargetTestingModel.map_from(source.get('targets')) + result.discovery = source.get('discovery') return result @staticmethod @@ -22,7 +24,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = TestingMetadata.from_dict(source[key]) + result[key] = TestingModel.from_dict(source[key]) return result @staticmethod @@ -35,5 +37,7 @@ def expand_dict(input): def to_dict(self): result = {} if self.targets: - result['targets'] = TargetTestingMetadata.expand_dict(self.targets) # 2 + result['targets'] = TargetTestingModel.expand_dict(self.targets) # 2 + if self.discovery: + result['discovery'] = self.discovery # 5 return result diff --git a/gencode/python/udmi/schema/model_testing_discovery_family.py b/gencode/python/udmi/schema/model_testing_discovery_family.py new file mode 100644 index 0000000000..4672edd58a --- /dev/null +++ b/gencode/python/udmi/schema/model_testing_discovery_family.py @@ -0,0 +1,35 @@ +"""Generated class for model_testing_discovery_family.json""" + + +class FamilyDiscoveryTestingModel: + """Generated schema class""" + + def __init__(self): + pass + + @staticmethod + def from_dict(source): + if not source: + return None + result = FamilyDiscoveryTestingModel() + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = FamilyDiscoveryTestingModel.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + return result diff --git a/gencode/python/udmi/schema/model_testing_target.py b/gencode/python/udmi/schema/model_testing_target.py index 1a02b59550..7adcff9f22 100644 --- a/gencode/python/udmi/schema/model_testing_target.py +++ b/gencode/python/udmi/schema/model_testing_target.py @@ -1,7 +1,7 @@ """Generated class for model_testing_target.json""" -class TargetTestingMetadata: +class TargetTestingModel: """Generated schema class""" def __init__(self): @@ -12,7 +12,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = TargetTestingMetadata() + result = TargetTestingModel() result.target_point = source.get('target_point') result.target_value = source.get('target_value') return result @@ -23,7 +23,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = TargetTestingMetadata.from_dict(source[key]) + result[key] = TargetTestingModel.from_dict(source[key]) return result @staticmethod diff --git a/schema/config_discovery.json b/schema/config_discovery.json index b3970a226d..3b24a05788 100644 --- a/schema/config_discovery.json +++ b/schema/config_discovery.json @@ -10,6 +10,7 @@ }, "families": { "description": "Address family results for a scan. Not included for device enumeration messages.", + "existingJavaType": "java.util.HashMap", "additionalProperties": false, "patternProperties": { "^iot|bacnet|ipv4|ipv6|ethmac$": { diff --git a/schema/event_discovery.json b/schema/event_discovery.json index a9838c6e9b..ed88baabd9 100644 --- a/schema/event_discovery.json +++ b/schema/event_discovery.json @@ -28,7 +28,7 @@ "description": "Address family results for a scan. Not included for device enumeration messages.", "type": "object", "additionalProperties": false, - "$explanation": "The json schema validator used doesn't support propertyNames, so use a regex instead.", + "existingJavaType": "java.util.Map", "patternProperties": { "^iot|bacnet|ipv4|ipv6|ethmac$": { "$ref": "file:event_discovery_family.json" diff --git a/schema/model_testing.json b/schema/model_testing.json index a079ec7a19..fc8dc26883 100644 --- a/schema/model_testing.json +++ b/schema/model_testing.json @@ -1,5 +1,5 @@ { - "title": "Testing Metadata", + "title": "Testing Model", "description": "Testing target parameters", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", @@ -7,16 +7,25 @@ "properties": { "targets": { "additionalProperties": false, - "maxProperties": 150, - "existingJavaType": "java.util.HashMap", + "existingJavaType": "java.util.HashMap", "patternProperties": { "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { "$ref": "file:model_testing_target.json#" } } + }, + "discovery": { + "additionalProperties": false, + "properties": { + "families": { + "existingJavaType": "java.util.HashMap", + "patternProperties": { + "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { + "$ref": "file:model_testing_discovery_family.json#" + } + } + } + } } - }, - "required": [ - "targets" - ] + } } diff --git a/schema/model_testing_discovery_family.json b/schema/model_testing_discovery_family.json new file mode 100644 index 0000000000..531f1f2d9e --- /dev/null +++ b/schema/model_testing_discovery_family.json @@ -0,0 +1,8 @@ +{ + "title": "Family Discovery Testing Model", + "type": "object", + "$schema": "http://json-schema.org/draft-04/schema#", + "additionalProperties": false, + "properties": { + } +} diff --git a/schema/model_testing_target.json b/schema/model_testing_target.json index 4d522e2f42..a7eb0ea2c2 100644 --- a/schema/model_testing_target.json +++ b/schema/model_testing_target.json @@ -1,5 +1,5 @@ { - "title": "Target Testing Metadata", + "title": "Target Testing Model", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, diff --git a/schema/state_discovery.json b/schema/state_discovery.json index 63219a3f78..866c5d406e 100644 --- a/schema/state_discovery.json +++ b/schema/state_discovery.json @@ -11,6 +11,7 @@ "families": { "description": "Discovery protocol families", "additionalProperties": false, + "existingJavaType": "java.util.HashMap", "patternProperties": { "^iot|bacnet|ipv4|ipv6|ethmac$": { "$ref": "file:state_discovery_family.json" diff --git a/tests/metadata.tests/example.json b/tests/metadata.tests/example.json index 25335e88b5..22135f50ab 100644 --- a/tests/metadata.tests/example.json +++ b/tests/metadata.tests/example.json @@ -41,6 +41,12 @@ } }, "testing": { + "discovery": { + "famililes": { + "bacnet": { + } + } + }, "targets": { "invalid": { "target_point": "return_air_temperature_sensor", diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/PointValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/PointValidator.java index b4e67f10bb..336ecd43e3 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/PointValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/PointValidator.java @@ -6,7 +6,7 @@ import org.junit.Before; import udmi.schema.PointPointsetConfig; import udmi.schema.PointsetConfig; -import udmi.schema.TargetTestingMetadata; +import udmi.schema.TargetTestingModel; /** * Class used for validating test about sequences with points. @@ -37,13 +37,13 @@ private void ensurePointConfig(String target) { } } - protected TargetTestingMetadata getTarget(String target) { + protected TargetTestingModel getTarget(String target) { if (deviceMetadata.testing == null || deviceMetadata.testing.targets == null || !deviceMetadata.testing.targets.containsKey(target)) { throw new SkipTest(String.format("Missing '%s' target specification", target)); } - TargetTestingMetadata testingMetadata = deviceMetadata.testing.targets.get(target); + TargetTestingModel testingMetadata = deviceMetadata.testing.targets.get(target); if (deviceMetadata.pointset == null || deviceMetadata.pointset.points == null) { info("No metadata pointset points defined, I hope you know what you're doing"); } else if (!deviceMetadata.pointset.points.containsKey(testingMetadata.target_point)) { diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index f0b9e1267f..4ac37e7901 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -1,11 +1,18 @@ package com.google.daq.mqtt.validator.validations; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import com.google.daq.mqtt.validator.CleanDateFormat; import com.google.daq.mqtt.validator.SequenceValidator; +import com.google.daq.mqtt.validator.SkipTest; +import java.time.Instant; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Set; +import java.util.function.Supplier; +import java.util.stream.Collectors; import org.junit.Test; import udmi.schema.DiscoveryConfig; import udmi.schema.DiscoveryEvent; @@ -16,8 +23,13 @@ */ public class DiscoveryValidator extends SequenceValidator { + public static final int SCAN_START_DELAY_SEC = 10; + @Test public void self_enumeration() { + if (!safeTrue(() -> deviceMetadata.pointset.points != null)) { + throw new SkipTest("No metadata pointset points defined"); + } untilUntrue(() -> deviceState.discovery.enumeration.active, "enumeration not active"); Date startTime = CleanDateFormat.cleanDate(); deviceConfig.discovery = new DiscoveryConfig(); @@ -39,4 +51,46 @@ public void self_enumeration() { discoveredPoints); } + @Test + public void single_scan() { + if (!safeTrue(() -> deviceMetadata.testing.discovery.families.size() > 0)) { + throw new SkipTest("No discovery families configured"); + } + Set families = deviceMetadata.testing.discovery.families.keySet(); + deviceConfig.discovery = new DiscoveryConfig(); + deviceConfig.discovery.families = new HashMap<>(); + families.forEach(family -> + deviceConfig.discovery.families.computeIfAbsent(family, + adding -> new FamilyDiscoveryConfig())); + updateConfig(); + untilUntrue( + () -> deviceState.discovery.families.values().stream().noneMatch(family -> family.active), + "all scans not active"); + Date startTime = Date.from(Instant.now().plusSeconds(SCAN_START_DELAY_SEC)); + families.forEach(family -> deviceConfig.discovery.families.get(family).generation = startTime); + updateConfig(); + getReceivedEvents(DiscoveryEvent.class); // Clear out any previously received events + untilTrue(() -> families.stream() + .allMatch(family -> deviceState.discovery.families.get(family).active && + CleanDateFormat.dateEquals(deviceState.discovery.families.get(family).generation, + startTime)), "all scans active"); + untilTrue(() -> families.stream() + .noneMatch(family -> deviceState.discovery.families.get(family).active), + "all scans not active"); + List receivedEvents = getReceivedEvents( + DiscoveryEvent.class); + + Set eventFamilies = receivedEvents.stream() + .flatMap(event -> event.families.keySet().stream()) + .collect(Collectors.toSet()); + assertTrue("all requested families present", eventFamilies.containsAll(families)); + } + + private boolean safeTrue(Supplier evaluator) { + try { + return evaluator.get(); + } catch (Exception e) { + return false; + } + } } diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/WritebackValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/WritebackValidator.java index 7e93b315a2..1faea253a8 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/WritebackValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/WritebackValidator.java @@ -4,7 +4,7 @@ import java.util.Objects; import org.junit.Test; import udmi.schema.PointPointsetState.Value_state; -import udmi.schema.TargetTestingMetadata; +import udmi.schema.TargetTestingModel; /** * Validate UDMI writeback capabilities. @@ -35,9 +35,9 @@ private String expectedValueState(String pointName, String expectedValue) { @Test public void writeback_states() { - TargetTestingMetadata invalidTarget = getTarget(INVALID_STATE); - TargetTestingMetadata failureTarget = getTarget(FAILURE_STATE); - TargetTestingMetadata appliedTarget = getTarget(APPLIED_STATE); + TargetTestingModel invalidTarget = getTarget(INVALID_STATE); + TargetTestingModel failureTarget = getTarget(FAILURE_STATE); + TargetTestingModel appliedTarget = getTarget(APPLIED_STATE); String invalidPoint = invalidTarget.target_point; String failurePoint = failureTarget.target_point; From 7a657a549d4ed8ae3faa20d9c975294b85a55a40 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 15 Apr 2022 22:50:42 -0700 Subject: [PATCH 60/95] Premature activation --- pubber/.idea/runConfigurations/Pubber.xml | 2 +- pubber/src/main/java/daq/pubber/Pubber.java | 56 +++++++++++++++++-- .../daq/mqtt/validator/SequenceValidator.java | 37 ++++++++---- .../validations/DiscoveryValidator.java | 36 ++++++------ 4 files changed, 94 insertions(+), 37 deletions(-) diff --git a/pubber/.idea/runConfigurations/Pubber.xml b/pubber/.idea/runConfigurations/Pubber.xml index 96e39f8913..8b5722f726 100644 --- a/pubber/.idea/runConfigurations/Pubber.xml +++ b/pubber/.idea/runConfigurations/Pubber.xml @@ -2,7 +2,7 @@

-
+
-
+

- +

-
+
Type: object
+ families
Type: object
@@ -992,18 +992,18 @@

-
+
-
+

- +

-
+

@@ -1025,15 +1025,15 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - subsystem + families - ^[a-z0-9-]+$

Type: object
-

The type of network

+ ^[a-z0-9-]+$
Type: object
+

The network family

No Additional Properties @@ -1042,23 +1042,23 @@


Examples:
-
"bacnet"
+
"bacnet"
 
-
"modbus"
+
"ipv4"
 
-
+
-
+

- +

-
+
Type: string
+ id
Type: string

The address of a device on the local network

@@ -1099,7 +1099,7 @@


Example:
-
"4148893"
+
"4148893"
 
@@ -1387,6 +1387,92 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the configuration was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Version of the UDMI schema

+
+ + + + + + +
+
+
+
diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 77c2e335be..9c162681da 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -1202,7 +1202,7 @@

/> gateway_id

Type: string
-

Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to

+

The device ID of the gateway the device is bound to

Must match regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ @@ -1218,18 +1218,18 @@

-
+
-
+

- +

-
+
Type: string
-Must match regular expression: ^[a-z0-9-]+$ + family
Type: string
+

Protocol family used for connecting to the proxy device

+
@@ -1287,7 +1288,7 @@

/> proxy_ids

Type: array of string
-

Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device

+

An array of all the device IDs which are bound to the device

@@ -1376,18 +1377,18 @@

-
+
-
+

- +

-
+
Type: object
+ families
Type: object
No Additional Properties @@ -1412,18 +1413,18 @@

-
+
-
+

- +

-
+

@@ -1445,14 +1446,14 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - subsystem + families - metadata_localnet_subsystem.json

Type: object
+ model_localnet_family.json
Type: object

The type of network

@@ -1464,23 +1465,23 @@


Examples:
-
"bacnet"
+
"bacnet"
 
-
"modbus"
+
"modbus"
 
-
+
-
+

- +

-
+
Type: string
+ id
Type: string

The address of a device on the local network

@@ -1521,7 +1522,7 @@


Example:
-
"4148893"
+
"4148893"
 
@@ -1577,7 +1578,7 @@

+ aria-expanded="" aria-controls="testing_targets" onclick="setAnchor('#testing_targets')">targets

@@ -1648,7 +1649,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - metadata_testing_target.json#

Type: object
+ model_testing_target.json#

Type: object
No Additional Properties @@ -1693,7 +1694,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Target Testing Metadata + Target Testing Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Target Testing Metadata + Target Testing Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - metadata_pointset_point.json#

Type: object
+ model_pointset_point.json#
Type: object

Information about a specific point name of the device.

diff --git a/gencode/docs/state.html b/gencode/docs/state.html index 9b33607ab7..0e2d39b036 100644 --- a/gencode/docs/state.html +++ b/gencode/docs/state.html @@ -3144,6 +3144,92 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp the configuration was generated

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Version of the UDMI schema

+
+ + + + + + +
+
+
+
diff --git a/gencode/java/udmi/schema/SubsystemLocalnetMetadata.java b/gencode/java/udmi/schema/FamilyLocalnetMetadata.java similarity index 64% rename from gencode/java/udmi/schema/SubsystemLocalnetMetadata.java rename to gencode/java/udmi/schema/FamilyLocalnetMetadata.java index c90d159c7e..c4302f226d 100644 --- a/gencode/java/udmi/schema/SubsystemLocalnetMetadata.java +++ b/gencode/java/udmi/schema/FamilyLocalnetMetadata.java @@ -9,31 +9,31 @@ /** - * Subsystem Localnet Metadata + * Family Localnet Metadata *

* The type of network * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "local_id" + "id" }) @Generated("jsonschema2pojo") -public class SubsystemLocalnetMetadata { +public class FamilyLocalnetMetadata { /** * The address of a device on the local network * (Required) * */ - @JsonProperty("local_id") + @JsonProperty("id") @JsonPropertyDescription("The address of a device on the local network") - public String local_id; + public String id; @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.local_id == null)? 0 :this.local_id.hashCode())); + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); return result; } @@ -42,11 +42,11 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof SubsystemLocalnetMetadata) == false) { + if ((other instanceof FamilyLocalnetMetadata) == false) { return false; } - SubsystemLocalnetMetadata rhs = ((SubsystemLocalnetMetadata) other); - return ((this.local_id == rhs.local_id)||((this.local_id!= null)&&this.local_id.equals(rhs.local_id))); + FamilyLocalnetMetadata rhs = ((FamilyLocalnetMetadata) other); + return ((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))); } } diff --git a/gencode/java/udmi/schema/GatewayMetadata.java b/gencode/java/udmi/schema/GatewayMetadata.java index f8731e86ee..b1d03e53c8 100644 --- a/gencode/java/udmi/schema/GatewayMetadata.java +++ b/gencode/java/udmi/schema/GatewayMetadata.java @@ -19,34 +19,39 @@ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "gateway_id", - "subsystem", + "family", "proxy_ids" }) @Generated("jsonschema2pojo") public class GatewayMetadata { /** - * Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to + * The device ID of the gateway the device is bound to * */ @JsonProperty("gateway_id") - @JsonPropertyDescription("Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to") + @JsonPropertyDescription("The device ID of the gateway the device is bound to") public String gateway_id; - @JsonProperty("subsystem") - public String subsystem; /** - * Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device + * Protocol family used for connecting to the proxy device + * + */ + @JsonProperty("family") + @JsonPropertyDescription("Protocol family used for connecting to the proxy device") + public String family; + /** + * An array of all the device IDs which are bound to the device * */ @JsonProperty("proxy_ids") - @JsonPropertyDescription("Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device") + @JsonPropertyDescription("An array of all the device IDs which are bound to the device") public List proxy_ids = new ArrayList(); @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.subsystem == null)? 0 :this.subsystem.hashCode())); result = ((result* 31)+((this.proxy_ids == null)? 0 :this.proxy_ids.hashCode())); + result = ((result* 31)+((this.family == null)? 0 :this.family.hashCode())); result = ((result* 31)+((this.gateway_id == null)? 0 :this.gateway_id.hashCode())); return result; } @@ -60,7 +65,7 @@ public boolean equals(Object other) { return false; } GatewayMetadata rhs = ((GatewayMetadata) other); - return ((((this.subsystem == rhs.subsystem)||((this.subsystem!= null)&&this.subsystem.equals(rhs.subsystem)))&&((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids))))&&((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))); + return ((((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids)))&&((this.family == rhs.family)||((this.family!= null)&&this.family.equals(rhs.family))))&&((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))); } } diff --git a/gencode/java/udmi/schema/LocalnetConfig.java b/gencode/java/udmi/schema/LocalnetConfig.java index eead25c84e..68aca4838e 100644 --- a/gencode/java/udmi/schema/LocalnetConfig.java +++ b/gencode/java/udmi/schema/LocalnetConfig.java @@ -15,25 +15,25 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "subsystem" + "families" }) @Generated("jsonschema2pojo") public class LocalnetConfig { /** - * Subsystem Reference + * Family Reference *

* * (Required) * */ - @JsonProperty("subsystem") - public Object subsystem; + @JsonProperty("families") + public Object families; @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.subsystem == null)? 0 :this.subsystem.hashCode())); + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); return result; } @@ -46,7 +46,7 @@ public boolean equals(Object other) { return false; } LocalnetConfig rhs = ((LocalnetConfig) other); - return ((this.subsystem == rhs.subsystem)||((this.subsystem!= null)&&this.subsystem.equals(rhs.subsystem))); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); } } diff --git a/gencode/java/udmi/schema/LocalnetMetadata.java b/gencode/java/udmi/schema/LocalnetMetadata.java index 02027f99c2..7a691ac711 100644 --- a/gencode/java/udmi/schema/LocalnetMetadata.java +++ b/gencode/java/udmi/schema/LocalnetMetadata.java @@ -16,7 +16,7 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "subsystem" + "families" }) @Generated("jsonschema2pojo") public class LocalnetMetadata { @@ -26,13 +26,13 @@ public class LocalnetMetadata { * (Required) * */ - @JsonProperty("subsystem") - public HashMap subsystem; + @JsonProperty("families") + public HashMap families; @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.subsystem == null)? 0 :this.subsystem.hashCode())); + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); return result; } @@ -45,7 +45,7 @@ public boolean equals(Object other) { return false; } LocalnetMetadata rhs = ((LocalnetMetadata) other); - return ((this.subsystem == rhs.subsystem)||((this.subsystem!= null)&&this.subsystem.equals(rhs.subsystem))); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); } } diff --git a/gencode/java/udmi/schema/Metadata.java b/gencode/java/udmi/schema/Metadata.java index af48b6cd0a..47303a831f 100644 --- a/gencode/java/udmi/schema/Metadata.java +++ b/gencode/java/udmi/schema/Metadata.java @@ -99,14 +99,14 @@ public class Metadata { @JsonPropertyDescription("Used to describe device local network parameters") public LocalnetMetadata localnet; /** - * Testing Metadata + * Testing Model *

* Testing target parameters * */ @JsonProperty("testing") @JsonPropertyDescription("Testing target parameters") - public TestingMetadata testing; + public TestingModel testing; /** * Pointset Metadata *

diff --git a/gencode/java/udmi/schema/PointsetConfig.java b/gencode/java/udmi/schema/PointsetConfig.java index 851abcf581..d3324f91c9 100644 --- a/gencode/java/udmi/schema/PointsetConfig.java +++ b/gencode/java/udmi/schema/PointsetConfig.java @@ -18,6 +18,8 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ + "timestamp", + "version", "state_etag", "set_value_expiry", "sample_limit_sec", @@ -27,6 +29,20 @@ @Generated("jsonschema2pojo") public class PointsetConfig { + /** + * RFC 3339 timestamp the configuration was generated + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the configuration was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public java.lang.String version; /** * The `state_etag` of the last _state_ message sent by the device. [Writeback documentation](../docs/specs/sequences/writeback.md) * @@ -69,7 +85,9 @@ public int hashCode() { result = ((result* 31)+((this.sample_rate_sec == null)? 0 :this.sample_rate_sec.hashCode())); result = ((result* 31)+((this.state_etag == null)? 0 :this.state_etag.hashCode())); result = ((result* 31)+((this.set_value_expiry == null)? 0 :this.set_value_expiry.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); result = ((result* 31)+((this.sample_limit_sec == null)? 0 :this.sample_limit_sec.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); result = ((result* 31)+((this.points == null)? 0 :this.points.hashCode())); return result; } @@ -83,7 +101,7 @@ public boolean equals(Object other) { return false; } PointsetConfig rhs = ((PointsetConfig) other); - return ((((((this.sample_rate_sec == rhs.sample_rate_sec)||((this.sample_rate_sec!= null)&&this.sample_rate_sec.equals(rhs.sample_rate_sec)))&&((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag))))&&((this.set_value_expiry == rhs.set_value_expiry)||((this.set_value_expiry!= null)&&this.set_value_expiry.equals(rhs.set_value_expiry))))&&((this.sample_limit_sec == rhs.sample_limit_sec)||((this.sample_limit_sec!= null)&&this.sample_limit_sec.equals(rhs.sample_limit_sec))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + return ((((((((this.sample_rate_sec == rhs.sample_rate_sec)||((this.sample_rate_sec!= null)&&this.sample_rate_sec.equals(rhs.sample_rate_sec)))&&((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag))))&&((this.set_value_expiry == rhs.set_value_expiry)||((this.set_value_expiry!= null)&&this.set_value_expiry.equals(rhs.set_value_expiry))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.sample_limit_sec == rhs.sample_limit_sec)||((this.sample_limit_sec!= null)&&this.sample_limit_sec.equals(rhs.sample_limit_sec))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); } } diff --git a/gencode/java/udmi/schema/PointsetState.java b/gencode/java/udmi/schema/PointsetState.java index ba20bf7397..aaaaf94f2e 100644 --- a/gencode/java/udmi/schema/PointsetState.java +++ b/gencode/java/udmi/schema/PointsetState.java @@ -1,6 +1,7 @@ package udmi.schema; +import java.util.Date; import java.util.HashMap; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; @@ -17,6 +18,8 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ + "timestamp", + "version", "state_etag", "status", "points" @@ -24,6 +27,20 @@ @Generated("jsonschema2pojo") public class PointsetState { + /** + * RFC 3339 timestamp the configuration was generated + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the configuration was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public java.lang.String version; /** * An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. [Additional information on implementation](../docs/specs/sequences/writeback.md) * @@ -52,6 +69,8 @@ public class PointsetState { public int hashCode() { int result = 1; result = ((result* 31)+((this.state_etag == null)? 0 :this.state_etag.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); result = ((result* 31)+((this.status == null)? 0 :this.status.hashCode())); result = ((result* 31)+((this.points == null)? 0 :this.points.hashCode())); return result; @@ -66,7 +85,7 @@ public boolean equals(Object other) { return false; } PointsetState rhs = ((PointsetState) other); - return ((((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag)))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + return ((((((this.state_etag == rhs.state_etag)||((this.state_etag!= null)&&this.state_etag.equals(rhs.state_etag)))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); } } diff --git a/gencode/java/udmi/schema/TargetTestingMetadata.java b/gencode/java/udmi/schema/TargetTestingModel.java similarity index 88% rename from gencode/java/udmi/schema/TargetTestingMetadata.java rename to gencode/java/udmi/schema/TargetTestingModel.java index 0137cf64dd..38df3828e3 100644 --- a/gencode/java/udmi/schema/TargetTestingMetadata.java +++ b/gencode/java/udmi/schema/TargetTestingModel.java @@ -9,7 +9,7 @@ /** - * Target Testing Metadata + * Target Testing Model *

* * @@ -20,7 +20,7 @@ "target_value" }) @Generated("jsonschema2pojo") -public class TargetTestingMetadata { +public class TargetTestingModel { /** * Point name used for testing @@ -50,10 +50,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof TargetTestingMetadata) == false) { + if ((other instanceof TargetTestingModel) == false) { return false; } - TargetTestingMetadata rhs = ((TargetTestingMetadata) other); + TargetTestingModel rhs = ((TargetTestingModel) other); return (((this.target_point == rhs.target_point)||((this.target_point!= null)&&this.target_point.equals(rhs.target_point)))&&((this.target_value == rhs.target_value)||((this.target_value!= null)&&this.target_value.equals(rhs.target_value)))); } diff --git a/gencode/java/udmi/schema/TestingMetadata.java b/gencode/java/udmi/schema/TestingModel.java similarity index 76% rename from gencode/java/udmi/schema/TestingMetadata.java rename to gencode/java/udmi/schema/TestingModel.java index c13beda07b..cc857d9423 100644 --- a/gencode/java/udmi/schema/TestingMetadata.java +++ b/gencode/java/udmi/schema/TestingModel.java @@ -9,7 +9,7 @@ /** - * Testing Metadata + * Testing Model *

* Testing target parameters * @@ -19,15 +19,10 @@ "targets" }) @Generated("jsonschema2pojo") -public class TestingMetadata { +public class TestingModel { - /** - * - * (Required) - * - */ @JsonProperty("targets") - public HashMap targets; + public HashMap targets; @Override public int hashCode() { @@ -41,10 +36,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof TestingMetadata) == false) { + if ((other instanceof TestingModel) == false) { return false; } - TestingMetadata rhs = ((TestingMetadata) other); + TestingModel rhs = ((TestingModel) other); return ((this.targets == rhs.targets)||((this.targets!= null)&&this.targets.equals(rhs.targets))); } diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 5cf3bbb0d8..f5e5d0e783 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -16,19 +16,20 @@ from .event_discovery_blob import BlobEnumerationEvent from .event_discovery_family import FamilyDiscoveryEvent from .event_discovery_point import PointEnumerationEvent +from .event_mapping import DiscoveryEvent from .event_pointset import PointsetEvent from .event_pointset_point import PointPointsetEvent from .event_system import SystemEvent from .metadata import Metadata -from .metadata_cloud import CloudMetadata -from .metadata_gateway import GatewayMetadata -from .metadata_localnet import LocalnetMetadata -from .metadata_localnet_subsystem import SubsystemLocalnetMetadata -from .metadata_pointset import PointsetMetadata -from .metadata_pointset_point import PointPointsetMetadata -from .metadata_system import SystemMetadata -from .metadata_testing import TestingMetadata -from .metadata_testing_target import TargetTestingMetadata +from .model_cloud import CloudMetadata +from .model_gateway import GatewayMetadata +from .model_localnet import LocalnetMetadata +from .model_localnet_family import FamilyLocalnetMetadata +from .model_pointset import PointsetMetadata +from .model_pointset_point import PointPointsetMetadata +from .model_system import SystemMetadata +from .model_testing import TestingModel +from .model_testing_target import TargetTestingModel from .properties import Properties from .state import State from .state_blobset import BlobsetState diff --git a/gencode/python/udmi/schema/config_localnet.py b/gencode/python/udmi/schema/config_localnet.py index b3c7952636..cca7195cb6 100644 --- a/gencode/python/udmi/schema/config_localnet.py +++ b/gencode/python/udmi/schema/config_localnet.py @@ -1,18 +1,18 @@ """Generated class for config_localnet.json""" -class Object587F40FB: +class Object75D54154: """Generated schema class""" def __init__(self): - self.local_id = None + self.id = None @staticmethod def from_dict(source): if not source: return None - result = Object587F40FB() - result.local_id = source.get('local_id') + result = Object75D54154() + result.id = source.get('id') return result @staticmethod @@ -21,7 +21,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = Object587F40FB.from_dict(source[key]) + result[key] = Object75D54154.from_dict(source[key]) return result @staticmethod @@ -33,8 +33,8 @@ def expand_dict(input): def to_dict(self): result = {} - if self.local_id: - result['local_id'] = self.local_id # 5 + if self.id: + result['id'] = self.id # 5 return result @@ -42,14 +42,14 @@ class LocalnetConfig: """Generated schema class""" def __init__(self): - self.subsystem = None + self.families = None @staticmethod def from_dict(source): if not source: return None result = LocalnetConfig() - result.subsystem = Object587F40FB.map_from(source.get('subsystem')) + result.families = Object75D54154.map_from(source.get('families')) return result @staticmethod @@ -70,6 +70,6 @@ def expand_dict(input): def to_dict(self): result = {} - if self.subsystem: - result['subsystem'] = Object587F40FB.expand_dict(self.subsystem) # 2 + if self.families: + result['families'] = Object75D54154.expand_dict(self.families) # 2 return result diff --git a/gencode/python/udmi/schema/config_pointset.py b/gencode/python/udmi/schema/config_pointset.py index c12c332221..c0415dc1df 100644 --- a/gencode/python/udmi/schema/config_pointset.py +++ b/gencode/python/udmi/schema/config_pointset.py @@ -6,6 +6,8 @@ class PointsetConfig: """Generated schema class""" def __init__(self): + self.timestamp = None + self.version = None self.state_etag = None self.set_value_expiry = None self.sample_limit_sec = None @@ -17,6 +19,8 @@ def from_dict(source): if not source: return None result = PointsetConfig() + result.timestamp = source.get('timestamp') + result.version = source.get('version') result.state_etag = source.get('state_etag') result.set_value_expiry = source.get('set_value_expiry') result.sample_limit_sec = source.get('sample_limit_sec') @@ -42,6 +46,10 @@ def expand_dict(input): def to_dict(self): result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 if self.state_etag: result['state_etag'] = self.state_etag # 5 if self.set_value_expiry: diff --git a/gencode/python/udmi/schema/event_mapping.py b/gencode/python/udmi/schema/event_mapping.py new file mode 100644 index 0000000000..fac601b6a7 --- /dev/null +++ b/gencode/python/udmi/schema/event_mapping.py @@ -0,0 +1,47 @@ +"""Generated class for event_mapping.json""" +from .common import Entry + + +class DiscoveryEvent: + """Generated schema class""" + + def __init__(self): + self.timestamp = None + self.version = None + self.status = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryEvent() + result.timestamp = source.get('timestamp') + result.version = source.get('version') + result.status = Entry.from_dict(source.get('status')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryEvent.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index 03484cf7c2..989df45da7 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -1,10 +1,10 @@ """Generated class for metadata.json""" -from .metadata_cloud import CloudMetadata -from .metadata_system import SystemMetadata -from .metadata_gateway import GatewayMetadata -from .metadata_localnet import LocalnetMetadata -from .metadata_testing import TestingMetadata -from .metadata_pointset import PointsetMetadata +from .model_cloud import CloudMetadata +from .model_system import SystemMetadata +from .model_gateway import GatewayMetadata +from .model_localnet import LocalnetMetadata +from .model_testing import TestingModel +from .model_pointset import PointsetMetadata class Metadata: @@ -35,7 +35,7 @@ def from_dict(source): result.system = SystemMetadata.from_dict(source.get('system')) result.gateway = GatewayMetadata.from_dict(source.get('gateway')) result.localnet = LocalnetMetadata.from_dict(source.get('localnet')) - result.testing = TestingMetadata.from_dict(source.get('testing')) + result.testing = TestingModel.from_dict(source.get('testing')) result.pointset = PointsetMetadata.from_dict(source.get('pointset')) return result diff --git a/gencode/python/udmi/schema/metadata_cloud.py b/gencode/python/udmi/schema/model_cloud.py similarity index 95% rename from gencode/python/udmi/schema/metadata_cloud.py rename to gencode/python/udmi/schema/model_cloud.py index a764258781..8845ed988c 100644 --- a/gencode/python/udmi/schema/metadata_cloud.py +++ b/gencode/python/udmi/schema/model_cloud.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_cloud.json""" +"""Generated class for model_cloud.json""" class CloudMetadata: diff --git a/gencode/python/udmi/schema/metadata_gateway.py b/gencode/python/udmi/schema/model_gateway.py similarity index 82% rename from gencode/python/udmi/schema/metadata_gateway.py rename to gencode/python/udmi/schema/model_gateway.py index 0034382c40..e5826eb9e6 100644 --- a/gencode/python/udmi/schema/metadata_gateway.py +++ b/gencode/python/udmi/schema/model_gateway.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_gateway.json""" +"""Generated class for model_gateway.json""" class GatewayMetadata: @@ -6,7 +6,7 @@ class GatewayMetadata: def __init__(self): self.gateway_id = None - self.subsystem = None + self.family = None self.proxy_ids = None @staticmethod @@ -15,7 +15,7 @@ def from_dict(source): return None result = GatewayMetadata() result.gateway_id = source.get('gateway_id') - result.subsystem = source.get('subsystem') + result.family = source.get('family') result.proxy_ids = source.get('proxy_ids') return result @@ -39,8 +39,8 @@ def to_dict(self): result = {} if self.gateway_id: result['gateway_id'] = self.gateway_id # 5 - if self.subsystem: - result['subsystem'] = self.subsystem # 5 + if self.family: + result['family'] = self.family # 5 if self.proxy_ids: result['proxy_ids'] = self.proxy_ids # 1 return result diff --git a/gencode/python/udmi/schema/metadata_localnet.py b/gencode/python/udmi/schema/model_localnet.py similarity index 65% rename from gencode/python/udmi/schema/metadata_localnet.py rename to gencode/python/udmi/schema/model_localnet.py index d6bbb1307b..e83b150775 100644 --- a/gencode/python/udmi/schema/metadata_localnet.py +++ b/gencode/python/udmi/schema/model_localnet.py @@ -1,19 +1,19 @@ -"""Generated class for metadata_localnet.json""" -from .metadata_localnet_subsystem import SubsystemLocalnetMetadata +"""Generated class for model_localnet.json""" +from .model_localnet_family import FamilyLocalnetMetadata class LocalnetMetadata: """Generated schema class""" def __init__(self): - self.subsystem = None + self.families = None @staticmethod def from_dict(source): if not source: return None result = LocalnetMetadata() - result.subsystem = SubsystemLocalnetMetadata.map_from(source.get('subsystem')) + result.families = FamilyLocalnetMetadata.map_from(source.get('families')) return result @staticmethod @@ -34,6 +34,6 @@ def expand_dict(input): def to_dict(self): result = {} - if self.subsystem: - result['subsystem'] = SubsystemLocalnetMetadata.expand_dict(self.subsystem) # 2 + if self.families: + result['families'] = FamilyLocalnetMetadata.expand_dict(self.families) # 2 return result diff --git a/gencode/python/udmi/schema/metadata_localnet_subsystem.py b/gencode/python/udmi/schema/model_localnet_family.py similarity index 60% rename from gencode/python/udmi/schema/metadata_localnet_subsystem.py rename to gencode/python/udmi/schema/model_localnet_family.py index 97198e9d60..d0962cb651 100644 --- a/gencode/python/udmi/schema/metadata_localnet_subsystem.py +++ b/gencode/python/udmi/schema/model_localnet_family.py @@ -1,18 +1,18 @@ -"""Generated class for metadata_localnet_subsystem.json""" +"""Generated class for model_localnet_family.json""" -class SubsystemLocalnetMetadata: +class FamilyLocalnetMetadata: """Generated schema class""" def __init__(self): - self.local_id = None + self.id = None @staticmethod def from_dict(source): if not source: return None - result = SubsystemLocalnetMetadata() - result.local_id = source.get('local_id') + result = FamilyLocalnetMetadata() + result.id = source.get('id') return result @staticmethod @@ -21,7 +21,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = SubsystemLocalnetMetadata.from_dict(source[key]) + result[key] = FamilyLocalnetMetadata.from_dict(source[key]) return result @staticmethod @@ -33,6 +33,6 @@ def expand_dict(input): def to_dict(self): result = {} - if self.local_id: - result['local_id'] = self.local_id # 5 + if self.id: + result['id'] = self.id # 5 return result diff --git a/gencode/python/udmi/schema/metadata_pointset.py b/gencode/python/udmi/schema/model_pointset.py similarity index 88% rename from gencode/python/udmi/schema/metadata_pointset.py rename to gencode/python/udmi/schema/model_pointset.py index 7783e7eb98..91bba573ea 100644 --- a/gencode/python/udmi/schema/metadata_pointset.py +++ b/gencode/python/udmi/schema/model_pointset.py @@ -1,5 +1,5 @@ -"""Generated class for metadata_pointset.json""" -from .metadata_pointset_point import PointPointsetMetadata +"""Generated class for model_pointset.json""" +from .model_pointset_point import PointPointsetMetadata class PointsetMetadata: diff --git a/gencode/python/udmi/schema/metadata_pointset_point.py b/gencode/python/udmi/schema/model_pointset_point.py similarity index 97% rename from gencode/python/udmi/schema/metadata_pointset_point.py rename to gencode/python/udmi/schema/model_pointset_point.py index c8018973a4..5b9b37d393 100644 --- a/gencode/python/udmi/schema/metadata_pointset_point.py +++ b/gencode/python/udmi/schema/model_pointset_point.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_pointset_point.json""" +"""Generated class for model_pointset_point.json""" class PointPointsetMetadata: diff --git a/gencode/python/udmi/schema/metadata_system.py b/gencode/python/udmi/schema/model_system.py similarity index 99% rename from gencode/python/udmi/schema/metadata_system.py rename to gencode/python/udmi/schema/model_system.py index 04bc177915..94ba79b70f 100644 --- a/gencode/python/udmi/schema/metadata_system.py +++ b/gencode/python/udmi/schema/model_system.py @@ -1,4 +1,4 @@ -"""Generated class for metadata_system.json""" +"""Generated class for model_system.json""" class Object2CCE4FC0: diff --git a/gencode/python/udmi/schema/metadata_testing.py b/gencode/python/udmi/schema/model_testing.py similarity index 60% rename from gencode/python/udmi/schema/metadata_testing.py rename to gencode/python/udmi/schema/model_testing.py index f78911533e..665b20e4a3 100644 --- a/gencode/python/udmi/schema/metadata_testing.py +++ b/gencode/python/udmi/schema/model_testing.py @@ -1,8 +1,8 @@ -"""Generated class for metadata_testing.json""" -from .metadata_testing_target import TargetTestingMetadata +"""Generated class for model_testing.json""" +from .model_testing_target import TargetTestingModel -class TestingMetadata: +class TestingModel: """Generated schema class""" def __init__(self): @@ -12,8 +12,8 @@ def __init__(self): def from_dict(source): if not source: return None - result = TestingMetadata() - result.targets = TargetTestingMetadata.map_from(source.get('targets')) + result = TestingModel() + result.targets = TargetTestingModel.map_from(source.get('targets')) return result @staticmethod @@ -22,7 +22,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = TestingMetadata.from_dict(source[key]) + result[key] = TestingModel.from_dict(source[key]) return result @staticmethod @@ -35,5 +35,5 @@ def expand_dict(input): def to_dict(self): result = {} if self.targets: - result['targets'] = TargetTestingMetadata.expand_dict(self.targets) # 2 + result['targets'] = TargetTestingModel.expand_dict(self.targets) # 2 return result diff --git a/gencode/python/udmi/schema/metadata_testing_target.py b/gencode/python/udmi/schema/model_testing_target.py similarity index 82% rename from gencode/python/udmi/schema/metadata_testing_target.py rename to gencode/python/udmi/schema/model_testing_target.py index 8c1bfd8f2b..7adcff9f22 100644 --- a/gencode/python/udmi/schema/metadata_testing_target.py +++ b/gencode/python/udmi/schema/model_testing_target.py @@ -1,7 +1,7 @@ -"""Generated class for metadata_testing_target.json""" +"""Generated class for model_testing_target.json""" -class TargetTestingMetadata: +class TargetTestingModel: """Generated schema class""" def __init__(self): @@ -12,7 +12,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = TargetTestingMetadata() + result = TargetTestingModel() result.target_point = source.get('target_point') result.target_value = source.get('target_value') return result @@ -23,7 +23,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = TargetTestingMetadata.from_dict(source[key]) + result[key] = TargetTestingModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/state_pointset.py b/gencode/python/udmi/schema/state_pointset.py index 9c3c377aef..2d037e21a0 100644 --- a/gencode/python/udmi/schema/state_pointset.py +++ b/gencode/python/udmi/schema/state_pointset.py @@ -7,6 +7,8 @@ class PointsetState: """Generated schema class""" def __init__(self): + self.timestamp = None + self.version = None self.state_etag = None self.status = None self.points = None @@ -16,6 +18,8 @@ def from_dict(source): if not source: return None result = PointsetState() + result.timestamp = source.get('timestamp') + result.version = source.get('version') result.state_etag = source.get('state_etag') result.status = Entry.from_dict(source.get('status')) result.points = PointPointsetState.map_from(source.get('points')) @@ -39,6 +43,10 @@ def expand_dict(input): def to_dict(self): result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 if self.state_etag: result['state_etag'] = self.state_etag # 5 if self.status: diff --git a/schema/config_localnet.json b/schema/config_localnet.json index 15793bbabf..1971f7f455 100644 --- a/schema/config_localnet.json +++ b/schema/config_localnet.json @@ -5,29 +5,29 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { - "subsystem": { - "title": "Subsystem Reference", + "families": { + "title": "Family Reference", "patternProperties": { "^[a-z0-9-]+$": { "additionalProperties": false, "type": "object", - "description": "The type of network", - "examples": ["bacnet", "modbus"], + "description": "The network family", + "examples": ["bacnet", "ipv4"], "properties": { - "local_id": { + "id": { "description": "The address of a device on the local network", "examples": ["4148893"], "type": "string" } }, "required": [ - "local_id" + "id" ] } } } }, "required": [ - "subsystem" + "families" ] } diff --git a/schema/config_pointset.json b/schema/config_pointset.json index 9ca2ce60c3..69061c3bb1 100644 --- a/schema/config_pointset.json +++ b/schema/config_pointset.json @@ -5,6 +5,16 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { + "timestamp": { + "description": "RFC 3339 timestamp the configuration was generated", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, + "version": { + "description": "Version of the UDMI schema", + "type": "string" + }, "state_etag": { "description": "The `state_etag` of the last _state_ message sent by the device. [Writeback documentation](../docs/specs/sequences/writeback.md)", "type": "string", diff --git a/schema/event_mapping.json b/schema/event_mapping.json new file mode 100644 index 0000000000..5524cdc63a --- /dev/null +++ b/schema/event_mapping.json @@ -0,0 +1,26 @@ +{ + "title": "Discovery Event", + "description": "[Discovery result](../docs/specs/discovery.md) with implicit enumeration", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "timestamp": { + "description": "RFC 3339 timestamp the discover telemetry event was generated", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, + "version": { + "description": "Version of the UDMI schema", + "type": "string" + }, + "status": { + "$ref": "file:common.json#/definitions/entry" + } + }, + "required": [ + "timestamp", + "version" + ] +} diff --git a/schema/metadata.json b/schema/metadata.json index 3a38bfdf62..fb956e16c7 100644 --- a/schema/metadata.json +++ b/schema/metadata.json @@ -30,22 +30,22 @@ "pattern": "^[0-9a-z]{8}$" }, "cloud": { - "$ref": "file:metadata_cloud.json#" + "$ref": "file:model_cloud.json#" }, "system": { - "$ref": "file:metadata_system.json#" + "$ref": "file:model_system.json#" }, "gateway": { - "$ref": "file:metadata_gateway.json#" + "$ref": "file:model_gateway.json#" }, "localnet": { - "$ref": "file:metadata_localnet.json#" + "$ref": "file:model_localnet.json#" }, "testing": { - "$ref": "file:metadata_testing.json#" + "$ref": "file:model_testing.json#" }, "pointset": { - "$ref": "file:metadata_pointset.json#" + "$ref": "file:model_pointset.json#" } } } diff --git a/schema/metadata_cloud.json b/schema/model_cloud.json similarity index 100% rename from schema/metadata_cloud.json rename to schema/model_cloud.json diff --git a/schema/metadata_gateway.json b/schema/model_gateway.json similarity index 64% rename from schema/metadata_gateway.json rename to schema/model_gateway.json index 998b53dd3f..d7df71ba4e 100644 --- a/schema/metadata_gateway.json +++ b/schema/model_gateway.json @@ -6,17 +6,17 @@ "additionalProperties": false, "properties": { "gateway_id": { - "description": "Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to", + "description": "The device ID of the gateway the device is bound to", "type": "string", "pattern": "^[A-Z]{2,6}-[0-9]{1,6}$", "examples": ["GAT-100"] }, - "subsystem": { - "type": "string", - "pattern": "^[a-z0-9-]+$" + "family": { + "description": "Protocol family used for connecting to the proxy device", + "type": "string" }, "proxy_ids": { - "description": "Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device", + "description": "An array of all the device IDs which are bound to the device", "type": "array", "items": { "type": "string", diff --git a/schema/metadata_localnet.json b/schema/model_localnet.json similarity index 68% rename from schema/metadata_localnet.json rename to schema/model_localnet.json index b276a6bf05..8276af1c6e 100644 --- a/schema/metadata_localnet.json +++ b/schema/model_localnet.json @@ -5,17 +5,17 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { - "subsystem": { + "families": { "additionalProperties": false, - "existingJavaType": "java.util.HashMap", + "existingJavaType": "java.util.HashMap", "patternProperties": { "^[a-z0-9-]+$": { - "$ref": "file:metadata_localnet_subsystem.json" + "$ref": "file:model_localnet_family.json" } } } }, "required": [ - "subsystem" + "families" ] } diff --git a/schema/metadata_localnet_subsystem.json b/schema/model_localnet_family.json similarity index 82% rename from schema/metadata_localnet_subsystem.json rename to schema/model_localnet_family.json index bfeff9b1dd..ac8f88d733 100644 --- a/schema/metadata_localnet_subsystem.json +++ b/schema/model_localnet_family.json @@ -1,18 +1,18 @@ { - "title": "Subsystem Localnet Metadata", + "title": "Family Localnet Metadata", "type": "object", "description": "The type of network", "examples": ["bacnet", "modbus"], "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { - "local_id": { + "id": { "type": "string", "description": "The address of a device on the local network", "examples": ["4148893"] } }, "required": [ - "local_id" + "id" ] } diff --git a/schema/metadata_pointset.json b/schema/model_pointset.json similarity index 93% rename from schema/metadata_pointset.json rename to schema/model_pointset.json index 4c5c6dee73..dbdd707521 100644 --- a/schema/metadata_pointset.json +++ b/schema/model_pointset.json @@ -12,7 +12,7 @@ "existingJavaType": "java.util.HashMap", "patternProperties": { "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { - "$ref": "file:metadata_pointset_point.json#" + "$ref": "file:model_pointset_point.json#" } } } diff --git a/schema/metadata_pointset_point.json b/schema/model_pointset_point.json similarity index 100% rename from schema/metadata_pointset_point.json rename to schema/model_pointset_point.json diff --git a/schema/metadata_system.json b/schema/model_system.json similarity index 100% rename from schema/metadata_system.json rename to schema/model_system.json diff --git a/schema/metadata_testing.json b/schema/model_testing.json similarity index 70% rename from schema/metadata_testing.json rename to schema/model_testing.json index b70c9438d0..a865111b1f 100644 --- a/schema/metadata_testing.json +++ b/schema/model_testing.json @@ -1,5 +1,5 @@ { - "title": "Testing Metadata", + "title": "Testing Model", "description": "Testing target parameters", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", @@ -7,16 +7,12 @@ "properties": { "targets": { "additionalProperties": false, - "maxProperties": 150, - "existingJavaType": "java.util.HashMap", + "existingJavaType": "java.util.HashMap", "patternProperties": { "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { - "$ref": "file:metadata_testing_target.json#" + "$ref": "file:model_testing_target.json#" } } } - }, - "required": [ - "targets" - ] + } } diff --git a/schema/metadata_testing_target.json b/schema/model_testing_target.json similarity index 89% rename from schema/metadata_testing_target.json rename to schema/model_testing_target.json index 4d522e2f42..a7eb0ea2c2 100644 --- a/schema/metadata_testing_target.json +++ b/schema/model_testing_target.json @@ -1,5 +1,5 @@ { - "title": "Target Testing Metadata", + "title": "Target Testing Model", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, diff --git a/schema/state_pointset.json b/schema/state_pointset.json index 057f89e046..92e599652f 100644 --- a/schema/state_pointset.json +++ b/schema/state_pointset.json @@ -5,6 +5,16 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { + "timestamp": { + "description": "RFC 3339 timestamp the configuration was generated", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, + "version": { + "description": "Version of the UDMI schema", + "type": "string" + }, "state_etag": { "description": "An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. [Additional information on implementation](../docs/specs/sequences/writeback.md)", "type": "string", diff --git a/tests/config.tests/delta_x1_gateway.out b/tests/config.tests/delta_x1_gateway.out index 79298a7943..566079e3a2 100644 --- a/tests/config.tests/delta_x1_gateway.out +++ b/tests/config.tests/delta_x1_gateway.out @@ -1,3 +1,5 @@ -2 schema violations found +4 schema violations found ECMA 262 regex "^[A-Z]{3}-[1-9][0-9]{0,2}$" does not match input string "TRHC-26" + object has missing required properties (["families"]) object has missing required properties (["version"]) + object instance has properties which are not allowed by the schema: ["subsystem"] diff --git a/tests/config.tests/delta_x1_target.out b/tests/config.tests/delta_x1_target.out index 81a1e0a21a..b0a72ba649 100644 --- a/tests/config.tests/delta_x1_target.out +++ b/tests/config.tests/delta_x1_target.out @@ -1,2 +1,4 @@ -1 schema violations found +3 schema violations found + object has missing required properties (["families"]) object has missing required properties (["version"]) + object instance has properties which are not allowed by the schema: ["subsystem"] diff --git a/tests/config.tests/errors.out b/tests/config.tests/errors.out index 15974cc6a8..ffb056e087 100644 --- a/tests/config.tests/errors.out +++ b/tests/config.tests/errors.out @@ -1,6 +1,7 @@ -5 schema violations found +6 schema violations found + instance type (integer) does not match any allowed primitive type (allowed: ["string"]) instance type (string) does not match any allowed primitive type (allowed: ["integer"]) - object instance has properties which are not allowed by the schema: ["config_etag","id","properties","timestamp","version"] + object instance has properties which are not allowed by the schema: ["config_etag","id","properties"] object instance has properties which are not allowed by the schema: ["object_type"] object instance has properties which are not allowed by the schema: ["points","properties","type"] string "2a8b71dwqhdhdddddddddddddddddddddddddddddddddddddddddd8" is too long (length: 55, maximum allowed: 32) diff --git a/tests/config.tests/proxy.json b/tests/config.tests/proxy.json index 6f56202964..de8250c887 100644 --- a/tests/config.tests/proxy.json +++ b/tests/config.tests/proxy.json @@ -5,9 +5,9 @@ "min_loglevel": 500 }, "localnet": { - "subsystem": { + "families": { "bacnet": { - "local_id": "0x78ce1900" + "id": "78ce19" } } }, diff --git a/tests/config_pointset.tests/example.json b/tests/config_pointset.tests/example.json new file mode 100644 index 0000000000..df57209ed4 --- /dev/null +++ b/tests/config_pointset.tests/example.json @@ -0,0 +1,25 @@ +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "state_etag": "2a8b718", + "set_value_expiry": "2018-08-26T21:49:29.364Z", + "points": { + "room_temperature": { + "set_value": 37.3 + }, + "hallway_temperature": { + "set_value": 37.3 + }, + "hallway_lights": { + "set_value": false + }, + "entryway_lock": { + "set_value": "locked" + }, + "scale_sensor": { + "set_value": 82 + }, + "rocket_motor": { + } + } +} diff --git a/tests/config_pointset.tests/example.out b/tests/config_pointset.tests/example.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/metadata.tests/example.json b/tests/metadata.tests/example.json index 25335e88b5..453d9d0eeb 100644 --- a/tests/metadata.tests/example.json +++ b/tests/metadata.tests/example.json @@ -41,6 +41,12 @@ } }, "testing": { + "discovery": { + "families": { + "bacnet": { + } + } + }, "targets": { "invalid": { "target_point": "return_air_temperature_sensor", diff --git a/tests/metadata.tests/gateway.json b/tests/metadata.tests/gateway.json index 0e701903fa..9a7d5003a8 100644 --- a/tests/metadata.tests/gateway.json +++ b/tests/metadata.tests/gateway.json @@ -32,9 +32,9 @@ } }, "localnet": { - "subsystem": { + "families": { "bacnet": { - "local_id": "0x991132ec" + "id": "0x991132ec" } } } diff --git a/tests/metadata.tests/proxy.json b/tests/metadata.tests/proxy.json index 6f20550116..c15deeaa36 100644 --- a/tests/metadata.tests/proxy.json +++ b/tests/metadata.tests/proxy.json @@ -22,9 +22,9 @@ } }, "localnet": { - "subsystem": { + "families": { "bacnet": { - "local_id": "0x82eecd" + "id": "82eecd" } } }, @@ -37,7 +37,7 @@ } }, "gateway": { - "subsystem": "bacnet", + "family": "bacnet", "gateway_id": "LTGW-123" } } diff --git a/tests/model_pointset.tests/example.json b/tests/model_pointset.tests/example.json new file mode 100644 index 0000000000..3bcc1234b5 --- /dev/null +++ b/tests/model_pointset.tests/example.json @@ -0,0 +1,15 @@ +{ + "points": { + "return_air_temperature_sensor": { + "units": "Degrees-Celsius", + "baseline_value": 20, + "baseline_tolerance": 2 + }, + "room_setpoint": { + "writable": true, + "units": "Degrees-Celsius", + "baseline_value": 20, + "baseline_state": "applied" + } + } +} diff --git a/tests/model_pointset.tests/example.out b/tests/model_pointset.tests/example.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/state_pointset.tests/example.json b/tests/state_pointset.tests/example.json new file mode 100644 index 0000000000..e0a0d45185 --- /dev/null +++ b/tests/state_pointset.tests/example.json @@ -0,0 +1,36 @@ +{ + "version": 1, + "timestamp": "2018-08-26T21:39:29.364Z", + "state_etag": "2a8b718", + "points": { + "room_temperature": { + "value_state": "applied" + }, + "hallway_temperature": { + "value_state": "overridden" + }, + "hallway_lights": { + "value_state": "updating" + }, + "entryway_lock": { + "value_state": "failure", + "status": { + "message": "Failure to confirm point", + "category": "state.pointset.points.config.failure", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 600 + } + }, + "scale_sensor": { + "value_state": "invalid", + "status": { + "message": "Point is not writable", + "category": "state.pointset.points.config.invalid", + "timestamp": "2018-08-26T21:39:28.364Z", + "level": 600 + } + }, + "rocket_motor": { + } + } +} diff --git a/tests/state_pointset.tests/example.out b/tests/state_pointset.tests/example.out new file mode 100644 index 0000000000..e69de29bb2 From 0bda9b677a77e113fe0982a1412e2065c63751bf Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 18 Apr 2022 22:32:05 -0700 Subject: [PATCH 68/95] Fixes --- docs/messages/pointset.md | 2 +- docs/messages/system.md | 4 +-- schema/event_mapping.json | 26 ------------------- tests/metadata.tests/example.json | 6 ----- .../daq/mqtt/validator/SequenceValidator.java | 2 +- 5 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 schema/event_mapping.json diff --git a/docs/messages/pointset.md b/docs/messages/pointset.md index c3005dd0f8..7f7b3d8297 100644 --- a/docs/messages/pointset.md +++ b/docs/messages/pointset.md @@ -18,7 +18,7 @@ Pointset is represented in four locations ## Metadata -- **Schema Definition:** [metadata_pointset.json](../../schema/metadata_pointset.json) +- **Schema Definition:** [model_pointset.json](../../schema/model_pointset.json) ([_🧬View_](../../gencode/docs/metadata.html#pointset)) - [Working `metadata` Example](../../tests/metadata.tests/example.json) diff --git a/docs/messages/system.md b/docs/messages/system.md index 97c981d2b4..65ab937bef 100644 --- a/docs/messages/system.md +++ b/docs/messages/system.md @@ -21,6 +21,6 @@ Primarily used for things like logging, general status, firmware management, etc ## Metadata -- **Schema Definition:** [metadata_system.json](../../schema/metadata_system.json) +- **Schema Definition:** [model_system.json](../../schema/model_system.json) ([_🧬View_](../../gencode/docs/metadata.html#system)) -- [Working `metadata` Example](../../tests/metadata.tests/example.json) \ No newline at end of file +- [Working `metadata` Example](../../tests/metadata.tests/example.json) diff --git a/schema/event_mapping.json b/schema/event_mapping.json deleted file mode 100644 index 5524cdc63a..0000000000 --- a/schema/event_mapping.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "title": "Discovery Event", - "description": "[Discovery result](../docs/specs/discovery.md) with implicit enumeration", - "type": "object", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "timestamp": { - "description": "RFC 3339 timestamp the discover telemetry event was generated", - "type": "string", - "format": "date-time", - "examples": ["2019-01-17T14:02:29.364Z"] - }, - "version": { - "description": "Version of the UDMI schema", - "type": "string" - }, - "status": { - "$ref": "file:common.json#/definitions/entry" - } - }, - "required": [ - "timestamp", - "version" - ] -} diff --git a/tests/metadata.tests/example.json b/tests/metadata.tests/example.json index 453d9d0eeb..25335e88b5 100644 --- a/tests/metadata.tests/example.json +++ b/tests/metadata.tests/example.json @@ -41,12 +41,6 @@ } }, "testing": { - "discovery": { - "families": { - "bacnet": { - } - } - }, "targets": { "invalid": { "target_point": "return_air_temperature_sensor", diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java index 553bd27853..d3dcebae2c 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java @@ -443,7 +443,7 @@ private void queryState() { public void tearDown() { recordMessages = false; if (debugLogLevel()) { - warning("Not resetting config@ b/c debug is enabled."); + warning("Not resetting config because debug is enabled."); } else { // Restore the config to a canonical state. resetConfig(); From 04a99d561d638bd9222cad8ab3f57223a0d2f84b Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 18 Apr 2022 22:33:42 -0700 Subject: [PATCH 69/95] Gencode --- .gencode_hash.txt | 3 +- gencode/python/udmi/schema/__init__.py | 1 - gencode/python/udmi/schema/event_mapping.py | 47 --------------------- 3 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 gencode/python/udmi/schema/event_mapping.py diff --git a/.gencode_hash.txt b/.gencode_hash.txt index bc0a3c0361..dfd2ceb493 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -60,7 +60,7 @@ c46848327791cec1f1e62dbee2ad66951af7f61ed3c56eeaa8e563774e305bf4 gencode/java/u dfe4bb7c9ba6e366a967ff475883a8ff33fc558ae51db5c71fafae2323d0f8eb gencode/java/udmi/schema/Target.java 7d6dd13e368e7f073738fee69c15e18652a9b7d7ac63bde0a200f747e3aa1b1d gencode/java/udmi/schema/TargetTestingModel.java d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/udmi/schema/TestingModel.java -97407895ce860ee20d80f43b09c5e69a4e57b4400af22cfb14238a30bbff1682 gencode/python/udmi/schema/__init__.py +dbc4084bb91080a350e862ecd8ffab786e677a0d18d4c77857c7546d78d9fe25 gencode/python/udmi/schema/__init__.py 704c8f0eec0b87015af8f7e524375f651b3d35f659ec89b4b022f8c1d0813ec5 gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py 191e1926c16b55f4ef350a711f540eef17a0ec60bec8c193c94182786dc3624b gencode/python/udmi/schema/config_blobset.py @@ -79,7 +79,6 @@ f74b62b11bbbd37ea8968ead811dc2534c4996a3dcfd3671807988b7874de347 gencode/python 3ea3e50436e6b87fbcd773361f4a5cd1662b554a1f3eba47c1670c7f82a765ea gencode/python/udmi/schema/event_discovery_blob.py ad33b91a7fabb4eed7e49c30a983a2106c96330facbe0f376f94d06e2263d6d0 gencode/python/udmi/schema/event_discovery_family.py 266c36a6174c959017894de6051f7d6071ac59ed3f049df9cbb49b894c11c84e gencode/python/udmi/schema/event_discovery_point.py -abe4044d2e3be6693ed39edc8ccaed4eee4eb8acad991e820b21d6ecf3812dd9 gencode/python/udmi/schema/event_mapping.py ddf849bfeb2b87d071cefd5e6feacabc57375a7fff6d72b6d42ffb89f33c859b gencode/python/udmi/schema/event_pointset.py 44aff1bc930dbdbadd51ac3fe0e7d9c83ad84a6a9f9d1c809b3fce66cbcd5e00 gencode/python/udmi/schema/event_pointset_point.py a27b3b2ace3f301b5fa08a3763f792158f9725a5fbed5cd7b5fac8a6701080e4 gencode/python/udmi/schema/event_system.py diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index f5e5d0e783..58d486bae8 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -16,7 +16,6 @@ from .event_discovery_blob import BlobEnumerationEvent from .event_discovery_family import FamilyDiscoveryEvent from .event_discovery_point import PointEnumerationEvent -from .event_mapping import DiscoveryEvent from .event_pointset import PointsetEvent from .event_pointset_point import PointPointsetEvent from .event_system import SystemEvent diff --git a/gencode/python/udmi/schema/event_mapping.py b/gencode/python/udmi/schema/event_mapping.py deleted file mode 100644 index fac601b6a7..0000000000 --- a/gencode/python/udmi/schema/event_mapping.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Generated class for event_mapping.json""" -from .common import Entry - - -class DiscoveryEvent: - """Generated schema class""" - - def __init__(self): - self.timestamp = None - self.version = None - self.status = None - - @staticmethod - def from_dict(source): - if not source: - return None - result = DiscoveryEvent() - result.timestamp = source.get('timestamp') - result.version = source.get('version') - result.status = Entry.from_dict(source.get('status')) - return result - - @staticmethod - def map_from(source): - if not source: - return None - result = {} - for key in source: - result[key] = DiscoveryEvent.from_dict(source[key]) - return result - - @staticmethod - def expand_dict(input): - result = {} - for property in input: - result[property] = input[property].to_dict() if input[property] else {} - return result - - def to_dict(self): - result = {} - if self.timestamp: - result['timestamp'] = self.timestamp # 5 - if self.version: - result['version'] = self.version # 5 - if self.status: - result['status'] = self.status.to_dict() # 4 - return result From 39badd656ba3bc9033488e6f286235d9fa779fa3 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 18 Apr 2022 22:47:27 -0700 Subject: [PATCH 70/95] Linty --- bin/loop_sequences | 5 ++++- bin/test_schema | 2 +- .../com/google/daq/mqtt/validator/SequenceValidator.java | 3 --- .../daq/mqtt/validator/validations/ConfigValidator.java | 9 ++++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bin/loop_sequences b/bin/loop_sequences index 8d961cb178..e4fa826afb 100755 --- a/bin/loop_sequences +++ b/bin/loop_sequences @@ -50,12 +50,15 @@ JAVA_CMD="java -cp $JARFILE com.google.daq.mqtt.validator.SequenceTestRunner" rm -rf $site_model/out/devices/$device_id +test_srces=`cd validator/src/main/java/com/google/daq/mqtt/validator/validations; ls *.java` + exit_code=2 for test_name in $test_names; do if [[ $test_name == . ]]; then test_name= fi - for test_class in ConfigValidator WritebackValidator; do + for test_src in $test_srces; do + test_class=${test_src%.java} target=$test_class$test_prefix$test_name CLASS=com.google.daq.mqtt.validator.validations.$target echo $JAVA_CMD $CLASS diff --git a/bin/test_schema b/bin/test_schema index 9090f7204d..f5c1661a39 100755 --- a/bin/test_schema +++ b/bin/test_schema @@ -62,7 +62,7 @@ fi echo Testing against $subsets for subset in $subsets; do schemaname=${subset%.tests}.json - testfiles=$(cd $testdir/$subset; ls *.json) + testfiles=$(cd $testdir/$subset; ls *.json || true) for testfile in $testfiles; do outfile=${testfile%.json}.out testbase=$testdir/$subset diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java index d3dcebae2c..67c7aa4557 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java @@ -42,18 +42,15 @@ import org.junit.runners.model.TestTimedOutException; import udmi.schema.Config; import udmi.schema.DiscoveryEvent; -import udmi.schema.DiscoveryState; import udmi.schema.Entry; import udmi.schema.Envelope.SubFolder; import udmi.schema.Envelope.SubType; import udmi.schema.Level; import udmi.schema.Metadata; import udmi.schema.PointsetEvent; -import udmi.schema.PointsetState; import udmi.schema.State; import udmi.schema.SystemConfig; import udmi.schema.SystemEvent; -import udmi.schema.SystemState; /** * Validate a device using a sequence of message exchanges. diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/ConfigValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/ConfigValidator.java index f2c8040c9b..98f7190e09 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/ConfigValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/ConfigValidator.java @@ -39,7 +39,8 @@ public void broken_config() { untilTrue("last_config not null", () -> deviceState.system.last_config != null); untilTrue("state no status", () -> deviceState.system.status == null); clearLogs(); - untilTrue("previous config/state synced", () -> dateEquals(deviceConfig.timestamp, deviceState.system.last_config) + untilTrue("previous config/state synced", + () -> dateEquals(deviceConfig.timestamp, deviceState.system.last_config) ); extraField = "break_json"; updateConfig(); @@ -69,7 +70,8 @@ public void broken_config() { extraField = null; hasLogged(SYSTEM_CONFIG_RECEIVE, Level.INFO); untilTrue("state no status", () -> deviceState.system.status == null); - untilTrue("last_config updated", () -> !dateEquals(matchedConfig, deviceState.system.last_config) + untilTrue("last_config updated", + () -> !dateEquals(matchedConfig, deviceState.system.last_config) ); assertTrue("system operational", deviceState.system.operational); hasLogged(SYSTEM_CONFIG_PARSE, Level.INFO); @@ -95,7 +97,8 @@ public void extra_config() { extraField = null; updateConfig(); hasLogged(SYSTEM_CONFIG_RECEIVE, Level.INFO); - untilTrue("last_config updated again", () -> !deviceState.system.last_config.equals(updatedConfig) + untilTrue("last_config updated again", + () -> !deviceState.system.last_config.equals(updatedConfig) ); untilTrue("system operational", () -> deviceState.system.operational); untilTrue("state no status", () -> deviceState.system.status == null); From dc84008de3952d34241c4bfbff0464a0741a101c Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Tue, 19 Apr 2022 13:31:11 -0700 Subject: [PATCH 71/95] Lint fixes --- .../util/CatchingScheduledThreadPoolExecutor.java | 8 ++++++++ pubber/src/main/java/daq/pubber/Pubber.java | 15 ++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pubber/src/main/java/com/google/daq/mqtt/util/CatchingScheduledThreadPoolExecutor.java b/pubber/src/main/java/com/google/daq/mqtt/util/CatchingScheduledThreadPoolExecutor.java index 99f0ebbbbf..c166d24e39 100644 --- a/pubber/src/main/java/com/google/daq/mqtt/util/CatchingScheduledThreadPoolExecutor.java +++ b/pubber/src/main/java/com/google/daq/mqtt/util/CatchingScheduledThreadPoolExecutor.java @@ -5,8 +5,16 @@ import java.util.concurrent.Future; import java.util.concurrent.ScheduledThreadPoolExecutor; +/** + * Thread executor wrapper that does a better job of exposing exceptions during execution. + */ public class CatchingScheduledThreadPoolExecutor extends ScheduledThreadPoolExecutor { + /** + * Create a new executor. + * + * @param corePoolSize number of threads to utilize + */ public CatchingScheduledThreadPoolExecutor(int corePoolSize) { super(corePoolSize); } diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 381b073655..35375977fe 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -107,6 +107,7 @@ public class Pubber { ); private static final long VERY_LONG_TIME_SEC = 1234567890; private static final Date NEVER_FUTURE = Date.from(Instant.now().plusSeconds(VERY_LONG_TIME_SEC)); + private static final Date DEVICE_START_TIME = new Date(); private final ScheduledExecutorService executor = new CatchingScheduledThreadPoolExecutor(1); private final Configuration configuration; private final AtomicInteger messageDelayMs = new AtomicInteger(DEFAULT_REPORT_SEC * 1000); @@ -115,7 +116,6 @@ public class Pubber { private final ExtraPointsetEvent devicePoints = new ExtraPointsetEvent(); private final Set allPoints = new HashSet<>(); private final AtomicInteger logMessageCount = new AtomicInteger(0); - private final Date DEVICE_START_TIME = new Date(); private final Config deviceConfig = new Config(); private int deviceMessageCount = -1; private MqttPublisher mqttPublisher; @@ -635,8 +635,8 @@ private void updateDiscoveryEnumeration(FamilyDiscoveryConfig enumeration) { deviceState.discovery.enumeration = new FamilyDiscoveryState(); } Date enumerationGeneration = enumeration.generation; - if (enumerationGeneration == null || - !enumerationGeneration.after(deviceState.discovery.enumeration.generation)) { + if (enumerationGeneration == null + || !enumerationGeneration.after(deviceState.discovery.enumeration.generation)) { return; } deviceState.discovery.enumeration = new FamilyDiscoveryState(); @@ -658,13 +658,14 @@ private void updateDiscoveryScan(HashMap families deviceState.discovery.families.keySet().forEach(family -> { if (!families.containsKey(family)) { - FamilyDiscoveryState familyDiscoveryState = deviceState.discovery.families.get(family); + FamilyDiscoveryState familyDiscoveryState = deviceState.discovery.families.get(family); if (familyDiscoveryState.generation != null) { info("Clearing scheduled discovery family " + family); familyDiscoveryState.generation = null; familyDiscoveryState.active = null; } - }}); + } + }); families.keySet().forEach(family -> { FamilyDiscoveryConfig familyDiscoveryConfig = families.get(family); Date configGeneration = familyDiscoveryConfig.generation; @@ -724,8 +725,8 @@ private void checkDiscoveryScan(String family, Date configGeneration) { private void sendDiscoveryEvent(String family, Date configGeneration) { FamilyDiscoveryState familyDiscoveryState = getFamilyDiscoveryState(family); - if (configGeneration.equals(familyDiscoveryState.generation) && - familyDiscoveryState.active) { + if (configGeneration.equals(familyDiscoveryState.generation) + && familyDiscoveryState.active) { info("Sending discovery event " + family + " for " + configGeneration); DiscoveryEvent discoveryEvent = new DiscoveryEvent(); discoveryEvent.timestamp = new Date(); From a382661cbfaf4f77ad340bf93fd0d5bb1c6a0bc1 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Tue, 19 Apr 2022 13:37:29 -0700 Subject: [PATCH 72/95] Linty --- .../validations/DiscoveryValidator.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index 86e3e02911..1eec905379 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -17,7 +17,6 @@ import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; -import java.util.stream.Stream; import org.junit.Test; import udmi.schema.DiscoveryConfig; import udmi.schema.DiscoveryEvent; @@ -70,17 +69,21 @@ public void single_scan() { untilTrue("all scans not active", () -> families.stream().noneMatch(familyScanActivated(null))); Map previousGenerations = new HashMap<>(); families.forEach(family -> previousGenerations.put(family, getStateFamilyGeneration(family))); - Date startTime = CleanDateFormat.cleanDate(Date.from(Instant.now().plusSeconds(SCAN_START_DELAY_SEC))); + Date startTime = CleanDateFormat.cleanDate( + Date.from(Instant.now().plusSeconds(SCAN_START_DELAY_SEC))); info("Scan start scheduled for " + startTime); families.forEach(family -> getConfigFamily(family).generation = startTime); updateConfig(); getReceivedEvents(DiscoveryEvent.class); // Clear out any previously received events - untilTrue("scheduled scan start", () -> families.stream().anyMatch(familyScanActivated(startTime)) - || families.stream().anyMatch(family -> !stateGenerationSame(family, previousGenerations)) - || !deviceState.timestamp.before(startTime)); + untilTrue("scheduled scan start", + () -> families.stream().anyMatch(familyScanActivated(startTime)) + || families.stream() + .anyMatch(family -> !stateGenerationSame(family, previousGenerations)) + || !deviceState.timestamp.before(startTime)); if (deviceState.timestamp.before(startTime)) { warning("scan started before activation: " + deviceState.timestamp + " < " + startTime); - assertFalse("premature activation", families.stream().anyMatch(familyScanActivated(startTime))); + assertFalse("premature activation", + families.stream().anyMatch(familyScanActivated(startTime))); assertFalse("premature generation", families.stream().anyMatch(family -> !stateGenerationSame(family, previousGenerations))); fail("unknown reason"); @@ -118,15 +121,17 @@ private FamilyDiscoveryState getStateFamily(String family) { } private Predicate familyScanActive(Date startTime) { - return family -> catchToFalse(() -> getStateFamily(family).active && - CleanDateFormat.dateEquals(getStateFamily(family).generation, startTime)); + return family -> catchToFalse(() -> getStateFamily(family).active + && CleanDateFormat.dateEquals(getStateFamily(family).generation, startTime)); } private Predicate familyScanActivated(Date startTime) { return family -> catchToFalse(() -> { - System.err.println(getStateFamily(family).active + " time check: " + getStateFamily(family).generation + " " + startTime); - return getStateFamily(family).active || - CleanDateFormat.dateEquals(getStateFamily(family).generation, startTime); + System.err.println( + getStateFamily(family).active + " time check: " + getStateFamily(family).generation + " " + + startTime); + return getStateFamily(family).active + || CleanDateFormat.dateEquals(getStateFamily(family).generation, startTime); }); } From 0ab92ff7a9dda976a2e0d1cd9791dddf93a90364 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Tue, 19 Apr 2022 13:46:25 -0700 Subject: [PATCH 73/95] Updating expected --- etc/sequencer.out | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/sequencer.out b/etc/sequencer.out index 601f4a3e6e..cd4328ee22 100644 --- a/etc/sequencer.out +++ b/etc/sequencer.out @@ -1,6 +1,7 @@ RESULT pass broken_config Sequence complete RESULT pass extra_config Sequence complete RESULT pass self_enumeration Sequence complete +RESULT skip single_scan No discovery families configured RESULT pass system_last_update Sequence complete RESULT pass valid_serial_no Sequence complete RESULT pass valid_serial_no Sequence complete From bf1bb747eac26fed371f9a3a68573807b0c3c820 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 07:59:53 -0700 Subject: [PATCH 74/95] Gencode --- .gencode_hash.txt | 44 ++- gencode/docs/metadata.html | 358 ++++++++++-------- .../{CloudMetadata.java => CloudModel.java} | 18 +- gencode/java/udmi/schema/DiscoveryModel.java | 45 +++ ...Metadata.java => FamilyLocalnetModel.java} | 8 +- ...GatewayMetadata.java => GatewayModel.java} | 8 +- ...calnetMetadata.java => LocalnetModel.java} | 10 +- gencode/java/udmi/schema/Metadata.java | 41 +- ...tMetadata.java => PointPointsetModel.java} | 18 +- ...intsetMetadata.java => PointsetModel.java} | 10 +- .../{SystemMetadata.java => SystemModel.java} | 10 +- gencode/java/udmi/schema/TestingModel.java | 8 +- gencode/python/udmi/schema/__init__.py | 17 +- gencode/python/udmi/schema/metadata.py | 25 +- gencode/python/udmi/schema/model_cloud.py | 6 +- gencode/python/udmi/schema/model_discovery.py | 38 ++ ...ry_family.py => model_discovery_family.py} | 2 +- gencode/python/udmi/schema/model_gateway.py | 6 +- gencode/python/udmi/schema/model_localnet.py | 12 +- .../udmi/schema/model_localnet_family.py | 6 +- gencode/python/udmi/schema/model_pointset.py | 12 +- .../udmi/schema/model_pointset_point.py | 6 +- gencode/python/udmi/schema/model_system.py | 6 +- gencode/python/udmi/schema/model_testing.py | 4 - pubber/src/main/java/daq/pubber/Pubber.java | 1 + schema/metadata.json | 5 +- schema/model_cloud.json | 2 +- schema/model_discovery.json | 22 ++ ...amily.json => model_discovery_family.json} | 0 schema/model_gateway.json | 2 +- schema/model_localnet.json | 4 +- schema/model_localnet_family.json | 2 +- schema/model_pointset.json | 4 +- schema/model_pointset_point.json | 2 +- schema/model_system.json | 4 +- schema/model_testing.json | 13 - tests/metadata.tests/example.json | 12 +- 37 files changed, 467 insertions(+), 324 deletions(-) rename gencode/java/udmi/schema/{CloudMetadata.java => CloudModel.java} (86%) create mode 100644 gencode/java/udmi/schema/DiscoveryModel.java rename gencode/java/udmi/schema/{FamilyLocalnetMetadata.java => FamilyLocalnetModel.java} (84%) rename gencode/java/udmi/schema/{GatewayMetadata.java => GatewayModel.java} (92%) rename gencode/java/udmi/schema/{LocalnetMetadata.java => LocalnetModel.java} (80%) rename gencode/java/udmi/schema/{PointPointsetMetadata.java => PointPointsetModel.java} (91%) rename gencode/java/udmi/schema/{PointsetMetadata.java => PointsetModel.java} (85%) rename gencode/java/udmi/schema/{SystemMetadata.java => SystemModel.java} (87%) create mode 100644 gencode/python/udmi/schema/model_discovery.py rename gencode/python/udmi/schema/{model_testing_discovery_family.py => model_discovery_family.py} (91%) create mode 100644 schema/model_discovery.json rename schema/{model_testing_discovery_family.json => model_discovery_family.json} (100%) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index eeed5473d1..a25fde744c 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -4,7 +4,7 @@ e2944b13db5ff06be9caea51d03bca48f2cb093a8bb583dca14051255d34ea6b gencode/docs/e 987503860562a3971314a98d75890b6c7615fee84bff6bede7010231f469c035 gencode/docs/event_pointset.html e3fb2b1a96f6fcb06f5af6cff32829abc825065ed52de81c3d379c8c8070fe09 gencode/docs/event_system.html a82821e72af6d0ee35800e6262eb9bb05256309b98aed2dad1a368fd2d6882bb gencode/docs/index.html -0b1e8450c3a4b106698b2df22be882748708daecf6b4e87236321bf08c4a8cf3 gencode/docs/metadata.html +4234d68aa512355c6e1047db0fbd293a6d8b461a217dd440b71e9f799040d409 gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js @@ -17,12 +17,13 @@ d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/u 7f54da38284a1010de1a2590381022fa16d27fd141d76d1ba6eb471de4d94781 gencode/java/udmi/schema/BlobBlobsetState.java d2c5b5aae8db27b68104fc83a1f38de0a3f1b5d683f2b13599adf24e96c7d124 gencode/java/udmi/schema/BlobsetConfig.java b6ff9b8739a9c3bb6972f73db6fc54f451189c13b273e58bc11cb3d82c74ad40 gencode/java/udmi/schema/BlobsetState.java -90d6e869087d4dfdc2c29c7f51872e630ad8135542dd432629bf4edac807053a gencode/java/udmi/schema/CloudMetadata.java +a2eeff86f4302272736d84602e2ca36a64d27c8ef6761cc05ffb8ad17b030d4d gencode/java/udmi/schema/CloudModel.java 28001569e7902d3aa39aa3749ca08fb8e29460ba97a4b560d266b365bf5f8c46 gencode/java/udmi/schema/Config.java b300398d6162a6ff18b8c09a366b8cf999f8c193cb61af1f1740464569c2c1b4 gencode/java/udmi/schema/Discovery.java 67ac3441ce6d5d4450741ee7e639174756498e1b3780c2d18ce20562b5a88c26 gencode/java/udmi/schema/DiscoveryCommand.java d8a80ab3180d33bfa17564c969018e1d4350a47dbc70c4ae8a5abbfb25cfedc9 gencode/java/udmi/schema/DiscoveryConfig.java ec270272082836e682bc41eb73a059995d08432fa7d82e0ed9f6ce80a4082796 gencode/java/udmi/schema/DiscoveryEvent.java +a7622890730423d1a221808af2eb5f0e784a47e8535c9297ef17a1ac518a4eab gencode/java/udmi/schema/DiscoveryModel.java 9962b0eb7d5adf52af6160e9f3131f8eeb52ae9e518954dbb6aead1bcad0245e gencode/java/udmi/schema/DiscoveryState.java 090bbaf1508aa6ca8380af936af990673f300eb5a940c9e8ab94deb64efa2b7b gencode/java/udmi/schema/Entry.java 8f71ecd4c32044eccd74225006887d58827976f699ea03efaa5b7ed1b69849d0 gencode/java/udmi/schema/Envelope.java @@ -31,37 +32,37 @@ aa0885ca43ab38c7597eacc38b7c512940a1a9fa061abd47d02c28e66b6fd93e gencode/java/u ae4a645f199c8e24b3303463d428ca17af7603ae9ae9238397a6a82e752ab454 gencode/java/udmi/schema/FamilyDiscoveryEvent.java 0afc15acd72874e5a0c47f546abc0c4569f5bc37838fdcac77bc7bd55cc53a6d gencode/java/udmi/schema/FamilyDiscoveryState.java 9959a84eea3e549c142c3edf637c86eb56eca138108ebd51fc2985e45aa41484 gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java -d7aeee0fe20a8dd8d92e43e10d5b563ba4d70cb259f17c5818f3a0a4eed1e2ec gencode/java/udmi/schema/FamilyLocalnetMetadata.java +efb376cd7a80ca74fbf74d3ef3f4101d393341a91d01db36456aa84f6be3d0a5 gencode/java/udmi/schema/FamilyLocalnetModel.java 60a8115ae1acae7c199b63180823198d38ec50d57b48dd85aca1ccc865058f85 gencode/java/udmi/schema/GatewayConfig.java -d79f50da651f376ec06bfe3b16bc76eae599d313240022894164ddbcc25c081c gencode/java/udmi/schema/GatewayMetadata.java +56b46f4914ef1f4baa59bf597186ff7901b7c8b607720ec798f4e4e6ad59aa08 gencode/java/udmi/schema/GatewayModel.java e0e7739046e834c0f0ca6a70b38b4579618899be3162887a0fa7ab60bbff22a5 gencode/java/udmi/schema/GatewayState.java a5e5adfc187709e8646a11c92e804acfb67743f9d72149008aaca954df3177f6 gencode/java/udmi/schema/Level.java 07fd4911363437b274c19b024759b04b116152176702da8d4203c4ff4cb55b7f gencode/java/udmi/schema/LocalnetConfig.java -419f04e56922a444c6cc1148796108df2c804cbe139f42b5505c3c48303a573c gencode/java/udmi/schema/LocalnetMetadata.java +910c68183db7703b00bcb81146ad73e6fe0d4bbc4caec4dc9c621f3cc2e5eee5 gencode/java/udmi/schema/LocalnetModel.java 2df4ae32d0bbecc21f7c3f6a416a195baa766a6210cfa8abca4a7bb45b9c7961 gencode/java/udmi/schema/Location.java -ceba95d0586f995eacc52defcf91cd91226e88891a01a0761770853de9dcdf5d gencode/java/udmi/schema/Metadata.java +a1b17e0a1bc10f8e2ea105649a4254fd81c67c3dbe5d78af661fadb739b5be54 gencode/java/udmi/schema/Metadata.java a4e8f69100ab678a8236f481c558d677bbaea3e76c853bbd9262113d2a9c031d gencode/java/udmi/schema/Metrics.java 5e1c5411fae4d7c47391ceb5d19ae864fcd484df75ac6b6db39fd2d12647dec8 gencode/java/udmi/schema/Physical_tag.java 0868f0a9beb671dd08f066e7e7e796531fe151307a0b853b1f1a1aafe50ee746 gencode/java/udmi/schema/PointEnumerationEvent.java 2cca321fb2fbc00d2082fd918062f6b02e8f2dbe1359c0fbb6a3f47a946838c7 gencode/java/udmi/schema/PointPointsetConfig.java 8f3fc1cdc2dcd3e524863f4675aebabc450a35f5fd1cdc3fd37289b5cab7f2ec gencode/java/udmi/schema/PointPointsetEvent.java -09a99eddb418ef56a4744f94a1d15815e5c460c5e2bd0ea2badfc0662986a853 gencode/java/udmi/schema/PointPointsetMetadata.java +1372dc65268324a65a5854008b5dc5d2492328c145799dc4fda2a520e9f8198b gencode/java/udmi/schema/PointPointsetModel.java db8d6dd3498019ad12e0f328b6237d07e52f133f8b08858b712611a52c198009 gencode/java/udmi/schema/PointPointsetState.java c6a0571e228490defcb8fba335220b23247aea0e0cb9b657efc1e1e6dbcc0fb3 gencode/java/udmi/schema/PointsetConfig.java f3aea029530d0d8c6f50a75f266fd222d3f5ad92004f40675d6a99c906d22c82 gencode/java/udmi/schema/PointsetEvent.java -7987adebea9103a857493bb7698913d0891fcb4a77cec0e208c655953df82243 gencode/java/udmi/schema/PointsetMetadata.java +580dd48ce15879fcedf2150e9b87de99c3b6bdf3b631372b1391af048ba6771f gencode/java/udmi/schema/PointsetModel.java fc3a9415c04d8a06954dbdbfdff5d68ab113cce3948532c19df555778ffb04fa gencode/java/udmi/schema/PointsetState.java ca2e7566106818ca7e5190c8041eb86f0c9b3251b0bda8c3ea7ce11a0c891a0a gencode/java/udmi/schema/Position.java 6ddce136f5e34e7e8c7d101c8a729f1fdd323befdfa52590ebdf0028f970bdf5 gencode/java/udmi/schema/Properties.java 0a1a025dde88fd46925cbb56f5179ed2803ea97948292809ff328a5201d90a3e gencode/java/udmi/schema/State.java 6b8b054c5fa2baef5163d42cd6bf1b0aeb4d07aa881529d81f4ae7dfa4c2906e gencode/java/udmi/schema/SystemConfig.java 8075f2133463e55ac24fccf9391c94698c580b860ad1a0901d5346a2f369030b gencode/java/udmi/schema/SystemEvent.java -c46848327791cec1f1e62dbee2ad66951af7f61ed3c56eeaa8e563774e305bf4 gencode/java/udmi/schema/SystemMetadata.java +9cad2475189fa1115ca78978cbacaeac62fcb875494d72efa4bc40781e8072f9 gencode/java/udmi/schema/SystemModel.java 451217e2cce0ae9224a86f35b3bdea14b36658efe6f94f4a2dff4f4b1dc51cf7 gencode/java/udmi/schema/SystemState.java dfe4bb7c9ba6e366a967ff475883a8ff33fc558ae51db5c71fafae2323d0f8eb gencode/java/udmi/schema/Target.java 7d6dd13e368e7f073738fee69c15e18652a9b7d7ac63bde0a200f747e3aa1b1d gencode/java/udmi/schema/TargetTestingModel.java -909e958afe9a2c46f7cd6170c962609105bce9a7f93581f5493ddffe4d689c39 gencode/java/udmi/schema/TestingModel.java -752cd4f6e66fd34f768cd3b1d144b417c06c5c67b6326063aca899e2130f308d gencode/python/udmi/schema/__init__.py +d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/udmi/schema/TestingModel.java +256831be7080ab66aac89d7027d9fa174a12ef4182de6123efa7f4c3f1e7ff04 gencode/python/udmi/schema/__init__.py 6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 704c8f0eec0b87015af8f7e524375f651b3d35f659ec89b4b022f8c1d0813ec5 gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py @@ -84,16 +85,17 @@ abe4044d2e3be6693ed39edc8ccaed4eee4eb8acad991e820b21d6ecf3812dd9 gencode/python ddf849bfeb2b87d071cefd5e6feacabc57375a7fff6d72b6d42ffb89f33c859b gencode/python/udmi/schema/event_pointset.py 44aff1bc930dbdbadd51ac3fe0e7d9c83ad84a6a9f9d1c809b3fce66cbcd5e00 gencode/python/udmi/schema/event_pointset_point.py a27b3b2ace3f301b5fa08a3763f792158f9725a5fbed5cd7b5fac8a6701080e4 gencode/python/udmi/schema/event_system.py -5052a13ce3b3b7affd607a62a8d919b79b464e1352e03fc35799f22996a4aa7a gencode/python/udmi/schema/metadata.py -defe9fcce671ff4ac1a91b9d60ff2260f60865a13fba29c032ff356b1b79f471 gencode/python/udmi/schema/model_cloud.py -1fb8473dd0f2b083ce7daf00a65121893ee5c88ba6999b4950813e4b914a514c gencode/python/udmi/schema/model_gateway.py -89ce7a460f6cba70b067329d2b58814fc2adfee9f783890b148babdceb1f5d2a gencode/python/udmi/schema/model_localnet.py -c1ebc4c6885a3299156300e27cefe63e3b745f595882e0e2be88bb61435d0752 gencode/python/udmi/schema/model_localnet_family.py -b0cfc2a86539f3525f2da52d7b0422bb8934348690f25d9ab64c38e7a8a20536 gencode/python/udmi/schema/model_pointset.py -347b1ee16f74b8cdfa83aa4e179af5a5529545daf1736baf401936c7cf9e7809 gencode/python/udmi/schema/model_pointset_point.py -cd00563a4e0be9112f6d8af3335acc12b0d3354beab602ab924aac59a0f588e4 gencode/python/udmi/schema/model_system.py -526f2ad011d1525937297514b5846435c43d392d082eae5b1e4bd9771396f286 gencode/python/udmi/schema/model_testing.py -c33a3a0f90612109425fcfaa5f4c88a527960e942b5f4a94d9ff3236adbf90ea gencode/python/udmi/schema/model_testing_discovery_family.py +42f3429edf4a187be6ebfe9760f5e14821a25afa8f7c65b69e0e34fb29a7932e gencode/python/udmi/schema/metadata.py +b2227a48f21594f78c07c427de64e7ce51dc0ecd4b8091601d739a5f5038a2c9 gencode/python/udmi/schema/model_cloud.py +9122b840339a3ded9f1a9238b2964c06e8780688197ce31382342a6574d919be gencode/python/udmi/schema/model_discovery.py +44d057dffcac3a994e7b894f8e1ebb643ba49d7dbfbb0bfea9cc04f97af0bc47 gencode/python/udmi/schema/model_discovery_family.py +9416018a6d01094ab7af77c35ae4e5e2271a5d52c3bd3e381a541650415048b2 gencode/python/udmi/schema/model_gateway.py +ae6a7bc93b520cdc90cd158f876a58e98a3e000402ebb1ca632f01ee492d408a gencode/python/udmi/schema/model_localnet.py +4718368765cacc2cbf552a65346452a14690d0175e9cc921fc576a5c7691fa1d gencode/python/udmi/schema/model_localnet_family.py +2b68c4bdc6d512d12881c1e3ad1d1d31e8422a120f71f3b55abd7c3045ff91ba gencode/python/udmi/schema/model_pointset.py +7125a56680e83c874a35caa6c26f0aa0127fa7a3990aef198090af133d109eab gencode/python/udmi/schema/model_pointset_point.py +75832b261c613b963012b96c406d7e7d22d12aab4f5ad649a5d9d1dd28235345 gencode/python/udmi/schema/model_system.py +aafe6e70c281152db958adf77a024e3e9fab8293927106297c5ec48c11f54e27 gencode/python/udmi/schema/model_testing.py 5c50847e136a033ea511209238bb570499b43fbee6189dae06603132dcb9f01f gencode/python/udmi/schema/model_testing_target.py a58f8c98e837a5b56126ca0f410e02f1e9cfcd80a8cb429e0ef522defab1f690 gencode/python/udmi/schema/properties.py 32bc70a30e37e89cfae14b44add18d546a6f9e00a3ec3519ede9c7486114d39c gencode/python/udmi/schema/state.py diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 694f6e04ab..ab5b286496 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -51,7 +51,7 @@

/> timestamp

Type: string
-

RFC 3339 timestamp the metadata was generated

+

RFC 3339 timestamp the message was generated

@@ -353,7 +353,7 @@

/> system

Type: object
-

High-level system information about the device. System Metadata Documentation

+

High-level system information about the device. System Model Documentation

No Additional Properties @@ -1345,6 +1345,190 @@

Each item of this array must be:

+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Discovery target parameters

+
+ + No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ No Additional Properties + + + + + + +
+
+
+

+ +

+
+ +
+
+ + Type: object
+ + + + + + + +
+
+
+

+ +

+
+ +
+

+ +

+

All property whose name matches the following regular expression must respect the following conditions

+ Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ +
+ + Type: object
+ + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1505,7 +1689,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Family Localnet Metadata + Family Localnet Model -

-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
- - - - - - - -
-
-
-

- -

-
- -
-

- -

-

All property whose name matches the following regular expression must respect the following conditions

- Property name regular expression: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$ -
- - Type: object
- - - - - - - - -
@@ -2084,7 +2120,7 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model * Information specific to how the device communicates with the cloud. * @@ -25,7 +25,7 @@ "is_gateway" }) @Generated("jsonschema2pojo") -public class CloudMetadata { +public class CloudModel { /** * The key type used for cloud communication. @@ -34,7 +34,7 @@ public class CloudMetadata { */ @JsonProperty("auth_type") @JsonPropertyDescription("The key type used for cloud communication.") - public CloudMetadata.Auth_type auth_type; + public CloudModel.Auth_type auth_type; /** * Whether the device authenticates via a private key. Typically false for devices which are proxied for by an IoT core gateway * @@ -64,10 +64,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof CloudMetadata) == false) { + if ((other instanceof CloudModel) == false) { return false; } - CloudMetadata rhs = ((CloudMetadata) other); + CloudModel rhs = ((CloudModel) other); return ((((this.is_gateway == rhs.is_gateway)||((this.is_gateway!= null)&&this.is_gateway.equals(rhs.is_gateway)))&&((this.auth_type == rhs.auth_type)||((this.auth_type!= null)&&this.auth_type.equals(rhs.auth_type))))&&((this.device_key == rhs.device_key)||((this.device_key!= null)&&this.device_key.equals(rhs.device_key)))); } @@ -84,10 +84,10 @@ public enum Auth_type { RS_256("RS256"), RS_256_X_509("RS256_X509"); private final String value; - private final static Map CONSTANTS = new HashMap(); + private final static Map CONSTANTS = new HashMap(); static { - for (CloudMetadata.Auth_type c: values()) { + for (CloudModel.Auth_type c: values()) { CONSTANTS.put(c.value, c); } } @@ -107,8 +107,8 @@ public String value() { } @JsonCreator - public static CloudMetadata.Auth_type fromValue(String value) { - CloudMetadata.Auth_type constant = CONSTANTS.get(value); + public static CloudModel.Auth_type fromValue(String value) { + CloudModel.Auth_type constant = CONSTANTS.get(value); if (constant == null) { throw new IllegalArgumentException(value); } else { diff --git a/gencode/java/udmi/schema/DiscoveryModel.java b/gencode/java/udmi/schema/DiscoveryModel.java new file mode 100644 index 0000000000..22541d4090 --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryModel.java @@ -0,0 +1,45 @@ + +package udmi.schema; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Discovery Model + *

+ * Discovery target parameters + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "discovery" +}) +@Generated("jsonschema2pojo") +public class DiscoveryModel { + + @JsonProperty("discovery") + public Discovery discovery; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DiscoveryModel) == false) { + return false; + } + DiscoveryModel rhs = ((DiscoveryModel) other); + return ((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))); + } + +} diff --git a/gencode/java/udmi/schema/FamilyLocalnetMetadata.java b/gencode/java/udmi/schema/FamilyLocalnetModel.java similarity index 84% rename from gencode/java/udmi/schema/FamilyLocalnetMetadata.java rename to gencode/java/udmi/schema/FamilyLocalnetModel.java index c4302f226d..efeb8caca9 100644 --- a/gencode/java/udmi/schema/FamilyLocalnetMetadata.java +++ b/gencode/java/udmi/schema/FamilyLocalnetModel.java @@ -9,7 +9,7 @@ /** - * Family Localnet Metadata + * Family Localnet Model *

* The type of network * @@ -19,7 +19,7 @@ "id" }) @Generated("jsonschema2pojo") -public class FamilyLocalnetMetadata { +public class FamilyLocalnetModel { /** * The address of a device on the local network @@ -42,10 +42,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof FamilyLocalnetMetadata) == false) { + if ((other instanceof FamilyLocalnetModel) == false) { return false; } - FamilyLocalnetMetadata rhs = ((FamilyLocalnetMetadata) other); + FamilyLocalnetModel rhs = ((FamilyLocalnetModel) other); return ((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))); } diff --git a/gencode/java/udmi/schema/GatewayMetadata.java b/gencode/java/udmi/schema/GatewayModel.java similarity index 92% rename from gencode/java/udmi/schema/GatewayMetadata.java rename to gencode/java/udmi/schema/GatewayModel.java index b1d03e53c8..dd8d54748b 100644 --- a/gencode/java/udmi/schema/GatewayMetadata.java +++ b/gencode/java/udmi/schema/GatewayModel.java @@ -11,7 +11,7 @@ /** - * Gateway Metadata + * Gateway Model *

* [Gateway Documentation](../docs/specs/gateway.md) * @@ -23,7 +23,7 @@ "proxy_ids" }) @Generated("jsonschema2pojo") -public class GatewayMetadata { +public class GatewayModel { /** * The device ID of the gateway the device is bound to @@ -61,10 +61,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof GatewayMetadata) == false) { + if ((other instanceof GatewayModel) == false) { return false; } - GatewayMetadata rhs = ((GatewayMetadata) other); + GatewayModel rhs = ((GatewayModel) other); return ((((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids)))&&((this.family == rhs.family)||((this.family!= null)&&this.family.equals(rhs.family))))&&((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))); } diff --git a/gencode/java/udmi/schema/LocalnetMetadata.java b/gencode/java/udmi/schema/LocalnetModel.java similarity index 80% rename from gencode/java/udmi/schema/LocalnetMetadata.java rename to gencode/java/udmi/schema/LocalnetModel.java index 7a691ac711..cebd3c0561 100644 --- a/gencode/java/udmi/schema/LocalnetMetadata.java +++ b/gencode/java/udmi/schema/LocalnetModel.java @@ -9,7 +9,7 @@ /** - * Localnet Metadata + * Localnet Model *

* Used to describe device local network parameters * @@ -19,7 +19,7 @@ "families" }) @Generated("jsonschema2pojo") -public class LocalnetMetadata { +public class LocalnetModel { /** * @@ -27,7 +27,7 @@ public class LocalnetMetadata { * */ @JsonProperty("families") - public HashMap families; + public HashMap families; @Override public int hashCode() { @@ -41,10 +41,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof LocalnetMetadata) == false) { + if ((other instanceof LocalnetModel) == false) { return false; } - LocalnetMetadata rhs = ((LocalnetMetadata) other); + LocalnetModel rhs = ((LocalnetModel) other); return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); } diff --git a/gencode/java/udmi/schema/Metadata.java b/gencode/java/udmi/schema/Metadata.java index 47303a831f..ac7297f3b1 100644 --- a/gencode/java/udmi/schema/Metadata.java +++ b/gencode/java/udmi/schema/Metadata.java @@ -24,6 +24,7 @@ "cloud", "system", "gateway", + "discovery", "localnet", "testing", "pointset" @@ -32,12 +33,12 @@ public class Metadata { /** - * RFC 3339 timestamp the metadata was generated + * RFC 3339 timestamp the message was generated * (Required) * */ @JsonProperty("timestamp") - @JsonPropertyDescription("RFC 3339 timestamp the metadata was generated") + @JsonPropertyDescription("RFC 3339 timestamp the message was generated") public Date timestamp; /** * Major version of the UDMI schema @@ -62,42 +63,51 @@ public class Metadata { @JsonPropertyDescription("Automatically generated field that contains the hash of file contents.") public String hash; /** - * Cloud Metadata + * Cloud Model *

* Information specific to how the device communicates with the cloud. * */ @JsonProperty("cloud") @JsonPropertyDescription("Information specific to how the device communicates with the cloud.") - public CloudMetadata cloud; + public CloudModel cloud; /** - * System Metadata + * System Model *

- * High-level system information about the device. [System Metadata Documentation](../docs/messages/system.md) + * High-level system information about the device. [System Model Documentation](../docs/messages/system.md) * (Required) * */ @JsonProperty("system") - @JsonPropertyDescription("High-level system information about the device. [System Metadata Documentation](../docs/messages/system.md)") - public SystemMetadata system; + @JsonPropertyDescription("High-level system information about the device. [System Model Documentation](../docs/messages/system.md)") + public SystemModel system; /** - * Gateway Metadata + * Gateway Model *

* [Gateway Documentation](../docs/specs/gateway.md) * */ @JsonProperty("gateway") @JsonPropertyDescription("[Gateway Documentation](../docs/specs/gateway.md)") - public GatewayMetadata gateway; + public GatewayModel gateway; /** - * Localnet Metadata + * Discovery Model + *

+ * Discovery target parameters + * + */ + @JsonProperty("discovery") + @JsonPropertyDescription("Discovery target parameters") + public DiscoveryModel discovery; + /** + * Localnet Model *

* Used to describe device local network parameters * */ @JsonProperty("localnet") @JsonPropertyDescription("Used to describe device local network parameters") - public LocalnetMetadata localnet; + public LocalnetModel localnet; /** * Testing Model *

@@ -108,20 +118,21 @@ public class Metadata { @JsonPropertyDescription("Testing target parameters") public TestingModel testing; /** - * Pointset Metadata + * Pointset Model *

* Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds * */ @JsonProperty("pointset") @JsonPropertyDescription("Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds") - public PointsetMetadata pointset; + public PointsetModel pointset; @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.cloud == null)? 0 :this.cloud.hashCode())); result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); + result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); result = ((result* 31)+((this.testing == null)? 0 :this.testing.hashCode())); result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); result = ((result* 31)+((this.pointset == null)? 0 :this.pointset.hashCode())); @@ -142,7 +153,7 @@ public boolean equals(Object other) { return false; } Metadata rhs = ((Metadata) other); - return (((((((((((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud)))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + return ((((((((((((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud)))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); } } diff --git a/gencode/java/udmi/schema/PointPointsetMetadata.java b/gencode/java/udmi/schema/PointPointsetModel.java similarity index 91% rename from gencode/java/udmi/schema/PointPointsetMetadata.java rename to gencode/java/udmi/schema/PointPointsetModel.java index 4083811251..a738745244 100644 --- a/gencode/java/udmi/schema/PointPointsetMetadata.java +++ b/gencode/java/udmi/schema/PointPointsetModel.java @@ -13,7 +13,7 @@ /** - * Point Pointset Metadata + * Point Pointset Model *

* Information about a specific point name of the device. * @@ -32,7 +32,7 @@ "sample_rate_sec" }) @Generated("jsonschema2pojo") -public class PointPointsetMetadata { +public class PointPointsetModel { /** * Expected unit configuration for the point @@ -68,7 +68,7 @@ public class PointPointsetMetadata { */ @JsonProperty("baseline_state") @JsonPropertyDescription("Expected state when `baseline_value` is set as the `set_value` for this point the config message") - public PointPointsetMetadata.Baseline_state baseline_state; + public PointPointsetModel.Baseline_state baseline_state; /** * Triggering threshold for partial cov update publishing * @@ -126,10 +126,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof PointPointsetMetadata) == false) { + if ((other instanceof PointPointsetModel) == false) { return false; } - PointPointsetMetadata rhs = ((PointPointsetMetadata) other); + PointPointsetModel rhs = ((PointPointsetModel) other); return (((((((((((this.sample_rate_sec == rhs.sample_rate_sec)||((this.sample_rate_sec!= null)&&this.sample_rate_sec.equals(rhs.sample_rate_sec)))&&((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref))))&&((this.baseline_value == rhs.baseline_value)||((this.baseline_value!= null)&&this.baseline_value.equals(rhs.baseline_value))))&&((this.min_loglevel == rhs.min_loglevel)||((this.min_loglevel!= null)&&this.min_loglevel.equals(rhs.min_loglevel))))&&((this.baseline_state == rhs.baseline_state)||((this.baseline_state!= null)&&this.baseline_state.equals(rhs.baseline_state))))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.baseline_tolerance == rhs.baseline_tolerance)||((this.baseline_tolerance!= null)&&this.baseline_tolerance.equals(rhs.baseline_tolerance))))&&((this.cov_increment == rhs.cov_increment)||((this.cov_increment!= null)&&this.cov_increment.equals(rhs.cov_increment))))&&((this.sample_limit_sec == rhs.sample_limit_sec)||((this.sample_limit_sec!= null)&&this.sample_limit_sec.equals(rhs.sample_limit_sec))))&&((this.writable == rhs.writable)||((this.writable!= null)&&this.writable.equals(rhs.writable)))); } @@ -147,10 +147,10 @@ public enum Baseline_state { INVALID("invalid"), FAILURE("failure"); private final String value; - private final static Map CONSTANTS = new HashMap(); + private final static Map CONSTANTS = new HashMap(); static { - for (PointPointsetMetadata.Baseline_state c: values()) { + for (PointPointsetModel.Baseline_state c: values()) { CONSTANTS.put(c.value, c); } } @@ -170,8 +170,8 @@ public String value() { } @JsonCreator - public static PointPointsetMetadata.Baseline_state fromValue(String value) { - PointPointsetMetadata.Baseline_state constant = CONSTANTS.get(value); + public static PointPointsetModel.Baseline_state fromValue(String value) { + PointPointsetModel.Baseline_state constant = CONSTANTS.get(value); if (constant == null) { throw new IllegalArgumentException(value); } else { diff --git a/gencode/java/udmi/schema/PointsetMetadata.java b/gencode/java/udmi/schema/PointsetModel.java similarity index 85% rename from gencode/java/udmi/schema/PointsetMetadata.java rename to gencode/java/udmi/schema/PointsetModel.java index dcdbcfe313..ab9f5cf298 100644 --- a/gencode/java/udmi/schema/PointsetMetadata.java +++ b/gencode/java/udmi/schema/PointsetModel.java @@ -10,7 +10,7 @@ /** - * Pointset Metadata + * Pointset Model *

* Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds * @@ -20,7 +20,7 @@ "points" }) @Generated("jsonschema2pojo") -public class PointsetMetadata { +public class PointsetModel { /** * Information about a specific point name of the device. @@ -29,7 +29,7 @@ public class PointsetMetadata { */ @JsonProperty("points") @JsonPropertyDescription("Information about a specific point name of the device.") - public HashMap points; + public HashMap points; @Override public int hashCode() { @@ -43,10 +43,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof PointsetMetadata) == false) { + if ((other instanceof PointsetModel) == false) { return false; } - PointsetMetadata rhs = ((PointsetMetadata) other); + PointsetModel rhs = ((PointsetModel) other); return ((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points))); } diff --git a/gencode/java/udmi/schema/SystemMetadata.java b/gencode/java/udmi/schema/SystemModel.java similarity index 87% rename from gencode/java/udmi/schema/SystemMetadata.java rename to gencode/java/udmi/schema/SystemModel.java index 0a309521f9..579cbc4e81 100644 --- a/gencode/java/udmi/schema/SystemMetadata.java +++ b/gencode/java/udmi/schema/SystemModel.java @@ -9,9 +9,9 @@ /** - * System Metadata + * System Model *

- * High-level system information about the device. [System Metadata Documentation](../docs/messages/system.md) + * High-level system information about the device. [System Model Documentation](../docs/messages/system.md) * */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -21,7 +21,7 @@ "aux" }) @Generated("jsonschema2pojo") -public class SystemMetadata { +public class SystemModel { /** * Properties the expected physical location of the device. @@ -56,10 +56,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof SystemMetadata) == false) { + if ((other instanceof SystemModel) == false) { return false; } - SystemMetadata rhs = ((SystemMetadata) other); + SystemModel rhs = ((SystemModel) other); return ((((this.location == rhs.location)||((this.location!= null)&&this.location.equals(rhs.location)))&&((this.physical_tag == rhs.physical_tag)||((this.physical_tag!= null)&&this.physical_tag.equals(rhs.physical_tag))))&&((this.aux == rhs.aux)||((this.aux!= null)&&this.aux.equals(rhs.aux)))); } diff --git a/gencode/java/udmi/schema/TestingModel.java b/gencode/java/udmi/schema/TestingModel.java index ac01dec472..cc857d9423 100644 --- a/gencode/java/udmi/schema/TestingModel.java +++ b/gencode/java/udmi/schema/TestingModel.java @@ -16,22 +16,18 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "targets", - "discovery" + "targets" }) @Generated("jsonschema2pojo") public class TestingModel { @JsonProperty("targets") public HashMap targets; - @JsonProperty("discovery") - public Discovery discovery; @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.targets == null)? 0 :this.targets.hashCode())); - result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); return result; } @@ -44,7 +40,7 @@ public boolean equals(Object other) { return false; } TestingModel rhs = ((TestingModel) other); - return (((this.targets == rhs.targets)||((this.targets!= null)&&this.targets.equals(rhs.targets)))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery)))); + return ((this.targets == rhs.targets)||((this.targets!= null)&&this.targets.equals(rhs.targets))); } } diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 90b27304a8..434b490555 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -21,15 +21,16 @@ from .event_pointset_point import PointPointsetEvent from .event_system import SystemEvent from .metadata import Metadata -from .model_cloud import CloudMetadata -from .model_gateway import GatewayMetadata -from .model_localnet import LocalnetMetadata -from .model_localnet_family import FamilyLocalnetMetadata -from .model_pointset import PointsetMetadata -from .model_pointset_point import PointPointsetMetadata -from .model_system import SystemMetadata +from .model_cloud import CloudModel +from .model_discovery import DiscoveryModel +from .model_discovery_family import FamilyDiscoveryTestingModel +from .model_gateway import GatewayModel +from .model_localnet import LocalnetModel +from .model_localnet_family import FamilyLocalnetModel +from .model_pointset import PointsetModel +from .model_pointset_point import PointPointsetModel +from .model_system import SystemModel from .model_testing import TestingModel -from .model_testing_discovery_family import FamilyDiscoveryTestingModel from .model_testing_target import TargetTestingModel from .properties import Properties from .state import State diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index 989df45da7..2787f38161 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -1,10 +1,11 @@ """Generated class for metadata.json""" -from .model_cloud import CloudMetadata -from .model_system import SystemMetadata -from .model_gateway import GatewayMetadata -from .model_localnet import LocalnetMetadata +from .model_cloud import CloudModel +from .model_system import SystemModel +from .model_gateway import GatewayModel +from .model_discovery import DiscoveryModel +from .model_localnet import LocalnetModel from .model_testing import TestingModel -from .model_pointset import PointsetMetadata +from .model_pointset import PointsetModel class Metadata: @@ -18,6 +19,7 @@ def __init__(self): self.cloud = None self.system = None self.gateway = None + self.discovery = None self.localnet = None self.testing = None self.pointset = None @@ -31,12 +33,13 @@ def from_dict(source): result.version = source.get('version') result.description = source.get('description') result.hash = source.get('hash') - result.cloud = CloudMetadata.from_dict(source.get('cloud')) - result.system = SystemMetadata.from_dict(source.get('system')) - result.gateway = GatewayMetadata.from_dict(source.get('gateway')) - result.localnet = LocalnetMetadata.from_dict(source.get('localnet')) + result.cloud = CloudModel.from_dict(source.get('cloud')) + result.system = SystemModel.from_dict(source.get('system')) + result.gateway = GatewayModel.from_dict(source.get('gateway')) + result.discovery = DiscoveryModel.from_dict(source.get('discovery')) + result.localnet = LocalnetModel.from_dict(source.get('localnet')) result.testing = TestingModel.from_dict(source.get('testing')) - result.pointset = PointsetMetadata.from_dict(source.get('pointset')) + result.pointset = PointsetModel.from_dict(source.get('pointset')) return result @staticmethod @@ -71,6 +74,8 @@ def to_dict(self): result['system'] = self.system.to_dict() # 4 if self.gateway: result['gateway'] = self.gateway.to_dict() # 4 + if self.discovery: + result['discovery'] = self.discovery.to_dict() # 4 if self.localnet: result['localnet'] = self.localnet.to_dict() # 4 if self.testing: diff --git a/gencode/python/udmi/schema/model_cloud.py b/gencode/python/udmi/schema/model_cloud.py index 8845ed988c..844fd9c8e1 100644 --- a/gencode/python/udmi/schema/model_cloud.py +++ b/gencode/python/udmi/schema/model_cloud.py @@ -1,7 +1,7 @@ """Generated class for model_cloud.json""" -class CloudMetadata: +class CloudModel: """Generated schema class""" def __init__(self): @@ -13,7 +13,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = CloudMetadata() + result = CloudModel() result.auth_type = source.get('auth_type') result.device_key = source.get('device_key') result.is_gateway = source.get('is_gateway') @@ -25,7 +25,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = CloudMetadata.from_dict(source[key]) + result[key] = CloudModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_discovery.py b/gencode/python/udmi/schema/model_discovery.py new file mode 100644 index 0000000000..8aec6d0ab7 --- /dev/null +++ b/gencode/python/udmi/schema/model_discovery.py @@ -0,0 +1,38 @@ +"""Generated class for model_discovery.json""" + + +class DiscoveryModel: + """Generated schema class""" + + def __init__(self): + self.discovery = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryModel() + result.discovery = source.get('discovery') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryModel.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.discovery: + result['discovery'] = self.discovery # 5 + return result diff --git a/gencode/python/udmi/schema/model_testing_discovery_family.py b/gencode/python/udmi/schema/model_discovery_family.py similarity index 91% rename from gencode/python/udmi/schema/model_testing_discovery_family.py rename to gencode/python/udmi/schema/model_discovery_family.py index 4672edd58a..aa2dd416ee 100644 --- a/gencode/python/udmi/schema/model_testing_discovery_family.py +++ b/gencode/python/udmi/schema/model_discovery_family.py @@ -1,4 +1,4 @@ -"""Generated class for model_testing_discovery_family.json""" +"""Generated class for model_discovery_family.json""" class FamilyDiscoveryTestingModel: diff --git a/gencode/python/udmi/schema/model_gateway.py b/gencode/python/udmi/schema/model_gateway.py index e5826eb9e6..9106dd4e56 100644 --- a/gencode/python/udmi/schema/model_gateway.py +++ b/gencode/python/udmi/schema/model_gateway.py @@ -1,7 +1,7 @@ """Generated class for model_gateway.json""" -class GatewayMetadata: +class GatewayModel: """Generated schema class""" def __init__(self): @@ -13,7 +13,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = GatewayMetadata() + result = GatewayModel() result.gateway_id = source.get('gateway_id') result.family = source.get('family') result.proxy_ids = source.get('proxy_ids') @@ -25,7 +25,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = GatewayMetadata.from_dict(source[key]) + result[key] = GatewayModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_localnet.py b/gencode/python/udmi/schema/model_localnet.py index e83b150775..670be9fa0a 100644 --- a/gencode/python/udmi/schema/model_localnet.py +++ b/gencode/python/udmi/schema/model_localnet.py @@ -1,8 +1,8 @@ """Generated class for model_localnet.json""" -from .model_localnet_family import FamilyLocalnetMetadata +from .model_localnet_family import FamilyLocalnetModel -class LocalnetMetadata: +class LocalnetModel: """Generated schema class""" def __init__(self): @@ -12,8 +12,8 @@ def __init__(self): def from_dict(source): if not source: return None - result = LocalnetMetadata() - result.families = FamilyLocalnetMetadata.map_from(source.get('families')) + result = LocalnetModel() + result.families = FamilyLocalnetModel.map_from(source.get('families')) return result @staticmethod @@ -22,7 +22,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = LocalnetMetadata.from_dict(source[key]) + result[key] = LocalnetModel.from_dict(source[key]) return result @staticmethod @@ -35,5 +35,5 @@ def expand_dict(input): def to_dict(self): result = {} if self.families: - result['families'] = FamilyLocalnetMetadata.expand_dict(self.families) # 2 + result['families'] = FamilyLocalnetModel.expand_dict(self.families) # 2 return result diff --git a/gencode/python/udmi/schema/model_localnet_family.py b/gencode/python/udmi/schema/model_localnet_family.py index d0962cb651..af5933ec21 100644 --- a/gencode/python/udmi/schema/model_localnet_family.py +++ b/gencode/python/udmi/schema/model_localnet_family.py @@ -1,7 +1,7 @@ """Generated class for model_localnet_family.json""" -class FamilyLocalnetMetadata: +class FamilyLocalnetModel: """Generated schema class""" def __init__(self): @@ -11,7 +11,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = FamilyLocalnetMetadata() + result = FamilyLocalnetModel() result.id = source.get('id') return result @@ -21,7 +21,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = FamilyLocalnetMetadata.from_dict(source[key]) + result[key] = FamilyLocalnetModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_pointset.py b/gencode/python/udmi/schema/model_pointset.py index 91bba573ea..c994e65427 100644 --- a/gencode/python/udmi/schema/model_pointset.py +++ b/gencode/python/udmi/schema/model_pointset.py @@ -1,8 +1,8 @@ """Generated class for model_pointset.json""" -from .model_pointset_point import PointPointsetMetadata +from .model_pointset_point import PointPointsetModel -class PointsetMetadata: +class PointsetModel: """Generated schema class""" def __init__(self): @@ -12,8 +12,8 @@ def __init__(self): def from_dict(source): if not source: return None - result = PointsetMetadata() - result.points = PointPointsetMetadata.map_from(source.get('points')) + result = PointsetModel() + result.points = PointPointsetModel.map_from(source.get('points')) return result @staticmethod @@ -22,7 +22,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = PointsetMetadata.from_dict(source[key]) + result[key] = PointsetModel.from_dict(source[key]) return result @staticmethod @@ -35,5 +35,5 @@ def expand_dict(input): def to_dict(self): result = {} if self.points: - result['points'] = PointPointsetMetadata.expand_dict(self.points) # 2 + result['points'] = PointPointsetModel.expand_dict(self.points) # 2 return result diff --git a/gencode/python/udmi/schema/model_pointset_point.py b/gencode/python/udmi/schema/model_pointset_point.py index 5b9b37d393..9e92c11509 100644 --- a/gencode/python/udmi/schema/model_pointset_point.py +++ b/gencode/python/udmi/schema/model_pointset_point.py @@ -1,7 +1,7 @@ """Generated class for model_pointset_point.json""" -class PointPointsetMetadata: +class PointPointsetModel: """Generated schema class""" def __init__(self): @@ -20,7 +20,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = PointPointsetMetadata() + result = PointPointsetModel() result.units = source.get('units') result.writable = source.get('writable') result.baseline_value = source.get('baseline_value') @@ -39,7 +39,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = PointPointsetMetadata.from_dict(source[key]) + result[key] = PointPointsetModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_system.py b/gencode/python/udmi/schema/model_system.py index 94ba79b70f..a574ef157c 100644 --- a/gencode/python/udmi/schema/model_system.py +++ b/gencode/python/udmi/schema/model_system.py @@ -210,7 +210,7 @@ def to_dict(self): return result -class SystemMetadata: +class SystemModel: """Generated schema class""" def __init__(self): @@ -222,7 +222,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = SystemMetadata() + result = SystemModel() result.location = Object683EF6A1.from_dict(source.get('location')) result.physical_tag = Object45E20BB3.from_dict(source.get('physical_tag')) result.aux = ObjectCA9644FB.from_dict(source.get('aux')) @@ -234,7 +234,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = SystemMetadata.from_dict(source[key]) + result[key] = SystemModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_testing.py b/gencode/python/udmi/schema/model_testing.py index b98c0b18aa..665b20e4a3 100644 --- a/gencode/python/udmi/schema/model_testing.py +++ b/gencode/python/udmi/schema/model_testing.py @@ -7,7 +7,6 @@ class TestingModel: def __init__(self): self.targets = None - self.discovery = None @staticmethod def from_dict(source): @@ -15,7 +14,6 @@ def from_dict(source): return None result = TestingModel() result.targets = TargetTestingModel.map_from(source.get('targets')) - result.discovery = source.get('discovery') return result @staticmethod @@ -38,6 +36,4 @@ def to_dict(self): result = {} if self.targets: result['targets'] = TargetTestingModel.expand_dict(self.targets) # 2 - if self.discovery: - result['discovery'] = self.discovery # 5 return result diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 35375977fe..b315d039f9 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -633,6 +633,7 @@ private void updateDiscoveryEnumeration(FamilyDiscoveryConfig enumeration) { } if (deviceState.discovery.enumeration == null) { deviceState.discovery.enumeration = new FamilyDiscoveryState(); + deviceState.discovery.enumeration.generation = DEVICE_START_TIME; } Date enumerationGeneration = enumeration.generation; if (enumerationGeneration == null diff --git a/schema/metadata.json b/schema/metadata.json index fb956e16c7..f4062aa2fa 100644 --- a/schema/metadata.json +++ b/schema/metadata.json @@ -11,7 +11,7 @@ ], "properties": { "timestamp": { - "description": "RFC 3339 timestamp the metadata was generated", + "description": "RFC 3339 timestamp the message was generated", "type": "string", "format": "date-time", "examples": ["2019-01-17T14:02:29.364Z"] @@ -38,6 +38,9 @@ "gateway": { "$ref": "file:model_gateway.json#" }, + "discovery": { + "$ref": "file:model_discovery.json#" + }, "localnet": { "$ref": "file:model_localnet.json#" }, diff --git a/schema/model_cloud.json b/schema/model_cloud.json index 6bd259e905..c4077da8d4 100644 --- a/schema/model_cloud.json +++ b/schema/model_cloud.json @@ -1,5 +1,5 @@ { - "title": "Cloud Metadata", + "title": "Cloud Model", "description": "Information specific to how the device communicates with the cloud.", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/schema/model_discovery.json b/schema/model_discovery.json new file mode 100644 index 0000000000..040fe60511 --- /dev/null +++ b/schema/model_discovery.json @@ -0,0 +1,22 @@ +{ + "title": "Discovery Model", + "description": "Discovery target parameters", + "type": "object", + "$schema": "http://json-schema.org/draft-04/schema#", + "additionalProperties": false, + "properties": { + "discovery": { + "additionalProperties": false, + "properties": { + "families": { + "existingJavaType": "java.util.HashMap", + "patternProperties": { + "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { + "$ref": "file:model_discovery_family.json#" + } + } + } + } + } + } +} diff --git a/schema/model_testing_discovery_family.json b/schema/model_discovery_family.json similarity index 100% rename from schema/model_testing_discovery_family.json rename to schema/model_discovery_family.json diff --git a/schema/model_gateway.json b/schema/model_gateway.json index d7df71ba4e..164f6a915c 100644 --- a/schema/model_gateway.json +++ b/schema/model_gateway.json @@ -1,5 +1,5 @@ { - "title": "Gateway Metadata", + "title": "Gateway Model", "description": "[Gateway Documentation](../docs/specs/gateway.md)", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/schema/model_localnet.json b/schema/model_localnet.json index 8276af1c6e..d2a9c33efe 100644 --- a/schema/model_localnet.json +++ b/schema/model_localnet.json @@ -1,5 +1,5 @@ { - "title": "Localnet Metadata", + "title": "Localnet Model", "description": "Used to describe device local network parameters", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", @@ -7,7 +7,7 @@ "properties": { "families": { "additionalProperties": false, - "existingJavaType": "java.util.HashMap", + "existingJavaType": "java.util.HashMap", "patternProperties": { "^[a-z0-9-]+$": { "$ref": "file:model_localnet_family.json" diff --git a/schema/model_localnet_family.json b/schema/model_localnet_family.json index ac8f88d733..01819a1b14 100644 --- a/schema/model_localnet_family.json +++ b/schema/model_localnet_family.json @@ -1,5 +1,5 @@ { - "title": "Family Localnet Metadata", + "title": "Family Localnet Model", "type": "object", "description": "The type of network", "examples": ["bacnet", "modbus"], diff --git a/schema/model_pointset.json b/schema/model_pointset.json index dbdd707521..be8d664558 100644 --- a/schema/model_pointset.json +++ b/schema/model_pointset.json @@ -1,5 +1,5 @@ { - "title": "Pointset Metadata", + "title": "Pointset Model", "description": "Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", @@ -9,7 +9,7 @@ "description": "Information about a specific point name of the device.", "additionalProperties": false, "maxProperties": 150, - "existingJavaType": "java.util.HashMap", + "existingJavaType": "java.util.HashMap", "patternProperties": { "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { "$ref": "file:model_pointset_point.json#" diff --git a/schema/model_pointset_point.json b/schema/model_pointset_point.json index feb018b4e5..b8b820170f 100644 --- a/schema/model_pointset_point.json +++ b/schema/model_pointset_point.json @@ -1,5 +1,5 @@ { - "title": "Point Pointset Metadata", + "title": "Point Pointset Model", "description": "Information about a specific point name of the device.", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/schema/model_system.json b/schema/model_system.json index b7a0d84bf2..5c1fa29fd1 100644 --- a/schema/model_system.json +++ b/schema/model_system.json @@ -1,6 +1,6 @@ { - "title": "System Metadata", - "description": "High-level system information about the device. [System Metadata Documentation](../docs/messages/system.md)", + "title": "System Model", + "description": "High-level system information about the device. [System Model Documentation](../docs/messages/system.md)", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, diff --git a/schema/model_testing.json b/schema/model_testing.json index fc8dc26883..a865111b1f 100644 --- a/schema/model_testing.json +++ b/schema/model_testing.json @@ -13,19 +13,6 @@ "$ref": "file:model_testing_target.json#" } } - }, - "discovery": { - "additionalProperties": false, - "properties": { - "families": { - "existingJavaType": "java.util.HashMap", - "patternProperties": { - "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { - "$ref": "file:model_testing_discovery_family.json#" - } - } - } - } } } } diff --git a/tests/metadata.tests/example.json b/tests/metadata.tests/example.json index 453d9d0eeb..d638a05338 100644 --- a/tests/metadata.tests/example.json +++ b/tests/metadata.tests/example.json @@ -40,13 +40,13 @@ } } }, - "testing": { - "discovery": { - "families": { - "bacnet": { - } + "discovery": { + "families": { + "bacnet": { } - }, + } + }, + "testing": { "targets": { "invalid": { "target_point": "return_air_temperature_sensor", From 8f5f59449fca79f5d4ef3aacb5b589ef90e85101 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 08:56:35 -0700 Subject: [PATCH 75/95] Fixing all tests --- .gencode_hash.txt | 7 +- gencode/docs/metadata.html | 88 ++++--------------- gencode/java/udmi/schema/Discovery.java | 39 -------- gencode/java/udmi/schema/DiscoveryModel.java | 11 +-- gencode/python/udmi/schema/model_discovery.py | 9 +- pubber/src/main/java/daq/pubber/Pubber.java | 22 ++--- schema/model_discovery.json | 16 ++-- .../daq/mqtt/registrar/LocalDevice.java | 4 +- .../daq/mqtt/validator/ReportingDevice.java | 4 +- .../validations/DiscoveryValidator.java | 2 +- 10 files changed, 53 insertions(+), 149 deletions(-) delete mode 100644 gencode/java/udmi/schema/Discovery.java diff --git a/.gencode_hash.txt b/.gencode_hash.txt index a25fde744c..cb037abd32 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -4,7 +4,7 @@ e2944b13db5ff06be9caea51d03bca48f2cb093a8bb583dca14051255d34ea6b gencode/docs/e 987503860562a3971314a98d75890b6c7615fee84bff6bede7010231f469c035 gencode/docs/event_pointset.html e3fb2b1a96f6fcb06f5af6cff32829abc825065ed52de81c3d379c8c8070fe09 gencode/docs/event_system.html a82821e72af6d0ee35800e6262eb9bb05256309b98aed2dad1a368fd2d6882bb gencode/docs/index.html -4234d68aa512355c6e1047db0fbd293a6d8b461a217dd440b71e9f799040d409 gencode/docs/metadata.html +2e2fd3af888c3e784f632ad31115f1029a9af7832c2064871ebb6bb3ec34a58e gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js @@ -19,11 +19,10 @@ d2c5b5aae8db27b68104fc83a1f38de0a3f1b5d683f2b13599adf24e96c7d124 gencode/java/u b6ff9b8739a9c3bb6972f73db6fc54f451189c13b273e58bc11cb3d82c74ad40 gencode/java/udmi/schema/BlobsetState.java a2eeff86f4302272736d84602e2ca36a64d27c8ef6761cc05ffb8ad17b030d4d gencode/java/udmi/schema/CloudModel.java 28001569e7902d3aa39aa3749ca08fb8e29460ba97a4b560d266b365bf5f8c46 gencode/java/udmi/schema/Config.java -b300398d6162a6ff18b8c09a366b8cf999f8c193cb61af1f1740464569c2c1b4 gencode/java/udmi/schema/Discovery.java 67ac3441ce6d5d4450741ee7e639174756498e1b3780c2d18ce20562b5a88c26 gencode/java/udmi/schema/DiscoveryCommand.java d8a80ab3180d33bfa17564c969018e1d4350a47dbc70c4ae8a5abbfb25cfedc9 gencode/java/udmi/schema/DiscoveryConfig.java ec270272082836e682bc41eb73a059995d08432fa7d82e0ed9f6ce80a4082796 gencode/java/udmi/schema/DiscoveryEvent.java -a7622890730423d1a221808af2eb5f0e784a47e8535c9297ef17a1ac518a4eab gencode/java/udmi/schema/DiscoveryModel.java +04112dd47b0f761131c276c67d3cd8b789d25e6716b5732be9fef14fc6831f1d gencode/java/udmi/schema/DiscoveryModel.java 9962b0eb7d5adf52af6160e9f3131f8eeb52ae9e518954dbb6aead1bcad0245e gencode/java/udmi/schema/DiscoveryState.java 090bbaf1508aa6ca8380af936af990673f300eb5a940c9e8ab94deb64efa2b7b gencode/java/udmi/schema/Entry.java 8f71ecd4c32044eccd74225006887d58827976f699ea03efaa5b7ed1b69849d0 gencode/java/udmi/schema/Envelope.java @@ -87,7 +86,7 @@ ddf849bfeb2b87d071cefd5e6feacabc57375a7fff6d72b6d42ffb89f33c859b gencode/python a27b3b2ace3f301b5fa08a3763f792158f9725a5fbed5cd7b5fac8a6701080e4 gencode/python/udmi/schema/event_system.py 42f3429edf4a187be6ebfe9760f5e14821a25afa8f7c65b69e0e34fb29a7932e gencode/python/udmi/schema/metadata.py b2227a48f21594f78c07c427de64e7ce51dc0ecd4b8091601d739a5f5038a2c9 gencode/python/udmi/schema/model_cloud.py -9122b840339a3ded9f1a9238b2964c06e8780688197ce31382342a6574d919be gencode/python/udmi/schema/model_discovery.py +805cc8dcb29732d1965bbd533b12d2bc4966d584f05b8a478dd2cac98fd99d52 gencode/python/udmi/schema/model_discovery.py 44d057dffcac3a994e7b894f8e1ebb643ba49d7dbfbb0bfea9cc04f97af0bc47 gencode/python/udmi/schema/model_discovery_family.py 9416018a6d01094ab7af77c35ae4e5e2271a5d52c3bd3e381a541650415048b2 gencode/python/udmi/schema/model_gateway.py ae6a7bc93b520cdc90cd158f876a58e98a3e000402ebb1ca632f01ee492d408a gencode/python/udmi/schema/model_localnet.py diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index ab5b286496..b80a8bb7f0 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -1377,18 +1377,18 @@

-
+
-
+

- +

-
+
Type: object
- No Additional Properties - - - - - - -
-
-
-

- -

-
- -
-
- - Type: object
+ families
Type: object
@@ -1456,18 +1413,18 @@

-
+
-
+

- +

-
+

@@ -1489,21 +1446,14 @@

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - discovery + families - families - - - - model_discovery_family.json#

Type: object
+ model_discovery_family.json#
Type: object
@@ -1524,10 +1474,6 @@

-
-
-

-
diff --git a/gencode/java/udmi/schema/Discovery.java b/gencode/java/udmi/schema/Discovery.java deleted file mode 100644 index bae9804f8c..0000000000 --- a/gencode/java/udmi/schema/Discovery.java +++ /dev/null @@ -1,39 +0,0 @@ - -package udmi.schema; - -import java.util.HashMap; -import javax.annotation.processing.Generated; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "families" -}) -@Generated("jsonschema2pojo") -public class Discovery { - - @JsonProperty("families") - public HashMap families; - - @Override - public int hashCode() { - int result = 1; - result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof Discovery) == false) { - return false; - } - Discovery rhs = ((Discovery) other); - return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); - } - -} diff --git a/gencode/java/udmi/schema/DiscoveryModel.java b/gencode/java/udmi/schema/DiscoveryModel.java index 22541d4090..0ecd62459a 100644 --- a/gencode/java/udmi/schema/DiscoveryModel.java +++ b/gencode/java/udmi/schema/DiscoveryModel.java @@ -1,6 +1,7 @@ package udmi.schema; +import java.util.HashMap; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,18 +16,18 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "discovery" + "families" }) @Generated("jsonschema2pojo") public class DiscoveryModel { - @JsonProperty("discovery") - public Discovery discovery; + @JsonProperty("families") + public HashMap families; @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); + result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); return result; } @@ -39,7 +40,7 @@ public boolean equals(Object other) { return false; } DiscoveryModel rhs = ((DiscoveryModel) other); - return ((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); } } diff --git a/gencode/python/udmi/schema/model_discovery.py b/gencode/python/udmi/schema/model_discovery.py index 8aec6d0ab7..92dc52ef13 100644 --- a/gencode/python/udmi/schema/model_discovery.py +++ b/gencode/python/udmi/schema/model_discovery.py @@ -1,18 +1,19 @@ """Generated class for model_discovery.json""" +from .model_discovery_family import FamilyDiscoveryTestingModel class DiscoveryModel: """Generated schema class""" def __init__(self): - self.discovery = None + self.families = None @staticmethod def from_dict(source): if not source: return None result = DiscoveryModel() - result.discovery = source.get('discovery') + result.families = FamilyDiscoveryTestingModel.map_from(source.get('families')) return result @staticmethod @@ -33,6 +34,6 @@ def expand_dict(input): def to_dict(self): result = {} - if self.discovery: - result['discovery'] = self.discovery # 5 + if self.families: + result['families'] = FamilyDiscoveryTestingModel.expand_dict(self.families) # 2 return result diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index b315d039f9..e65b3584ff 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -47,7 +47,7 @@ import udmi.schema.Level; import udmi.schema.Metadata; import udmi.schema.PointPointsetConfig; -import udmi.schema.PointPointsetMetadata; +import udmi.schema.PointPointsetModel; import udmi.schema.PointsetConfig; import udmi.schema.PointsetEvent; import udmi.schema.PointsetState; @@ -100,10 +100,10 @@ public class Pubber { Level.WARNING, LOG::warn, Level.ERROR, LOG::error ); - private static final Map DEFAULT_POINTS = ImmutableMap.of( - "recalcitrant_angle", makePointPointsetMetadata(true, 50, 50, "Celsius"), - "faulty_finding", makePointPointsetMetadata(true, 40, 0, "deg"), - "superimposition_reading", makePointPointsetMetadata(false) + private static final Map DEFAULT_POINTS = ImmutableMap.of( + "recalcitrant_angle", makePointPointsetModel(true, 50, 50, "Celsius"), + "faulty_finding", makePointPointsetModel(true, 40, 0, "deg"), + "superimposition_reading", makePointPointsetModel(false) ); private static final long VERY_LONG_TIME_SEC = 1234567890; private static final Date NEVER_FUTURE = Date.from(Instant.now().plusSeconds(VERY_LONG_TIME_SEC)); @@ -161,9 +161,9 @@ public Pubber(String projectId, String sitePath, String deviceId, String serialN } } - private static PointPointsetMetadata makePointPointsetMetadata(boolean writable, int value, + private static PointPointsetModel makePointPointsetModel(boolean writable, int value, double tolerance, String units) { - PointPointsetMetadata pointMetadata = new PointPointsetMetadata(); + PointPointsetModel pointMetadata = new PointPointsetModel(); pointMetadata.writable = writable; pointMetadata.baseline_value = value; pointMetadata.baseline_tolerance = tolerance; @@ -171,8 +171,8 @@ private static PointPointsetMetadata makePointPointsetMetadata(boolean writable, return pointMetadata; } - private static PointPointsetMetadata makePointPointsetMetadata(boolean writable) { - PointPointsetMetadata pointMetadata = new PointPointsetMetadata(); + private static PointPointsetModel makePointPointsetModel(boolean writable) { + PointPointsetModel pointMetadata = new PointPointsetModel(); return pointMetadata; } @@ -264,12 +264,12 @@ private void processDeviceMetadata(Metadata metadata) { info("Configuring with key type " + configuration.algorithm); } - Map points = + Map points = metadata.pointset == null ? DEFAULT_POINTS : metadata.pointset.points; points.forEach((name, point) -> addPoint(makePoint(name, point))); } - private AbstractPoint makePoint(String name, PointPointsetMetadata point) { + private AbstractPoint makePoint(String name, PointPointsetModel point) { boolean writable = point.writable != null && point.writable; if (BOOLEAN_UNITS.contains(point.units)) { return new RandomBoolean(name, writable); diff --git a/schema/model_discovery.json b/schema/model_discovery.json index 040fe60511..cf3d7290d3 100644 --- a/schema/model_discovery.json +++ b/schema/model_discovery.json @@ -5,18 +5,14 @@ "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, "properties": { - "discovery": { - "additionalProperties": false, - "properties": { - "families": { - "existingJavaType": "java.util.HashMap", - "patternProperties": { - "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { - "$ref": "file:model_discovery_family.json#" - } - } + "families": { + "existingJavaType": "java.util.HashMap", + "patternProperties": { + "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { + "$ref": "file:model_discovery_family.json#" } } } } } + diff --git a/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java b/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java index ebde33c37b..15e26cde7f 100644 --- a/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java +++ b/validator/src/main/java/com/google/daq/mqtt/registrar/LocalDevice.java @@ -63,7 +63,7 @@ import udmi.schema.LocalnetConfig; import udmi.schema.Metadata; import udmi.schema.PointPointsetConfig; -import udmi.schema.PointPointsetMetadata; +import udmi.schema.PointPointsetModel; import udmi.schema.PointsetConfig; class LocalDevice { @@ -565,7 +565,7 @@ private PointsetConfig getDevicePointsetConfig() { return pointsetConfig; } - PointPointsetConfig configFromMetadata(PointPointsetMetadata metadata) { + PointPointsetConfig configFromMetadata(PointPointsetModel metadata) { PointPointsetConfig pointConfig = new PointPointsetConfig(); pointConfig.ref = metadata.ref; if (Boolean.TRUE.equals(metadata.writable)) { diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java b/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java index 8b1743807e..b801e292f8 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java @@ -10,7 +10,7 @@ import java.util.TreeSet; import udmi.schema.Metadata; import udmi.schema.PointPointsetEvent; -import udmi.schema.PointPointsetMetadata; +import udmi.schema.PointPointsetModel; import udmi.schema.PointsetEvent; /** @@ -128,7 +128,7 @@ private Map getPoints(PointsetEvent message) { return message.points == null ? ImmutableMap.of() : message.points; } - private Map getPoints(Metadata metadata) { + private Map getPoints(Metadata metadata) { if (metadata == null || metadata.pointset == null || metadata.pointset.points == null) { return ImmutableMap.of(); } diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index 1eec905379..6dda8f0763 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -59,7 +59,7 @@ public void self_enumeration() { @Test public void single_scan() { - Set families = catchToNull(() -> deviceMetadata.testing.discovery.families.keySet()); + Set families = catchToNull(() -> deviceMetadata.discovery.families.keySet()); if (families == null || families.isEmpty()) { throw new SkipTest("No discovery families configured"); } From 42a428e682d8e8321347e61875c70033210132fe Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 09:03:21 -0700 Subject: [PATCH 76/95] Using udmi model ver 1.7 --- bin/clone_model | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/clone_model b/bin/clone_model index 36c33ae377..7217c449c7 100755 --- a/bin/clone_model +++ b/bin/clone_model @@ -4,7 +4,7 @@ ROOT_DIR=$(dirname $0)/.. cd $ROOT_DIR MODEL_DIR=udmi_site_model -MODEL_VER=1.6 +MODEL_VER=1.7 TEST_SITE_GIT=https://github.com/faucetsdn/$MODEL_DIR.git if [[ -d $MODEL_DIR ]]; then From 556274fe3ca4ea4ab435a7b4218ec82b4f476df9 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 09:08:15 -0700 Subject: [PATCH 77/95] debugging --- bin/clone_model | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/clone_model b/bin/clone_model index 7217c449c7..c7d6612c97 100755 --- a/bin/clone_model +++ b/bin/clone_model @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex ROOT_DIR=$(dirname $0)/.. cd $ROOT_DIR From 5b90827786ac7ae5bc940d72818c854e2356061a Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 09:16:19 -0700 Subject: [PATCH 78/95] Remove debugging --- bin/clone_model | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/clone_model b/bin/clone_model index c7d6612c97..7217c449c7 100755 --- a/bin/clone_model +++ b/bin/clone_model @@ -1,4 +1,4 @@ -#!/bin/bash -ex +#!/bin/bash -e ROOT_DIR=$(dirname $0)/.. cd $ROOT_DIR From 6cc9c256057f482077aa21b455e6e8ba1224bcee Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 11:06:31 -0700 Subject: [PATCH 79/95] Working continuous scan --- pubber/src/main/java/daq/pubber/Pubber.java | 83 +++++++++++++------ .../daq/mqtt/validator/SequenceValidator.java | 3 +- .../validations/DiscoveryValidator.java | 80 +++++++++++------- 3 files changed, 108 insertions(+), 58 deletions(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index e65b3584ff..8c2db3dba8 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -116,7 +116,7 @@ public class Pubber { private final ExtraPointsetEvent devicePoints = new ExtraPointsetEvent(); private final Set allPoints = new HashSet<>(); private final AtomicInteger logMessageCount = new AtomicInteger(0); - private final Config deviceConfig = new Config(); + private Config deviceConfig = new Config(); private int deviceMessageCount = -1; private MqttPublisher mqttPublisher; private ScheduledFuture scheduledFuture; @@ -606,6 +606,7 @@ private void configHandler(Config config) { private void processConfigUpdate(Config config) { final int actualInterval; if (config != null) { + deviceConfig = config; info(String.format("%s received config %s", getTimestamp(), isoConvert(config.timestamp))); deviceState.system.last_config = config.timestamp; actualInterval = updateSystemConfig(config.pointset); @@ -676,14 +677,25 @@ private void updateDiscoveryScan(HashMap families } Date previousGeneration = getFamilyDiscoveryState(family).generation; - if (configGeneration.before( - previousGeneration == null ? DEVICE_START_TIME : previousGeneration)) { - return; + Date baseGeneration = previousGeneration == null ? DEVICE_START_TIME : previousGeneration; + final Date startGeneration; + if (configGeneration.before(baseGeneration)) { + int interval = getScanInterval(family); + if (interval > 0) { + long deltaSec = (baseGeneration.getTime() - configGeneration.getTime() + 999) / 1000; + long intervals = (deltaSec + interval - 1) / interval; + startGeneration = Date.from( + configGeneration.toInstant().plusSeconds(intervals * interval)); + } else { + return; + } + } else { + startGeneration = configGeneration; } - info("Discovery scan generation " + family + " is " + isoConvert(configGeneration)); - long delay = scheduleFuture(configGeneration, - () -> checkDiscoveryScan(family, configGeneration)); + info("Discovery scan generation " + family + " is " + isoConvert(startGeneration)); + long delay = scheduleFuture(startGeneration, + () -> checkDiscoveryScan(family, startGeneration)); info("Waiting until start: " + delay); }); @@ -703,32 +715,35 @@ private long scheduleFuture(Date futureTime, Runnable futureTask) { return delay; } - private void checkDiscoveryScan(String family, Date configGeneration) { + private void checkDiscoveryScan(String family, Date scanGeneration) { try { FamilyDiscoveryState familyDiscoveryState = getFamilyDiscoveryState(family); if (familyDiscoveryState.generation == null - || familyDiscoveryState.generation.before(configGeneration)) { - info("Discovery scan starting " + family + " as " + isoConvert(configGeneration)); - Date stopTime = Date.from(Instant.now().plusSeconds(SCAN_DURATION_SEC)); - long delay = scheduleFuture(stopTime, - () -> discoveryScanComplete(family, configGeneration)); - info("Waiting until cancel: " + delay); - familyDiscoveryState.generation = configGeneration; - familyDiscoveryState.active = true; - publishStateMessage(); - Date sendTime = Date.from(Instant.now().plusSeconds(SCAN_DURATION_SEC / 2)); - scheduleFuture(sendTime, () -> sendDiscoveryEvent(family, configGeneration)); + || familyDiscoveryState.generation.before(scanGeneration)) { + scheduleDiscoveryScan(family, scanGeneration); } } catch (Exception e) { throw new RuntimeException("While checking for discovery scan start", e); } } - private void sendDiscoveryEvent(String family, Date configGeneration) { + private void scheduleDiscoveryScan(String family, Date scanGeneration) { + info("Discovery scan starting " + family + " as " + isoConvert(scanGeneration)); + Date stopTime = Date.from(Instant.now().plusSeconds(SCAN_DURATION_SEC)); + FamilyDiscoveryState familyDiscoveryState = getFamilyDiscoveryState(family); + scheduleFuture(stopTime, () -> discoveryScanComplete(family, scanGeneration)); + familyDiscoveryState.generation = scanGeneration; + familyDiscoveryState.active = true; + publishStateMessage(); + Date sendTime = Date.from(Instant.now().plusSeconds(SCAN_DURATION_SEC / 2)); + scheduleFuture(sendTime, () -> sendDiscoveryEvent(family, scanGeneration)); + } + + private void sendDiscoveryEvent(String family, Date scanGeneration) { FamilyDiscoveryState familyDiscoveryState = getFamilyDiscoveryState(family); - if (configGeneration.equals(familyDiscoveryState.generation) + if (scanGeneration.equals(familyDiscoveryState.generation) && familyDiscoveryState.active) { - info("Sending discovery event " + family + " for " + configGeneration); + info("Sending discovery event " + family + " for " + scanGeneration); DiscoveryEvent discoveryEvent = new DiscoveryEvent(); discoveryEvent.timestamp = new Date(); discoveryEvent.version = UDMI_VERSION; @@ -740,19 +755,33 @@ private void sendDiscoveryEvent(String family, Date configGeneration) { } } - private void discoveryScanComplete(String family, Date configGeneration) { + private void discoveryScanComplete(String family, Date scanGeneration) { try { FamilyDiscoveryState familyDiscoveryState = getFamilyDiscoveryState(family); - if (configGeneration.equals(familyDiscoveryState.generation)) { - info("Discovery scan stopping " + family + " from " + isoConvert(configGeneration)); - familyDiscoveryState.active = false; - publishStateMessage(); + if (scanGeneration.equals(familyDiscoveryState.generation)) { + int interval = getScanInterval(family); + if (interval > 0) { + Date newGeneration = Date.from(scanGeneration.toInstant().plusSeconds(interval)); + scheduleDiscoveryScan(family, newGeneration); + publishStateMessage(); + } else { + info("Discovery scan stopping " + family + " from " + isoConvert(scanGeneration)); + familyDiscoveryState.active = false; + } } } catch (Exception e) { throw new RuntimeException("While checking for discovery scan complete", e); } } + private int getScanInterval(String family) { + try { + return deviceConfig.discovery.families.get(family).scan_interval_sec; + } catch (Exception e) { + return 0; + } + } + private String stackTraceString(Throwable e) { OutputStream outputStream = new ByteArrayOutputStream(); try (PrintStream ps = new PrintStream(outputStream)) { diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java index a8d1429345..45cfdc580a 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java @@ -42,7 +42,6 @@ import org.junit.runners.model.TestTimedOutException; import udmi.schema.Config; import udmi.schema.DiscoveryEvent; -import udmi.schema.DiscoveryState; import udmi.schema.Entry; import udmi.schema.Envelope.SubFolder; import udmi.schema.Envelope.SubType; @@ -614,7 +613,7 @@ protected void untilTrue(String description, Supplier evaluator) { untilLoop(() -> !catchToFalse(evaluator), description); } - protected void untilUntrue(Supplier evaluator, String description) { + protected void untilUntrue(String description, Supplier evaluator) { untilLoop(() -> catchToFalse(evaluator), description); } diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index 6dda8f0763..62673554e0 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -15,6 +15,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.concurrent.atomic.AtomicReference; import java.util.function.Predicate; import java.util.stream.Collectors; import org.junit.Test; @@ -29,13 +30,16 @@ public class DiscoveryValidator extends SequenceValidator { public static final int SCAN_START_DELAY_SEC = 10; + private static final int SCAN_ITERATIONS = 2; + private HashMap previousGenerations; + private Set families; @Test public void self_enumeration() { if (!catchToFalse(() -> deviceMetadata.pointset.points != null)) { throw new SkipTest("No metadata pointset points defined"); } - untilUntrue(() -> deviceState.discovery.enumeration.active, "enumeration not active"); + untilUntrue("enumeration not active", () -> deviceState.discovery.enumeration.active); Date startTime = CleanDateFormat.cleanDate(); deviceConfig.discovery = new DiscoveryConfig(); deviceConfig.discovery.enumeration = new FamilyDiscoveryConfig(); @@ -45,7 +49,7 @@ public void self_enumeration() { untilTrue("enumeration generation", () -> deviceState.discovery.enumeration.generation.equals(startTime) ); - untilUntrue(() -> deviceState.discovery.enumeration.active, "enumeration still not active"); + untilUntrue("enumeration still not active", () -> deviceState.discovery.enumeration.active); List events = getReceivedEvents(DiscoveryEvent.class); assertEquals("one event received", 1, events.size()); DiscoveryEvent discoveryEvent = events.get(0); @@ -59,22 +63,10 @@ public void self_enumeration() { @Test public void single_scan() { - Set families = catchToNull(() -> deviceMetadata.discovery.families.keySet()); - if (families == null || families.isEmpty()) { - throw new SkipTest("No discovery families configured"); - } - deviceConfig.discovery = new DiscoveryConfig(); - deviceConfig.discovery.families = new HashMap<>(); - updateConfig(); - untilTrue("all scans not active", () -> families.stream().noneMatch(familyScanActivated(null))); - Map previousGenerations = new HashMap<>(); - families.forEach(family -> previousGenerations.put(family, getStateFamilyGeneration(family))); + initializeDiscovery(); Date startTime = CleanDateFormat.cleanDate( Date.from(Instant.now().plusSeconds(SCAN_START_DELAY_SEC))); - info("Scan start scheduled for " + startTime); - families.forEach(family -> getConfigFamily(family).generation = startTime); - updateConfig(); - getReceivedEvents(DiscoveryEvent.class); // Clear out any previously received events + scheduleScan(startTime, null); untilTrue("scheduled scan start", () -> families.stream().anyMatch(familyScanActivated(startTime)) || families.stream() @@ -89,7 +81,7 @@ public void single_scan() { fail("unknown reason"); } untilTrue("scan activation", () -> families.stream().allMatch(familyScanActivated(startTime))); - untilTrue("scan completed", () -> families.stream().noneMatch(familyScanActive(startTime))); + untilTrue("scan completed", () -> families.stream().allMatch(familyScanComplete(startTime))); List receivedEvents = getReceivedEvents( DiscoveryEvent.class); Set eventFamilies = receivedEvents.stream() @@ -98,7 +90,42 @@ public void single_scan() { assertTrue("all requested families present", eventFamilies.containsAll(families)); } - // TODO: Add test for current timestamp generation not starting a scan + @Test + public void continuous_scan() { + initializeDiscovery(); + Date startTime = CleanDateFormat.cleanDate(); + scheduleScan(startTime, SCAN_START_DELAY_SEC); + Instant endTime = Instant.now().plusSeconds(SCAN_START_DELAY_SEC * SCAN_ITERATIONS); + untilUntrue("scan iterations", () -> Instant.now().isBefore(endTime)); + String oneFamily = families.iterator().next(); + Date finishTime = deviceState.discovery.families.get(oneFamily).generation; + assertTrue("premature termination", families.stream().noneMatch(familyScanComplete(finishTime))); + List receivedEvents = getReceivedEvents(DiscoveryEvent.class); + assertEquals("number responses received", SCAN_ITERATIONS * families.size(), receivedEvents.size()); + } + + private void initializeDiscovery() { + families = catchToNull(() -> deviceMetadata.discovery.families.keySet()); + if (families == null || families.isEmpty()) { + throw new SkipTest("No discovery families configured"); + } + deviceConfig.discovery = new DiscoveryConfig(); + deviceConfig.discovery.families = new HashMap<>(); + updateConfig(); + untilTrue("all scans not active", () -> families.stream().noneMatch(familyScanActivated(null))); + previousGenerations = new HashMap<>(); + families.forEach(family -> previousGenerations.put(family, getStateFamilyGeneration(family))); + } + + private void scheduleScan(Date startTime, Integer scanIntervalSec) { + info("Scan start scheduled for " + startTime); + families.forEach(family -> { + getConfigFamily(family).generation = startTime; + getConfigFamily(family).scan_interval_sec = scanIntervalSec; + }); + updateConfig(); + getReceivedEvents(DiscoveryEvent.class); // Clear out any previously received events + } private FamilyDiscoveryConfig getConfigFamily(String family) { return deviceConfig.discovery.families.computeIfAbsent(family, @@ -110,10 +137,7 @@ private Date getStateFamilyGeneration(String family) { } private boolean stateGenerationSame(String family, Map previousGenerations) { - Date previous = previousGenerations.get(family); - Date current = getStateFamilyGeneration(family); - System.err.println("generation match " + previous + " " + current); - return Objects.equals(previous, current); + return Objects.equals(previousGenerations.get(family), getStateFamilyGeneration(family)); } private FamilyDiscoveryState getStateFamily(String family) { @@ -126,13 +150,11 @@ private Predicate familyScanActive(Date startTime) { } private Predicate familyScanActivated(Date startTime) { - return family -> catchToFalse(() -> { - System.err.println( - getStateFamily(family).active + " time check: " + getStateFamily(family).generation + " " - + startTime); - return getStateFamily(family).active - || CleanDateFormat.dateEquals(getStateFamily(family).generation, startTime); - }); + return family -> catchToFalse(() -> getStateFamily(family).active + || CleanDateFormat.dateEquals(getStateFamily(family).generation, startTime)); } + private Predicate familyScanComplete(Date startTime) { + return familyScanActivated(startTime).and(familyScanActive(startTime).negate()); + } } From 1f5fd9a04ede548f3165c139832e116f7d35dd2a Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 11:21:12 -0700 Subject: [PATCH 80/95] Adjusting output --- etc/sequencer.out | 1 + .../daq/mqtt/validator/validations/DiscoveryValidator.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/sequencer.out b/etc/sequencer.out index cd4328ee22..b40bbf5acc 100644 --- a/etc/sequencer.out +++ b/etc/sequencer.out @@ -1,4 +1,5 @@ RESULT pass broken_config Sequence complete +RESULT pass continuous_scan Sequence complete RESULT pass extra_config Sequence complete RESULT pass self_enumeration Sequence complete RESULT skip single_scan No discovery families configured diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index 62673554e0..9a3c64667a 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -15,7 +15,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; -import java.util.concurrent.atomic.AtomicReference; import java.util.function.Predicate; import java.util.stream.Collectors; import org.junit.Test; @@ -99,9 +98,11 @@ public void continuous_scan() { untilUntrue("scan iterations", () -> Instant.now().isBefore(endTime)); String oneFamily = families.iterator().next(); Date finishTime = deviceState.discovery.families.get(oneFamily).generation; - assertTrue("premature termination", families.stream().noneMatch(familyScanComplete(finishTime))); + assertTrue("premature termination", + families.stream().noneMatch(familyScanComplete(finishTime))); List receivedEvents = getReceivedEvents(DiscoveryEvent.class); - assertEquals("number responses received", SCAN_ITERATIONS * families.size(), receivedEvents.size()); + assertEquals("number responses received", SCAN_ITERATIONS * families.size(), + receivedEvents.size()); } private void initializeDiscovery() { From 23a246889d45fe4c7c2b525f8b4388700ebd0393 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 11:31:46 -0700 Subject: [PATCH 81/95] Adding debug --- bin/loop_sequences | 1 + validator/.idea/runConfigurations/Registrar.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/loop_sequences b/bin/loop_sequences index e4fa826afb..f61eb2292e 100755 --- a/bin/loop_sequences +++ b/bin/loop_sequences @@ -51,6 +51,7 @@ JAVA_CMD="java -cp $JARFILE com.google.daq.mqtt.validator.SequenceTestRunner" rm -rf $site_model/out/devices/$device_id test_srces=`cd validator/src/main/java/com/google/daq/mqtt/validator/validations; ls *.java` +echo Processing test sources $test_srces exit_code=2 for test_name in $test_names; do diff --git a/validator/.idea/runConfigurations/Registrar.xml b/validator/.idea/runConfigurations/Registrar.xml index b4aab06c4a..00eb8333bd 100644 --- a/validator/.idea/runConfigurations/Registrar.xml +++ b/validator/.idea/runConfigurations/Registrar.xml @@ -2,7 +2,7 @@
Type: string
- - - - - - - -
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: string
- +

The primary scan discovery address family

+
diff --git a/gencode/java/udmi/schema/DiscoveryEvent.java b/gencode/java/udmi/schema/DiscoveryEvent.java index 326fbd03c6..a357e02426 100644 --- a/gencode/java/udmi/schema/DiscoveryEvent.java +++ b/gencode/java/udmi/schema/DiscoveryEvent.java @@ -23,7 +23,6 @@ "generation", "status", "scan_family", - "scan_id", "families", "points" }) @@ -62,10 +61,13 @@ public class DiscoveryEvent { */ @JsonProperty("status") public Entry status; + /** + * The primary scan discovery address family + * + */ @JsonProperty("scan_family") + @JsonPropertyDescription("The primary scan discovery address family") public java.lang.String scan_family; - @JsonProperty("scan_id") - public java.lang.String scan_id; /** * Address family results for a scan. Not included for device enumeration messages. * @@ -85,7 +87,6 @@ public class DiscoveryEvent { public int hashCode() { int result = 1; result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); - result = ((result* 31)+((this.scan_id == null)? 0 :this.scan_id.hashCode())); result = ((result* 31)+((this.scan_family == null)? 0 :this.scan_family.hashCode())); result = ((result* 31)+((this.families == null)? 0 :this.families.hashCode())); result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); @@ -104,7 +105,7 @@ public boolean equals(Object other) { return false; } DiscoveryEvent rhs = ((DiscoveryEvent) other); - return (((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.scan_id == rhs.scan_id)||((this.scan_id!= null)&&this.scan_id.equals(rhs.scan_id))))&&((this.scan_family == rhs.scan_family)||((this.scan_family!= null)&&this.scan_family.equals(rhs.scan_family))))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + return ((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.scan_family == rhs.scan_family)||((this.scan_family!= null)&&this.scan_family.equals(rhs.scan_family))))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); } } diff --git a/gencode/python/udmi/schema/event_discovery.py b/gencode/python/udmi/schema/event_discovery.py index 9600657983..c1b457ecb7 100644 --- a/gencode/python/udmi/schema/event_discovery.py +++ b/gencode/python/udmi/schema/event_discovery.py @@ -13,7 +13,6 @@ def __init__(self): self.generation = None self.status = None self.scan_family = None - self.scan_id = None self.families = None self.points = None @@ -27,7 +26,6 @@ def from_dict(source): result.generation = source.get('generation') result.status = Entry.from_dict(source.get('status')) result.scan_family = source.get('scan_family') - result.scan_id = source.get('scan_id') result.families = FamilyDiscoveryEvent.map_from(source.get('families')) result.points = PointEnumerationEvent.map_from(source.get('points')) return result @@ -60,8 +58,6 @@ def to_dict(self): result['status'] = self.status.to_dict() # 4 if self.scan_family: result['scan_family'] = self.scan_family # 5 - if self.scan_id: - result['scan_id'] = self.scan_id # 5 if self.families: result['families'] = FamilyDiscoveryEvent.expand_dict(self.families) # 2 if self.points: diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index b79584da4d..a94f3a0844 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -779,12 +779,10 @@ private void sendDiscoveryEvent(String family, Date scanGeneration) { FamilyLocalnetModel familyLocalnetModel = getFamilyLocalnetModel(family, targetMetadata); if (familyLocalnetModel != null && familyLocalnetModel.id != null) { final String deviceId = entry.getKey(); - final String familyId = familyLocalnetModel.id; DiscoveryEvent discoveryEvent = new DiscoveryEvent(); discoveryEvent.timestamp = new Date(); discoveryEvent.version = UDMI_VERSION; discoveryEvent.scan_family = family; - discoveryEvent.scan_id = familyId; discoveryEvent.families = targetMetadata.localnet.families.entrySet().stream() .collect(toMap(Map.Entry::getKey, this::eventForTarget)); discoveryEvent.families.computeIfAbsent("iot", diff --git a/schema/event_discovery.json b/schema/event_discovery.json index 31d6d2b596..e4592c51c8 100644 --- a/schema/event_discovery.json +++ b/schema/event_discovery.json @@ -25,9 +25,7 @@ "$ref": "file:common.json#/definitions/entry" }, "scan_family": { - "type": "string" - }, - "scan_id": { + "description": "The primary scan discovery address family", "type": "string" }, "families": { From df2d7724c93fba34b94f071e74ac3f3c41cd2294 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 17:29:18 -0700 Subject: [PATCH 89/95] Cleanup --- .../CatchingScheduledThreadPoolExecutor.java | 2 +- pubber/src/main/java/daq/pubber/Pubber.java | 23 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/pubber/src/main/java/com/google/daq/mqtt/util/CatchingScheduledThreadPoolExecutor.java b/pubber/src/main/java/com/google/daq/mqtt/util/CatchingScheduledThreadPoolExecutor.java index 39c219689e..ce02484caa 100644 --- a/pubber/src/main/java/com/google/daq/mqtt/util/CatchingScheduledThreadPoolExecutor.java +++ b/pubber/src/main/java/com/google/daq/mqtt/util/CatchingScheduledThreadPoolExecutor.java @@ -36,7 +36,7 @@ protected void afterExecute(Runnable r, Throwable t) { } } if (t != null) { - System.err.println(t); + System.err.println("Scheduled: " + t); } } } diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index a94f3a0844..d844860413 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -35,6 +35,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; +import java.util.function.Supplier; import java.util.stream.Collectors; import org.apache.http.ConnectionClosedException; import org.slf4j.Logger; @@ -773,12 +774,10 @@ private void sendDiscoveryEvent(String family, Date scanGeneration) { FamilyDiscoveryState familyDiscoveryState = getFamilyDiscoveryState(family); if (scanGeneration.equals(familyDiscoveryState.generation) && familyDiscoveryState.active) { - AtomicInteger events = new AtomicInteger(); - allMetadata.entrySet().forEach(entry -> { - Metadata targetMetadata = entry.getValue(); + AtomicInteger sentEvents = new AtomicInteger(); + allMetadata.forEach((deviceId, targetMetadata) -> { FamilyLocalnetModel familyLocalnetModel = getFamilyLocalnetModel(family, targetMetadata); if (familyLocalnetModel != null && familyLocalnetModel.id != null) { - final String deviceId = entry.getKey(); DiscoveryEvent discoveryEvent = new DiscoveryEvent(); discoveryEvent.timestamp = new Date(); discoveryEvent.version = UDMI_VERSION; @@ -787,14 +786,22 @@ private void sendDiscoveryEvent(String family, Date scanGeneration) { .collect(toMap(Map.Entry::getKey, this::eventForTarget)); discoveryEvent.families.computeIfAbsent("iot", key -> new FamilyDiscoveryEvent()).id = deviceId; - if (Boolean.TRUE.equals(deviceConfig.discovery.families.get(family).enumerate)) { + if (isTrue(() -> deviceConfig.discovery.families.get(family).enumerate)) { discoveryEvent.points = enumeratePoints(deviceId); } publishDeviceMessage(discoveryEvent); - events.incrementAndGet(); + sentEvents.incrementAndGet(); } }); - info("Sent " + events.get() + " discovery events from " + family + " for " + scanGeneration); + info("Sent " + sentEvents.get() + " discovery events from " + family + " for " + scanGeneration); + } + } + + private boolean isTrue(Supplier target) { + try { + return target.get(); + } catch (Exception e) { + return false; } } @@ -820,10 +827,10 @@ private void discoveryScanComplete(String family, Date scanGeneration) { if (interval > 0) { Date newGeneration = Date.from(scanGeneration.toInstant().plusSeconds(interval)); scheduleDiscoveryScan(family, newGeneration); - publishStateMessage(); } else { info("Discovery scan stopping " + family + " from " + isoConvert(scanGeneration)); familyDiscoveryState.active = false; + publishStateMessage(); } } } catch (Exception e) { From af9bed3839a327c5c9951546cf7bb69be6a84ec7 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 17:39:27 -0700 Subject: [PATCH 90/95] Linty --- pubber/src/main/java/daq/pubber/Pubber.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index d844860413..a346793894 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -793,7 +793,8 @@ private void sendDiscoveryEvent(String family, Date scanGeneration) { sentEvents.incrementAndGet(); } }); - info("Sent " + sentEvents.get() + " discovery events from " + family + " for " + scanGeneration); + info("Sent " + sentEvents.get() + " discovery events from " + family + " for " + + scanGeneration); } } From 5304fb3c5ac8af24c8c6efe202eefa826cea03c4 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 17:46:51 -0700 Subject: [PATCH 91/95] Fix tests --- tests/event_discovery.tests/continuous.json | 3 +-- tests/event_discovery.tests/discovery.json | 3 +-- tests/event_discovery.tests/implicit.json | 4 +++- tests/event_discovery.tests/point_error.json | 1 - tests/event_discovery.tests/scan_error.json | 4 +++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/event_discovery.tests/continuous.json b/tests/event_discovery.tests/continuous.json index aad3645c38..35336a5514 100644 --- a/tests/event_discovery.tests/continuous.json +++ b/tests/event_discovery.tests/continuous.json @@ -7,8 +7,7 @@ "version": 1, "timestamp": "2018-08-26T21:39:29.364Z", "generation": "2018-08-26T22:00:13Z", - "scan_family": "bacnet", - "scan_id": "92EA09", + "scan_family": "ipv6", "families": { "ipv4": { "id": "192.168.1.2" diff --git a/tests/event_discovery.tests/discovery.json b/tests/event_discovery.tests/discovery.json index 867f69ed06..4ba5a9e8ee 100644 --- a/tests/event_discovery.tests/discovery.json +++ b/tests/event_discovery.tests/discovery.json @@ -7,8 +7,7 @@ "version": 1, "timestamp": "2018-08-26T21:39:29.364Z", "generation": "2018-08-26T21:00:13Z", - "scan_family": "bacnet", - "scan_id": "92EA09", + "scan_family": "ipv4", "families": { "ipv4": { "id": "192.168.1.2" diff --git a/tests/event_discovery.tests/implicit.json b/tests/event_discovery.tests/implicit.json index 26d767e897..699394089e 100644 --- a/tests/event_discovery.tests/implicit.json +++ b/tests/event_discovery.tests/implicit.json @@ -11,11 +11,13 @@ "timestamp": "2018-08-26T21:39:29.364Z", "generation": "2018-08-26T21:37:12Z", "scan_family": "bacnet", - "scan_id": "92EA09", "families": { "iot": { "id": "AHU-1" }, + "bacnet": { + "id": "92EA09" + }, "ipv4": { "id": "192.168.1.2" }, diff --git a/tests/event_discovery.tests/point_error.json b/tests/event_discovery.tests/point_error.json index a47ff7b31b..8193826825 100644 --- a/tests/event_discovery.tests/point_error.json +++ b/tests/event_discovery.tests/point_error.json @@ -11,7 +11,6 @@ "timestamp": "2018-08-26T21:39:29.364Z", "generation": "2018-08-26T21:37:12Z", "scan_family": "iot", - "scan_id": "AHU-1", "points": { "sup_flow_actual_avo_1": { "status": { diff --git a/tests/event_discovery.tests/scan_error.json b/tests/event_discovery.tests/scan_error.json index 0573754159..8f19d68fb0 100644 --- a/tests/event_discovery.tests/scan_error.json +++ b/tests/event_discovery.tests/scan_error.json @@ -8,11 +8,13 @@ "timestamp": "2018-08-26T21:42:12.237Z", "generation": "2018-08-26T21:37:12Z", "scan_family": "bacnet", - "scan_id": "92EA09", "families": { "ipv4": { "id": "192.168.1.2" }, + "bacnet": { + "id": "872849" + }, "ipv6": { "id": "FE80::D05C:1A90:DD9E:A582" }, From 3019f0ef4be2fe731ab9a2137c6741d5ded0b897 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 19:17:06 -0700 Subject: [PATCH 92/95] Linty --- .../main/java/com/google/daq/mqtt/validator/Validator.java | 2 -- .../daq/mqtt/validator/validations/DiscoveryValidator.java | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index d8c63d52a0..dfbcd6bfc0 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -25,10 +25,8 @@ import com.google.daq.mqtt.util.DataSink; import com.google.daq.mqtt.util.ExceptionMap; import com.google.daq.mqtt.util.ExceptionMap.ErrorTree; -import com.google.daq.mqtt.util.FirestoreDataSink; import com.google.daq.mqtt.util.PubSubClient; import com.google.daq.mqtt.util.PubSubDataSink; -import com.google.daq.mqtt.util.PubSubPusher; import com.google.daq.mqtt.util.ValidationException; import java.io.ByteArrayOutputStream; import java.io.File; diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index 3c710312e5..eb27743469 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -83,7 +83,8 @@ public void single_scan() { untilTrue("scan completed", () -> families.stream().allMatch(familyScanComplete(startTime))); List receivedEvents = getReceivedEvents( DiscoveryEvent.class); - assertTrue("enumerated points", receivedEvents.stream().noneMatch(event -> event.points != null && !event.points.isEmpty())); + assertTrue("enumerated points", receivedEvents.stream() + .noneMatch(event -> event.points != null && !event.points.isEmpty())); Set eventFamilies = receivedEvents.stream() .flatMap(event -> event.families.keySet().stream()) .collect(Collectors.toSet()); @@ -102,7 +103,8 @@ public void continuous_scan() { assertTrue("premature termination", families.stream().noneMatch(familyScanComplete(finishTime))); List receivedEvents = getReceivedEvents(DiscoveryEvent.class); - assertTrue("enumerated points", receivedEvents.stream().allMatch(event -> event.points != null && !event.points.isEmpty())); + assertTrue("enumerated points", + receivedEvents.stream().allMatch(event -> event.points != null && !event.points.isEmpty())); assertEquals("number responses received", SCAN_ITERATIONS * families.size(), receivedEvents.size()); } From 32a4a740ef6bbefcb048c8860e2cf830aa1bf0da Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 20:15:36 -0700 Subject: [PATCH 93/95] Debugging --- .../java/com/google/daq/mqtt/validator/SequenceValidator.java | 2 +- .../daq/mqtt/validator/validations/DiscoveryValidator.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java index 45cfdc580a..26842c25d0 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/SequenceValidator.java @@ -73,7 +73,7 @@ public abstract class SequenceValidator { private static final String RESULT_LOG_FILE = "RESULT.log"; private static final String DEVICE_METADATA_FORMAT = "%s/devices/%s/metadata.json"; private static final String DEVICE_CONFIG_FORMAT = "%s/devices/%s/out/generated_config.json"; - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() + protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() .enable(SerializationFeature.INDENT_OUTPUT) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index eb27743469..79115437e2 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -111,6 +111,7 @@ public void continuous_scan() { private void initializeDiscovery() { families = catchToNull(() -> deviceMetadata.discovery.families.keySet()); + System.err.println("TAP device metadata: " + OBJECT_MAPPER.writeValueAsString(deviceMetadata)); if (families == null || families.isEmpty()) { throw new SkipTest("No discovery families configured"); } From 3888f7971557da46747ee3b06d7b86ffafc8f6f7 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 21:50:16 -0700 Subject: [PATCH 94/95] Catch error --- .../daq/mqtt/validator/validations/DiscoveryValidator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index 79115437e2..6eb6ace688 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -111,7 +111,12 @@ public void continuous_scan() { private void initializeDiscovery() { families = catchToNull(() -> deviceMetadata.discovery.families.keySet()); - System.err.println("TAP device metadata: " + OBJECT_MAPPER.writeValueAsString(deviceMetadata)); + try { + System.err.println( + "TAP device metadata: " + OBJECT_MAPPER.writeValueAsString(deviceMetadata)); + } catch (Exception e) { + throw new RuntimeException("While writing device metadata", e); + } if (families == null || families.isEmpty()) { throw new SkipTest("No discovery families configured"); } From 0f3973eda9fac40fabfec90154901ceb6e841819 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 20 Apr 2022 22:01:15 -0700 Subject: [PATCH 95/95] Cleanup --- etc/sequencer.out | 2 +- .../validator/validations/DiscoveryValidator.java | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/etc/sequencer.out b/etc/sequencer.out index b40bbf5acc..0d25bea7cc 100644 --- a/etc/sequencer.out +++ b/etc/sequencer.out @@ -2,7 +2,7 @@ RESULT pass broken_config Sequence complete RESULT pass continuous_scan Sequence complete RESULT pass extra_config Sequence complete RESULT pass self_enumeration Sequence complete -RESULT skip single_scan No discovery families configured +RESULT pass single_scan Sequence complete RESULT pass system_last_update Sequence complete RESULT pass valid_serial_no Sequence complete RESULT pass valid_serial_no Sequence complete diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java index 6eb6ace688..7d6695790c 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/validations/DiscoveryValidator.java @@ -54,7 +54,6 @@ public void self_enumeration() { DiscoveryEvent discoveryEvent = events.get(0); info("Received discovery generation " + getTimestamp(discoveryEvent.generation)); assertEquals("matching event generation", startTime, discoveryEvent.generation); - discoveryEvent.points.values().forEach(point -> System.err.println(toJsonString(point))); int discoveredPoints = discoveryEvent.points == null ? 0 : discoveryEvent.points.size(); assertEquals("discovered points count", deviceMetadata.pointset.points.size(), discoveredPoints); @@ -83,7 +82,7 @@ public void single_scan() { untilTrue("scan completed", () -> families.stream().allMatch(familyScanComplete(startTime))); List receivedEvents = getReceivedEvents( DiscoveryEvent.class); - assertTrue("enumerated points", receivedEvents.stream() + assertTrue("no enumerated points", receivedEvents.stream() .noneMatch(event -> event.points != null && !event.points.isEmpty())); Set eventFamilies = receivedEvents.stream() .flatMap(event -> event.families.keySet().stream()) @@ -103,7 +102,7 @@ public void continuous_scan() { assertTrue("premature termination", families.stream().noneMatch(familyScanComplete(finishTime))); List receivedEvents = getReceivedEvents(DiscoveryEvent.class); - assertTrue("enumerated points", + assertTrue("has enumerated points", receivedEvents.stream().allMatch(event -> event.points != null && !event.points.isEmpty())); assertEquals("number responses received", SCAN_ITERATIONS * families.size(), receivedEvents.size()); @@ -111,12 +110,6 @@ public void continuous_scan() { private void initializeDiscovery() { families = catchToNull(() -> deviceMetadata.discovery.families.keySet()); - try { - System.err.println( - "TAP device metadata: " + OBJECT_MAPPER.writeValueAsString(deviceMetadata)); - } catch (Exception e) { - throw new RuntimeException("While writing device metadata", e); - } if (families == null || families.isEmpty()) { throw new SkipTest("No discovery families configured"); }