From 62c59c40aa0f0e6c139c89a09aab939d41520b6f Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Tue, 9 Aug 2022 21:55:02 -0700 Subject: [PATCH 01/70] Add gencode Category --- .gencode_hash.txt | 1 + etc/Category.java | 16 ++++++++++ gencode/java/udmi/schema/Category.java | 16 ++++++++++ .../validations/ConfigValidator.java | 32 ++++++++++--------- 4 files changed, 50 insertions(+), 15 deletions(-) create mode 100644 etc/Category.java create mode 100644 gencode/java/udmi/schema/Category.java diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 436967489a..757b4dd3da 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -16,6 +16,7 @@ d326a550d75ab7f558f165f1a5e8c24eee2b0b52290a7472f529bb1e15d79fb2 gencode/java/u 2c03651cb2ecda072b1418222eebb5560185669f8ffdd03021ad5ad8ff7ba3b0 gencode/java/udmi/schema/BlobBlobsetState.java 3fccb6bc6714fdc3dd912c8b1155e7ce19b0ac8a7ec48a01be9eb27bdd034a75 gencode/java/udmi/schema/BlobsetConfig.java fcbed49f1af8b791d8c52bcbe18f65521a79d9ac3eb33ec3afd9b342ab2bfc56 gencode/java/udmi/schema/BlobsetState.java +eb457036f822e67c87f203493c29bfebfe5118de2c3a8b5b71b3e623e66e8535 gencode/java/udmi/schema/Category.java a2eeff86f4302272736d84602e2ca36a64d27c8ef6761cc05ffb8ad17b030d4d gencode/java/udmi/schema/CloudModel.java ff79de9390aa25bb45fb3e2ebb682c865ccab764f56d9644377d9d28c0ab10e4 gencode/java/udmi/schema/Config.java d4a82e132b2d223c4a82384d22455283c0b64aba3100fc210e72f9700b9df2d0 gencode/java/udmi/schema/DeviceValidationEvent.java diff --git a/etc/Category.java b/etc/Category.java new file mode 100644 index 0000000000..1ee2f320e4 --- /dev/null +++ b/etc/Category.java @@ -0,0 +1,16 @@ +package udmi.schema; + +import static udmi.schema.Level.DEBUG; +import static udmi.schema.Level.NOTICE; + +// This class is manually curated, auto-generated, and then copied into the gencode directory. +// Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md +public class Category { + + public static final String SYSTEM_CONFIG_RECEIVE ="system.config.receive"; + public static final Level SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; + public static final String SYSTEM_CONFIG_PARSE ="system.config.parse"; + public static final Level SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; + public static final String SYSTEM_CONFIG_APPLY ="system.config.apply"; + public static final Level SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; +} diff --git a/gencode/java/udmi/schema/Category.java b/gencode/java/udmi/schema/Category.java new file mode 100644 index 0000000000..1ee2f320e4 --- /dev/null +++ b/gencode/java/udmi/schema/Category.java @@ -0,0 +1,16 @@ +package udmi.schema; + +import static udmi.schema.Level.DEBUG; +import static udmi.schema.Level.NOTICE; + +// This class is manually curated, auto-generated, and then copied into the gencode directory. +// Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md +public class Category { + + public static final String SYSTEM_CONFIG_RECEIVE ="system.config.receive"; + public static final Level SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; + public static final String SYSTEM_CONFIG_PARSE ="system.config.parse"; + public static final Level SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; + public static final String SYSTEM_CONFIG_APPLY ="system.config.apply"; + public static final Level SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; +} 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 7e2983d5cc..2cabd1188b 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 @@ -4,6 +4,12 @@ import static com.google.daq.mqtt.validator.CleanDateFormat.dateEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static udmi.schema.Category.SYSTEM_CONFIG_APPLY; +import static udmi.schema.Category.SYSTEM_CONFIG_APPLY_LEVEL; +import static udmi.schema.Category.SYSTEM_CONFIG_PARSE; +import static udmi.schema.Category.SYSTEM_CONFIG_PARSE_LEVEL; +import static udmi.schema.Category.SYSTEM_CONFIG_RECEIVE; +import static udmi.schema.Category.SYSTEM_CONFIG_RECEIVE_LEVEL; import com.google.daq.mqtt.validator.SequenceValidator; import java.util.Date; @@ -17,10 +23,6 @@ */ public class ConfigValidator extends SequenceValidator { - public static final String SYSTEM_CONFIG_RECEIVE = "system.config.receive"; - public static final String SYSTEM_CONFIG_PARSE = "system.config.parse"; - public static final String SYSTEM_CONFIG_APPLY = "system.config.apply"; - @Test public void system_last_update() { deviceConfig.system.min_loglevel = 400; @@ -49,7 +51,7 @@ public void broken_config() { ); extraField = "break_json"; updateConfig(); - hasLogged(SYSTEM_CONFIG_RECEIVE, Level.INFO); + hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); AtomicReference stableConfig = new AtomicReference<>(null); untilTrue("state has status", () -> { boolean hasStatus = deviceState.system.status != null; @@ -70,17 +72,17 @@ public void broken_config() { dateEquals(matchedConfig, deviceState.system.last_config)); assertTrue("system operational", deviceState.system.operational); hasLogged(SYSTEM_CONFIG_PARSE, Level.ERROR); - hasNotLogged(SYSTEM_CONFIG_APPLY, Level.INFO); + hasNotLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); resetConfig(); extraField = null; - hasLogged(SYSTEM_CONFIG_RECEIVE, Level.INFO); + hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); untilTrue("state no status", () -> deviceState.system.status == null); untilTrue("last_config updated", () -> !dateEquals(matchedConfig, deviceState.system.last_config) ); assertTrue("system operational", deviceState.system.operational); - hasLogged(SYSTEM_CONFIG_PARSE, Level.INFO); - hasLogged(SYSTEM_CONFIG_APPLY, Level.INFO); + hasLogged(SYSTEM_CONFIG_PARSE, SYSTEM_CONFIG_PARSE_LEVEL); + hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); } @Test @@ -92,23 +94,23 @@ public void extra_config() { final Date prevConfig = deviceState.system.last_config; extraField = "Flabberguilstadt"; updateConfig(); - hasLogged(SYSTEM_CONFIG_RECEIVE, Level.INFO); + hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); untilTrue("last_config updated", () -> !deviceState.system.last_config.equals(prevConfig)); untilTrue("system operational", () -> deviceState.system.operational); untilTrue("state no status", () -> deviceState.system.status == null); - hasLogged(SYSTEM_CONFIG_PARSE, Level.INFO); - hasLogged(SYSTEM_CONFIG_APPLY, Level.INFO); + hasLogged(SYSTEM_CONFIG_PARSE, SYSTEM_CONFIG_PARSE_LEVEL); + hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); final Date updatedConfig = deviceState.system.last_config; extraField = null; updateConfig(); - hasLogged(SYSTEM_CONFIG_RECEIVE, Level.INFO); + hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); 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); - hasLogged(SYSTEM_CONFIG_PARSE, Level.INFO); - hasLogged(SYSTEM_CONFIG_APPLY, Level.INFO); + hasLogged(SYSTEM_CONFIG_PARSE, SYSTEM_CONFIG_PARSE_LEVEL); + hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); } From 3bcab401830dc2d0d746951fd3b6347d25c1872a Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Tue, 9 Aug 2022 22:07:03 -0700 Subject: [PATCH 02/70] category.json --- .gencode_hash.txt | 11 +- etc/category.json | 0 gencode/docs/event_discovery.html | 118 +++++- gencode/docs/event_system.html | 59 ++- gencode/docs/event_validation.html | 177 ++++++++- gencode/docs/state.html | 476 ++++++++++++++++++++++++- gencode/python/udmi/schema/__init__.py | 1 + gencode/python/udmi/schema/category.py | 35 ++ schema/category.json | 10 + schema/common.json | 5 +- 10 files changed, 870 insertions(+), 22 deletions(-) create mode 100644 etc/category.json create mode 100644 gencode/python/udmi/schema/category.py create mode 100644 schema/category.json diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 757b4dd3da..3f69057c9c 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,15 +1,15 @@ f5cf191b0151d2142fa634d1deafb93e35041d5b9ae89b26beab32fa25fb9521 gencode/docs/config.html 90679d3d866579501e7aa00b515af05d42fc9fe399eafacaacf297d1e4a22884 gencode/docs/envelope.html -368f12b9b695b31d97e65509c461f56c12762ec50b9baff89fd7fd85713e8fce gencode/docs/event_discovery.html +06083fe56a8b1f71e682fb1c672cee3fe403ea2233c704188a44bd40e6195aa3 gencode/docs/event_discovery.html 8133e380e40f27c56accbffc665b2eeb56ec84a4da3b52ba7aa5e439c9c40572 gencode/docs/event_pointset.html -076eb51e75281ed065a9f0236a1e19b6bf3c277b51ceca84f6aa3f76d5bb6022 gencode/docs/event_system.html -465a940ab96c32e040ae14b62f384ae9c472f646f3de1ea96288fd4c11de1409 gencode/docs/event_validation.html +0c9b62518a6071258df6de69385a50f1936cc781077d421836faa97cd5ee1409 gencode/docs/event_system.html +7bbcc13588705c0c032d470ccf8b0da2c923887d8f9e2746c32e03e5ffb66f35 gencode/docs/event_validation.html f48026471ae3cd7867bce416dc21c2fb728f48d8476a8d6e95f6acaf1d8b6cf3 gencode/docs/index.html 6d5081d04c86f8bd444efb41cd788826aa66802d37e8f98e93b6b75425542d5e gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js -16d46783ef2271abef54f071bb3723a4d124a95ec4fb5a536a7dee5c266d8899 gencode/docs/state.html +c87b93694dc04754807b67aa80a40f9f2189d97a1740d8be9de795b8ee39dd8b gencode/docs/state.html d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/udmi/schema/Asset.java 0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java d326a550d75ab7f558f165f1a5e8c24eee2b0b52290a7472f529bb1e15d79fb2 gencode/java/udmi/schema/BlobBlobsetConfig.java @@ -70,8 +70,9 @@ e0f70f8e2c4793ebd05a38dc249d329eaa5b0171097ecc5fad4630fa0df3536d gencode/java/u d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/udmi/schema/TestingModel.java 347da3d586ff6e5dcf3ce8ec0c800ec0efd5fed4e0c80eef35de65ad92ae48bf gencode/java/udmi/schema/ValidationEvent.java e007ddd1ceeae3603c85110c33e1bb4a418ff9c7a791ca0df25b7ea3caeafd36 gencode/java/udmi/schema/ValidationSummary.java -f5f5a460513570c0af0aba1afb8052007987a9f05755586a8ddef5eaa7ef6025 gencode/python/udmi/schema/__init__.py +22047603db1a2a78df2626c1a1e5804d00990f3a401607edfa85df9da9e19f70 gencode/python/udmi/schema/__init__.py 4b25dd95f863059b761269f93adcae7049507924a1c6e74d6856849203c179db gencode/python/udmi/schema/ancillary_properties.py +bfd0c96eff755f9aae3ff77e6e0fdfac1deb91fe35c95f929d60d58afd7ef179 gencode/python/udmi/schema/category.py 6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 1e13e34fea2cda5c28b6c59e0ef107c79b4ef532b564dd5c5601e211cbf5d21e gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py diff --git a/etc/category.json b/etc/category.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/gencode/docs/event_discovery.html b/gencode/docs/event_discovery.html index 2a38e77fbe..8fe96d8e51 100644 --- a/gencode/docs/event_discovery.html +++ b/gencode/docs/event_discovery.html @@ -286,7 +286,57 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -1248,7 +1298,71 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
diff --git a/gencode/docs/event_system.html b/gencode/docs/event_system.html index a338c37cca..515beee826 100644 --- a/gencode/docs/event_system.html +++ b/gencode/docs/event_system.html @@ -295,7 +295,64 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
diff --git a/gencode/docs/event_validation.html b/gencode/docs/event_validation.html index 0dd1d7a15c..3e7b939b67 100644 --- a/gencode/docs/event_validation.html +++ b/gencode/docs/event_validation.html @@ -350,7 +350,57 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -840,7 +890,64 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -1670,7 +1777,71 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
diff --git a/gencode/docs/state.html b/gencode/docs/state.html index 315a3848f7..2e9a06ae55 100644 --- a/gencode/docs/state.html +++ b/gencode/docs/state.html @@ -1027,7 +1027,64 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -1496,7 +1553,78 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -2030,7 +2158,71 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -2601,7 +2793,78 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -3112,7 +3375,78 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -3610,7 +3944,64 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
@@ -4166,7 +4557,78 @@

categoryType: string

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

-
Must match regular expression: ^[a-z][._a-zA-Z]*[a-zA-Z]$ + + +

+ +

+
+ + + Type: object
+ + + + + + + +
diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index ab2240039e..8a202aa795 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -1,4 +1,5 @@ from .ancillary_properties import AncillaryProperties +from .category import Object287A131B from .command_discovery import DiscoveryCommand from .common import Common from .config import Config diff --git a/gencode/python/udmi/schema/category.py b/gencode/python/udmi/schema/category.py new file mode 100644 index 0000000000..d9424ddea0 --- /dev/null +++ b/gencode/python/udmi/schema/category.py @@ -0,0 +1,35 @@ +"""Generated class for category.json""" + + +class Object287A131B: + """Generated schema class""" + + def __init__(self): + pass + + @staticmethod + def from_dict(source): + if not source: + return None + result = Object287A131B() + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = Object287A131B.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/schema/category.json b/schema/category.json new file mode 100644 index 0000000000..431d639f37 --- /dev/null +++ b/schema/category.json @@ -0,0 +1,10 @@ +{ + "description": "A device-specific representation of the category an entry pertains to", + "type": "string", + "examples": ["pointset.points.config"], + "oneOf": [ + { + "exact": "system.config.receive" + } + ] +} diff --git a/schema/common.json b/schema/common.json index 1c45556896..1f24c95bd8 100644 --- a/schema/common.json +++ b/schema/common.json @@ -33,10 +33,7 @@ "type": "string" }, "category": { - "description": "A device-specific representation of the category an entry pertains to", - "type": "string", - "pattern": "^[a-z][._a-zA-Z]*[a-zA-Z]$", - "examples": ["pointset.points.config"] + "$ref": "file:category.json" }, "timestamp": { "description": "Timestamp the condition was triggered, or most recently updated", From 617e733e035db436b4fae102965c753bb1c55616 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Tue, 9 Aug 2022 22:20:35 -0700 Subject: [PATCH 03/70] Basic validation of categories --- .gencode_hash.txt | 12 +- gencode/docs/event_discovery.html | 208 +++++ gencode/docs/event_system.html | 104 +++ gencode/docs/event_validation.html | 312 ++++++++ gencode/docs/state.html | 1014 ++++++++++++++++++++++-- gencode/python/udmi/schema/__init__.py | 2 +- gencode/python/udmi/schema/category.py | 6 +- schema/category.json | 6 +- tests/event_system.tests/example.json | 4 +- 9 files changed, 1573 insertions(+), 95 deletions(-) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 3f69057c9c..a77b56b3bd 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,15 +1,15 @@ f5cf191b0151d2142fa634d1deafb93e35041d5b9ae89b26beab32fa25fb9521 gencode/docs/config.html 90679d3d866579501e7aa00b515af05d42fc9fe399eafacaacf297d1e4a22884 gencode/docs/envelope.html -06083fe56a8b1f71e682fb1c672cee3fe403ea2233c704188a44bd40e6195aa3 gencode/docs/event_discovery.html +438122f7b9fdfd6ab8edd57f667628b512fab43e51dc6a7efaa47d919bef98f5 gencode/docs/event_discovery.html 8133e380e40f27c56accbffc665b2eeb56ec84a4da3b52ba7aa5e439c9c40572 gencode/docs/event_pointset.html -0c9b62518a6071258df6de69385a50f1936cc781077d421836faa97cd5ee1409 gencode/docs/event_system.html -7bbcc13588705c0c032d470ccf8b0da2c923887d8f9e2746c32e03e5ffb66f35 gencode/docs/event_validation.html +aa0aa5ed4b6b5794ec1525ae3fe8ce7465df5f6129452865c2cb26886d398949 gencode/docs/event_system.html +aad8f0c65e80a128a95050f445a2dec53d6f11a5c1ec2c4ad64b7e645ccf4065 gencode/docs/event_validation.html f48026471ae3cd7867bce416dc21c2fb728f48d8476a8d6e95f6acaf1d8b6cf3 gencode/docs/index.html 6d5081d04c86f8bd444efb41cd788826aa66802d37e8f98e93b6b75425542d5e gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js -c87b93694dc04754807b67aa80a40f9f2189d97a1740d8be9de795b8ee39dd8b gencode/docs/state.html +0758383757b0dbd4a1fbfb1531a0424033541ddf576be66fb09b883599225147 gencode/docs/state.html d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/udmi/schema/Asset.java 0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java d326a550d75ab7f558f165f1a5e8c24eee2b0b52290a7472f529bb1e15d79fb2 gencode/java/udmi/schema/BlobBlobsetConfig.java @@ -70,9 +70,9 @@ e0f70f8e2c4793ebd05a38dc249d329eaa5b0171097ecc5fad4630fa0df3536d gencode/java/u d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/udmi/schema/TestingModel.java 347da3d586ff6e5dcf3ce8ec0c800ec0efd5fed4e0c80eef35de65ad92ae48bf gencode/java/udmi/schema/ValidationEvent.java e007ddd1ceeae3603c85110c33e1bb4a418ff9c7a791ca0df25b7ea3caeafd36 gencode/java/udmi/schema/ValidationSummary.java -22047603db1a2a78df2626c1a1e5804d00990f3a401607edfa85df9da9e19f70 gencode/python/udmi/schema/__init__.py +92d6dbfce8879bb25c7d98350bf368ad5abdbe9a1aab47daf3004d067c7ae48a gencode/python/udmi/schema/__init__.py 4b25dd95f863059b761269f93adcae7049507924a1c6e74d6856849203c179db gencode/python/udmi/schema/ancillary_properties.py -bfd0c96eff755f9aae3ff77e6e0fdfac1deb91fe35c95f929d60d58afd7ef179 gencode/python/udmi/schema/category.py +d8092388082be9e234cc9ea537549fa86b595db889b0a526e0aa7e26a5a29b98 gencode/python/udmi/schema/category.py 6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 1e13e34fea2cda5c28b6c59e0ef107c79b4ef532b564dd5c5601e211cbf5d21e gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py diff --git a/gencode/docs/event_discovery.html b/gencode/docs/event_discovery.html index 8fe96d8e51..0eb910c304 100644 --- a/gencode/docs/event_discovery.html +++ b/gencode/docs/event_discovery.html @@ -295,6 +295,16 @@

id="status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_status_category_oneOf_i0" role="tab" onclick="setAnchor('#status_category_oneOf_i0')" >Option 1 +
@@ -329,8 +339,88 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply + @@ -1307,6 +1397,16 @@

id="uniqs_pattern1_status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_uniqs_pattern1_status_category_oneOf_i0" role="tab" onclick="setAnchor('#uniqs_pattern1_status_category_oneOf_i0')" >Option 1 +
@@ -1355,7 +1455,115 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + Type: object
+Must match regular expression: ^system\.config\.apply diff --git a/gencode/docs/event_system.html b/gencode/docs/event_system.html index 515beee826..7d07bce37d 100644 --- a/gencode/docs/event_system.html +++ b/gencode/docs/event_system.html @@ -304,6 +304,16 @@

id="logentries_items_category_oneOf_i0" data-toggle="tab" href="#tab-pane_logentries_items_category_oneOf_i0" role="tab" onclick="setAnchor('#logentries_items_category_oneOf_i0')" >Option 1 +
@@ -345,8 +355,102 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply + diff --git a/gencode/docs/event_validation.html b/gencode/docs/event_validation.html index 3e7b939b67..df3e6fc844 100644 --- a/gencode/docs/event_validation.html +++ b/gencode/docs/event_validation.html @@ -359,6 +359,16 @@

id="status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_status_category_oneOf_i0" role="tab" onclick="setAnchor('#status_category_oneOf_i0')" >Option 1 +
@@ -393,8 +403,88 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply + @@ -899,6 +989,16 @@

id="errors_items_category_oneOf_i0" data-toggle="tab" href="#tab-pane_errors_items_category_oneOf_i0" role="tab" onclick="setAnchor('#errors_items_category_oneOf_i0')" >Option 1 +
@@ -940,8 +1040,102 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply + @@ -1786,6 +1980,16 @@

id="devices_pattern1_status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_devices_pattern1_status_category_oneOf_i0" role="tab" onclick="setAnchor('#devices_pattern1_status_category_oneOf_i0')" >Option 1 +
@@ -1834,8 +2038,116 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply + diff --git a/gencode/docs/state.html b/gencode/docs/state.html index 2e9a06ae55..24a00e7c70 100644 --- a/gencode/docs/state.html +++ b/gencode/docs/state.html @@ -1036,6 +1036,16 @@

id="system_status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_system_status_category_oneOf_i0" role="tab" onclick="setAnchor('#system_status_category_oneOf_i0')" >Option 1 +
@@ -1077,7 +1087,101 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + Type: object
+Must match regular expression: ^system\.config\.apply @@ -1562,6 +1666,16 @@

id="gateway_devices_additionalProperties_status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i0" role="tab" onclick="setAnchor('#gateway_devices_additionalProperties_status_category_oneOf_i0')" >Option 1 +
@@ -1617,7 +1731,129 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + Type: object
+Must match regular expression: ^system\.config\.apply @@ -2167,6 +2403,16 @@

id="discovery_enumeration_status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_discovery_enumeration_status_category_oneOf_i0" role="tab" onclick="setAnchor('#discovery_enumeration_status_category_oneOf_i0')" >Option 1 +
@@ -2215,42 +2461,17 @@

/> item 0

Type: object
- - - - +Must match regular expression: ^system\.config\.receive$ -

+

-
-
Example:
-
"pointset.points.config"
-
-
-
-

-

-

-
-
-
-

- -

-
- -
-
- Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ category + + + + oneOf + + + + item 1
Type: object
+Must match regular expression: ^system\.config\.parse -
-
Example:
-
"2018-08-26T21:39:28.364Z"
-
-
-
-
-
-

-
-
-
-

+ +

+ + + Type: object
+Must match regular expression: ^system\.config\.apply + + + + + + +
+ + + + + +
+
Example:
+
"pointset.points.config"
+
+
+

+ + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

Timestamp the condition was triggered, or most recently updated

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

@@ -2802,6 +3156,16 @@

id="discovery_families_pattern1_status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_discovery_families_pattern1_status_category_oneOf_i0" role="tab" onclick="setAnchor('#discovery_families_pattern1_status_category_oneOf_i0')" >Option 1 +
@@ -2857,8 +3221,130 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply + @@ -3304,39 +3790,161 @@

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" /> - status + status + + + + detail

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

+
+ +

+ +

+
+ + + Type: string
-

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

-
+ item 0
Type: object
+Must match regular expression: ^system\.config\.receive$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 1
Type: object
+Must match regular expression: ^system\.config\.parse + -

- -

-
+ + + + +
Type: object
- + item 2
Type: object
+Must match regular expression: ^system\.config\.apply @@ -3953,6 +4571,16 @@

id="pointset_status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_pointset_status_category_oneOf_i0" role="tab" onclick="setAnchor('#pointset_status_category_oneOf_i0')" >Option 1 +
@@ -3994,7 +4622,101 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + + + +
+ + Type: object
+Must match regular expression: ^system\.config\.apply @@ -4566,6 +5288,16 @@

id="pointset_points_pattern1_status_category_oneOf_i0" data-toggle="tab" href="#tab-pane_pointset_points_pattern1_status_category_oneOf_i0" role="tab" onclick="setAnchor('#pointset_points_pattern1_status_category_oneOf_i0')" >Option 1 +
@@ -4621,8 +5353,130 @@

/> item 0

Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply + diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 8a202aa795..2ad07c2e6d 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -1,5 +1,5 @@ from .ancillary_properties import AncillaryProperties -from .category import Object287A131B +from .category import ObjectD83FA82F from .command_discovery import DiscoveryCommand from .common import Common from .config import Config diff --git a/gencode/python/udmi/schema/category.py b/gencode/python/udmi/schema/category.py index d9424ddea0..b7df8ae173 100644 --- a/gencode/python/udmi/schema/category.py +++ b/gencode/python/udmi/schema/category.py @@ -1,7 +1,7 @@ """Generated class for category.json""" -class Object287A131B: +class ObjectD83FA82F: """Generated schema class""" def __init__(self): @@ -11,7 +11,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = Object287A131B() + result = ObjectD83FA82F() return result @staticmethod @@ -20,7 +20,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = Object287A131B.from_dict(source[key]) + result[key] = ObjectD83FA82F.from_dict(source[key]) return result @staticmethod diff --git a/schema/category.json b/schema/category.json index 431d639f37..11eab86aee 100644 --- a/schema/category.json +++ b/schema/category.json @@ -3,8 +3,8 @@ "type": "string", "examples": ["pointset.points.config"], "oneOf": [ - { - "exact": "system.config.receive" - } + { "pattern": "^system\\.config\\.receive$" }, + { "pattern": "^system\\.config\\.parse" }, + { "pattern": "^system\\.config\\.apply" } ] } diff --git a/tests/event_system.tests/example.json b/tests/event_system.tests/example.json index c13f8dbca9..c31922b7ae 100644 --- a/tests/event_system.tests/example.json +++ b/tests/event_system.tests/example.json @@ -6,14 +6,14 @@ "message": "things are happening", "detail": "someplace, sometime", "timestamp": "2018-08-26T21:39:19.364Z", - "category": "com.testCategory", + "category": "system.config.receive", "level": 600 }, { "message": "something else happened", "timestamp": "2018-08-26T21:39:39.364Z", "detail": "someplace, sometime", - "category": "com.testCategory", + "category": "system.config.apply", "level": 700 } ] From cec5107040200b528643a9ad3d4a7577cf3e655e Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 04:43:00 -0700 Subject: [PATCH 04/70] Cleanup gencode --- bin/gencode_docs | 2 +- bin/gencode_java | 2 +- bin/gencode_python | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/gencode_docs b/bin/gencode_docs index 6e598c3891..1257f69c0e 100755 --- a/bin/gencode_docs +++ b/bin/gencode_docs @@ -21,6 +21,7 @@ cd $ROOT_DIR OUTPUT_DIR=$ROOT_DIR/gencode/docs TMP_DIR=$ROOT_DIR/tmp/schema +rm -rf $OUTPUT_DIR $TMP_DIR schema_files=`ls schema/*.json` @@ -71,7 +72,6 @@ if [ -d venv ]; then source venv/bin/activate fi -rm -rf $OUTPUT_DIR mkdir -p $OUTPUT_DIR # Make a copy of the schema files into a tmp folder for any pre generator fixes diff --git a/bin/gencode_java b/bin/gencode_java index a5a8b9b958..04b979052f 100755 --- a/bin/gencode_java +++ b/bin/gencode_java @@ -6,7 +6,7 @@ JBASENAME=jsonschema2pojo ROOT_DIR=$(realpath $(dirname $0)/..) cd $ROOT_DIR -rm -rf gencode +rm -rf gencode/java codegen/java mkdir -p codegen gencode OUTDIR=$ROOT_DIR/gencode/java diff --git a/bin/gencode_python b/bin/gencode_python index 030e64e2d1..e1f271152c 100755 --- a/bin/gencode_python +++ b/bin/gencode_python @@ -3,6 +3,7 @@ import hashlib import json import os +import shutil import sys FILE_PREFIX="file:" @@ -261,6 +262,7 @@ def generate_class(contents): write_class(writer, contents) def generate_module(in_files): + shutil.rmtree(out_dir) os.makedirs(out_dir, exist_ok=True) full_path = os.path.join(out_dir, '__init__.py') with open(full_path, 'w') as fd: From 560470c682e912d10051a30a5f84494b38d98f0d Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 05:00:44 -0700 Subject: [PATCH 05/70] Initial gencode files --- bin/gencode_categories | 24 ++++++++++++++ bin/gencode_java | 2 ++ etc/category.json | 5 +++ gencode/java/udmi/schema/Category.java | 44 ++++++++++++++++++-------- schema/category.json | 9 ++---- 5 files changed, 64 insertions(+), 20 deletions(-) create mode 100755 bin/gencode_categories diff --git a/bin/gencode_categories b/bin/gencode_categories new file mode 100755 index 0000000000..b476ba0098 --- /dev/null +++ b/bin/gencode_categories @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +import hashlib +import json +import os +import shutil +import sys + +doc_in = os.path.join('docs/specs/categories.md') +schema_in = os.path.join('etc/category.json') +schema_out = os.path.join('schema/category.json') +java_in = os.path.join('etc/Category.java') +java_out = os.path.join('gencode/java/udmi/schema/Category.java') + +lines=[] + +with open(doc_in) as doc: + lines = doc.readlines(); + +with open(schema_in) as inp: + with open(schema_out, 'w') as out: + while line := inp.readline(): + out.write(line) + diff --git a/bin/gencode_java b/bin/gencode_java index 04b979052f..36fd3ca987 100755 --- a/bin/gencode_java +++ b/bin/gencode_java @@ -9,6 +9,8 @@ cd $ROOT_DIR rm -rf gencode/java codegen/java mkdir -p codegen gencode +bin/gencode_categories + OUTDIR=$ROOT_DIR/gencode/java cd codegen GENDIR=$PWD diff --git a/etc/category.json b/etc/category.json index e69de29bb2..5efd820f15 100644 --- a/etc/category.json +++ b/etc/category.json @@ -0,0 +1,5 @@ +{ + "oneOf": [ + @@ gencode stuff goes here + ] +} diff --git a/gencode/java/udmi/schema/Category.java b/gencode/java/udmi/schema/Category.java index 1ee2f320e4..207acc8b21 100644 --- a/gencode/java/udmi/schema/Category.java +++ b/gencode/java/udmi/schema/Category.java @@ -1,16 +1,34 @@ -package udmi.schema; +[**UDMI**](../../) / [**Docs**](../) / [**Specs**](./) / [Categories](#) -import static udmi.schema.Level.DEBUG; -import static udmi.schema.Level.NOTICE; +# Entry Error Categories -// This class is manually curated, auto-generated, and then copied into the gencode directory. -// Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md -public class Category { +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`. Some categories come with +implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy below. - public static final String SYSTEM_CONFIG_RECEIVE ="system.config.receive"; - public static final Level SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; - public static final String SYSTEM_CONFIG_PARSE ="system.config.parse"; - public static final Level SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; - public static final String SYSTEM_CONFIG_APPLY ="system.config.apply"; - public static final Level SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; -} +* _system_: Basic system operation + * _base_: Baseline system operational messages + * _start_ (**NOTICE**): System is in the process of (re)starting and essentially offline + * _shutdown_ (**NOTICE**): System is shutting down + * _ready_: (**NOTICE**): System is fully ready for operation + * _comms_: Baseline message handling + * _config_: Configuration message handling + * _receive_: (**DEBUG**) Receiving a config message + * _parse_: (**DEBUG**) Parsing a received message + * _apply_: (**NOTICE**) Application of a parsed config message + * _network_: Network (IP) message handling + * _connect_: (**NOTICE**) Connected to the network + * _disconnect_: (**NOTICE**) Disconnected from a network + * _auth_: Authentication to local application (e.g. web server, SSH) + * _login_: (**NOTICE**) Successful login. The entry message should include the username and application + * _logout_: (**NOTICE**) Successful logout + * _fail_: (**WARNING**) Failed authentication attempt. The entry message should include the application +* _pointset_: Handling managing data point conditions + * _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/schema/category.json b/schema/category.json index 11eab86aee..5efd820f15 100644 --- a/schema/category.json +++ b/schema/category.json @@ -1,10 +1,5 @@ { - "description": "A device-specific representation of the category an entry pertains to", - "type": "string", - "examples": ["pointset.points.config"], "oneOf": [ - { "pattern": "^system\\.config\\.receive$" }, - { "pattern": "^system\\.config\\.parse" }, - { "pattern": "^system\\.config\\.apply" } - ] + @@ gencode stuff goes here + ] } From 9564141caafcaa202dda13824345efd6ca088032 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 05:14:06 -0700 Subject: [PATCH 06/70] Basic category handling --- bin/gencode_categories | 33 +++++++++++++++++++++++++-------- docs/specs/categories.md | 4 ++-- etc/category.json | 1 + schema/category.json | 25 ++++++++++++++++++++++++- 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/bin/gencode_categories b/bin/gencode_categories index b476ba0098..7bd62259c1 100755 --- a/bin/gencode_categories +++ b/bin/gencode_categories @@ -6,19 +6,36 @@ import os import shutil import sys +GENCODE_MARKER = '@@ ' +CATEGORY_MARKER = '* ' +CATEGORY_REGEX = '* _([a-z]+)_: (\(\*\*([A-Z]+)\*\*\) )?(.*)' + doc_in = os.path.join('docs/specs/categories.md') schema_in = os.path.join('etc/category.json') schema_out = os.path.join('schema/category.json') java_in = os.path.join('etc/Category.java') java_out = os.path.join('gencode/java/udmi/schema/Category.java') -lines=[] +def read_categories(): + categories = [] + with open(doc_in) as doc: + while line := doc.readline(): + if line.strip().startswith(CATEGORY_MARKER): + categories += line + return categories -with open(doc_in) as doc: - lines = doc.readlines(); +def write_schema_out(categories): + with open(schema_in) as inp: + with open(schema_out, 'w') as out: + while line := inp.readline(): + if line.strip().startswith(GENCODE_MARKER): + write_schema_categories(out, categories) + else: + out.write(line) -with open(schema_in) as inp: - with open(schema_out, 'w') as out: - while line := inp.readline(): - out.write(line) - +def write_schema_categories(out, categories): + for category in categories: + out.write(category) + +categories = read_categories() +write_schema_out(categories) diff --git a/docs/specs/categories.md b/docs/specs/categories.md index 207acc8b21..7535e89bd6 100644 --- a/docs/specs/categories.md +++ b/docs/specs/categories.md @@ -10,8 +10,8 @@ implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy be * _system_: Basic system operation * _base_: Baseline system operational messages - * _start_ (**NOTICE**): System is in the process of (re)starting and essentially offline - * _shutdown_ (**NOTICE**): System is shutting down + * _start_: (**NOTICE**) System is in the process of (re)starting and essentially offline + * _shutdown_: (**NOTICE**) System is shutting down * _ready_: (**NOTICE**): System is fully ready for operation * _comms_: Baseline message handling * _config_: Configuration message handling diff --git a/etc/category.json b/etc/category.json index 5efd820f15..1995f70a6b 100644 --- a/etc/category.json +++ b/etc/category.json @@ -1,5 +1,6 @@ { "oneOf": [ + // auto-generated category mappings from bin/gencode_categories @@ gencode stuff goes here ] } diff --git a/schema/category.json b/schema/category.json index 5efd820f15..fb7e4f6b17 100644 --- a/schema/category.json +++ b/schema/category.json @@ -1,5 +1,28 @@ { "oneOf": [ - @@ gencode stuff goes here + // auto-generated category mappings from bin/gencode_categories +* _system_: Basic system operation + * _base_: Baseline system operational messages + * _start_ (**NOTICE**): System is in the process of (re)starting and essentially offline + * _shutdown_ (**NOTICE**): System is shutting down + * _ready_: (**NOTICE**): System is fully ready for operation + * _comms_: Baseline message handling + * _config_: Configuration message handling + * _receive_: (**DEBUG**) Receiving a config message + * _parse_: (**DEBUG**) Parsing a received message + * _apply_: (**NOTICE**) Application of a parsed config message + * _network_: Network (IP) message handling + * _connect_: (**NOTICE**) Connected to the network + * _disconnect_: (**NOTICE**) Disconnected from a network + * _auth_: Authentication to local application (e.g. web server, SSH) + * _login_: (**NOTICE**) Successful login. The entry message should include the username and application + * _logout_: (**NOTICE**) Successful logout + * _fail_: (**WARNING**) Failed authentication attempt. The entry message should include the application +* _pointset_: Handling managing data point conditions + * _point_: Conditions relating to a specific point, the entry `message` field should + * _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 ] } From 76f8ad1efd4f22fb01b65bdcebb8038ebde4903c Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 11:33:45 -0700 Subject: [PATCH 07/70] Basic schema catagory generator --- .gencode_hash.txt | 22 +- bin/gencode_categories | 40 +- etc/category.json | 2 +- gencode/docs/event_discovery.html | 1650 +++-- gencode/docs/event_system.html | 381 +- gencode/docs/event_validation.html | 2467 +++++-- gencode/docs/state.html | 6358 ++++++++++++----- gencode/java/udmi/schema/Asset.java | 56 + gencode/java/udmi/schema/Aux.java | 38 + .../java/udmi/schema/BlobBlobsetConfig.java | 105 + .../java/udmi/schema/BlobBlobsetState.java | 51 + gencode/java/udmi/schema/BlobsetConfig.java | 107 + gencode/java/udmi/schema/BlobsetState.java | 51 + gencode/java/udmi/schema/Category.java | 16 + gencode/java/udmi/schema/CloudIotConfig.java | 61 + gencode/java/udmi/schema/CloudModel.java | 121 + gencode/java/udmi/schema/Config.java | 128 + .../udmi/schema/DeviceValidationEvent.java | 71 + .../java/udmi/schema/DiscoveryCommand.java | 63 + gencode/java/udmi/schema/DiscoveryConfig.java | 63 + gencode/java/udmi/schema/DiscoveryEvent.java | 130 + gencode/java/udmi/schema/DiscoveryModel.java | 46 + gencode/java/udmi/schema/DiscoveryState.java | 63 + .../udmi/schema/EndpointConfiguration.java | 61 + gencode/java/udmi/schema/Entry.java | 91 + gencode/java/udmi/schema/Envelope.java | 188 + gencode/java/udmi/schema/Event.java | 75 + .../udmi/schema/FamilyDiscoveryConfig.java | 79 + .../udmi/schema/FamilyDiscoveryEvent.java | 52 + .../udmi/schema/FamilyDiscoveryState.java | 71 + .../schema/FamilyDiscoveryTestingModel.java | 41 + .../java/udmi/schema/FamilyLocalnetModel.java | 52 + gencode/java/udmi/schema/GatewayConfig.java | 53 + gencode/java/udmi/schema/GatewayModel.java | 71 + gencode/java/udmi/schema/GatewayState.java | 45 + gencode/java/udmi/schema/Level.java | 42 + gencode/java/udmi/schema/LocalnetConfig.java | 52 + gencode/java/udmi/schema/LocalnetModel.java | 51 + gencode/java/udmi/schema/Location.java | 58 + gencode/java/udmi/schema/Metadata.java | 159 + gencode/java/udmi/schema/Metrics.java | 62 + gencode/java/udmi/schema/Physical_tag.java | 48 + .../udmi/schema/PointEnumerationEvent.java | 129 + .../java/udmi/schema/PointPointsetConfig.java | 69 + .../java/udmi/schema/PointPointsetEvent.java | 52 + .../java/udmi/schema/PointPointsetModel.java | 157 + .../java/udmi/schema/PointPointsetState.java | 122 + gencode/java/udmi/schema/PointsetConfig.java | 107 + gencode/java/udmi/schema/PointsetEvent.java | 83 + gencode/java/udmi/schema/PointsetModel.java | 71 + gencode/java/udmi/schema/PointsetState.java | 91 + gencode/java/udmi/schema/PointsetSummary.java | 62 + gencode/java/udmi/schema/Position.java | 62 + gencode/java/udmi/schema/Properties.java | 153 + .../java/udmi/schema/PubberConfiguration.java | 96 + gencode/java/udmi/schema/PubberOptions.java | 65 + gencode/java/udmi/schema/ReflectorConfig.java | 71 + gencode/java/udmi/schema/ReflectorState.java | 71 + .../udmi/schema/SetupReflectorConfig.java | 50 + .../java/udmi/schema/SetupReflectorState.java | 45 + gencode/java/udmi/schema/State.java | 118 + gencode/java/udmi/schema/SystemConfig.java | 123 + .../udmi/schema/SystemDiscoveryEvent.java | 74 + gencode/java/udmi/schema/SystemEvent.java | 73 + gencode/java/udmi/schema/SystemHardware.java | 80 + gencode/java/udmi/schema/SystemModel.java | 75 + gencode/java/udmi/schema/SystemState.java | 139 + .../java/udmi/schema/TargetTestingModel.java | 60 + gencode/java/udmi/schema/TestingModel.java | 46 + gencode/java/udmi/schema/ValidationEvent.java | 137 + .../java/udmi/schema/ValidationSummary.java | 59 + gencode/python/udmi/schema/__init__.py | 5 +- gencode/python/udmi/schema/category.py | 6 +- schema/category.json | 35 +- 74 files changed, 13102 insertions(+), 2925 deletions(-) create mode 100644 gencode/java/udmi/schema/Asset.java create mode 100644 gencode/java/udmi/schema/Aux.java create mode 100644 gencode/java/udmi/schema/BlobBlobsetConfig.java create mode 100644 gencode/java/udmi/schema/BlobBlobsetState.java create mode 100644 gencode/java/udmi/schema/BlobsetConfig.java create mode 100644 gencode/java/udmi/schema/BlobsetState.java create mode 100644 gencode/java/udmi/schema/Category.java create mode 100644 gencode/java/udmi/schema/CloudIotConfig.java create mode 100644 gencode/java/udmi/schema/CloudModel.java create mode 100644 gencode/java/udmi/schema/Config.java create mode 100644 gencode/java/udmi/schema/DeviceValidationEvent.java create mode 100644 gencode/java/udmi/schema/DiscoveryCommand.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/DiscoveryModel.java create mode 100644 gencode/java/udmi/schema/DiscoveryState.java create mode 100644 gencode/java/udmi/schema/EndpointConfiguration.java create mode 100644 gencode/java/udmi/schema/Entry.java create mode 100644 gencode/java/udmi/schema/Envelope.java create mode 100644 gencode/java/udmi/schema/Event.java create mode 100644 gencode/java/udmi/schema/FamilyDiscoveryConfig.java create mode 100644 gencode/java/udmi/schema/FamilyDiscoveryEvent.java create mode 100644 gencode/java/udmi/schema/FamilyDiscoveryState.java create mode 100644 gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java create mode 100644 gencode/java/udmi/schema/FamilyLocalnetModel.java create mode 100644 gencode/java/udmi/schema/GatewayConfig.java create mode 100644 gencode/java/udmi/schema/GatewayModel.java create mode 100644 gencode/java/udmi/schema/GatewayState.java create mode 100644 gencode/java/udmi/schema/Level.java create mode 100644 gencode/java/udmi/schema/LocalnetConfig.java create mode 100644 gencode/java/udmi/schema/LocalnetModel.java create mode 100644 gencode/java/udmi/schema/Location.java create mode 100644 gencode/java/udmi/schema/Metadata.java create mode 100644 gencode/java/udmi/schema/Metrics.java create mode 100644 gencode/java/udmi/schema/Physical_tag.java create mode 100644 gencode/java/udmi/schema/PointEnumerationEvent.java create mode 100644 gencode/java/udmi/schema/PointPointsetConfig.java create mode 100644 gencode/java/udmi/schema/PointPointsetEvent.java create mode 100644 gencode/java/udmi/schema/PointPointsetModel.java create mode 100644 gencode/java/udmi/schema/PointPointsetState.java create mode 100644 gencode/java/udmi/schema/PointsetConfig.java create mode 100644 gencode/java/udmi/schema/PointsetEvent.java create mode 100644 gencode/java/udmi/schema/PointsetModel.java create mode 100644 gencode/java/udmi/schema/PointsetState.java create mode 100644 gencode/java/udmi/schema/PointsetSummary.java create mode 100644 gencode/java/udmi/schema/Position.java create mode 100644 gencode/java/udmi/schema/Properties.java create mode 100644 gencode/java/udmi/schema/PubberConfiguration.java create mode 100644 gencode/java/udmi/schema/PubberOptions.java create mode 100644 gencode/java/udmi/schema/ReflectorConfig.java create mode 100644 gencode/java/udmi/schema/ReflectorState.java create mode 100644 gencode/java/udmi/schema/SetupReflectorConfig.java create mode 100644 gencode/java/udmi/schema/SetupReflectorState.java create mode 100644 gencode/java/udmi/schema/State.java create mode 100644 gencode/java/udmi/schema/SystemConfig.java create mode 100644 gencode/java/udmi/schema/SystemDiscoveryEvent.java create mode 100644 gencode/java/udmi/schema/SystemEvent.java create mode 100644 gencode/java/udmi/schema/SystemHardware.java create mode 100644 gencode/java/udmi/schema/SystemModel.java create mode 100644 gencode/java/udmi/schema/SystemState.java create mode 100644 gencode/java/udmi/schema/TargetTestingModel.java create mode 100644 gencode/java/udmi/schema/TestingModel.java create mode 100644 gencode/java/udmi/schema/ValidationEvent.java create mode 100644 gencode/java/udmi/schema/ValidationSummary.java diff --git a/.gencode_hash.txt b/.gencode_hash.txt index f21e698324..9a7efaece6 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,26 +1,23 @@ f5cf191b0151d2142fa634d1deafb93e35041d5b9ae89b26beab32fa25fb9521 gencode/docs/config.html 90679d3d866579501e7aa00b515af05d42fc9fe399eafacaacf297d1e4a22884 gencode/docs/envelope.html -438122f7b9fdfd6ab8edd57f667628b512fab43e51dc6a7efaa47d919bef98f5 gencode/docs/event_discovery.html +fce52420e4567cd205fbc391e3eafd86f6b0bd652c9fc39f3584eabb75becd05 gencode/docs/event_discovery.html 8133e380e40f27c56accbffc665b2eeb56ec84a4da3b52ba7aa5e439c9c40572 gencode/docs/event_pointset.html -aa0aa5ed4b6b5794ec1525ae3fe8ce7465df5f6129452865c2cb26886d398949 gencode/docs/event_system.html -aad8f0c65e80a128a95050f445a2dec53d6f11a5c1ec2c4ad64b7e645ccf4065 gencode/docs/event_validation.html +528c17ecd3d8faf899a262fb197401e98ea493ab544f42ffc29457eae6889971 gencode/docs/event_system.html +0fb7c664009830023095e254c8f143d3554be64fee28bde8b93cdf51e37d1b68 gencode/docs/event_validation.html f48026471ae3cd7867bce416dc21c2fb728f48d8476a8d6e95f6acaf1d8b6cf3 gencode/docs/index.html 6d5081d04c86f8bd444efb41cd788826aa66802d37e8f98e93b6b75425542d5e gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js -0758383757b0dbd4a1fbfb1531a0424033541ddf576be66fb09b883599225147 gencode/docs/state.html +3737c048cda80c9296206697e43c98dbe9ef4b246719c16b7450c4d68a194088 gencode/docs/state.html d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/udmi/schema/Asset.java 0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java d326a550d75ab7f558f165f1a5e8c24eee2b0b52290a7472f529bb1e15d79fb2 gencode/java/udmi/schema/BlobBlobsetConfig.java 2c03651cb2ecda072b1418222eebb5560185669f8ffdd03021ad5ad8ff7ba3b0 gencode/java/udmi/schema/BlobBlobsetState.java 3fccb6bc6714fdc3dd912c8b1155e7ce19b0ac8a7ec48a01be9eb27bdd034a75 gencode/java/udmi/schema/BlobsetConfig.java fcbed49f1af8b791d8c52bcbe18f65521a79d9ac3eb33ec3afd9b342ab2bfc56 gencode/java/udmi/schema/BlobsetState.java -<<<<<<< HEAD eb457036f822e67c87f203493c29bfebfe5118de2c3a8b5b71b3e623e66e8535 gencode/java/udmi/schema/Category.java -======= d6875f63ce67d1b945a0b75a4a660bd083cc52492371a7350c4109f6bf54968b gencode/java/udmi/schema/CloudIotConfig.java ->>>>>>> master a2eeff86f4302272736d84602e2ca36a64d27c8ef6761cc05ffb8ad17b030d4d gencode/java/udmi/schema/CloudModel.java ff79de9390aa25bb45fb3e2ebb682c865ccab764f56d9644377d9d28c0ab10e4 gencode/java/udmi/schema/Config.java d4a82e132b2d223c4a82384d22455283c0b64aba3100fc210e72f9700b9df2d0 gencode/java/udmi/schema/DeviceValidationEvent.java @@ -30,7 +27,7 @@ d8a80ab3180d33bfa17564c969018e1d4350a47dbc70c4ae8a5abbfb25cfedc9 gencode/java/u 04112dd47b0f761131c276c67d3cd8b789d25e6716b5732be9fef14fc6831f1d gencode/java/udmi/schema/DiscoveryModel.java 9962b0eb7d5adf52af6160e9f3131f8eeb52ae9e518954dbb6aead1bcad0245e gencode/java/udmi/schema/DiscoveryState.java 4e64cf10484266a297fb418b165dd84a9f4b8c2e53520b33915cc96365151fc2 gencode/java/udmi/schema/EndpointConfiguration.java -090bbaf1508aa6ca8380af936af990673f300eb5a940c9e8ab94deb64efa2b7b gencode/java/udmi/schema/Entry.java +885859ea9de29217186c34f3a90b112411d1beddaf58a88b85e7934cd3c92b6f gencode/java/udmi/schema/Entry.java cd362f94454eba8fd5ce3fce5d5e2b5f046d0dd9c35b01de69ef4d2e38413cc5 gencode/java/udmi/schema/Envelope.java e9f5c77be81486b6b8c6d88f70f2d50583d8c3fafa2ac09ead80f44b8d5e751e gencode/java/udmi/schema/Event.java aa0885ca43ab38c7597eacc38b7c512940a1a9fa061abd47d02c28e66b6fd93e gencode/java/udmi/schema/FamilyDiscoveryConfig.java @@ -77,15 +74,10 @@ e0f70f8e2c4793ebd05a38dc249d329eaa5b0171097ecc5fad4630fa0df3536d gencode/java/u d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/udmi/schema/TestingModel.java 347da3d586ff6e5dcf3ce8ec0c800ec0efd5fed4e0c80eef35de65ad92ae48bf gencode/java/udmi/schema/ValidationEvent.java e007ddd1ceeae3603c85110c33e1bb4a418ff9c7a791ca0df25b7ea3caeafd36 gencode/java/udmi/schema/ValidationSummary.java -<<<<<<< HEAD -92d6dbfce8879bb25c7d98350bf368ad5abdbe9a1aab47daf3004d067c7ae48a gencode/python/udmi/schema/__init__.py -4b25dd95f863059b761269f93adcae7049507924a1c6e74d6856849203c179db gencode/python/udmi/schema/ancillary_properties.py -d8092388082be9e234cc9ea537549fa86b595db889b0a526e0aa7e26a5a29b98 gencode/python/udmi/schema/category.py -======= -32e82ac7f7e20c77ab5d40d3de0a06c3934267d449b243bb9cad48493974c306 gencode/python/udmi/schema/__init__.py +c9c472f3d4b19603f0fb9c20539da700ab02bc95deed739c325a4f0df5cf25c0 gencode/python/udmi/schema/__init__.py 4b25dd95f863059b761269f93adcae7049507924a1c6e74d6856849203c179db gencode/python/udmi/schema/ancillary_properties.py +48a75ea67083eb6cb1546cda3756468baaf449fc2f26e72a10b6cb58533aa904 gencode/python/udmi/schema/category.py a61b1c5732f01b7efda41a773d5786fad755f371193ce4478b458387ca2a8fe8 gencode/python/udmi/schema/cloud_iot_config.py ->>>>>>> master 6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 2082a9f3ff4d37bb13a647932fcacb99499f71569cd9dc12d5e63dead34fee63 gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py diff --git a/bin/gencode_categories b/bin/gencode_categories index 7bd62259c1..a9420c2b54 100755 --- a/bin/gencode_categories +++ b/bin/gencode_categories @@ -2,13 +2,15 @@ import hashlib import json +import re import os import shutil import sys GENCODE_MARKER = '@@ ' CATEGORY_MARKER = '* ' -CATEGORY_REGEX = '* _([a-z]+)_: (\(\*\*([A-Z]+)\*\*\) )?(.*)' +CATEGORY_REGEX = ' *\\* _([a-z]+)_: (\(\*\*([A-Z]+)\*\*\) )?(.*)' +JSON_FORMAT = '%s { "pattern": "^%s$" }' doc_in = os.path.join('docs/specs/categories.md') schema_in = os.path.join('etc/category.json') @@ -16,12 +18,37 @@ schema_out = os.path.join('schema/category.json') java_in = os.path.join('etc/Category.java') java_out = os.path.join('gencode/java/udmi/schema/Category.java') + +def calculate_index_level(line): + if not line.strip().startswith(CATEGORY_MARKER): + return -1 + return line.find(CATEGORY_MARKER)//2 + def read_categories(): categories = [] + prefix = [] + previous = -1 + group = None with open(doc_in) as doc: while line := doc.readline(): - if line.strip().startswith(CATEGORY_MARKER): - categories += line + level = calculate_index_level(line) + match = re.match(CATEGORY_REGEX, line) + if level < 0 or not match: + continue + if level < previous: + for _ in range(level, previous): + prefix.pop(len(prefix) - 1) + elif level > previous: + if group: + prefix.append(group) + previous = level + group = match.group(1) + category = '.'.join(prefix + [group]) + level = match.group(3) + description = match.group(4) + if level: + entry = (category, level, description) + categories.append(entry) return categories def write_schema_out(categories): @@ -34,8 +61,13 @@ def write_schema_out(categories): out.write(line) def write_schema_categories(out, categories): + first = True for category in categories: - out.write(category) + prefix = '' if first else ',\n' + target = category[0].replace('.', '\\\\.') + out.write(JSON_FORMAT % (prefix, target)) + first = False + out.write('\n') categories = read_categories() write_schema_out(categories) diff --git a/etc/category.json b/etc/category.json index 1995f70a6b..39ec940909 100644 --- a/etc/category.json +++ b/etc/category.json @@ -1,6 +1,6 @@ { + "$comment": "Auto-generated category mappings from bin/gencode_categories.", "oneOf": [ - // auto-generated category mappings from bin/gencode_categories @@ gencode stuff goes here ] } diff --git a/gencode/docs/event_discovery.html b/gencode/docs/event_discovery.html index 0eb910c304..2a6f334a3b 100644 --- a/gencode/docs/event_discovery.html +++ b/gencode/docs/event_discovery.html @@ -284,9 +284,8 @@

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" /> - category

Type: string
-

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

-
+ category

Type: object
+

@@ -305,6 +304,41 @@

id="status_category_oneOf_i2" data-toggle="tab" href="#tab-pane_status_category_oneOf_i2" role="tab" onclick="setAnchor('#status_category_oneOf_i2')" >Option 3 +
@@ -339,7 +373,7 @@

/> item 0

Type: object
-Must match regular expression: ^system\.config\.receive$ +Must match regular expression: ^system\.base\.start$ @@ -379,7 +413,7 @@

/> item 1

Type: object
-Must match regular expression: ^system\.config\.parse +Must match regular expression: ^system\.base\.shutdown$ @@ -419,42 +453,17 @@

/> item 2

Type: object
-Must match regular expression: ^system\.config\.apply +Must match regular expression: ^system\.config\.receive$ -

- - - +
-
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ category + + + + oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
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: string
-

The primary scan discovery address family

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

- -

-
- -
-
- - Type: string
-

The primary id of the device (for scan_family)

-
+ item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
-
- -
-
-
-

- -

-
- -
-
+
+ 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 + oneOf + + + + item 5
Type: object
+Must match regular expression: ^system\.network\.connect$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

Device id in the namespace of the given family

-
Must match regular expression: ^[-_.:0-9A-Z]+$ + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.disconnect$ -
-
-
-
-
-
-
-
-
-
+
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + + + + + + + + +
+
+
+

+ +

+
+ +
+
+ + 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: string
+

The primary scan discovery address family

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

+ +

+
+ +
+
+ + Type: string
+

The primary id of the device (for scan_family)

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

+ +

+
+ +
+
+ + 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-Z0-9]+$ +
+ + Type: object
+

Object representation for for a single point enumeration

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

+ +

+
+ +
+
+ + Type: string
+

Friendly name for the point, if known

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

- +

-
+
Type: object
-

Collection of data points available for this device.

-
No Additional Properties + uniqs + + + + Point Enumeration Event + + + + possible_values
Type: array of string
+

List of possible enumerated values for the point

+
+

Each item of this array must be:

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

- +

-
-

- -

-

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

- Property name regular expression: ^[-_.:/a-zA-Z0-9]+$ -
+
+
+ + 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: object
-

Object representation for for a single point enumeration

+ Point Enumeration Event + + + + writable
Type: boolean
+

Indicates if this point is writable or not

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

- +

-
+
Type: string
-

Friendly name for the point, if known

+ description
Type: string
+

Human-readable description of this point

@@ -855,18 +1495,18 @@

-
+
-
+

- +

-
+
Type: array of string
-

List of possible enumerated values for the point

-
+ status
Type: object
+ + + No Additional Properties -

Each item of this array must be:

-
-
+
+
+
+

+ +

+
+ +
+
Type: string
- + message
Type: string
+

A human-readable one-line description of the entry

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

- +

-
+
Type: string
-

Current or default unit for this point

+ status + + + + detail
Type: string
+

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

@@ -993,18 +1654,18 @@

-
+
-
+

- +

-
+
Type: string
-

Current or default type for this point

-
- + status + + + + category
Type: object
+ +

+ +

+
+ + Type: object
+Must match regular expression: ^system\.base\.start$ -
-
-
-
-
-
-
-

- -

-
+ -
-
+ +
+ Type: string
-

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

-
+ item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: boolean
-

Indicates if this point is writable or not

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

- -

-
- -
-
- - Type: string
-

Human-readable description of this point

-
+ item 2
Type: object
+Must match regular expression: ^system\.config\.receive$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
- - - No Additional Properties + status + + + + category + + + + oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ category + + + + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 5
Type: object
+Must match regular expression: ^system\.network\.connect$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.config\.receive$ + item 7
Type: object
+Must match regular expression: ^system\.auth\.login$ @@ -1463,7 +2185,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i8" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse + item 8
Type: object
+Must match regular expression: ^system\.auth\.logout$ @@ -1517,7 +2239,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i9" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply + item 9
Type: object
+Must match regular expression: ^system\.auth\.fail$ @@ -1576,11 +2298,7 @@

-
-
Example:
-
"pointset.points.config"
-
-
+

diff --git a/gencode/docs/event_system.html b/gencode/docs/event_system.html index 7d07bce37d..d6912c3002 100644 --- a/gencode/docs/event_system.html +++ b/gencode/docs/event_system.html @@ -293,9 +293,8 @@

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" /> - category

Type: string
-

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

-
+ category
Type: object
+

@@ -314,6 +313,41 @@

id="logentries_items_category_oneOf_i2" data-toggle="tab" href="#tab-pane_logentries_items_category_oneOf_i2" role="tab" onclick="setAnchor('#logentries_items_category_oneOf_i2')" >Option 3 +
@@ -355,7 +389,7 @@

/> item 0

Type: object
-Must match regular expression: ^system\.config\.receive$ +Must match regular expression: ^system\.base\.start$ @@ -402,7 +436,7 @@

/> item 1

Type: object
-Must match regular expression: ^system\.config\.parse +Must match regular expression: ^system\.base\.shutdown$ @@ -449,7 +483,336 @@

/> item 2

Type: object
-Must match regular expression: ^system\.config\.apply +Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ @@ -462,11 +825,7 @@

-
-
Example:
-
"pointset.points.config"
-
-
+

diff --git a/gencode/docs/event_validation.html b/gencode/docs/event_validation.html index df3e6fc844..6d0cf434d9 100644 --- a/gencode/docs/event_validation.html +++ b/gencode/docs/event_validation.html @@ -348,9 +348,8 @@

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" /> - category

Type: string
-

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

-
+ category
Type: object
+

@@ -369,6 +368,41 @@

id="status_category_oneOf_i2" data-toggle="tab" href="#tab-pane_status_category_oneOf_i2" role="tab" onclick="setAnchor('#status_category_oneOf_i2')" >Option 3 +
@@ -403,7 +437,7 @@

/> item 0

Type: object
-Must match regular expression: ^system\.config\.receive$ +Must match regular expression: ^system\.base\.start$ @@ -443,7 +477,7 @@

/> item 1

Type: object
-Must match regular expression: ^system\.config\.parse +Must match regular expression: ^system\.base\.shutdown$ @@ -483,42 +517,17 @@

/> item 2

Type: object
-Must match regular expression: ^system\.config\.apply +Must match regular expression: ^system\.config\.receive$ -
- - - +
-
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ category + + + + oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
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
-

Errors specific to pointset handling

-
No Additional Properties + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
-
-

- -

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

Missing points discovered while validating a device

-
+ category + + + + oneOf + + + + item 5
Type: object
+Must match regular expression: ^system\.network\.connect$ -

Each item of this array must be:

-
-
+ +
Type: string
- + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.disconnect$ -
-
-
-
-
-
-
-
-
-

- -

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

Extra points discovered while validating a device

-
+ category + + + + oneOf + + + + item 7
Type: object
+Must match regular expression: ^system\.auth\.login$ -

Each item of this array must be:

-
-
+ +
Type: string
- + oneOf + + + + item 8
Type: object
+Must match regular expression: ^system\.auth\.logout$ -
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: array
-

List of errors encountered while validating a device

-
- - - - - -

Each item of this array must be:

-
-
- - - Type: object
+ oneOf + + + + item 9
Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + - No Additional Properties + +
-
+
+
+
+
+
-
+

- +

-
+
Type: string
-

A human-readable one-line description of the entry

+ timestamp
Type: string
+

Timestamp the condition was triggered, or most recently updated

@@ -888,25 +853,25 @@


Example:
-
"Point is not writable"
+
"2018-08-26T21:39:28.364Z"
 

-
+
-
+

- +

-
+
Type: string
-

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

+ level
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
+

Errors specific to pointset handling

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

+ +

+
+ +
+
+ + Type: string
-

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

+ missing
Type: array of string
+

Missing points discovered while validating a device

+ -

- -

-
+ + + +

Each item of this array must be:

+
+
Type: object
-Must match regular expression: ^system\.config\.receive$ + missing items
Type: string
+ -
- +
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
Type: array of string
+

Extra points discovered while validating a device

+
+ + + + + +

Each item of this array must be:

+
+
+ + + Type: object
-Must match regular expression: ^system\.config\.parse - + extra items
Type: string
- -
- +
+
+
+
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: array
+

List of errors encountered while validating a device

+
+ + + + + +

Each item of this array must be:

+
+
+ + + Type: object
-Must match regular expression: ^system\.config\.apply - + entry
Type: object
- - - -
+ No Additional Properties -
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
+ +
-
+

- +

-
+
Type: string
-

Timestamp the condition was triggered, or most recently updated

+ message
Type: string
+

A human-readable one-line description of the entry

@@ -1201,25 +1198,25 @@


Example:
-
"2018-08-26T21:39:28.364Z"
+
"Point is not writable"
 

-
+
-
+

- +

-
+
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).

+ detail
Type: string
+

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

-

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: array of string
- - + category
Type: object
- - -

Each item of this array must be:

-
-
+

+ +

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

- -

-
- -
-
- - Type: array of string
- + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ -

Each item of this array must be:

-
-
+ +
Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + 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: array of string
+ + + + + + +

Each item of this array must be:

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

+ +

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

Each item of this array must be:

+
+
+ + +

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

+ +

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

Each item of this array must be:

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

+ +

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

Each item of this array must be:

+
+
+ + + 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]{2,6}-[0-9]{1,6}$ +
+ + Type: object
+

Validation summary information for an individual device.

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

+ +

+
+ +
+
+ + Type: string
+

Last time any message from this device was received

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

+ +

+
+ +
+
+ + Type: string
+

Oldest recorded mark for this device

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

+ +

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

- +

-
+
Type: array of string
- + Device Validation Event + + + + status + + + + message
Type: string
+

A human-readable one-line description of the entry

+
-

Each item of this array must be:

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

+ +

+
+ +
+
Type: string
- + status + + + + detail
Type: string
+

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

+
-
-
-
+
-
+

- +

-
+
Type: array of string
- - + Device Validation Event + + + + status + + + + category
Type: object
- - -

Each item of this array must be:

-
-
+

+ +

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

- -

-
- -
-
- - Type: object
- No Additional Properties + category + + + + oneOf + + + + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ -
-
-
-

- -

-
- -
-

- -

-

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

- Property name regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ -
+
+ Type: object
-

Validation summary information for an individual device.

-
- - No Additional Properties + oneOf + + + + item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

Last time any message from this device was received

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

- -

-
- -
-
- - Type: string
-

Oldest recorded mark for this device

-
+ item 2
Type: object
+Must match regular expression: ^system\.config\.receive$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
- - - No Additional Properties + status + + + + category + + + + oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ category + + + + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 5
Type: object
+Must match regular expression: ^system\.network\.connect$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.config\.receive$ + item 7
Type: object
+Must match regular expression: ^system\.auth\.login$ @@ -2046,7 +3127,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i8" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse + item 8
Type: object
+Must match regular expression: ^system\.auth\.logout$ @@ -2100,7 +3181,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i9" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply + item 9
Type: object
+Must match regular expression: ^system\.auth\.fail$ @@ -2159,11 +3240,7 @@

-
-
Example:
-
"pointset.points.config"
-
-
+

diff --git a/gencode/docs/state.html b/gencode/docs/state.html index 24a00e7c70..8e10909058 100644 --- a/gencode/docs/state.html +++ b/gencode/docs/state.html @@ -1025,9 +1025,8 @@

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" /> - category

Type: string
-

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

-
+ category
Type: object
+

@@ -1046,6 +1045,41 @@

id="system_status_category_oneOf_i2" data-toggle="tab" href="#tab-pane_system_status_category_oneOf_i2" role="tab" onclick="setAnchor('#system_status_category_oneOf_i2')" >Option 3 +
@@ -1087,7 +1121,7 @@

/> item 0

Type: object
-Must match regular expression: ^system\.config\.receive$ +Must match regular expression: ^system\.base\.start$ @@ -1134,7 +1168,7 @@

/> item 1

Type: object
-Must match regular expression: ^system\.config\.parse +Must match regular expression: ^system\.base\.shutdown$ @@ -1181,42 +1215,17 @@

/> item 2

Type: object
-Must match regular expression: ^system\.config\.apply +Must match regular expression: ^system\.config\.receive$ -
- - - +
-
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ category + + + + oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
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 + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
-
-

- -

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

- -

-
- -
-

Each additional property must conform to the following schema

- - Type: object
- No Additional Properties + item 5
Type: object
+Must match regular expression: ^system\.network\.connect$ -
-
-
-

- -

-
- -
-
+
+ Type: object
- - - No Additional Properties + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.disconnect$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ item 7
Type: object
+Must match regular expression: ^system\.auth\.login$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ item 8
Type: object
+Must match regular expression: ^system\.auth\.logout$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

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

-
+ item 9
Type: object
+Must match regular expression: ^system\.auth\.fail$ + -

- -

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

+ +

+
+ +
+
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
-Must match regular expression: ^system\.config\.receive$ + gateway
Type: object
+

Gateway Documentation

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

+ +

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

+ +

+
+ +
+

Each additional property must conform to the following schema

+ + Type: object
-Must match regular expression: ^system\.config\.parse + additionalProperties
Type: object
+ No Additional Properties -
- - - -
-
-
-
+ +
-
+

- +

-
+
Type: string
-

Timestamp the condition was triggered, or most recently updated

+ message
Type: string
+

A human-readable one-line description of the entry

@@ -1934,25 +1896,25 @@


Example:
-
"2018-08-26T21:39:28.364Z"
+
"Point is not writable"
 

-
+
-
+

- +

-
+
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).

+ detail
Type: string
+

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

-

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

-
- + category
Type: object
- - +

+ +

+
-
-
-
-
-
-
-
-

- -

-
- -
-
Type: boolean
-

Indicates if the discovery process is currently active

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

- -

-
- -
-
- - Type: object
-

Status information about the discovery operation

-
- - No Additional Properties + oneOf + + + + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ status + + + + category + + + + oneOf + + + + item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

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

- -

-
- -
-
- - Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: string
-

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

-
- -

- -

-
- - - Type: object
-Must match regular expression: ^system\.config\.receive$ + item 3
Type: object
+Must match regular expression: ^system\.config\.parse$ @@ -2469,7 +2315,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i4" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ @@ -2523,7 +2376,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i5" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply - - - + oneOf + + + + item 5
Type: object
+Must match regular expression: ^system\.network\.connect$ -
+
-
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ status + + + + category + + + + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.disconnect$ -
-
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 + oneOf + + + + item 7
Type: object
+Must match regular expression: ^system\.auth\.login$ -
-
-
-

- -

-
- -
-

- -

-

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 + additionalProperties + + + + status + + + + category + + + + oneOf + + + + item 8
Type: object
+Must match regular expression: ^system\.auth\.logout$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

Generational marker for controlling discovery

-
+ status + + + + category + + + + oneOf + + + + item 9
Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
@@ -2860,18 +2691,18 @@

-
+
-
+

- +

-
+
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: object
+ + +

+ +

+
+ + + Type: object
+Must match regular expression: ^system\.base\.start$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + 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: object
+ + +

+ +

+
+ + + Type: object
+Must match regular expression: ^system\.base\.start$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + 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: 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: 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: object
+ + +

+ +

+
+ + + Type: object
+Must match regular expression: ^system\.base\.start$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
+ + + Type: boolean
-

Indicates if the discovery process is currently active

-
+ item 2
Type: object
+Must match regular expression: ^system\.config\.receive$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
-

Status information about the discovery operation

-
- - No Additional Properties + status + + + + category + + + + oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ category + + + + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 5
Type: object
+Must match regular expression: ^system\.network\.connect$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.config\.receive$ + item 7
Type: object
+Must match regular expression: ^system\.auth\.login$ @@ -3229,7 +6085,7 @@

+ id="tab-pane_blobset_blobs_pattern1_status_category_oneOf_i8" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse + item 8
Type: object
+Must match regular expression: ^system\.auth\.logout$ @@ -3290,7 +6146,7 @@

+ id="tab-pane_blobset_blobs_pattern1_status_category_oneOf_i9" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply + item 9
Type: object
+Must match regular expression: ^system\.auth\.fail$ @@ -3356,27 +6212,23 @@

-
-
Example:
-
"pointset.points.config"
-
-
+

-
+
-
+

- +

-
+
Type: string
+ timestamp
Type: string

Timestamp the condition was triggered, or most recently updated

@@ -3424,25 +6276,25 @@


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

-
+
-
+

- +

-
+
Type: integer
+ level
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

+

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


Example:
-
600
+
600
 
@@ -3513,18 +6365,18 @@

-
+
-
+

- +

-
+
Type: object
+ pointset
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 @@ -3544,18 +6563,18 @@

-
+
-
+

- +

-
+
Type: object
- No Additional Properties + status + + + + message
Type: string
+

A human-readable one-line description of the entry

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

- +

-
-

- -

-

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 + detail
Type: string
+

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

+
-
+
+
+
+
+
-
+

- +

-
+
Type: object
- - - No Additional Properties - + category
Type: object
- - +

+ +

+
-
-
-
-

- -

-
- -
-
Type: string
-

A human-readable one-line description of the entry

-
+ item 0
Type: object
+Must match regular expression: ^system\.base\.start$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

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

-
+ item 2
Type: object
+Must match regular expression: ^system\.config\.receive$ + -

- -

-
+ + + + +
Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.config\.receive$ + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ @@ -3943,7 +6990,7 @@

+ id="tab-pane_pointset_status_category_oneOf_i5" role="tabpanel"> Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.config\.parse - - - - - - -
- - - Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.config\.apply - - - + oneOf + + + + item 7
Type: object
+Must match regular expression: ^system\.auth\.login$ -
+
-
-
Example:
-
"pointset.points.config"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ item 8
Type: object
+Must match regular expression: ^system\.auth\.logout$ -
-
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).

-
+ item 9
Type: object
+Must match regular expression: ^system\.auth\.fail$ -

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.

+ pointset + + + + status + + + + timestamp
Type: string
+

Timestamp the condition was triggered, or most recently updated

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

- +

-
+
Type: string
-

RFC 3339 timestamp the configuration was generated

+ status + + + + level
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:
-
"2019-01-17T14:02:29.364Z"
+
600
 
-
+
+
+
+
+
-
+

- +

-
+
Type: string
-

Version of the UDMI schema

-
+ points
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: 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

+ points + + + + state_pointset_point.json#
Type: object
+

Object representation for for a single point

+ + No Additional Properties -

Must be at most 32 characters long

+ -
-
-
-
-
+
-
+

- +

-
+
Type: object
-

Optional status information about pointset

+ points + + + + Point Pointset State + + + + units
Type: string
+

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

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

- +

-
+
Type: string
-

A human-readable one-line description of the entry

-
+ Point Pointset State + + + + value_state
Type: enum (of string)
+

Optional enumeration indicating the state of the points value.

+
+

Must be one of:

+
  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
+
-
-
Example:
-
"Point is not writable"
-
-
+
-
+
-
+

- +

-
+
Type: string
-

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

+ Point Pointset State + + + + status
Type: object
+

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

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

- +

-
+
Type: string
-

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

+ message
Type: string
+

A human-readable one-line description of the entry

+ -

- -

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

+ +

+
+ +
+
Type: object
-Must match regular expression: ^system\.config\.receive$ + detail
Type: string
+

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

+
-
- +
+
+
+
+
+
+
+

+ +

+
+ +
+
Type: object
-Must match regular expression: ^system\.config\.parse - + category
Type: object
- - - -
+

+ +

+
Type: object
-Must match regular expression: ^system\.config\.apply - - - + category + + + + oneOf + + + + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ -
+
-
-
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 - - - - - + item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
-
-
-
-

- -

-
- -
-

- -

-

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.

-
+ item 2
Type: object
+Must match regular expression: ^system\.config\.receive$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ 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 + item 3
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ category + + + + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 5
Type: object
+Must match regular expression: ^system\.network\.connect$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.config\.receive$ + item 7
Type: object
+Must match regular expression: ^system\.auth\.login$ @@ -5361,7 +8319,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i8" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse + item 8
Type: object
+Must match regular expression: ^system\.auth\.logout$ @@ -5422,7 +8380,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i9" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply + item 9
Type: object
+Must match regular expression: ^system\.auth\.fail$ @@ -5488,11 +8446,7 @@

-
-
Example:
-
"pointset.points.config"
-
-
+

diff --git a/gencode/java/udmi/schema/Asset.java b/gencode/java/udmi/schema/Asset.java new file mode 100644 index 0000000000..44b058c92e --- /dev/null +++ b/gencode/java/udmi/schema/Asset.java @@ -0,0 +1,56 @@ + +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; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "guid", + "site", + "name" +}) +@Generated("jsonschema2pojo") +public class Asset { + + /** + * + * (Required) + * + */ + @JsonProperty("guid") + public String guid; + @JsonProperty("site") + public String site; + /** + * + * (Required) + * + */ + @JsonProperty("name") + public String name; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); + result = ((result* 31)+((this.guid == null)? 0 :this.guid.hashCode())); + result = ((result* 31)+((this.site == null)? 0 :this.site.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Asset) == false) { + return false; + } + Asset rhs = ((Asset) other); + return ((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.guid == rhs.guid)||((this.guid!= null)&&this.guid.equals(rhs.guid))))&&((this.site == rhs.site)||((this.site!= null)&&this.site.equals(rhs.site)))); + } + +} diff --git a/gencode/java/udmi/schema/Aux.java b/gencode/java/udmi/schema/Aux.java new file mode 100644 index 0000000000..da5682d160 --- /dev/null +++ b/gencode/java/udmi/schema/Aux.java @@ -0,0 +1,38 @@ + +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; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "suffix" +}) +@Generated("jsonschema2pojo") +public class Aux { + + @JsonProperty("suffix") + public String suffix; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.suffix == null)? 0 :this.suffix.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Aux) == false) { + return false; + } + Aux rhs = ((Aux) other); + return ((this.suffix == rhs.suffix)||((this.suffix!= null)&&this.suffix.equals(rhs.suffix))); + } + +} diff --git a/gencode/java/udmi/schema/BlobBlobsetConfig.java b/gencode/java/udmi/schema/BlobBlobsetConfig.java new file mode 100644 index 0000000000..03826f9710 --- /dev/null +++ b/gencode/java/udmi/schema/BlobBlobsetConfig.java @@ -0,0 +1,105 @@ + +package udmi.schema; + +import java.net.URI; +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.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; + + +/** + * Blob Blobset Config + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "phase", + "content_type", + "base64", + "url", + "sha256" +}) +@Generated("jsonschema2pojo") +public class BlobBlobsetConfig { + + @JsonProperty("phase") + public BlobBlobsetConfig.Phase phase; + @JsonProperty("content_type") + public String content_type; + @JsonProperty("base64") + public String base64; + @JsonProperty("url") + public URI url; + @JsonProperty("sha256") + public String sha256; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.phase == null)? 0 :this.phase.hashCode())); + result = ((result* 31)+((this.base64 == null)? 0 :this.base64 .hashCode())); + result = ((result* 31)+((this.content_type == null)? 0 :this.content_type.hashCode())); + result = ((result* 31)+((this.sha256 == null)? 0 :this.sha256 .hashCode())); + result = ((result* 31)+((this.url == null)? 0 :this.url.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof BlobBlobsetConfig) == false) { + return false; + } + BlobBlobsetConfig rhs = ((BlobBlobsetConfig) other); + return ((((((this.phase == rhs.phase)||((this.phase!= null)&&this.phase.equals(rhs.phase)))&&((this.base64 == rhs.base64)||((this.base64 != null)&&this.base64 .equals(rhs.base64))))&&((this.content_type == rhs.content_type)||((this.content_type!= null)&&this.content_type.equals(rhs.content_type))))&&((this.sha256 == rhs.sha256)||((this.sha256 != null)&&this.sha256 .equals(rhs.sha256))))&&((this.url == rhs.url)||((this.url!= null)&&this.url.equals(rhs.url)))); + } + + @Generated("jsonschema2pojo") + public enum Phase { + + FINAL("final"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (BlobBlobsetConfig.Phase c: values()) { + CONSTANTS.put(c.value, c); + } + } + + Phase(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static BlobBlobsetConfig.Phase fromValue(String value) { + BlobBlobsetConfig.Phase constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/gencode/java/udmi/schema/BlobBlobsetState.java b/gencode/java/udmi/schema/BlobBlobsetState.java new file mode 100644 index 0000000000..e8e80893a1 --- /dev/null +++ b/gencode/java/udmi/schema/BlobBlobsetState.java @@ -0,0 +1,51 @@ + +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; + + +/** + * Blob Blobset State + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "status" +}) +@Generated("jsonschema2pojo") +public class BlobBlobsetState { + + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + + @Override + public int hashCode() { + int result = 1; + 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 BlobBlobsetState) == false) { + return false; + } + BlobBlobsetState rhs = ((BlobBlobsetState) other); + return ((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))); + } + +} diff --git a/gencode/java/udmi/schema/BlobsetConfig.java b/gencode/java/udmi/schema/BlobsetConfig.java new file mode 100644 index 0000000000..407ffbcde8 --- /dev/null +++ b/gencode/java/udmi/schema/BlobsetConfig.java @@ -0,0 +1,107 @@ + +package udmi.schema; + +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; + + +/** + * Blobset Config + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "blobsets", + "blobs" +}) +@Generated("jsonschema2pojo") +public class BlobsetConfig { + + /** + * System Blobsets + *

+ * Predefined system blobsets + * + */ + @JsonProperty("blobsets") + @JsonPropertyDescription("Predefined system blobsets") + public BlobsetConfig.SystemBlobsets blobsets; + @JsonProperty("blobs") + public HashMap blobs; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.blobs == null)? 0 :this.blobs.hashCode())); + result = ((result* 31)+((this.blobsets == null)? 0 :this.blobsets.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof BlobsetConfig) == false) { + return false; + } + BlobsetConfig rhs = ((BlobsetConfig) other); + return (((this.blobs == rhs.blobs)||((this.blobs!= null)&&this.blobs.equals(rhs.blobs)))&&((this.blobsets == rhs.blobsets)||((this.blobsets!= null)&&this.blobsets.equals(rhs.blobsets)))); + } + + + /** + * System Blobsets + *

+ * Predefined system blobsets + * + */ + @Generated("jsonschema2pojo") + public enum SystemBlobsets { + + IOT_CONFIG("_iot_config"); + private final java.lang.String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (BlobsetConfig.SystemBlobsets c: values()) { + CONSTANTS.put(c.value, c); + } + } + + SystemBlobsets(java.lang.String value) { + this.value = value; + } + + @Override + public java.lang.String toString() { + return this.value; + } + + @JsonValue + public java.lang.String value() { + return this.value; + } + + @JsonCreator + public static BlobsetConfig.SystemBlobsets fromValue(java.lang.String value) { + BlobsetConfig.SystemBlobsets constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/gencode/java/udmi/schema/BlobsetState.java b/gencode/java/udmi/schema/BlobsetState.java new file mode 100644 index 0000000000..2c6f0bee63 --- /dev/null +++ b/gencode/java/udmi/schema/BlobsetState.java @@ -0,0 +1,51 @@ + +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; + + +/** + * Blobset State + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "blobs" +}) +@Generated("jsonschema2pojo") +public class BlobsetState { + + /** + * + * (Required) + * + */ + @JsonProperty("blobs") + public HashMap blobs; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.blobs == null)? 0 :this.blobs.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof BlobsetState) == false) { + return false; + } + BlobsetState rhs = ((BlobsetState) other); + return ((this.blobs == rhs.blobs)||((this.blobs!= null)&&this.blobs.equals(rhs.blobs))); + } + +} diff --git a/gencode/java/udmi/schema/Category.java b/gencode/java/udmi/schema/Category.java new file mode 100644 index 0000000000..1ee2f320e4 --- /dev/null +++ b/gencode/java/udmi/schema/Category.java @@ -0,0 +1,16 @@ +package udmi.schema; + +import static udmi.schema.Level.DEBUG; +import static udmi.schema.Level.NOTICE; + +// This class is manually curated, auto-generated, and then copied into the gencode directory. +// Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md +public class Category { + + public static final String SYSTEM_CONFIG_RECEIVE ="system.config.receive"; + public static final Level SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; + public static final String SYSTEM_CONFIG_PARSE ="system.config.parse"; + public static final Level SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; + public static final String SYSTEM_CONFIG_APPLY ="system.config.apply"; + public static final Level SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; +} diff --git a/gencode/java/udmi/schema/CloudIotConfig.java b/gencode/java/udmi/schema/CloudIotConfig.java new file mode 100644 index 0000000000..fbafa456ea --- /dev/null +++ b/gencode/java/udmi/schema/CloudIotConfig.java @@ -0,0 +1,61 @@ + +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; + + +/** + * Cloud Iot Config + *

+ * Parameters for configuring a connection to cloud systems + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "registry_id", + "cloud_region", + "site_name", + "update_topic", + "reflect_region" +}) +@Generated("jsonschema2pojo") +public class CloudIotConfig { + + @JsonProperty("registry_id") + public String registry_id; + @JsonProperty("cloud_region") + public String cloud_region; + @JsonProperty("site_name") + public String site_name; + @JsonProperty("update_topic") + public String update_topic; + @JsonProperty("reflect_region") + public String reflect_region; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.site_name == null)? 0 :this.site_name.hashCode())); + result = ((result* 31)+((this.cloud_region == null)? 0 :this.cloud_region.hashCode())); + result = ((result* 31)+((this.update_topic == null)? 0 :this.update_topic.hashCode())); + result = ((result* 31)+((this.registry_id == null)? 0 :this.registry_id.hashCode())); + result = ((result* 31)+((this.reflect_region == null)? 0 :this.reflect_region.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CloudIotConfig) == false) { + return false; + } + CloudIotConfig rhs = ((CloudIotConfig) other); + return ((((((this.site_name == rhs.site_name)||((this.site_name!= null)&&this.site_name.equals(rhs.site_name)))&&((this.cloud_region == rhs.cloud_region)||((this.cloud_region!= null)&&this.cloud_region.equals(rhs.cloud_region))))&&((this.update_topic == rhs.update_topic)||((this.update_topic!= null)&&this.update_topic.equals(rhs.update_topic))))&&((this.registry_id == rhs.registry_id)||((this.registry_id!= null)&&this.registry_id.equals(rhs.registry_id))))&&((this.reflect_region == rhs.reflect_region)||((this.reflect_region!= null)&&this.reflect_region.equals(rhs.reflect_region)))); + } + +} diff --git a/gencode/java/udmi/schema/CloudModel.java b/gencode/java/udmi/schema/CloudModel.java new file mode 100644 index 0000000000..97f60410e6 --- /dev/null +++ b/gencode/java/udmi/schema/CloudModel.java @@ -0,0 +1,121 @@ + +package udmi.schema; + +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; + + +/** + * Cloud Model + *

+ * Information specific to how the device communicates with the cloud. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "auth_type", + "device_key", + "is_gateway" +}) +@Generated("jsonschema2pojo") +public class CloudModel { + + /** + * The key type used for cloud communication. + * (Required) + * + */ + @JsonProperty("auth_type") + @JsonPropertyDescription("The key type used for cloud communication.") + 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 + * + */ + @JsonProperty("device_key") + @JsonPropertyDescription("Whether the device authenticates via a private key. Typically false for devices which are proxied for by an IoT core gateway") + public Boolean device_key; + /** + * If the device functions as an IoT Gateway, proxying for other devices using a single logical connection + * + */ + @JsonProperty("is_gateway") + @JsonPropertyDescription("If the device functions as an IoT Gateway, proxying for other devices using a single logical connection") + public Boolean is_gateway; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.is_gateway == null)? 0 :this.is_gateway.hashCode())); + result = ((result* 31)+((this.auth_type == null)? 0 :this.auth_type.hashCode())); + result = ((result* 31)+((this.device_key == null)? 0 :this.device_key.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof CloudModel) == false) { + return false; + } + 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)))); + } + + + /** + * The key type used for cloud communication. + * + */ + @Generated("jsonschema2pojo") + public enum Auth_type { + + ES_256("ES256"), + ES_256_X_509("ES256_X509"), + RS_256("RS256"), + RS_256_X_509("RS256_X509"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (CloudModel.Auth_type c: values()) { + CONSTANTS.put(c.value, c); + } + } + + Auth_type(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static CloudModel.Auth_type fromValue(String value) { + CloudModel.Auth_type constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/gencode/java/udmi/schema/Config.java b/gencode/java/udmi/schema/Config.java new file mode 100644 index 0000000000..f2031e8298 --- /dev/null +++ b/gencode/java/udmi/schema/Config.java @@ -0,0 +1,128 @@ + +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; + + +/** + * Config + *

+ * The config block controls a device's intended behavior. [Config Documentation](../docs/messages/config.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "system", + "gateway", + "discovery", + "localnet", + "blobset", + "pointset" +}) +@Generated("jsonschema2pojo") +public class Config { + + /** + * RFC 3339 timestamp the configuration was generated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the configuration was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public String version; + /** + * System Config + *

+ * [System Config Documentation](../docs/messages/system.md#config) + * + */ + @JsonProperty("system") + @JsonPropertyDescription("[System Config Documentation](../docs/messages/system.md#config)") + public SystemConfig system; + /** + * Gateway Config + *

+ * Configuration for gateways. Only required for devices which are acting as [gateways](../docs/specs/gateway.md) + * + */ + @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 + *

+ * Used to describe device local network parameters + * + */ + @JsonProperty("localnet") + @JsonPropertyDescription("Used to describe device local network parameters") + public LocalnetConfig localnet; + /** + * Blobset Config + *

+ * + * + */ + @JsonProperty("blobset") + public BlobsetConfig blobset; + /** + * Pointset Config + *

+ * [Pointset Config Documentation](../docs/messages/pointset.md#config) + * + */ + @JsonProperty("pointset") + @JsonPropertyDescription("[Pointset Config Documentation](../docs/messages/pointset.md#config)") + public PointsetConfig pointset; + + @Override + 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())); + result = ((result* 31)+((this.gateway == null)? 0 :this.gateway.hashCode())); + result = ((result* 31)+((this.localnet == null)? 0 :this.localnet.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 Config) == false) { + return false; + } + Config rhs = ((Config) other); + 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/DeviceValidationEvent.java b/gencode/java/udmi/schema/DeviceValidationEvent.java new file mode 100644 index 0000000000..c2a2fe1c4f --- /dev/null +++ b/gencode/java/udmi/schema/DeviceValidationEvent.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; + + +/** + * Device Validation Event + *

+ * Validation summary information for an individual device. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "last_seen", + "oldest_mark", + "status" +}) +@Generated("jsonschema2pojo") +public class DeviceValidationEvent { + + /** + * Last time any message from this device was received + * + */ + @JsonProperty("last_seen") + @JsonPropertyDescription("Last time any message from this device was received") + public Date last_seen; + /** + * Oldest recorded mark for this device + * + */ + @JsonProperty("oldest_mark") + @JsonPropertyDescription("Oldest recorded mark for this device") + public Date oldest_mark; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.last_seen == null)? 0 :this.last_seen.hashCode())); + result = ((result* 31)+((this.oldest_mark == null)? 0 :this.oldest_mark.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 DeviceValidationEvent) == false) { + return false; + } + DeviceValidationEvent rhs = ((DeviceValidationEvent) other); + return ((((this.last_seen == rhs.last_seen)||((this.last_seen!= null)&&this.last_seen.equals(rhs.last_seen)))&&((this.oldest_mark == rhs.oldest_mark)||((this.oldest_mark!= null)&&this.oldest_mark.equals(rhs.oldest_mark))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status)))); + } + +} diff --git a/gencode/java/udmi/schema/DiscoveryCommand.java b/gencode/java/udmi/schema/DiscoveryCommand.java new file mode 100644 index 0000000000..c007dc9aef --- /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; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("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/DiscoveryConfig.java b/gencode/java/udmi/schema/DiscoveryConfig.java new file mode 100644 index 0000000000..489322422d --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryConfig.java @@ -0,0 +1,63 @@ + +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.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 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 HashMap 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..bb14f067b4 --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryEvent.java @@ -0,0 +1,130 @@ + +package udmi.schema; + +import java.util.Date; +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", + "scan_family", + "scan_id", + "families", + "uniqs", + "system" +}) +@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; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public java.lang.String 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; + /** + * The primary scan discovery address family + * + */ + @JsonProperty("scan_family") + @JsonPropertyDescription("The primary scan discovery address family") + public java.lang.String scan_family; + /** + * The primary id of the device (for scan_family) + * + */ + @JsonProperty("scan_id") + @JsonPropertyDescription("The primary id of the device (for scan_family)") + public java.lang.String scan_id; + /** + * 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 Map families; + /** + * Collection of data points available for this device. + * + */ + @JsonProperty("uniqs") + @JsonPropertyDescription("Collection of data points available for this device.") + public Map uniqs; + /** + * System Discovery Event + *

+ * + * + */ + @JsonProperty("system") + public SystemDiscoveryEvent system; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); + result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); + result = ((result* 31)+((this.uniqs == null)? 0 :this.uniqs.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())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.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 DiscoveryEvent) == false) { + return false; + } + DiscoveryEvent rhs = ((DiscoveryEvent) other); + return ((((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.uniqs == rhs.uniqs)||((this.uniqs!= null)&&this.uniqs.equals(rhs.uniqs))))&&((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)))); + } + +} diff --git a/gencode/java/udmi/schema/DiscoveryModel.java b/gencode/java/udmi/schema/DiscoveryModel.java new file mode 100644 index 0000000000..0ecd62459a --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryModel.java @@ -0,0 +1,46 @@ + +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; + + +/** + * Discovery Model + *

+ * Discovery target parameters + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "families" +}) +@Generated("jsonschema2pojo") +public class DiscoveryModel { + + @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 DiscoveryModel) == false) { + return false; + } + DiscoveryModel rhs = ((DiscoveryModel) other); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); + } + +} diff --git a/gencode/java/udmi/schema/DiscoveryState.java b/gencode/java/udmi/schema/DiscoveryState.java new file mode 100644 index 0000000000..6358c95fee --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryState.java @@ -0,0 +1,63 @@ + +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.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 udmi.schema.FamilyDiscoveryState enumeration; + /** + * Discovery protocol families + * + */ + @JsonProperty("families") + @JsonPropertyDescription("Discovery protocol families") + public HashMap 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/EndpointConfiguration.java b/gencode/java/udmi/schema/EndpointConfiguration.java new file mode 100644 index 0000000000..a898219e85 --- /dev/null +++ b/gencode/java/udmi/schema/EndpointConfiguration.java @@ -0,0 +1,61 @@ + +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; + + +/** + * Endpoint Configuration + *

+ * Parameters to define an MQTT endpoint + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "bridgeHostname", + "bridgePort", + "cloudRegion", + "projectId", + "registryId" +}) +@Generated("jsonschema2pojo") +public class EndpointConfiguration { + + @JsonProperty("bridgeHostname") + public String bridgeHostname = "mqtt.googleapis.com"; + @JsonProperty("bridgePort") + public String bridgePort = "443"; + @JsonProperty("cloudRegion") + public String cloudRegion; + @JsonProperty("projectId") + public String projectId; + @JsonProperty("registryId") + public String registryId; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.registryId == null)? 0 :this.registryId.hashCode())); + result = ((result* 31)+((this.bridgePort == null)? 0 :this.bridgePort.hashCode())); + result = ((result* 31)+((this.projectId == null)? 0 :this.projectId.hashCode())); + result = ((result* 31)+((this.bridgeHostname == null)? 0 :this.bridgeHostname.hashCode())); + result = ((result* 31)+((this.cloudRegion == null)? 0 :this.cloudRegion.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof EndpointConfiguration) == false) { + return false; + } + EndpointConfiguration rhs = ((EndpointConfiguration) other); + return ((((((this.registryId == rhs.registryId)||((this.registryId!= null)&&this.registryId.equals(rhs.registryId)))&&((this.bridgePort == rhs.bridgePort)||((this.bridgePort!= null)&&this.bridgePort.equals(rhs.bridgePort))))&&((this.projectId == rhs.projectId)||((this.projectId!= null)&&this.projectId.equals(rhs.projectId))))&&((this.bridgeHostname == rhs.bridgeHostname)||((this.bridgeHostname!= null)&&this.bridgeHostname.equals(rhs.bridgeHostname))))&&((this.cloudRegion == rhs.cloudRegion)||((this.cloudRegion!= null)&&this.cloudRegion.equals(rhs.cloudRegion)))); + } + +} diff --git a/gencode/java/udmi/schema/Entry.java b/gencode/java/udmi/schema/Entry.java new file mode 100644 index 0000000000..105a88a6f1 --- /dev/null +++ b/gencode/java/udmi/schema/Entry.java @@ -0,0 +1,91 @@ + +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; + + +/** + * Entry + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "message", + "detail", + "category", + "timestamp", + "level" +}) +@Generated("jsonschema2pojo") +public class Entry { + + /** + * A human-readable one-line description of the entry + * (Required) + * + */ + @JsonProperty("message") + @JsonPropertyDescription("A human-readable one-line description of the entry") + public String message; + /** + * An optional extensive entry which can include more detail, e.g. a complete program stack-trace + * + */ + @JsonProperty("detail") + @JsonPropertyDescription("An optional extensive entry which can include more detail, e.g. a complete program stack-trace") + public String detail; + /** + * Auto-generated category mappings from bin/gencode_categories. + * (Required) + * + */ + @JsonProperty("category") + public Object category; + /** + * Timestamp the condition was triggered, or most recently updated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("Timestamp the condition was triggered, or most recently updated") + public Date timestamp; + /** + * The status `level` should conform to the numerical [Stackdriver LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity) levels. The `DEFAULT` value of 0 is not allowed (lowest value is 100, maximum 800).https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity + * (Required) + * + */ + @JsonProperty("level") + @JsonPropertyDescription("The status `level` should conform to the numerical [Stackdriver LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity) levels. The `DEFAULT` value of 0 is not allowed (lowest value is 100, maximum 800).") + public Integer level; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.detail == null)? 0 :this.detail.hashCode())); + result = ((result* 31)+((this.message == null)? 0 :this.message.hashCode())); + result = ((result* 31)+((this.category == null)? 0 :this.category.hashCode())); + result = ((result* 31)+((this.level == null)? 0 :this.level.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 Entry) == false) { + return false; + } + Entry rhs = ((Entry) other); + return ((((((this.detail == rhs.detail)||((this.detail!= null)&&this.detail.equals(rhs.detail)))&&((this.message == rhs.message)||((this.message!= null)&&this.message.equals(rhs.message))))&&((this.category == rhs.category)||((this.category!= null)&&this.category.equals(rhs.category))))&&((this.level == rhs.level)||((this.level!= null)&&this.level.equals(rhs.level))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + +} diff --git a/gencode/java/udmi/schema/Envelope.java b/gencode/java/udmi/schema/Envelope.java new file mode 100644 index 0000000000..99ac30ca03 --- /dev/null +++ b/gencode/java/udmi/schema/Envelope.java @@ -0,0 +1,188 @@ + +package udmi.schema; + +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.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; + + +/** + * Envelope + *

+ * 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](../docs/messages/envelope.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "deviceId", + "deviceNumId", + "deviceRegistryId", + "deviceRegistryLocation", + "projectId", + "subFolder", + "subType" +}) +@Generated("jsonschema2pojo") +public class Envelope { + + /** + * + * (Required) + * + */ + @JsonProperty("deviceId") + public String deviceId; + /** + * + * (Required) + * + */ + @JsonProperty("deviceNumId") + public String deviceNumId; + /** + * + * (Required) + * + */ + @JsonProperty("deviceRegistryId") + public String deviceRegistryId; + @JsonProperty("deviceRegistryLocation") + public String deviceRegistryLocation; + /** + * + * (Required) + * + */ + @JsonProperty("projectId") + public String projectId; + /** + * + * (Required) + * + */ + @JsonProperty("subFolder") + public Envelope.SubFolder subFolder; + @JsonProperty("subType") + public Envelope.SubType subType; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.deviceRegistryLocation == null)? 0 :this.deviceRegistryLocation.hashCode())); + result = ((result* 31)+((this.deviceNumId == null)? 0 :this.deviceNumId.hashCode())); + result = ((result* 31)+((this.subFolder == null)? 0 :this.subFolder.hashCode())); + result = ((result* 31)+((this.deviceRegistryId == null)? 0 :this.deviceRegistryId.hashCode())); + result = ((result* 31)+((this.subType == null)? 0 :this.subType.hashCode())); + result = ((result* 31)+((this.deviceId == null)? 0 :this.deviceId.hashCode())); + result = ((result* 31)+((this.projectId == null)? 0 :this.projectId.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Envelope) == false) { + return false; + } + Envelope rhs = ((Envelope) other); + return ((((((((this.deviceRegistryLocation == rhs.deviceRegistryLocation)||((this.deviceRegistryLocation!= null)&&this.deviceRegistryLocation.equals(rhs.deviceRegistryLocation)))&&((this.deviceNumId == rhs.deviceNumId)||((this.deviceNumId!= null)&&this.deviceNumId.equals(rhs.deviceNumId))))&&((this.subFolder == rhs.subFolder)||((this.subFolder!= null)&&this.subFolder.equals(rhs.subFolder))))&&((this.deviceRegistryId == rhs.deviceRegistryId)||((this.deviceRegistryId!= null)&&this.deviceRegistryId.equals(rhs.deviceRegistryId))))&&((this.subType == rhs.subType)||((this.subType!= null)&&this.subType.equals(rhs.subType))))&&((this.deviceId == rhs.deviceId)||((this.deviceId!= null)&&this.deviceId.equals(rhs.deviceId))))&&((this.projectId == rhs.projectId)||((this.projectId!= null)&&this.projectId.equals(rhs.projectId)))); + } + + @Generated("jsonschema2pojo") + public enum SubFolder { + + UPDATE("update"), + AUDIT("audit"), + DISCOVERY("discovery"), + SYSTEM("system"), + GATEWAY("gateway"), + SWARM("swarm"), + LOCALNET("localnet"), + POINTSET("pointset"), + BLOBSET("blobset"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (Envelope.SubFolder c: values()) { + CONSTANTS.put(c.value, c); + } + } + + SubFolder(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static Envelope.SubFolder fromValue(String value) { + Envelope.SubFolder constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum SubType { + + EVENT("event"), + COMMAND("command"), + STATE("state"), + CONFIG("config"), + MODEL("model"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (Envelope.SubType c: values()) { + CONSTANTS.put(c.value, c); + } + } + + SubType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static Envelope.SubType fromValue(String value) { + Envelope.SubType constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/gencode/java/udmi/schema/Event.java b/gencode/java/udmi/schema/Event.java new file mode 100644 index 0000000000..15926e009e --- /dev/null +++ b/gencode/java/udmi/schema/Event.java @@ -0,0 +1,75 @@ + +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; + + +/** + * Event + *

+ * Container object for all event schemas, not directly used. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "system", + "pointset", + "discovery" +}) +@Generated("jsonschema2pojo") +public class Event { + + /** + * System Event + *

+ * Used for system events such as logging. [System Event Documentation](../docs/messages/system.md#event) + * + */ + @JsonProperty("system") + @JsonPropertyDescription("Used for system events such as logging. [System Event Documentation](../docs/messages/system.md#event)") + public SystemEvent system; + /** + * Pointset Event + *

+ * A set of points reporting telemetry data. [Pointset Event Documentation](../docs/messages/pointset.md#telemetry) + * + */ + @JsonProperty("pointset") + @JsonPropertyDescription("A set of points reporting telemetry data. [Pointset Event Documentation](../docs/messages/pointset.md#telemetry)") + public PointsetEvent pointset; + /** + * Discovery Event + *

+ * [Discovery result](../docs/specs/discovery.md) with implicit enumeration + * + */ + @JsonProperty("discovery") + @JsonPropertyDescription("[Discovery result](../docs/specs/discovery.md) with implicit enumeration") + public DiscoveryEvent discovery; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.pointset == null)? 0 :this.pointset.hashCode())); + result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); + 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 Event) == false) { + return false; + } + Event rhs = ((Event) other); + return ((((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset)))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery)))); + } + +} 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 new file mode 100644 index 0000000000..d13ccaa8c4 --- /dev/null +++ b/gencode/java/udmi/schema/FamilyDiscoveryEvent.java @@ -0,0 +1,52 @@ + +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; + + +/** + * Family Discovery Event + *

+ * Discovery information for an individual protocol family. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "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; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof FamilyDiscoveryEvent) == false) { + return false; + } + FamilyDiscoveryEvent rhs = ((FamilyDiscoveryEvent) other); + 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/FamilyDiscoveryTestingModel.java b/gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java new file mode 100644 index 0000000000..89c4ccbe58 --- /dev/null +++ b/gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java @@ -0,0 +1,41 @@ + +package udmi.schema; + +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Family Discovery Testing Model + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + +}) +@Generated("jsonschema2pojo") +public class FamilyDiscoveryTestingModel { + + + @Override + public int hashCode() { + int result = 1; + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof FamilyDiscoveryTestingModel) == false) { + return false; + } + FamilyDiscoveryTestingModel rhs = ((FamilyDiscoveryTestingModel) other); + return true; + } + +} diff --git a/gencode/java/udmi/schema/FamilyLocalnetModel.java b/gencode/java/udmi/schema/FamilyLocalnetModel.java new file mode 100644 index 0000000000..efeb8caca9 --- /dev/null +++ b/gencode/java/udmi/schema/FamilyLocalnetModel.java @@ -0,0 +1,52 @@ + +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; + + +/** + * Family Localnet Model + *

+ * The type of network + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "id" +}) +@Generated("jsonschema2pojo") +public class FamilyLocalnetModel { + + /** + * The address of a device on the local network + * (Required) + * + */ + @JsonProperty("id") + @JsonPropertyDescription("The address of a device on the local network") + public String id; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof FamilyLocalnetModel) == false) { + return false; + } + FamilyLocalnetModel rhs = ((FamilyLocalnetModel) other); + return ((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))); + } + +} diff --git a/gencode/java/udmi/schema/GatewayConfig.java b/gencode/java/udmi/schema/GatewayConfig.java new file mode 100644 index 0000000000..3a5c2c2634 --- /dev/null +++ b/gencode/java/udmi/schema/GatewayConfig.java @@ -0,0 +1,53 @@ + +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; + + +/** + * Gateway Config + *

+ * Configuration for gateways. Only required for devices which are acting as [gateways](../docs/specs/gateway.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "proxy_ids" +}) +@Generated("jsonschema2pojo") +public class GatewayConfig { + + /** + * An array of all the device IDs which are bound to the device + * + */ + @JsonProperty("proxy_ids") + @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.proxy_ids == null)? 0 :this.proxy_ids.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof GatewayConfig) == false) { + return false; + } + GatewayConfig rhs = ((GatewayConfig) other); + return ((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids))); + } + +} diff --git a/gencode/java/udmi/schema/GatewayModel.java b/gencode/java/udmi/schema/GatewayModel.java new file mode 100644 index 0000000000..dd8d54748b --- /dev/null +++ b/gencode/java/udmi/schema/GatewayModel.java @@ -0,0 +1,71 @@ + +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; + + +/** + * Gateway Model + *

+ * [Gateway Documentation](../docs/specs/gateway.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "gateway_id", + "family", + "proxy_ids" +}) +@Generated("jsonschema2pojo") +public class GatewayModel { + + /** + * The device ID of the gateway the device is bound to + * + */ + @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 + * + */ + @JsonProperty("proxy_ids") + @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.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; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof GatewayModel) == false) { + return false; + } + 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/GatewayState.java b/gencode/java/udmi/schema/GatewayState.java new file mode 100644 index 0000000000..3ccab4340b --- /dev/null +++ b/gencode/java/udmi/schema/GatewayState.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; + + +/** + * Gateway State + *

+ * [Gateway Documentation](../docs/specs/gateway.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "devices" +}) +@Generated("jsonschema2pojo") +public class GatewayState { + + @JsonProperty("devices") + public Object devices; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.devices == null)? 0 :this.devices.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof GatewayState) == false) { + return false; + } + GatewayState rhs = ((GatewayState) other); + return ((this.devices == rhs.devices)||((this.devices!= null)&&this.devices.equals(rhs.devices))); + } + +} diff --git a/gencode/java/udmi/schema/Level.java b/gencode/java/udmi/schema/Level.java new file mode 100644 index 0000000000..561f133cfa --- /dev/null +++ b/gencode/java/udmi/schema/Level.java @@ -0,0 +1,42 @@ +package udmi.schema; + +import java.util.HashMap; +import java.util.Map; + +// This class is manually curated and then copied into the gencode directory. Look for the +// proper source and don't be fooled! This is subset of the StackDriver LogSeverity levels. +public enum Level { + + TRACE(50), + DEBUG(100), + INFO(200), + NOTICE(300), + WARNING(400), + ERROR(500); + + private final int value; + private final static Map CONSTANTS = new HashMap<>(); + + static { + for (Level c: values()) { + CONSTANTS.put(c.value, c); + } + } + + Level(int value) { + this.value = value; + } + + public int value() { + return this.value; + } + + public static Level fromValue(int value) { + Level constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(Integer.toString(value)); + } else { + return constant; + } + } +} diff --git a/gencode/java/udmi/schema/LocalnetConfig.java b/gencode/java/udmi/schema/LocalnetConfig.java new file mode 100644 index 0000000000..68aca4838e --- /dev/null +++ b/gencode/java/udmi/schema/LocalnetConfig.java @@ -0,0 +1,52 @@ + +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; + + +/** + * Localnet Config + *

+ * Used to describe device local network parameters + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "families" +}) +@Generated("jsonschema2pojo") +public class LocalnetConfig { + + /** + * Family Reference + *

+ * + * (Required) + * + */ + @JsonProperty("families") + public Object 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 LocalnetConfig) == false) { + return false; + } + LocalnetConfig rhs = ((LocalnetConfig) other); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); + } + +} diff --git a/gencode/java/udmi/schema/LocalnetModel.java b/gencode/java/udmi/schema/LocalnetModel.java new file mode 100644 index 0000000000..cebd3c0561 --- /dev/null +++ b/gencode/java/udmi/schema/LocalnetModel.java @@ -0,0 +1,51 @@ + +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; + + +/** + * Localnet Model + *

+ * Used to describe device local network parameters + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "families" +}) +@Generated("jsonschema2pojo") +public class LocalnetModel { + + /** + * + * (Required) + * + */ + @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 LocalnetModel) == false) { + return false; + } + LocalnetModel rhs = ((LocalnetModel) other); + return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); + } + +} diff --git a/gencode/java/udmi/schema/Location.java b/gencode/java/udmi/schema/Location.java new file mode 100644 index 0000000000..27a07cafe4 --- /dev/null +++ b/gencode/java/udmi/schema/Location.java @@ -0,0 +1,58 @@ + +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; + + +/** + * Properties the expected physical location of the device. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "site", + "section", + "position" +}) +@Generated("jsonschema2pojo") +public class Location { + + /** + * The site name according to the site model in which a device is installed in + * (Required) + * + */ + @JsonProperty("site") + @JsonPropertyDescription("The site name according to the site model in which a device is installed in") + public String site; + @JsonProperty("section") + public String section; + @JsonProperty("position") + public Position position; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.site == null)? 0 :this.site.hashCode())); + result = ((result* 31)+((this.section == null)? 0 :this.section.hashCode())); + result = ((result* 31)+((this.position == null)? 0 :this.position.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Location) == false) { + return false; + } + Location rhs = ((Location) other); + return ((((this.site == rhs.site)||((this.site!= null)&&this.site.equals(rhs.site)))&&((this.section == rhs.section)||((this.section!= null)&&this.section.equals(rhs.section))))&&((this.position == rhs.position)||((this.position!= null)&&this.position.equals(rhs.position)))); + } + +} diff --git a/gencode/java/udmi/schema/Metadata.java b/gencode/java/udmi/schema/Metadata.java new file mode 100644 index 0000000000..f6affe376c --- /dev/null +++ b/gencode/java/udmi/schema/Metadata.java @@ -0,0 +1,159 @@ + +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; + + +/** + * Metadata + *

+ * [Metadata](../docs/specs/metadata.md) 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` + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "description", + "hash", + "cloud", + "system", + "gateway", + "discovery", + "localnet", + "testing", + "pointset" +}) +@Generated("jsonschema2pojo") +public class Metadata { + + /** + * RFC 3339 timestamp the message was generated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the message was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public String version; + /** + * Generic human-readable text describing the device + * + */ + @JsonProperty("description") + @JsonPropertyDescription("Generic human-readable text describing the device") + public String description; + /** + * Automatically generated field that contains the hash of file contents. + * + */ + @JsonProperty("hash") + @JsonPropertyDescription("Automatically generated field that contains the hash of file contents.") + public String hash; + /** + * 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 CloudModel cloud; + /** + * System Model + *

+ * 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 Model Documentation](../docs/messages/system.md)") + public SystemModel system; + /** + * Gateway Model + *

+ * [Gateway Documentation](../docs/specs/gateway.md) + * + */ + @JsonProperty("gateway") + @JsonPropertyDescription("[Gateway Documentation](../docs/specs/gateway.md)") + public GatewayModel gateway; + /** + * 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 LocalnetModel localnet; + /** + * Testing Model + *

+ * Testing target parameters + * + */ + @JsonProperty("testing") + @JsonPropertyDescription("Testing target parameters") + public TestingModel testing; + /** + * 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 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())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.hash == null)? 0 :this.hash.hashCode())); + result = ((result* 31)+((this.gateway == null)? 0 :this.gateway.hashCode())); + result = ((result* 31)+((this.localnet == null)? 0 :this.localnet.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 Metadata) == false) { + 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.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/Metrics.java b/gencode/java/udmi/schema/Metrics.java new file mode 100644 index 0000000000..47cb518c3b --- /dev/null +++ b/gencode/java/udmi/schema/Metrics.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.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "restart_count", + "mem_total_mb", + "mem_free_mb", + "store_total_mb", + "store_free_mb", + "cpu_temp_c", + "cpu_load_5m" +}) +@Generated("jsonschema2pojo") +public class Metrics { + + @JsonProperty("restart_count") + public Double restart_count; + @JsonProperty("mem_total_mb") + public Double mem_total_mb; + @JsonProperty("mem_free_mb") + public Double mem_free_mb; + @JsonProperty("store_total_mb") + public Double store_total_mb; + @JsonProperty("store_free_mb") + public Double store_free_mb; + @JsonProperty("cpu_temp_c") + public Double cpu_temp_c; + @JsonProperty("cpu_load_5m") + public Double cpu_load_5m; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.store_free_mb == null)? 0 :this.store_free_mb.hashCode())); + result = ((result* 31)+((this.mem_free_mb == null)? 0 :this.mem_free_mb.hashCode())); + result = ((result* 31)+((this.restart_count == null)? 0 :this.restart_count.hashCode())); + result = ((result* 31)+((this.cpu_load_5m == null)? 0 :this.cpu_load_5m.hashCode())); + result = ((result* 31)+((this.mem_total_mb == null)? 0 :this.mem_total_mb.hashCode())); + result = ((result* 31)+((this.cpu_temp_c == null)? 0 :this.cpu_temp_c.hashCode())); + result = ((result* 31)+((this.store_total_mb == null)? 0 :this.store_total_mb.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Metrics) == false) { + return false; + } + Metrics rhs = ((Metrics) other); + return ((((((((this.store_free_mb == rhs.store_free_mb)||((this.store_free_mb!= null)&&this.store_free_mb.equals(rhs.store_free_mb)))&&((this.mem_free_mb == rhs.mem_free_mb)||((this.mem_free_mb!= null)&&this.mem_free_mb.equals(rhs.mem_free_mb))))&&((this.restart_count == rhs.restart_count)||((this.restart_count!= null)&&this.restart_count.equals(rhs.restart_count))))&&((this.cpu_load_5m == rhs.cpu_load_5m)||((this.cpu_load_5m!= null)&&this.cpu_load_5m.equals(rhs.cpu_load_5m))))&&((this.mem_total_mb == rhs.mem_total_mb)||((this.mem_total_mb!= null)&&this.mem_total_mb.equals(rhs.mem_total_mb))))&&((this.cpu_temp_c == rhs.cpu_temp_c)||((this.cpu_temp_c!= null)&&this.cpu_temp_c.equals(rhs.cpu_temp_c))))&&((this.store_total_mb == rhs.store_total_mb)||((this.store_total_mb!= null)&&this.store_total_mb.equals(rhs.store_total_mb)))); + } + +} diff --git a/gencode/java/udmi/schema/Physical_tag.java b/gencode/java/udmi/schema/Physical_tag.java new file mode 100644 index 0000000000..29b92667dc --- /dev/null +++ b/gencode/java/udmi/schema/Physical_tag.java @@ -0,0 +1,48 @@ + +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; + + +/** + * Information used to print a physical QR code label. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "asset" +}) +@Generated("jsonschema2pojo") +public class Physical_tag { + + /** + * + * (Required) + * + */ + @JsonProperty("asset") + public Asset asset; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.asset == null)? 0 :this.asset.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Physical_tag) == false) { + return false; + } + Physical_tag rhs = ((Physical_tag) other); + return ((this.asset == rhs.asset)||((this.asset!= null)&&this.asset.equals(rhs.asset))); + } + +} diff --git a/gencode/java/udmi/schema/PointEnumerationEvent.java b/gencode/java/udmi/schema/PointEnumerationEvent.java new file mode 100644 index 0000000000..054f7bb8dc --- /dev/null +++ b/gencode/java/udmi/schema/PointEnumerationEvent.java @@ -0,0 +1,129 @@ + +package udmi.schema; + +import java.util.ArrayList; +import java.util.HashMap; +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({ + "name", + "possible_values", + "units", + "type", + "ref", + "writable", + "description", + "status", + "ancillary" +}) +@Generated("jsonschema2pojo") +public class PointEnumerationEvent { + + /** + * Friendly name for the point, if known + * + */ + @JsonProperty("name") + @JsonPropertyDescription("Friendly name for the point, if known") + public java.lang.String name; + /** + * 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 java.lang.String units; + /** + * Current or default type for this point + * + */ + @JsonProperty("type") + @JsonPropertyDescription("Current or default type for this point") + public java.lang.String type; + /** + * Reference parameter for this point (e.g. BACnet object) + * + */ + @JsonProperty("ref") + @JsonPropertyDescription("Reference parameter for this point (e.g. BACnet object)") + public java.lang.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 java.lang.String description; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + /** + * Ancillary Properties + *

+ * Arbitrary blob of json associated with this point + * + */ + @JsonProperty("ancillary") + @JsonPropertyDescription("Arbitrary blob of json associated with this point") + public HashMap 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.name == null)? 0 :this.name.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(java.lang.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.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((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/PointPointsetConfig.java b/gencode/java/udmi/schema/PointPointsetConfig.java new file mode 100644 index 0000000000..0909c0c2cc --- /dev/null +++ b/gencode/java/udmi/schema/PointPointsetConfig.java @@ -0,0 +1,69 @@ + +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; + + +/** + * Point Pointset Config + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "ref", + "units", + "set_value" +}) +@Generated("jsonschema2pojo") +public class PointPointsetConfig { + + /** + * Mapping for the point to an internal resource (e.g. BACnet object reference) + * + */ + @JsonProperty("ref") + @JsonPropertyDescription("Mapping for the point to an internal resource (e.g. BACnet object reference)") + public String ref; + /** + * If specified, indicates the units the device should report the data in. + * + */ + @JsonProperty("units") + @JsonPropertyDescription("If specified, indicates the units the device should report the data in.") + public String units; + /** + * Used for cloud writeback functionality, this field specifies the value for a given point in the device's current units. + * + */ + @JsonProperty("set_value") + @JsonPropertyDescription("Used for cloud writeback functionality, this field specifies the value for a given point in the device's current units.") + public Object set_value; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.ref == null)? 0 :this.ref.hashCode())); + result = ((result* 31)+((this.units == null)? 0 :this.units.hashCode())); + result = ((result* 31)+((this.set_value == null)? 0 :this.set_value.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PointPointsetConfig) == false) { + return false; + } + PointPointsetConfig rhs = ((PointPointsetConfig) other); + return ((((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref)))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.set_value == rhs.set_value)||((this.set_value!= null)&&this.set_value.equals(rhs.set_value)))); + } + +} diff --git a/gencode/java/udmi/schema/PointPointsetEvent.java b/gencode/java/udmi/schema/PointPointsetEvent.java new file mode 100644 index 0000000000..468102606d --- /dev/null +++ b/gencode/java/udmi/schema/PointPointsetEvent.java @@ -0,0 +1,52 @@ + +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; + + +/** + * Point Pointset Event + *

+ * Object representation for for a single point + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "present_value" +}) +@Generated("jsonschema2pojo") +public class PointPointsetEvent { + + /** + * The specific point data reading + * (Required) + * + */ + @JsonProperty("present_value") + @JsonPropertyDescription("The specific point data reading") + public Object present_value; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.present_value == null)? 0 :this.present_value.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PointPointsetEvent) == false) { + return false; + } + PointPointsetEvent rhs = ((PointPointsetEvent) other); + return ((this.present_value == rhs.present_value)||((this.present_value!= null)&&this.present_value.equals(rhs.present_value))); + } + +} diff --git a/gencode/java/udmi/schema/PointPointsetModel.java b/gencode/java/udmi/schema/PointPointsetModel.java new file mode 100644 index 0000000000..9d1a6b9fc8 --- /dev/null +++ b/gencode/java/udmi/schema/PointPointsetModel.java @@ -0,0 +1,157 @@ + +package udmi.schema; + +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; + + +/** + * Point Pointset Model + *

+ * Information about a specific point name of the device. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "units", + "writable", + "baseline_value", + "baseline_tolerance", + "baseline_state", + "cov_increment", + "ref" +}) +@Generated("jsonschema2pojo") +public class PointPointsetModel { + + /** + * Expected unit configuration for the point + * + */ + @JsonProperty("units") + @JsonPropertyDescription("Expected unit configuration for the point") + public String units; + /** + * Indicates if this point is writable (else read-only) + * + */ + @JsonProperty("writable") + @JsonPropertyDescription("Indicates if this point is writable (else read-only)") + public Boolean writable; + /** + * Represents the expected baseline value of the point + * + */ + @JsonProperty("baseline_value") + @JsonPropertyDescription("Represents the expected baseline value of the point") + public Object baseline_value; + /** + * Maximum deviation from `baseline_value` + * + */ + @JsonProperty("baseline_tolerance") + @JsonPropertyDescription("Maximum deviation from `baseline_value`") + public Double baseline_tolerance; + /** + * Expected state when `baseline_value` is set as the `set_value` for this point the config message + * + */ + @JsonProperty("baseline_state") + @JsonPropertyDescription("Expected state when `baseline_value` is set as the `set_value` for this point the config message") + public PointPointsetModel.Baseline_state baseline_state; + /** + * Triggering threshold for partial cov update publishing + * + */ + @JsonProperty("cov_increment") + @JsonPropertyDescription("Triggering threshold for partial cov update publishing") + public Double cov_increment; + /** + * Mapping for the point to an internal resource (e.g. BACnet object reference) + * + */ + @JsonProperty("ref") + @JsonPropertyDescription("Mapping for the point to an internal resource (e.g. BACnet object reference)") + public String ref; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.ref == null)? 0 :this.ref.hashCode())); + result = ((result* 31)+((this.baseline_value == null)? 0 :this.baseline_value.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.baseline_tolerance == null)? 0 :this.baseline_tolerance.hashCode())); + result = ((result* 31)+((this.cov_increment == null)? 0 :this.cov_increment.hashCode())); + result = ((result* 31)+((this.writable == null)? 0 :this.writable.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PointPointsetModel) == false) { + return false; + } + PointPointsetModel rhs = ((PointPointsetModel) other); + return ((((((((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.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.writable == rhs.writable)||((this.writable!= null)&&this.writable.equals(rhs.writable)))); + } + + + /** + * Expected state when `baseline_value` is set as the `set_value` for this point the config message + * + */ + @Generated("jsonschema2pojo") + public enum Baseline_state { + + APPLIED("applied"), + UPDATING("updating"), + OVERRIDDEN("overridden"), + INVALID("invalid"), + FAILURE("failure"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (PointPointsetModel.Baseline_state c: values()) { + CONSTANTS.put(c.value, c); + } + } + + Baseline_state(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static PointPointsetModel.Baseline_state fromValue(String value) { + PointPointsetModel.Baseline_state constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/gencode/java/udmi/schema/PointPointsetState.java b/gencode/java/udmi/schema/PointPointsetState.java new file mode 100644 index 0000000000..fd3b3fdabc --- /dev/null +++ b/gencode/java/udmi/schema/PointPointsetState.java @@ -0,0 +1,122 @@ + +package udmi.schema; + +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; + + +/** + * Point Pointset State + *

+ * Object representation for for a single point + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "units", + "value_state", + "status" +}) +@Generated("jsonschema2pojo") +public class PointPointsetState { + + /** + * If specified, indicates a programmed point unit. If empty, means unspecified or matches configured point. + * + */ + @JsonProperty("units") + @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. + * + */ + @JsonProperty("value_state") + @JsonPropertyDescription("Optional enumeration indicating the state of the points value.") + public PointPointsetState.Value_state value_state; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.value_state == null)? 0 :this.value_state.hashCode())); + result = ((result* 31)+((this.units == null)? 0 :this.units.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 PointPointsetState) == false) { + return false; + } + PointPointsetState rhs = ((PointPointsetState) other); + return ((((this.value_state == rhs.value_state)||((this.value_state!= null)&&this.value_state.equals(rhs.value_state)))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status)))); + } + + + /** + * Optional enumeration indicating the state of the points value. + * + */ + @Generated("jsonschema2pojo") + public enum Value_state { + + APPLIED("applied"), + UPDATING("updating"), + OVERRIDDEN("overridden"), + INVALID("invalid"), + FAILURE("failure"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (PointPointsetState.Value_state c: values()) { + CONSTANTS.put(c.value, c); + } + } + + Value_state(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static PointPointsetState.Value_state fromValue(String value) { + PointPointsetState.Value_state constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/gencode/java/udmi/schema/PointsetConfig.java b/gencode/java/udmi/schema/PointsetConfig.java new file mode 100644 index 0000000000..5767339823 --- /dev/null +++ b/gencode/java/udmi/schema/PointsetConfig.java @@ -0,0 +1,107 @@ + +package udmi.schema; + +import java.util.Date; +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.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Pointset Config + *

+ * [Pointset Config Documentation](../docs/messages/pointset.md#config) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "state_etag", + "set_value_expiry", + "sample_limit_sec", + "sample_rate_sec", + "points" +}) +@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) + * + */ + @JsonProperty("state_etag") + @JsonPropertyDescription("The `state_etag` of the last _state_ message sent by the device. [Writeback documentation](../docs/specs/sequences/writeback.md)") + public java.lang.String state_etag; + /** + * An expiry for the the device to revert to baseline (no set value). [Writeback documentation](../docs/specs/sequences/writeback.md) + * + */ + @JsonProperty("set_value_expiry") + @JsonPropertyDescription("An expiry for the the device to revert to baseline (no set value). [Writeback documentation](../docs/specs/sequences/writeback.md)") + public Date set_value_expiry; + /** + * Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update. + * + */ + @JsonProperty("sample_limit_sec") + @JsonPropertyDescription("Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.") + public Integer sample_limit_sec; + /** + * 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. + * + */ + @JsonProperty("sample_rate_sec") + @JsonPropertyDescription("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.") + public Integer sample_rate_sec; + /** + * 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](../docs/messages/pointset.md) + * + */ + @JsonProperty("points") + @JsonPropertyDescription("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](../docs/messages/pointset.md)") + public HashMap points; + + @Override + public int hashCode() { + int result = 1; + 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; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PointsetConfig) == false) { + 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.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/PointsetEvent.java b/gencode/java/udmi/schema/PointsetEvent.java new file mode 100644 index 0000000000..985ab1aef9 --- /dev/null +++ b/gencode/java/udmi/schema/PointsetEvent.java @@ -0,0 +1,83 @@ + +package udmi.schema; + +import java.util.Date; +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.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Pointset Event + *

+ * A set of points reporting telemetry data. [Pointset Event Documentation](../docs/messages/pointset.md#telemetry) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "partial_update", + "points" +}) +@Generated("jsonschema2pojo") +public class PointsetEvent { + + /** + * RFC 3339 timestamp the telemetry event was generated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the telemetry event was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public java.lang.String version; + /** + * Indicates if this is a partial update (only some points may be included) + * + */ + @JsonProperty("partial_update") + @JsonPropertyDescription("Indicates if this is a partial update (only some points may be included)") + public Boolean partial_update; + /** + * Collection of point names, defining the representative point set for this device. + * (Required) + * + */ + @JsonProperty("points") + @JsonPropertyDescription("Collection of point names, defining the representative point set for this device.") + public HashMap points; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.partial_update == null)? 0 :this.partial_update.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.points == null)? 0 :this.points.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PointsetEvent) == false) { + return false; + } + PointsetEvent rhs = ((PointsetEvent) other); + return (((((this.partial_update == rhs.partial_update)||((this.partial_update!= null)&&this.partial_update.equals(rhs.partial_update)))&&((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.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + } + +} diff --git a/gencode/java/udmi/schema/PointsetModel.java b/gencode/java/udmi/schema/PointsetModel.java new file mode 100644 index 0000000000..0793561f83 --- /dev/null +++ b/gencode/java/udmi/schema/PointsetModel.java @@ -0,0 +1,71 @@ + +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.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * 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 + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "points", + "sample_limit_sec", + "sample_rate_sec" +}) +@Generated("jsonschema2pojo") +public class PointsetModel { + + /** + * Information about a specific point name of the device. + * (Required) + * + */ + @JsonProperty("points") + @JsonPropertyDescription("Information about a specific point name of the device.") + public HashMap points; + /** + * Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update. + * + */ + @JsonProperty("sample_limit_sec") + @JsonPropertyDescription("Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.") + public Integer sample_limit_sec; + /** + * 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. + * + */ + @JsonProperty("sample_rate_sec") + @JsonPropertyDescription("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.") + public Integer sample_rate_sec; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.sample_rate_sec == null)? 0 :this.sample_rate_sec.hashCode())); + result = ((result* 31)+((this.sample_limit_sec == null)? 0 :this.sample_limit_sec.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 PointsetModel) == false) { + return false; + } + PointsetModel rhs = ((PointsetModel) 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.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)))); + } + +} diff --git a/gencode/java/udmi/schema/PointsetState.java b/gencode/java/udmi/schema/PointsetState.java new file mode 100644 index 0000000000..aaaaf94f2e --- /dev/null +++ b/gencode/java/udmi/schema/PointsetState.java @@ -0,0 +1,91 @@ + +package udmi.schema; + +import java.util.Date; +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.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Pointset State + *

+ * A set of points reporting telemetry data. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "state_etag", + "status", + "points" +}) +@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) + * + */ + @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) + * + */ + @JsonProperty("points") + @JsonPropertyDescription("Collection of point names, defining the representative point set for this device.") + public HashMap points; + + @Override + 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; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PointsetState) == false) { + 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.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/PointsetSummary.java b/gencode/java/udmi/schema/PointsetSummary.java new file mode 100644 index 0000000000..b5954b890b --- /dev/null +++ b/gencode/java/udmi/schema/PointsetSummary.java @@ -0,0 +1,62 @@ + +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; + + +/** + * Pointset Summary + *

+ * Errors specific to pointset handling + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "missing", + "extra" +}) +@Generated("jsonschema2pojo") +public class PointsetSummary { + + /** + * Missing points discovered while validating a device + * + */ + @JsonProperty("missing") + @JsonPropertyDescription("Missing points discovered while validating a device") + public List missing = new ArrayList(); + /** + * Extra points discovered while validating a device + * + */ + @JsonProperty("extra") + @JsonPropertyDescription("Extra points discovered while validating a device") + public List extra = new ArrayList(); + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.missing == null)? 0 :this.missing.hashCode())); + result = ((result* 31)+((this.extra == null)? 0 :this.extra.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PointsetSummary) == false) { + return false; + } + PointsetSummary rhs = ((PointsetSummary) other); + return (((this.missing == rhs.missing)||((this.missing!= null)&&this.missing.equals(rhs.missing)))&&((this.extra == rhs.extra)||((this.extra!= null)&&this.extra.equals(rhs.extra)))); + } + +} diff --git a/gencode/java/udmi/schema/Position.java b/gencode/java/udmi/schema/Position.java new file mode 100644 index 0000000000..e9192ea881 --- /dev/null +++ b/gencode/java/udmi/schema/Position.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; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "x", + "y", + "z" +}) +@Generated("jsonschema2pojo") +public class Position { + + /** + * The `x` coordinate of the device location in a project specific coordinate system + * + */ + @JsonProperty("x") + @JsonPropertyDescription("The `x` coordinate of the device location in a project specific coordinate system") + public Double x; + /** + * The `y` coordinate of the device location in a project specific coordinate system + * + */ + @JsonProperty("y") + @JsonPropertyDescription("The `y` coordinate of the device location in a project specific coordinate system") + public Double y; + /** + * The `z` (height) coordinate of the device location in a project specific coordinate system + * + */ + @JsonProperty("z") + @JsonPropertyDescription("The `z` (height) coordinate of the device location in a project specific coordinate system") + public Double z; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.x == null)? 0 :this.x.hashCode())); + result = ((result* 31)+((this.y == null)? 0 :this.y.hashCode())); + result = ((result* 31)+((this.z == null)? 0 :this.z.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Position) == false) { + return false; + } + Position rhs = ((Position) other); + return ((((this.x == rhs.x)||((this.x!= null)&&this.x.equals(rhs.x)))&&((this.y == rhs.y)||((this.y!= null)&&this.y.equals(rhs.y))))&&((this.z == rhs.z)||((this.z!= null)&&this.z.equals(rhs.z)))); + } + +} diff --git a/gencode/java/udmi/schema/Properties.java b/gencode/java/udmi/schema/Properties.java new file mode 100644 index 0000000000..c0391b7ad3 --- /dev/null +++ b/gencode/java/udmi/schema/Properties.java @@ -0,0 +1,153 @@ + +package udmi.schema; + +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; + + +/** + * Properties + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "key_type", + "version", + "connect" +}) +@Generated("jsonschema2pojo") +public class Properties { + + /** + * + * (Required) + * + */ + @JsonProperty("key_type") + public Properties.Key_type key_type; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public String version; + /** + * + * (Required) + * + */ + @JsonProperty("connect") + public Properties.Connect connect; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.key_type == null)? 0 :this.key_type.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.connect == null)? 0 :this.connect.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof Properties) == false) { + return false; + } + Properties rhs = ((Properties) other); + return ((((this.key_type == rhs.key_type)||((this.key_type!= null)&&this.key_type.equals(rhs.key_type)))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.connect == rhs.connect)||((this.connect!= null)&&this.connect.equals(rhs.connect)))); + } + + @Generated("jsonschema2pojo") + public enum Connect { + + DIRECT("direct"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (Properties.Connect c: values()) { + CONSTANTS.put(c.value, c); + } + } + + Connect(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static Properties.Connect fromValue(String value) { + Properties.Connect constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + + @Generated("jsonschema2pojo") + public enum Key_type { + + RSA_PEM("RSA_PEM"), + RSA_X_509_PEM("RSA_X509_PEM"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (Properties.Key_type c: values()) { + CONSTANTS.put(c.value, c); + } + } + + Key_type(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static Properties.Key_type fromValue(String value) { + Properties.Key_type constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/gencode/java/udmi/schema/PubberConfiguration.java b/gencode/java/udmi/schema/PubberConfiguration.java new file mode 100644 index 0000000000..dd23c8b9b9 --- /dev/null +++ b/gencode/java/udmi/schema/PubberConfiguration.java @@ -0,0 +1,96 @@ + +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; + + +/** + * Pubber Configuration + *

+ * Parameters to define a pubber runtime instance + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "endpoint", + "deviceId", + "gatewayId", + "sitePath", + "keyFile", + "algorithm", + "serialNo", + "macAddr", + "keyBytes", + "options" +}) +@Generated("jsonschema2pojo") +public class PubberConfiguration { + + /** + * Endpoint Configuration + *

+ * Parameters to define an MQTT endpoint + * + */ + @JsonProperty("endpoint") + @JsonPropertyDescription("Parameters to define an MQTT endpoint") + public EndpointConfiguration endpoint; + @JsonProperty("deviceId") + public String deviceId; + @JsonProperty("gatewayId") + public String gatewayId; + @JsonProperty("sitePath") + public String sitePath; + @JsonProperty("keyFile") + public String keyFile = "local/rsa_private.pkcs8"; + @JsonProperty("algorithm") + public String algorithm = "RS256"; + @JsonProperty("serialNo") + public String serialNo; + @JsonProperty("macAddr") + public String macAddr; + @JsonProperty("keyBytes") + public Object keyBytes; + /** + * Pubber Options + *

+ * Pubber runtime options + * + */ + @JsonProperty("options") + @JsonPropertyDescription("Pubber runtime options") + public PubberOptions options; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.sitePath == null)? 0 :this.sitePath.hashCode())); + result = ((result* 31)+((this.endpoint == null)? 0 :this.endpoint.hashCode())); + result = ((result* 31)+((this.keyBytes == null)? 0 :this.keyBytes.hashCode())); + result = ((result* 31)+((this.keyFile == null)? 0 :this.keyFile.hashCode())); + result = ((result* 31)+((this.options == null)? 0 :this.options.hashCode())); + result = ((result* 31)+((this.deviceId == null)? 0 :this.deviceId.hashCode())); + result = ((result* 31)+((this.gatewayId == null)? 0 :this.gatewayId.hashCode())); + result = ((result* 31)+((this.algorithm == null)? 0 :this.algorithm.hashCode())); + result = ((result* 31)+((this.serialNo == null)? 0 :this.serialNo.hashCode())); + result = ((result* 31)+((this.macAddr == null)? 0 :this.macAddr.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PubberConfiguration) == false) { + return false; + } + PubberConfiguration rhs = ((PubberConfiguration) other); + return (((((((((((this.sitePath == rhs.sitePath)||((this.sitePath!= null)&&this.sitePath.equals(rhs.sitePath)))&&((this.endpoint == rhs.endpoint)||((this.endpoint!= null)&&this.endpoint.equals(rhs.endpoint))))&&((this.keyBytes == rhs.keyBytes)||((this.keyBytes!= null)&&this.keyBytes.equals(rhs.keyBytes))))&&((this.keyFile == rhs.keyFile)||((this.keyFile!= null)&&this.keyFile.equals(rhs.keyFile))))&&((this.options == rhs.options)||((this.options!= null)&&this.options.equals(rhs.options))))&&((this.deviceId == rhs.deviceId)||((this.deviceId!= null)&&this.deviceId.equals(rhs.deviceId))))&&((this.gatewayId == rhs.gatewayId)||((this.gatewayId!= null)&&this.gatewayId.equals(rhs.gatewayId))))&&((this.algorithm == rhs.algorithm)||((this.algorithm!= null)&&this.algorithm.equals(rhs.algorithm))))&&((this.serialNo == rhs.serialNo)||((this.serialNo!= null)&&this.serialNo.equals(rhs.serialNo))))&&((this.macAddr == rhs.macAddr)||((this.macAddr!= null)&&this.macAddr.equals(rhs.macAddr)))); + } + +} diff --git a/gencode/java/udmi/schema/PubberOptions.java b/gencode/java/udmi/schema/PubberOptions.java new file mode 100644 index 0000000000..50ac5d562d --- /dev/null +++ b/gencode/java/udmi/schema/PubberOptions.java @@ -0,0 +1,65 @@ + +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; + + +/** + * Pubber Options + *

+ * Pubber runtime options + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "noHardware", + "noConfigAck", + "extraPoint", + "missingPoint", + "extraField", + "redirectRegistry" +}) +@Generated("jsonschema2pojo") +public class PubberOptions { + + @JsonProperty("noHardware") + public Boolean noHardware; + @JsonProperty("noConfigAck") + public Boolean noConfigAck; + @JsonProperty("extraPoint") + public String extraPoint; + @JsonProperty("missingPoint") + public String missingPoint; + @JsonProperty("extraField") + public String extraField; + @JsonProperty("redirectRegistry") + public String redirectRegistry; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.redirectRegistry == null)? 0 :this.redirectRegistry.hashCode())); + result = ((result* 31)+((this.noHardware == null)? 0 :this.noHardware.hashCode())); + result = ((result* 31)+((this.extraField == null)? 0 :this.extraField.hashCode())); + result = ((result* 31)+((this.missingPoint == null)? 0 :this.missingPoint.hashCode())); + result = ((result* 31)+((this.noConfigAck == null)? 0 :this.noConfigAck.hashCode())); + result = ((result* 31)+((this.extraPoint == null)? 0 :this.extraPoint.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof PubberOptions) == false) { + return false; + } + PubberOptions rhs = ((PubberOptions) other); + return (((((((this.redirectRegistry == rhs.redirectRegistry)||((this.redirectRegistry!= null)&&this.redirectRegistry.equals(rhs.redirectRegistry)))&&((this.noHardware == rhs.noHardware)||((this.noHardware!= null)&&this.noHardware.equals(rhs.noHardware))))&&((this.extraField == rhs.extraField)||((this.extraField!= null)&&this.extraField.equals(rhs.extraField))))&&((this.missingPoint == rhs.missingPoint)||((this.missingPoint!= null)&&this.missingPoint.equals(rhs.missingPoint))))&&((this.noConfigAck == rhs.noConfigAck)||((this.noConfigAck!= null)&&this.noConfigAck.equals(rhs.noConfigAck))))&&((this.extraPoint == rhs.extraPoint)||((this.extraPoint!= null)&&this.extraPoint.equals(rhs.extraPoint)))); + } + +} diff --git a/gencode/java/udmi/schema/ReflectorConfig.java b/gencode/java/udmi/schema/ReflectorConfig.java new file mode 100644 index 0000000000..1babd2f1f9 --- /dev/null +++ b/gencode/java/udmi/schema/ReflectorConfig.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; + + +/** + * Reflector Config + *

+ * Config for a reflector client + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "setup" +}) +@Generated("jsonschema2pojo") +public class ReflectorConfig { + + /** + * RFC 3339 Timestamp the state payload was generated + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 Timestamp the state payload was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public String version; + /** + * Setup Reflector Config + *

+ * + * + */ + @JsonProperty("setup") + public SetupReflectorConfig setup; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.setup == null)? 0 :this.setup.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 ReflectorConfig) == false) { + return false; + } + ReflectorConfig rhs = ((ReflectorConfig) other); + return ((((this.setup == rhs.setup)||((this.setup!= null)&&this.setup.equals(rhs.setup)))&&((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/ReflectorState.java b/gencode/java/udmi/schema/ReflectorState.java new file mode 100644 index 0000000000..49b22a348f --- /dev/null +++ b/gencode/java/udmi/schema/ReflectorState.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; + + +/** + * Reflector State + *

+ * State of a reflector client + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "setup" +}) +@Generated("jsonschema2pojo") +public class ReflectorState { + + /** + * RFC 3339 Timestamp the state payload was generated + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 Timestamp the state payload was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public String version; + /** + * Setup Reflector State + *

+ * + * + */ + @JsonProperty("setup") + public SetupReflectorState setup; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.setup == null)? 0 :this.setup.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 ReflectorState) == false) { + return false; + } + ReflectorState rhs = ((ReflectorState) other); + return ((((this.setup == rhs.setup)||((this.setup!= null)&&this.setup.equals(rhs.setup)))&&((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/SetupReflectorConfig.java b/gencode/java/udmi/schema/SetupReflectorConfig.java new file mode 100644 index 0000000000..d7aaebb4b5 --- /dev/null +++ b/gencode/java/udmi/schema/SetupReflectorConfig.java @@ -0,0 +1,50 @@ + +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.JsonPropertyOrder; + + +/** + * Setup Reflector Config + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "last_state", + "deployed_at" +}) +@Generated("jsonschema2pojo") +public class SetupReflectorConfig { + + @JsonProperty("last_state") + public Date last_state; + @JsonProperty("deployed_at") + public Date deployed_at; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.last_state == null)? 0 :this.last_state.hashCode())); + result = ((result* 31)+((this.deployed_at == null)? 0 :this.deployed_at.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof SetupReflectorConfig) == false) { + return false; + } + SetupReflectorConfig rhs = ((SetupReflectorConfig) other); + return (((this.last_state == rhs.last_state)||((this.last_state!= null)&&this.last_state.equals(rhs.last_state)))&&((this.deployed_at == rhs.deployed_at)||((this.deployed_at!= null)&&this.deployed_at.equals(rhs.deployed_at)))); + } + +} diff --git a/gencode/java/udmi/schema/SetupReflectorState.java b/gencode/java/udmi/schema/SetupReflectorState.java new file mode 100644 index 0000000000..791c8e4e4d --- /dev/null +++ b/gencode/java/udmi/schema/SetupReflectorState.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; + + +/** + * Setup Reflector State + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "user" +}) +@Generated("jsonschema2pojo") +public class SetupReflectorState { + + @JsonProperty("user") + public String user; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.user == null)? 0 :this.user.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof SetupReflectorState) == false) { + return false; + } + SetupReflectorState rhs = ((SetupReflectorState) other); + return ((this.user == rhs.user)||((this.user!= null)&&this.user.equals(rhs.user))); + } + +} diff --git a/gencode/java/udmi/schema/State.java b/gencode/java/udmi/schema/State.java new file mode 100644 index 0000000000..e9ed2116cf --- /dev/null +++ b/gencode/java/udmi/schema/State.java @@ -0,0 +1,118 @@ + +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; + + +/** + * State + *

+ * [State](../docs/messages/state.md) message, defined by [`state.json`] + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "system", + "gateway", + "discovery", + "blobset", + "pointset" +}) +@Generated("jsonschema2pojo") +public class State { + + /** + * RFC 3339 Timestamp the state payload was generated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 Timestamp the state payload was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public String version; + /** + * System State + *

+ * [System State Documentation](../docs/messages/system.md#state) + * (Required) + * + */ + @JsonProperty("system") + @JsonPropertyDescription("[System State Documentation](../docs/messages/system.md#state)") + public SystemState system; + /** + * Gateway State + *

+ * [Gateway Documentation](../docs/specs/gateway.md) + * + */ + @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 + *

+ * + * + */ + @JsonProperty("blobset") + public BlobsetState blobset; + /** + * Pointset State + *

+ * A set of points reporting telemetry data. + * + */ + @JsonProperty("pointset") + @JsonPropertyDescription("A set of points reporting telemetry data.") + public PointsetState pointset; + + @Override + 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())); + result = ((result* 31)+((this.gateway == null)? 0 :this.gateway.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 State) == false) { + return false; + } + State rhs = ((State) other); + 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/SystemConfig.java b/gencode/java/udmi/schema/SystemConfig.java new file mode 100644 index 0000000000..4f6d3752c2 --- /dev/null +++ b/gencode/java/udmi/schema/SystemConfig.java @@ -0,0 +1,123 @@ + +package udmi.schema; + +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; + + +/** + * System Config + *

+ * [System Config Documentation](../docs/messages/system.md#config) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "min_loglevel", + "metrics_rate_sec", + "mode" +}) +@Generated("jsonschema2pojo") +public class SystemConfig { + + /** + * The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300. + * + */ + @JsonProperty("min_loglevel") + @JsonPropertyDescription("The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300.") + public Integer min_loglevel = 300; + /** + * The rate at which the system should send system event metric updates. 0 indicates no updates. + * + */ + @JsonProperty("metrics_rate_sec") + @JsonPropertyDescription("The rate at which the system should send system event metric updates. 0 indicates no updates.") + public Integer metrics_rate_sec = 600; + /** + * System Mode + *

+ * Operating mode for the device. Defaults is 'active'. + * + */ + @JsonProperty("mode") + @JsonPropertyDescription("Operating mode for the device. Defaults is 'active'.") + public SystemConfig.SystemMode mode; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.metrics_rate_sec == null)? 0 :this.metrics_rate_sec.hashCode())); + result = ((result* 31)+((this.mode == null)? 0 :this.mode.hashCode())); + result = ((result* 31)+((this.min_loglevel == null)? 0 :this.min_loglevel.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof SystemConfig) == false) { + return false; + } + SystemConfig rhs = ((SystemConfig) other); + return ((((this.metrics_rate_sec == rhs.metrics_rate_sec)||((this.metrics_rate_sec!= null)&&this.metrics_rate_sec.equals(rhs.metrics_rate_sec)))&&((this.mode == rhs.mode)||((this.mode!= null)&&this.mode.equals(rhs.mode))))&&((this.min_loglevel == rhs.min_loglevel)||((this.min_loglevel!= null)&&this.min_loglevel.equals(rhs.min_loglevel)))); + } + + + /** + * System Mode + *

+ * Operating mode for the device. Defaults is 'active'. + * + */ + @Generated("jsonschema2pojo") + public enum SystemMode { + + INITIAL("initial"), + ACTIVE("active"), + RESTART("restart"); + private final String value; + private final static Map CONSTANTS = new HashMap(); + + static { + for (SystemConfig.SystemMode c: values()) { + CONSTANTS.put(c.value, c); + } + } + + SystemMode(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + @JsonValue + public String value() { + return this.value; + } + + @JsonCreator + public static SystemConfig.SystemMode fromValue(String value) { + SystemConfig.SystemMode constant = CONSTANTS.get(value); + if (constant == null) { + throw new IllegalArgumentException(value); + } else { + return constant; + } + } + + } + +} diff --git a/gencode/java/udmi/schema/SystemDiscoveryEvent.java b/gencode/java/udmi/schema/SystemDiscoveryEvent.java new file mode 100644 index 0000000000..e988f41972 --- /dev/null +++ b/gencode/java/udmi/schema/SystemDiscoveryEvent.java @@ -0,0 +1,74 @@ + +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.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * System Discovery Event + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "serial_no", + "ancillary", + "hardware" +}) +@Generated("jsonschema2pojo") +public class SystemDiscoveryEvent { + + /** + * The serial number of the physical device + * + */ + @JsonProperty("serial_no") + @JsonPropertyDescription("The serial number of the physical device") + public java.lang.String serial_no; + /** + * Ancillary Properties + *

+ * Arbitrary blob of json associated with this point + * + */ + @JsonProperty("ancillary") + @JsonPropertyDescription("Arbitrary blob of json associated with this point") + public HashMap ancillary; + /** + * SystemHardware + *

+ * A collection of fields which describe the physical hardware of the device. + * + */ + @JsonProperty("hardware") + @JsonPropertyDescription("A collection of fields which describe the physical hardware of the device.") + public SystemHardware hardware; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.ancillary == null)? 0 :this.ancillary.hashCode())); + result = ((result* 31)+((this.serial_no == null)? 0 :this.serial_no.hashCode())); + result = ((result* 31)+((this.hardware == null)? 0 :this.hardware.hashCode())); + return result; + } + + @Override + public boolean equals(java.lang.Object other) { + if (other == this) { + return true; + } + if ((other instanceof SystemDiscoveryEvent) == false) { + return false; + } + SystemDiscoveryEvent rhs = ((SystemDiscoveryEvent) other); + return ((((this.ancillary == rhs.ancillary)||((this.ancillary!= null)&&this.ancillary.equals(rhs.ancillary)))&&((this.serial_no == rhs.serial_no)||((this.serial_no!= null)&&this.serial_no.equals(rhs.serial_no))))&&((this.hardware == rhs.hardware)||((this.hardware!= null)&&this.hardware.equals(rhs.hardware)))); + } + +} diff --git a/gencode/java/udmi/schema/SystemEvent.java b/gencode/java/udmi/schema/SystemEvent.java new file mode 100644 index 0000000000..069180c6c7 --- /dev/null +++ b/gencode/java/udmi/schema/SystemEvent.java @@ -0,0 +1,73 @@ + +package udmi.schema; + +import java.util.ArrayList; +import java.util.Date; +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; + + +/** + * System Event + *

+ * Used for system events such as logging. [System Event Documentation](../docs/messages/system.md#event) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "logentries", + "metrics" +}) +@Generated("jsonschema2pojo") +public class SystemEvent { + + /** + * RFC 3339 timestamp the event payload was generated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the event payload was generated") + public Date timestamp; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public String version; + @JsonProperty("logentries") + public List logentries = new ArrayList(); + @JsonProperty("metrics") + public Metrics metrics; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.metrics == null)? 0 :this.metrics.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.logentries == null)? 0 :this.logentries.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof SystemEvent) == false) { + return false; + } + SystemEvent rhs = ((SystemEvent) other); + return (((((this.metrics == rhs.metrics)||((this.metrics!= null)&&this.metrics.equals(rhs.metrics)))&&((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.logentries == rhs.logentries)||((this.logentries!= null)&&this.logentries.equals(rhs.logentries)))); + } + +} diff --git a/gencode/java/udmi/schema/SystemHardware.java b/gencode/java/udmi/schema/SystemHardware.java new file mode 100644 index 0000000000..e2ca922211 --- /dev/null +++ b/gencode/java/udmi/schema/SystemHardware.java @@ -0,0 +1,80 @@ + +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; + + +/** + * SystemHardware + *

+ * A collection of fields which describe the physical hardware of the device. + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "make", + "model", + "sku", + "rev" +}) +@Generated("jsonschema2pojo") +public class SystemHardware { + + /** + * The manufacturer of the device + * (Required) + * + */ + @JsonProperty("make") + @JsonPropertyDescription("The manufacturer of the device") + public String make; + /** + * The model of the device + * (Required) + * + */ + @JsonProperty("model") + @JsonPropertyDescription("The model of the device") + public String model; + /** + * A stock keeping unit which identifies the unique composition of a device, for example those with different hardware configurations + * + */ + @JsonProperty("sku") + @JsonPropertyDescription("A stock keeping unit which identifies the unique composition of a device, for example those with different hardware configurations") + public String sku; + /** + * Hardware revision of the device + * + */ + @JsonProperty("rev") + @JsonPropertyDescription("Hardware revision of the device") + public String rev; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.model == null)? 0 :this.model.hashCode())); + result = ((result* 31)+((this.rev == null)? 0 :this.rev.hashCode())); + result = ((result* 31)+((this.sku == null)? 0 :this.sku.hashCode())); + result = ((result* 31)+((this.make == null)? 0 :this.make.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof SystemHardware) == false) { + return false; + } + SystemHardware rhs = ((SystemHardware) other); + return (((((this.model == rhs.model)||((this.model!= null)&&this.model.equals(rhs.model)))&&((this.rev == rhs.rev)||((this.rev!= null)&&this.rev.equals(rhs.rev))))&&((this.sku == rhs.sku)||((this.sku!= null)&&this.sku.equals(rhs.sku))))&&((this.make == rhs.make)||((this.make!= null)&&this.make.equals(rhs.make)))); + } + +} diff --git a/gencode/java/udmi/schema/SystemModel.java b/gencode/java/udmi/schema/SystemModel.java new file mode 100644 index 0000000000..afdd1583f6 --- /dev/null +++ b/gencode/java/udmi/schema/SystemModel.java @@ -0,0 +1,75 @@ + +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; + + +/** + * System Model + *

+ * High-level system information about the device. [System Model Documentation](../docs/messages/system.md) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "location", + "physical_tag", + "aux", + "min_loglevel" +}) +@Generated("jsonschema2pojo") +public class SystemModel { + + /** + * Properties the expected physical location of the device. + * (Required) + * + */ + @JsonProperty("location") + @JsonPropertyDescription("Properties the expected physical location of the device.") + public Location location; + /** + * Information used to print a physical QR code label. + * (Required) + * + */ + @JsonProperty("physical_tag") + @JsonPropertyDescription("Information used to print a physical QR code label.") + public Physical_tag physical_tag; + @JsonProperty("aux") + public Aux aux; + /** + * The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300. + * + */ + @JsonProperty("min_loglevel") + @JsonPropertyDescription("The minimum loglevel for reporting log messages below which log entries should not be sent. Default to 300.") + public Integer min_loglevel = 300; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.location == null)? 0 :this.location.hashCode())); + result = ((result* 31)+((this.physical_tag == null)? 0 :this.physical_tag.hashCode())); + result = ((result* 31)+((this.aux == null)? 0 :this.aux.hashCode())); + result = ((result* 31)+((this.min_loglevel == null)? 0 :this.min_loglevel.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof SystemModel) == false) { + return false; + } + 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))))&&((this.min_loglevel == rhs.min_loglevel)||((this.min_loglevel!= null)&&this.min_loglevel.equals(rhs.min_loglevel)))); + } + +} diff --git a/gencode/java/udmi/schema/SystemState.java b/gencode/java/udmi/schema/SystemState.java new file mode 100644 index 0000000000..020802458f --- /dev/null +++ b/gencode/java/udmi/schema/SystemState.java @@ -0,0 +1,139 @@ + +package udmi.schema; + +import java.util.Date; +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; + + +/** + * System State + *

+ * [System State Documentation](../docs/messages/system.md#state) + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "last_config", + "operational", + "mode", + "serial_no", + "hardware", + "software", + "params", + "status" +}) +@Generated("jsonschema2pojo") +public class SystemState { + + /** + * 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; + /** + * Time from the `timestamp` field of the last successfully parsed `config` message (not the timestamp the message was received/processed). Part of the [config state sequence](../docs/specs/sequences/config.md) + * (Required) + * + */ + @JsonProperty("last_config") + @JsonPropertyDescription("Time from the `timestamp` field of the last successfully parsed `config` message (not the timestamp the message was received/processed). Part of the [config state sequence](../docs/specs/sequences/config.md)") + public Date last_config; + /** + * Operational status of the device. + * (Required) + * + */ + @JsonProperty("operational") + @JsonPropertyDescription("Operational status of the device.") + public Boolean operational; + /** + * System Mode + *

+ * Operating mode for the device. Defaults is 'active'. + * + */ + @JsonProperty("mode") + @JsonPropertyDescription("Operating mode for the device. Defaults is 'active'.") + public udmi.schema.SystemConfig.SystemMode mode; + /** + * The serial number of the physical device + * (Required) + * + */ + @JsonProperty("serial_no") + @JsonPropertyDescription("The serial number of the physical device") + public java.lang.String serial_no; + /** + * SystemHardware + *

+ * A collection of fields which describe the physical hardware of the device. + * (Required) + * + */ + @JsonProperty("hardware") + @JsonPropertyDescription("A collection of fields which describe the physical hardware of the device.") + public SystemHardware hardware; + /** + * A collection of items which can be used to describe version of software running on a device + * (Required) + * + */ + @JsonProperty("software") + @JsonPropertyDescription("A collection of items which can be used to describe version of software running on a device") + public Map software; + @JsonProperty("params") + public Map params; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.mode == null)? 0 :this.mode.hashCode())); + result = ((result* 31)+((this.software == null)? 0 :this.software.hashCode())); + result = ((result* 31)+((this.operational == null)? 0 :this.operational.hashCode())); + result = ((result* 31)+((this.params == null)? 0 :this.params.hashCode())); + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.serial_no == null)? 0 :this.serial_no.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + result = ((result* 31)+((this.last_config == null)? 0 :this.last_config.hashCode())); + result = ((result* 31)+((this.hardware == null)? 0 :this.hardware.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 SystemState) == false) { + return false; + } + SystemState rhs = ((SystemState) other); + return (((((((((((this.mode == rhs.mode)||((this.mode!= null)&&this.mode.equals(rhs.mode)))&&((this.software == rhs.software)||((this.software!= null)&&this.software.equals(rhs.software))))&&((this.operational == rhs.operational)||((this.operational!= null)&&this.operational.equals(rhs.operational))))&&((this.params == rhs.params)||((this.params!= null)&&this.params.equals(rhs.params))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.serial_no == rhs.serial_no)||((this.serial_no!= null)&&this.serial_no.equals(rhs.serial_no))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.last_config == rhs.last_config)||((this.last_config!= null)&&this.last_config.equals(rhs.last_config))))&&((this.hardware == rhs.hardware)||((this.hardware!= null)&&this.hardware.equals(rhs.hardware))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status)))); + } + +} diff --git a/gencode/java/udmi/schema/TargetTestingModel.java b/gencode/java/udmi/schema/TargetTestingModel.java new file mode 100644 index 0000000000..38df3828e3 --- /dev/null +++ b/gencode/java/udmi/schema/TargetTestingModel.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; + + +/** + * Target Testing Model + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "target_point", + "target_value" +}) +@Generated("jsonschema2pojo") +public class TargetTestingModel { + + /** + * Point name used for testing + * + */ + @JsonProperty("target_point") + @JsonPropertyDescription("Point name used for testing") + public String target_point; + /** + * Value used for testing + * + */ + @JsonProperty("target_value") + @JsonPropertyDescription("Value used for testing") + public Object target_value; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.target_point == null)? 0 :this.target_point.hashCode())); + result = ((result* 31)+((this.target_value == null)? 0 :this.target_value.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TargetTestingModel) == false) { + return false; + } + 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/TestingModel.java b/gencode/java/udmi/schema/TestingModel.java new file mode 100644 index 0000000000..cc857d9423 --- /dev/null +++ b/gencode/java/udmi/schema/TestingModel.java @@ -0,0 +1,46 @@ + +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; + + +/** + * Testing Model + *

+ * Testing target parameters + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "targets" +}) +@Generated("jsonschema2pojo") +public class TestingModel { + + @JsonProperty("targets") + public HashMap targets; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.targets == null)? 0 :this.targets.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestingModel) == false) { + return false; + } + TestingModel rhs = ((TestingModel) other); + return ((this.targets == rhs.targets)||((this.targets!= null)&&this.targets.equals(rhs.targets))); + } + +} diff --git a/gencode/java/udmi/schema/ValidationEvent.java b/gencode/java/udmi/schema/ValidationEvent.java new file mode 100644 index 0000000000..467ba55f38 --- /dev/null +++ b/gencode/java/udmi/schema/ValidationEvent.java @@ -0,0 +1,137 @@ + +package udmi.schema; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +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; + + +/** + * Validation Event + *

+ * Validation result + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version", + "last_updated", + "sub_folder", + "sub_type", + "status", + "pointset", + "errors", + "summary", + "devices" +}) +@Generated("jsonschema2pojo") +public class ValidationEvent { + + /** + * 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; + /** + * Version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Version of the UDMI schema") + public java.lang.String version; + /** + * Last time this validation report was updated + * + */ + @JsonProperty("last_updated") + @JsonPropertyDescription("Last time this validation report was updated") + public Date last_updated; + /** + * Subfolder of the validated message + * + */ + @JsonProperty("sub_folder") + @JsonPropertyDescription("Subfolder of the validated message") + public java.lang.String sub_folder; + /** + * Subtype of the validated message + * + */ + @JsonProperty("sub_type") + @JsonPropertyDescription("Subtype of the validated message") + public java.lang.String sub_type; + /** + * Entry + *

+ * + * + */ + @JsonProperty("status") + public Entry status; + /** + * Pointset Summary + *

+ * Errors specific to pointset handling + * + */ + @JsonProperty("pointset") + @JsonPropertyDescription("Errors specific to pointset handling") + public PointsetSummary pointset; + /** + * List of errors encountered while validating a device + * + */ + @JsonProperty("errors") + @JsonPropertyDescription("List of errors encountered while validating a device") + public List errors = new ArrayList(); + /** + * Validation Summary + *

+ * + * + */ + @JsonProperty("summary") + public ValidationSummary summary; + @JsonProperty("devices") + public Map devices; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.summary == null)? 0 :this.summary.hashCode())); + result = ((result* 31)+((this.last_updated == null)? 0 :this.last_updated.hashCode())); + result = ((result* 31)+((this.sub_type == null)? 0 :this.sub_type.hashCode())); + result = ((result* 31)+((this.devices == null)? 0 :this.devices.hashCode())); + result = ((result* 31)+((this.sub_folder == null)? 0 :this.sub_folder.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.errors == null)? 0 :this.errors.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.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 ValidationEvent) == false) { + return false; + } + ValidationEvent rhs = ((ValidationEvent) other); + return (((((((((((this.summary == rhs.summary)||((this.summary!= null)&&this.summary.equals(rhs.summary)))&&((this.last_updated == rhs.last_updated)||((this.last_updated!= null)&&this.last_updated.equals(rhs.last_updated))))&&((this.sub_type == rhs.sub_type)||((this.sub_type!= null)&&this.sub_type.equals(rhs.sub_type))))&&((this.devices == rhs.devices)||((this.devices!= null)&&this.devices.equals(rhs.devices))))&&((this.sub_folder == rhs.sub_folder)||((this.sub_folder!= null)&&this.sub_folder.equals(rhs.sub_folder))))&&((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.errors == rhs.errors)||((this.errors!= null)&&this.errors.equals(rhs.errors))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status)))); + } + +} diff --git a/gencode/java/udmi/schema/ValidationSummary.java b/gencode/java/udmi/schema/ValidationSummary.java new file mode 100644 index 0000000000..88608db729 --- /dev/null +++ b/gencode/java/udmi/schema/ValidationSummary.java @@ -0,0 +1,59 @@ + +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.JsonPropertyOrder; + + +/** + * Validation Summary + *

+ * + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "correct_devices", + "extra_devices", + "missing_devices", + "error_devices" +}) +@Generated("jsonschema2pojo") +public class ValidationSummary { + + @JsonProperty("correct_devices") + public List correct_devices = new ArrayList(); + @JsonProperty("extra_devices") + public List extra_devices = new ArrayList(); + @JsonProperty("missing_devices") + public List missing_devices = new ArrayList(); + @JsonProperty("error_devices") + public List error_devices = new ArrayList(); + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.error_devices == null)? 0 :this.error_devices.hashCode())); + result = ((result* 31)+((this.correct_devices == null)? 0 :this.correct_devices.hashCode())); + result = ((result* 31)+((this.extra_devices == null)? 0 :this.extra_devices.hashCode())); + result = ((result* 31)+((this.missing_devices == null)? 0 :this.missing_devices.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof ValidationSummary) == false) { + return false; + } + ValidationSummary rhs = ((ValidationSummary) other); + return (((((this.error_devices == rhs.error_devices)||((this.error_devices!= null)&&this.error_devices.equals(rhs.error_devices)))&&((this.correct_devices == rhs.correct_devices)||((this.correct_devices!= null)&&this.correct_devices.equals(rhs.correct_devices))))&&((this.extra_devices == rhs.extra_devices)||((this.extra_devices!= null)&&this.extra_devices.equals(rhs.extra_devices))))&&((this.missing_devices == rhs.missing_devices)||((this.missing_devices!= null)&&this.missing_devices.equals(rhs.missing_devices)))); + } + +} diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 581e1f79eb..0fe9b14afd 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -1,9 +1,6 @@ from .ancillary_properties import AncillaryProperties -<<<<<<< HEAD -from .category import ObjectD83FA82F -======= +from .category import Object9194F77A from .cloud_iot_config import CloudIotConfig ->>>>>>> master from .command_discovery import DiscoveryCommand from .common import Common from .config import Config diff --git a/gencode/python/udmi/schema/category.py b/gencode/python/udmi/schema/category.py index b7df8ae173..713f79b049 100644 --- a/gencode/python/udmi/schema/category.py +++ b/gencode/python/udmi/schema/category.py @@ -1,7 +1,7 @@ """Generated class for category.json""" -class ObjectD83FA82F: +class Object9194F77A: """Generated schema class""" def __init__(self): @@ -11,7 +11,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = ObjectD83FA82F() + result = Object9194F77A() return result @staticmethod @@ -20,7 +20,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = ObjectD83FA82F.from_dict(source[key]) + result[key] = Object9194F77A.from_dict(source[key]) return result @staticmethod diff --git a/schema/category.json b/schema/category.json index 4b9e7a5b2a..044d355638 100644 --- a/schema/category.json +++ b/schema/category.json @@ -1,28 +1,15 @@ { + "$comment": "Auto-generated category mappings from bin/gencode_categories.", "oneOf": [ - // auto-generated category mappings from bin/gencode_categories -* _system_: Basic system operation - * _base_: Baseline system operational messages - * _start_: (**NOTICE**) System is in the process of (re)starting and essentially offline - * _shutdown_: (**NOTICE**) System is shutting down - * _ready_: (**NOTICE**): System is fully ready for operation - * _comms_: Baseline message handling - * _config_: Configuration message handling - * _receive_: (**DEBUG**) Receiving a config message - * _parse_: (**DEBUG**) Parsing a received message - * _apply_: (**NOTICE**) Application of a parsed config message - * _network_: Network (IP) message handling - * _connect_: (**NOTICE**) Connected to the network - * _disconnect_: (**NOTICE**) Disconnected from a network - * _auth_: Authentication to local application (e.g. web server, SSH) - * _login_: (**NOTICE**) Successful login. The entry message should include the username and application - * _logout_: (**NOTICE**) Successful logout - * _fail_: (**WARNING**) Failed authentication attempt. The entry message should include the application -* _pointset_: Handling managing data point conditions - * _point_: Conditions relating to a specific point, the entry `message` field should - * _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 + { "pattern": "^system\\.base\\.start$" }, + { "pattern": "^system\\.base\\.shutdown$" }, + { "pattern": "^system\\.config\\.receive$" }, + { "pattern": "^system\\.config\\.parse$" }, + { "pattern": "^system\\.config\\.apply$" }, + { "pattern": "^system\\.network\\.connect$" }, + { "pattern": "^system\\.network\\.disconnect$" }, + { "pattern": "^system\\.auth\\.login$" }, + { "pattern": "^system\\.auth\\.logout$" }, + { "pattern": "^system\\.auth\\.fail$" } ] } From 9b6994efcf082d2c7c7b001a429293cab19fe2f8 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 12:56:05 -0700 Subject: [PATCH 08/70] One round of cleanup --- bin/gencode_categories | 15 +++++++-------- etc/Category.java | 8 +------- tests/event_system.tests/errors.json | 2 +- tests/event_system.tests/fcu.json | 4 ++-- tests/event_validation.tests/report.json | 2 +- tests/event_validation.tests/simple_ok.json | 2 +- tests/state.tests/example.json | 2 +- tests/state.tests/fcu.json | 6 +++--- tests/state.tests/gateway.json | 6 +++--- tests/state.tests/makemodel_error.json | 2 +- tests/state.tests/makemodel_upgrade.json | 2 +- tests/state.tests/restart.json | 2 +- 12 files changed, 23 insertions(+), 30 deletions(-) diff --git a/bin/gencode_categories b/bin/gencode_categories index a9420c2b54..c66aa006ec 100755 --- a/bin/gencode_categories +++ b/bin/gencode_categories @@ -10,7 +10,7 @@ import sys GENCODE_MARKER = '@@ ' CATEGORY_MARKER = '* ' CATEGORY_REGEX = ' *\\* _([a-z]+)_: (\(\*\*([A-Z]+)\*\*\) )?(.*)' -JSON_FORMAT = '%s { "pattern": "^%s$" }' +JSON_FORMAT = '%s%s{ "pattern": "^%s$" }' doc_in = os.path.join('docs/specs/categories.md') schema_in = os.path.join('etc/category.json') @@ -18,7 +18,6 @@ schema_out = os.path.join('schema/category.json') java_in = os.path.join('etc/Category.java') java_out = os.path.join('gencode/java/udmi/schema/Category.java') - def calculate_index_level(line): if not line.strip().startswith(CATEGORY_MARKER): return -1 @@ -56,17 +55,17 @@ def write_schema_out(categories): with open(schema_out, 'w') as out: while line := inp.readline(): if line.strip().startswith(GENCODE_MARKER): - write_schema_categories(out, categories) + indent = line[0:line.find(GENCODE_MARKER)] + write_schema_categories(out, indent, categories) else: out.write(line) -def write_schema_categories(out, categories): - first = True +def write_schema_categories(out, indent, categories): + prefix = '' for category in categories: - prefix = '' if first else ',\n' target = category[0].replace('.', '\\\\.') - out.write(JSON_FORMAT % (prefix, target)) - first = False + out.write(JSON_FORMAT % (prefix, indent, target)) + prefix = ',\n' out.write('\n') categories = read_categories() diff --git a/etc/Category.java b/etc/Category.java index 1ee2f320e4..a4c2ed3bb7 100644 --- a/etc/Category.java +++ b/etc/Category.java @@ -6,11 +6,5 @@ // This class is manually curated, auto-generated, and then copied into the gencode directory. // Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md public class Category { - - public static final String SYSTEM_CONFIG_RECEIVE ="system.config.receive"; - public static final Level SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; - public static final String SYSTEM_CONFIG_PARSE ="system.config.parse"; - public static final Level SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; - public static final String SYSTEM_CONFIG_APPLY ="system.config.apply"; - public static final Level SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; + @@ gencode stuff goes here } diff --git a/tests/event_system.tests/errors.json b/tests/event_system.tests/errors.json index ddf4c70815..fb39ffa49c 100644 --- a/tests/event_system.tests/errors.json +++ b/tests/event_system.tests/errors.json @@ -4,7 +4,7 @@ "logentries": [ { "detail": "someplace, sometime", - "category": "com.testCategory$", + "category": "system.unknown.cateogry", "level": 60 }, "nope" diff --git a/tests/event_system.tests/fcu.json b/tests/event_system.tests/fcu.json index f1b8276df8..8df9d76fa3 100644 --- a/tests/event_system.tests/fcu.json +++ b/tests/event_system.tests/fcu.json @@ -5,14 +5,14 @@ { "message": "System Booted", "timestamp": "2018-08-26T20:39:19.364Z", - "category": "com.acme.system", + "category": "system.config.apply", "level": 300 }, { "message": "Device communication failed", "detail": "Connection attempt to device 3564 failed", "timestamp": "2018-08-26T21:39:19.364Z", - "category": "com.acme.comms", + "category": "system.config.apply", "level": 700 } ] diff --git a/tests/event_validation.tests/report.json b/tests/event_validation.tests/report.json index d12117bfc1..476a5444a0 100644 --- a/tests/event_validation.tests/report.json +++ b/tests/event_validation.tests/report.json @@ -14,7 +14,7 @@ "oldest_mark": "2022-07-16T18:27:19Z", "status": { "message": "Tickity Boo", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 600 } diff --git a/tests/event_validation.tests/simple_ok.json b/tests/event_validation.tests/simple_ok.json index 42d0c9b2d4..119158c4a7 100644 --- a/tests/event_validation.tests/simple_ok.json +++ b/tests/event_validation.tests/simple_ok.json @@ -5,7 +5,7 @@ "sub_folder": "discovery", "status": { "message": "Tickity Boo", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 600 }, diff --git a/tests/state.tests/example.json b/tests/state.tests/example.json index 60fdfae12e..c8b59cacd0 100644 --- a/tests/state.tests/example.json +++ b/tests/state.tests/example.json @@ -14,7 +14,7 @@ "operational": true, "status": { "message": "Tickity Boo", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 600 } diff --git a/tests/state.tests/fcu.json b/tests/state.tests/fcu.json index 323e13e4cd..4ba4328885 100644 --- a/tests/state.tests/fcu.json +++ b/tests/state.tests/fcu.json @@ -21,7 +21,7 @@ "space_temperature_sensor": { "status": { "message": "Present value out of limits", - "category": "com.acme.device.regulator", + "category": "system.config.apply", "timestamp": "2019-01-17T11:39:28.364Z", "level": 400 } @@ -30,7 +30,7 @@ "value_state": "overridden", "status": { "message": "Value overridden by set_value", - "category": "com.acme.device.monitor", + "category": "system.config.apply", "timestamp": "2019-01-17T10:59:11.364Z", "level": 300 } @@ -39,7 +39,7 @@ "value_state": "overridden", "status": { "message": "Value overridden by set_value", - "category": "com.acme.device.manager", + "category": "system.config.apply", "timestamp": "2019-01-17T13:14:55.364Z", "level": 300 } diff --git a/tests/state.tests/gateway.json b/tests/state.tests/gateway.json index 44d6ae2291..9c16c745c4 100644 --- a/tests/state.tests/gateway.json +++ b/tests/state.tests/gateway.json @@ -25,7 +25,7 @@ "operational": true, "status": { "message": "Tickity Boo", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 600 } @@ -35,7 +35,7 @@ "991": { "status": { "message": "Error attaching device", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 600 } @@ -43,7 +43,7 @@ "SMS-91": { "status": { "message": "Error attaching device", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 600 } diff --git a/tests/state.tests/makemodel_error.json b/tests/state.tests/makemodel_error.json index f16674fbe1..091ec2d985 100644 --- a/tests/state.tests/makemodel_error.json +++ b/tests/state.tests/makemodel_error.json @@ -11,7 +11,7 @@ "operational": true, "status": { "message": "Tickity Boo", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 600 } diff --git a/tests/state.tests/makemodel_upgrade.json b/tests/state.tests/makemodel_upgrade.json index fd9fc2d221..bfb627bf72 100644 --- a/tests/state.tests/makemodel_upgrade.json +++ b/tests/state.tests/makemodel_upgrade.json @@ -11,7 +11,7 @@ "operational": true, "status": { "message": "Tickity Boo", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 600 } diff --git a/tests/state.tests/restart.json b/tests/state.tests/restart.json index eeec051032..a108d1fd52 100644 --- a/tests/state.tests/restart.json +++ b/tests/state.tests/restart.json @@ -15,7 +15,7 @@ "mode": "restart", "status": { "message": "System rebooting due to config trigger", - "category": "device.state.com", + "category": "system.config.apply", "timestamp": "2018-08-26T21:39:30.364Z", "level": 800 } From fb24f3349fc483dae04f83a150e164b36bb259bc Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 13:12:36 -0700 Subject: [PATCH 09/70] Fix category generation --- bin/gencode_categories | 16 ++++++++-------- docs/specs/categories.md | 14 +++++++------- schema/category.json | 8 +++++++- tests/state.tests/example.json | 4 ++-- tests/state.tests/fcu.json | 2 +- tests/state.tests/makemodel_error.json | 4 ++-- tests/state.tests/makemodel_upgrade.json | 4 ++-- tests/state.tests/restart.json | 4 ++-- tests/state.tests/writeback.json | 4 ++-- tests/state_pointset.tests/example.json | 4 ++-- 10 files changed, 35 insertions(+), 29 deletions(-) diff --git a/bin/gencode_categories b/bin/gencode_categories index c66aa006ec..f778aa11d5 100755 --- a/bin/gencode_categories +++ b/bin/gencode_categories @@ -18,7 +18,7 @@ schema_out = os.path.join('schema/category.json') java_in = os.path.join('etc/Category.java') java_out = os.path.join('gencode/java/udmi/schema/Category.java') -def calculate_index_level(line): +def calculate_index_indent(line): if not line.strip().startswith(CATEGORY_MARKER): return -1 return line.find(CATEGORY_MARKER)//2 @@ -30,17 +30,17 @@ def read_categories(): group = None with open(doc_in) as doc: while line := doc.readline(): - level = calculate_index_level(line) + indent = calculate_index_indent(line) match = re.match(CATEGORY_REGEX, line) - if level < 0 or not match: + if indent < 0 or not match: continue - if level < previous: - for _ in range(level, previous): - prefix.pop(len(prefix) - 1) - elif level > previous: + if indent < previous: + for _ in range(indent, previous): + rem = prefix.pop(len(prefix) - 1) + elif indent > previous: if group: prefix.append(group) - previous = level + previous = indent group = match.group(1) category = '.'.join(prefix + [group]) level = match.group(3) diff --git a/docs/specs/categories.md b/docs/specs/categories.md index 7535e89bd6..7dce107478 100644 --- a/docs/specs/categories.md +++ b/docs/specs/categories.md @@ -12,7 +12,7 @@ implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy be * _base_: Baseline system operational messages * _start_: (**NOTICE**) System is in the process of (re)starting and essentially offline * _shutdown_: (**NOTICE**) System is shutting down - * _ready_: (**NOTICE**): System is fully ready for operation + * _ready_: (**NOTICE**) System is fully ready for operation * _comms_: Baseline message handling * _config_: Configuration message handling * _receive_: (**DEBUG**) Receiving a config message @@ -26,9 +26,9 @@ implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy be * _logout_: (**NOTICE**) Successful logout * _fail_: (**WARNING**) Failed authentication attempt. The entry message should include the application * _pointset_: Handling managing data point conditions - * _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 + * _point_: Conditions relating to a specific point, the entry `message` should start with "Point _pointname_" + * _applied_: (**INFO**) The `set_value` for a point has been applied + * _updating_: (**NOTICE**) The point is in the process of updating + * _overridden_: (**WARNING**) The reported value has been overridden locally + * _failure_: (**ERROR**) The system failed to read/write the point + * _invalid_: (**ERROR**) A `config` parameter for the point is invalid in some way diff --git a/schema/category.json b/schema/category.json index 044d355638..c94feea152 100644 --- a/schema/category.json +++ b/schema/category.json @@ -3,6 +3,7 @@ "oneOf": [ { "pattern": "^system\\.base\\.start$" }, { "pattern": "^system\\.base\\.shutdown$" }, + { "pattern": "^system\\.base\\.ready$" }, { "pattern": "^system\\.config\\.receive$" }, { "pattern": "^system\\.config\\.parse$" }, { "pattern": "^system\\.config\\.apply$" }, @@ -10,6 +11,11 @@ { "pattern": "^system\\.network\\.disconnect$" }, { "pattern": "^system\\.auth\\.login$" }, { "pattern": "^system\\.auth\\.logout$" }, - { "pattern": "^system\\.auth\\.fail$" } + { "pattern": "^system\\.auth\\.fail$" }, + { "pattern": "^pointset\\.point\\.applied$" }, + { "pattern": "^pointset\\.point\\.updating$" }, + { "pattern": "^pointset\\.point\\.overridden$" }, + { "pattern": "^pointset\\.point\\.failure$" }, + { "pattern": "^pointset\\.point\\.invalid$" } ] } diff --git a/tests/state.tests/example.json b/tests/state.tests/example.json index c8b59cacd0..88a4443f24 100644 --- a/tests/state.tests/example.json +++ b/tests/state.tests/example.json @@ -22,7 +22,7 @@ "pointset": { "status": { // Status scoped to overall pointset operation "message": "Invalid sample time", - "category": "pointset.config", + "category": "pointset.point.invalid", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 }, @@ -30,7 +30,7 @@ "return_air_temperature_sensor": { "status": { // Status scoped to a specific point in a pointset "message": "Point return_air_temperature_sensor unable to read value", - "category": "pointset.points.telemetry", + "category": "pointset.points.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 } diff --git a/tests/state.tests/fcu.json b/tests/state.tests/fcu.json index 4ba4328885..0b84a15dab 100644 --- a/tests/state.tests/fcu.json +++ b/tests/state.tests/fcu.json @@ -11,7 +11,7 @@ "operational": true, "status": { "message": "Time on the device is not synchronized", - "category": "com.acme.sync", + "category": "system.config.apply", "timestamp": "2019-01-17T13:29:47.364Z", "level": 600 } diff --git a/tests/state.tests/makemodel_error.json b/tests/state.tests/makemodel_error.json index 091ec2d985..8df5107511 100644 --- a/tests/state.tests/makemodel_error.json +++ b/tests/state.tests/makemodel_error.json @@ -19,7 +19,7 @@ "pointset": { "status": { // Status scoped to overall pointset operation "message": "Invalid sample time", - "category": "pointset.config", + "category": "pointset.point.invalid", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 }, @@ -27,7 +27,7 @@ "return_air_temperature_sensor": { "status": { // Status scoped to a specific point in a pointset "message": "Point return_air_temperature_sensor unable to read value", - "category": "pointset.points.telemetry", + "category": "pointset.point.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 } diff --git a/tests/state.tests/makemodel_upgrade.json b/tests/state.tests/makemodel_upgrade.json index bfb627bf72..ce8a1342be 100644 --- a/tests/state.tests/makemodel_upgrade.json +++ b/tests/state.tests/makemodel_upgrade.json @@ -19,7 +19,7 @@ "pointset": { "status": { // Status scoped to overall pointset operation "message": "Invalid sample time", - "category": "pointset.config", + "category": "pointset.point.invalid", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 }, @@ -27,7 +27,7 @@ "return_air_temperature_sensor": { "status": { // Status scoped to a specific point in a pointset "message": "Point return_air_temperature_sensor unable to read value", - "category": "pointset.points.telemetry", + "category": "pointset.point.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 } diff --git a/tests/state.tests/restart.json b/tests/state.tests/restart.json index a108d1fd52..c198670c89 100644 --- a/tests/state.tests/restart.json +++ b/tests/state.tests/restart.json @@ -23,7 +23,7 @@ "pointset": { "status": { // Status scoped to overall pointset operation "message": "Invalid sample time", - "category": "pointset.config", + "category": "pointset.point.invalid", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 }, @@ -31,7 +31,7 @@ "return_air_temperature_sensor": { "status": { // Status scoped to a specific point in a pointset "message": "Point return_air_temperature_sensor unable to read value", - "category": "pointset.points.telemetry", + "category": "pointset.point.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 } diff --git a/tests/state.tests/writeback.json b/tests/state.tests/writeback.json index d45d5da03f..2981883c7e 100644 --- a/tests/state.tests/writeback.json +++ b/tests/state.tests/writeback.json @@ -29,7 +29,7 @@ "value_state": "failure", "status": { "message": "Point entryway_lock failed to confirm", - "category": "pointset.points.set_value.failure", + "category": "pointset.point.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } @@ -38,7 +38,7 @@ "value_state": "invalid", "status": { "message": "Point scale_sensor is not writeable", - "category": "pointset.points.set_value.invalid", + "category": "pointset.points.invalid", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } diff --git a/tests/state_pointset.tests/example.json b/tests/state_pointset.tests/example.json index e0a0d45185..2e692a594a 100644 --- a/tests/state_pointset.tests/example.json +++ b/tests/state_pointset.tests/example.json @@ -16,7 +16,7 @@ "value_state": "failure", "status": { "message": "Failure to confirm point", - "category": "state.pointset.points.config.failure", + "category": "pointset.points.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } @@ -25,7 +25,7 @@ "value_state": "invalid", "status": { "message": "Point is not writable", - "category": "state.pointset.points.config.invalid", + "category": "pointset.point.invalid", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } From b8269f8e93c028e075cfcd70cffe2ae77a914de5 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 13:26:54 -0700 Subject: [PATCH 10/70] Fixing discovery events --- docs/specs/categories.md | 5 +++++ schema/category.json | 4 +++- tests/event_discovery.tests/point_error.json | 2 +- tests/event_discovery.tests/scan_error.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/specs/categories.md b/docs/specs/categories.md index 7dce107478..2c0109e9cf 100644 --- a/docs/specs/categories.md +++ b/docs/specs/categories.md @@ -32,3 +32,8 @@ implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy be * _overridden_: (**WARNING**) The reported value has been overridden locally * _failure_: (**ERROR**) The system failed to read/write the point * _invalid_: (**ERROR**) A `config` parameter for the point is invalid in some way +* _discovery_: Handling on-prem discovery flow + * _device_: Conditions specific to device scanning + * _failure_: (**ERROR**) Failure to discover/scan an entire device + * _point_: Conditions specific to point enumeration + * _failure_: (**ERROR**) Failure to discover/enumerate a particular point diff --git a/schema/category.json b/schema/category.json index c94feea152..5e51f7e0ae 100644 --- a/schema/category.json +++ b/schema/category.json @@ -16,6 +16,8 @@ { "pattern": "^pointset\\.point\\.updating$" }, { "pattern": "^pointset\\.point\\.overridden$" }, { "pattern": "^pointset\\.point\\.failure$" }, - { "pattern": "^pointset\\.point\\.invalid$" } + { "pattern": "^pointset\\.point\\.invalid$" }, + { "pattern": "^discovery\\.device\\.failure$" }, + { "pattern": "^discovery\\.point\\.failure$" } ] } diff --git a/tests/event_discovery.tests/point_error.json b/tests/event_discovery.tests/point_error.json index 13da0b5d7c..d699c1db62 100644 --- a/tests/event_discovery.tests/point_error.json +++ b/tests/event_discovery.tests/point_error.json @@ -21,7 +21,7 @@ "sup_flow_actual_avo_1": { "status": { "message": "Timeout during point communication", - "category": "discovery.bacnet.timeout", + "category": "discovery.point.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } diff --git a/tests/event_discovery.tests/scan_error.json b/tests/event_discovery.tests/scan_error.json index 4610716ba8..30580a8dee 100644 --- a/tests/event_discovery.tests/scan_error.json +++ b/tests/event_discovery.tests/scan_error.json @@ -24,7 +24,7 @@ }, "status": { "message": "Could not find all points", - "category": "discovery.enumeration.incomplete", + "category": "discovery.device.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } From 5acb4a7cf1aa9e54d62e2e398c8d7a7ed92fce8a Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 14:14:53 -0700 Subject: [PATCH 11/70] Fixing blobset and others --- docs/specs/categories.md | 5 +++++ schema/category.json | 5 ++++- tests/event_system.tests/errors.out | 2 +- tests/state_pointset.tests/example.json | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/specs/categories.md b/docs/specs/categories.md index 2c0109e9cf..154538ecf8 100644 --- a/docs/specs/categories.md +++ b/docs/specs/categories.md @@ -37,3 +37,8 @@ implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy be * _failure_: (**ERROR**) Failure to discover/scan an entire device * _point_: Conditions specific to point enumeration * _failure_: (**ERROR**) Failure to discover/enumerate a particular point +* _blobset_: Handling update of device data blobs + * _blob_: Conditions specific to an individual blob + * _received_: (**DEBUG**) Request for an update has been received + * _fetched_: (**DEBUG**) Update blob has been successfully fetched + * _applied_: (**NOTICE**) Update has been successfully applied diff --git a/schema/category.json b/schema/category.json index 5e51f7e0ae..f4c24157a2 100644 --- a/schema/category.json +++ b/schema/category.json @@ -18,6 +18,9 @@ { "pattern": "^pointset\\.point\\.failure$" }, { "pattern": "^pointset\\.point\\.invalid$" }, { "pattern": "^discovery\\.device\\.failure$" }, - { "pattern": "^discovery\\.point\\.failure$" } + { "pattern": "^discovery\\.point\\.failure$" }, + { "pattern": "^blobset\\.blob\\.received$" }, + { "pattern": "^blobset\\.blob\\.fetched$" }, + { "pattern": "^blobset\\.blob\\.applied$" } ] } diff --git a/tests/event_system.tests/errors.out b/tests/event_system.tests/errors.out index 7a7bda401d..01ef773884 100644 --- a/tests/event_system.tests/errors.out +++ b/tests/event_system.tests/errors.out @@ -1,5 +1,5 @@ 4 schema violations found - ECMA 262 regex "^[a-z][._a-zA-Z]*[a-zA-Z]$" does not match input string "com.testCategory$" + instance failed to match exactly one schema (matched 0 out of 18) instance type (string) does not match any allowed primitive type (allowed: ["object"]) numeric instance is lower than the required minimum (minimum: 100, found: 60) object has missing required properties (["message","timestamp"]) diff --git a/tests/state_pointset.tests/example.json b/tests/state_pointset.tests/example.json index 2e692a594a..79e09cc9ec 100644 --- a/tests/state_pointset.tests/example.json +++ b/tests/state_pointset.tests/example.json @@ -16,7 +16,7 @@ "value_state": "failure", "status": { "message": "Failure to confirm point", - "category": "pointset.points.failure", + "category": "pointset.point.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } From 5eeeb6a4978f5d7a332a04916f10e74ace7713de Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 14:23:07 -0700 Subject: [PATCH 12/70] Fixing blob and bacnet --- docs/specs/categories.md | 2 ++ schema/category.json | 1 + .../{blobset_receive.json => blobset_received.json} | 6 +++--- .../{blobset_receive.out => blobset_received.out} | 0 tests/state.tests/enumeration.json | 8 +------- tests/state.tests/example.json | 2 +- tests/state.tests/scan_error.json | 2 +- tests/state.tests/writeback.json | 2 +- 8 files changed, 10 insertions(+), 13 deletions(-) rename tests/state.tests/{blobset_receive.json => blobset_received.json} (86%) rename tests/state.tests/{blobset_receive.out => blobset_received.out} (100%) diff --git a/docs/specs/categories.md b/docs/specs/categories.md index 154538ecf8..915008149e 100644 --- a/docs/specs/categories.md +++ b/docs/specs/categories.md @@ -33,6 +33,8 @@ implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy be * _failure_: (**ERROR**) The system failed to read/write the point * _invalid_: (**ERROR**) A `config` parameter for the point is invalid in some way * _discovery_: Handling on-prem discovery flow + * _family_: Conditions specific to an entire address family (e.g. bacnet) + * _failure_: (**ERROR**) Failure of (e.g.) network scanning * _device_: Conditions specific to device scanning * _failure_: (**ERROR**) Failure to discover/scan an entire device * _point_: Conditions specific to point enumeration diff --git a/schema/category.json b/schema/category.json index f4c24157a2..a328d50e81 100644 --- a/schema/category.json +++ b/schema/category.json @@ -17,6 +17,7 @@ { "pattern": "^pointset\\.point\\.overridden$" }, { "pattern": "^pointset\\.point\\.failure$" }, { "pattern": "^pointset\\.point\\.invalid$" }, + { "pattern": "^discovery\\.family\\.failure$" }, { "pattern": "^discovery\\.device\\.failure$" }, { "pattern": "^discovery\\.point\\.failure$" }, { "pattern": "^blobset\\.blob\\.received$" }, diff --git a/tests/state.tests/blobset_receive.json b/tests/state.tests/blobset_received.json similarity index 86% rename from tests/state.tests/blobset_receive.json rename to tests/state.tests/blobset_received.json index d85d5743b1..78cd420999 100644 --- a/tests/state.tests/blobset_receive.json +++ b/tests/state.tests/blobset_received.json @@ -18,7 +18,7 @@ "arbitrary_manufacturer_id": { "status": { "message": "Received arbitrary_manufacturer_id", - "category": "blobset.blob.receive", + "category": "blobset.blob.received", "timestamp": "2022-07-13T12:00:08.000Z", "level": 100 } @@ -26,7 +26,7 @@ "_firmware_update": { "status": { "message": "Received firmware update", - "category": "blobset.blob.receive", + "category": "blobset.blob.received", "timestamp": "2022-07-13T12:00:08.000Z", "level": 100 } @@ -34,7 +34,7 @@ "_endpoint_redirect": { "status": { "message": "Received endpoint redirect", - "category": "blobset.blob.receive", + "category": "blobset.blob.received", "timestamp": "2022-07-13T12:00:08.000Z", "level": 100 } diff --git a/tests/state.tests/blobset_receive.out b/tests/state.tests/blobset_received.out similarity index 100% rename from tests/state.tests/blobset_receive.out rename to tests/state.tests/blobset_received.out diff --git a/tests/state.tests/enumeration.json b/tests/state.tests/enumeration.json index 863bc0629d..b22c732adb 100644 --- a/tests/state.tests/enumeration.json +++ b/tests/state.tests/enumeration.json @@ -19,13 +19,7 @@ }, "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 - } + "generation": "2018-08-26T21:37:12Z" } } } diff --git a/tests/state.tests/example.json b/tests/state.tests/example.json index 88a4443f24..290017828b 100644 --- a/tests/state.tests/example.json +++ b/tests/state.tests/example.json @@ -30,7 +30,7 @@ "return_air_temperature_sensor": { "status": { // Status scoped to a specific point in a pointset "message": "Point return_air_temperature_sensor unable to read value", - "category": "pointset.points.failure", + "category": "pointset.point.failure", "timestamp": "2018-08-26T21:39:28.364Z", "level": 800 } diff --git a/tests/state.tests/scan_error.json b/tests/state.tests/scan_error.json index 992a1a459a..a123be6840 100644 --- a/tests/state.tests/scan_error.json +++ b/tests/state.tests/scan_error.json @@ -23,7 +23,7 @@ "generation": "2018-08-26T21:00:13Z", "status": { "message": "Timeout during scan", - "category": "discovery.bacnet.timeout", + "category": "discovery.family.failed", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } diff --git a/tests/state.tests/writeback.json b/tests/state.tests/writeback.json index 2981883c7e..dd39e36d8d 100644 --- a/tests/state.tests/writeback.json +++ b/tests/state.tests/writeback.json @@ -38,7 +38,7 @@ "value_state": "invalid", "status": { "message": "Point scale_sensor is not writeable", - "category": "pointset.points.invalid", + "category": "pointset.point.invalid", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } From 8a915a52fce6aca799bd8ac8e95154277880ee56 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 14:28:06 -0700 Subject: [PATCH 13/70] Fixing discovery --- docs/specs/categories.md | 6 +++--- schema/category.json | 6 +++--- tests/event_discovery.tests/point_error.json | 2 +- tests/event_discovery.tests/scan_error.json | 4 ++-- tests/state.tests/scan_error.json | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/specs/categories.md b/docs/specs/categories.md index 915008149e..510c0a6ef1 100644 --- a/docs/specs/categories.md +++ b/docs/specs/categories.md @@ -34,11 +34,11 @@ implicit expected `level` values, indicated by '(**LEVEL**)' in the hierarchy be * _invalid_: (**ERROR**) A `config` parameter for the point is invalid in some way * _discovery_: Handling on-prem discovery flow * _family_: Conditions specific to an entire address family (e.g. bacnet) - * _failure_: (**ERROR**) Failure of (e.g.) network scanning + * _scan_: (**INFO**) Relating to scanning a particular address family * _device_: Conditions specific to device scanning - * _failure_: (**ERROR**) Failure to discover/scan an entire device + * _enumerate_: (**INFO**) Handling point enumeration for a given device * _point_: Conditions specific to point enumeration - * _failure_: (**ERROR**) Failure to discover/enumerate a particular point + * _describe_: (**INFO**) Relating to describing a particular point * _blobset_: Handling update of device data blobs * _blob_: Conditions specific to an individual blob * _received_: (**DEBUG**) Request for an update has been received diff --git a/schema/category.json b/schema/category.json index a328d50e81..0f208ee996 100644 --- a/schema/category.json +++ b/schema/category.json @@ -17,9 +17,9 @@ { "pattern": "^pointset\\.point\\.overridden$" }, { "pattern": "^pointset\\.point\\.failure$" }, { "pattern": "^pointset\\.point\\.invalid$" }, - { "pattern": "^discovery\\.family\\.failure$" }, - { "pattern": "^discovery\\.device\\.failure$" }, - { "pattern": "^discovery\\.point\\.failure$" }, + { "pattern": "^discovery\\.family\\.scan$" }, + { "pattern": "^discovery\\.device\\.enumerate$" }, + { "pattern": "^discovery\\.point\\.describe$" }, { "pattern": "^blobset\\.blob\\.received$" }, { "pattern": "^blobset\\.blob\\.fetched$" }, { "pattern": "^blobset\\.blob\\.applied$" } diff --git a/tests/event_discovery.tests/point_error.json b/tests/event_discovery.tests/point_error.json index d699c1db62..40b1399152 100644 --- a/tests/event_discovery.tests/point_error.json +++ b/tests/event_discovery.tests/point_error.json @@ -21,7 +21,7 @@ "sup_flow_actual_avo_1": { "status": { "message": "Timeout during point communication", - "category": "discovery.point.failure", + "category": "discovery.point.describe", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } diff --git a/tests/event_discovery.tests/scan_error.json b/tests/event_discovery.tests/scan_error.json index 30580a8dee..056ced52e2 100644 --- a/tests/event_discovery.tests/scan_error.json +++ b/tests/event_discovery.tests/scan_error.json @@ -23,8 +23,8 @@ } }, "status": { - "message": "Could not find all points", - "category": "discovery.device.failure", + "message": "Could not find all device points", + "category": "discovery.device.enumerate", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } diff --git a/tests/state.tests/scan_error.json b/tests/state.tests/scan_error.json index a123be6840..5596ffd668 100644 --- a/tests/state.tests/scan_error.json +++ b/tests/state.tests/scan_error.json @@ -23,7 +23,7 @@ "generation": "2018-08-26T21:00:13Z", "status": { "message": "Timeout during scan", - "category": "discovery.family.failed", + "category": "discovery.family.scan", "timestamp": "2018-08-26T21:39:28.364Z", "level": 600 } From df8f353c9fd20bb833fac8262bd712b553d8af96 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 14:36:26 -0700 Subject: [PATCH 14/70] Add java gencode --- bin/gencode_categories | 25 +++++++ gencode/java/udmi/schema/Category.java | 93 ++++++++++++++++++++++++-- 2 files changed, 112 insertions(+), 6 deletions(-) diff --git a/bin/gencode_categories b/bin/gencode_categories index f778aa11d5..f2d07c3b2d 100755 --- a/bin/gencode_categories +++ b/bin/gencode_categories @@ -12,6 +12,10 @@ CATEGORY_MARKER = '* ' CATEGORY_REGEX = ' *\\* _([a-z]+)_: (\(\*\*([A-Z]+)\*\*\) )?(.*)' JSON_FORMAT = '%s%s{ "pattern": "^%s$" }' +JAVA_DESCRIPTION = "\n%s// %s\n" +JAVA_TARGET = '%s%s = "%s";\n' +JAVA_LEVEL = '%s%s_LEVEL = %s;\n' + doc_in = os.path.join('docs/specs/categories.md') schema_in = os.path.join('etc/category.json') schema_out = os.path.join('schema/category.json') @@ -68,5 +72,26 @@ def write_schema_categories(out, indent, categories): prefix = ',\n' out.write('\n') +def write_java_out(categories): + with open(java_in) as inp: + with open(java_out, 'w') as out: + while line := inp.readline(): + if line.strip().startswith(GENCODE_MARKER): + indent = line[0:line.find(GENCODE_MARKER)] + write_java_categories(out, indent, categories) + else: + out.write(line) + +def write_java_categories(out, indent, categories): + for category in categories: + target = category[0] + level = category[1] + desc = category[2] + const = target.replace('.', '_').upper() + out.write(JAVA_DESCRIPTION % (indent, desc)) + out.write(JAVA_TARGET % (indent, const, target)) + out.write(JAVA_LEVEL % (indent, const, level)) + categories = read_categories() write_schema_out(categories) +write_java_out(categories) diff --git a/gencode/java/udmi/schema/Category.java b/gencode/java/udmi/schema/Category.java index 1ee2f320e4..16293864cb 100644 --- a/gencode/java/udmi/schema/Category.java +++ b/gencode/java/udmi/schema/Category.java @@ -7,10 +7,91 @@ // Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md public class Category { - public static final String SYSTEM_CONFIG_RECEIVE ="system.config.receive"; - public static final Level SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; - public static final String SYSTEM_CONFIG_PARSE ="system.config.parse"; - public static final Level SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; - public static final String SYSTEM_CONFIG_APPLY ="system.config.apply"; - public static final Level SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; + // System is in the process of (re)starting and essentially offline + SYSTEM_BASE_START = "system.base.start"; + SYSTEM_BASE_START_LEVEL = NOTICE; + + // System is shutting down + SYSTEM_BASE_SHUTDOWN = "system.base.shutdown"; + SYSTEM_BASE_SHUTDOWN_LEVEL = NOTICE; + + // System is fully ready for operation + SYSTEM_BASE_READY = "system.base.ready"; + SYSTEM_BASE_READY_LEVEL = NOTICE; + + // Receiving a config message + SYSTEM_CONFIG_RECEIVE = "system.config.receive"; + SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; + + // Parsing a received message + SYSTEM_CONFIG_PARSE = "system.config.parse"; + SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; + + // Application of a parsed config message + SYSTEM_CONFIG_APPLY = "system.config.apply"; + SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; + + // Connected to the network + SYSTEM_NETWORK_CONNECT = "system.network.connect"; + SYSTEM_NETWORK_CONNECT_LEVEL = NOTICE; + + // Disconnected from a network + SYSTEM_NETWORK_DISCONNECT = "system.network.disconnect"; + SYSTEM_NETWORK_DISCONNECT_LEVEL = NOTICE; + + // Successful login. The entry message should include the username and application + SYSTEM_AUTH_LOGIN = "system.auth.login"; + SYSTEM_AUTH_LOGIN_LEVEL = NOTICE; + + // Successful logout + SYSTEM_AUTH_LOGOUT = "system.auth.logout"; + SYSTEM_AUTH_LOGOUT_LEVEL = NOTICE; + + // Failed authentication attempt. The entry message should include the application + SYSTEM_AUTH_FAIL = "system.auth.fail"; + SYSTEM_AUTH_FAIL_LEVEL = WARNING; + + // The `set_value` for a point has been applied + POINTSET_POINT_APPLIED = "pointset.point.applied"; + POINTSET_POINT_APPLIED_LEVEL = INFO; + + // The point is in the process of updating + POINTSET_POINT_UPDATING = "pointset.point.updating"; + POINTSET_POINT_UPDATING_LEVEL = NOTICE; + + // The reported value has been overridden locally + POINTSET_POINT_OVERRIDDEN = "pointset.point.overridden"; + POINTSET_POINT_OVERRIDDEN_LEVEL = WARNING; + + // The system failed to read/write the point + POINTSET_POINT_FAILURE = "pointset.point.failure"; + POINTSET_POINT_FAILURE_LEVEL = ERROR; + + // A `config` parameter for the point is invalid in some way + POINTSET_POINT_INVALID = "pointset.point.invalid"; + POINTSET_POINT_INVALID_LEVEL = ERROR; + + // Relating to scanning a particular address family + DISCOVERY_FAMILY_SCAN = "discovery.family.scan"; + DISCOVERY_FAMILY_SCAN_LEVEL = INFO; + + // Handling point enumeration for a given device + DISCOVERY_DEVICE_ENUMERATE = "discovery.device.enumerate"; + DISCOVERY_DEVICE_ENUMERATE_LEVEL = INFO; + + // Relating to describing a particular point + DISCOVERY_POINT_DESCRIBE = "discovery.point.describe"; + DISCOVERY_POINT_DESCRIBE_LEVEL = INFO; + + // Request for an update has been received + BLOBSET_BLOB_RECEIVED = "blobset.blob.received"; + BLOBSET_BLOB_RECEIVED_LEVEL = DEBUG; + + // Update blob has been successfully fetched + BLOBSET_BLOB_FETCHED = "blobset.blob.fetched"; + BLOBSET_BLOB_FETCHED_LEVEL = DEBUG; + + // Update has been successfully applied + BLOBSET_BLOB_APPLIED = "blobset.blob.applied"; + BLOBSET_BLOB_APPLIED_LEVEL = NOTICE; } From 416a350ba06af418e0adbcdcca195b9f6abcd68c Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 14:41:59 -0700 Subject: [PATCH 15/70] Working gencode java --- bin/gencode_categories | 4 +- gencode/java/udmi/schema/Category.java | 88 +++++++++++++------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/bin/gencode_categories b/bin/gencode_categories index f2d07c3b2d..60d6eb2507 100755 --- a/bin/gencode_categories +++ b/bin/gencode_categories @@ -13,8 +13,8 @@ CATEGORY_REGEX = ' *\\* _([a-z]+)_: (\(\*\*([A-Z]+)\*\*\) )?(.*)' JSON_FORMAT = '%s%s{ "pattern": "^%s$" }' JAVA_DESCRIPTION = "\n%s// %s\n" -JAVA_TARGET = '%s%s = "%s";\n' -JAVA_LEVEL = '%s%s_LEVEL = %s;\n' +JAVA_TARGET = '%spublic static final String %s = "%s";\n' +JAVA_LEVEL = '%spublic static final Level %s_LEVEL = %s;\n' doc_in = os.path.join('docs/specs/categories.md') schema_in = os.path.join('etc/category.json') diff --git a/gencode/java/udmi/schema/Category.java b/gencode/java/udmi/schema/Category.java index 16293864cb..ae0d511110 100644 --- a/gencode/java/udmi/schema/Category.java +++ b/gencode/java/udmi/schema/Category.java @@ -8,90 +8,90 @@ public class Category { // System is in the process of (re)starting and essentially offline - SYSTEM_BASE_START = "system.base.start"; - SYSTEM_BASE_START_LEVEL = NOTICE; + public static final String SYSTEM_BASE_START = "system.base.start"; + public static final Level SYSTEM_BASE_START_LEVEL = NOTICE; // System is shutting down - SYSTEM_BASE_SHUTDOWN = "system.base.shutdown"; - SYSTEM_BASE_SHUTDOWN_LEVEL = NOTICE; + public static final String SYSTEM_BASE_SHUTDOWN = "system.base.shutdown"; + public static final Level SYSTEM_BASE_SHUTDOWN_LEVEL = NOTICE; // System is fully ready for operation - SYSTEM_BASE_READY = "system.base.ready"; - SYSTEM_BASE_READY_LEVEL = NOTICE; + public static final String SYSTEM_BASE_READY = "system.base.ready"; + public static final Level SYSTEM_BASE_READY_LEVEL = NOTICE; // Receiving a config message - SYSTEM_CONFIG_RECEIVE = "system.config.receive"; - SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; + public static final String SYSTEM_CONFIG_RECEIVE = "system.config.receive"; + public static final Level SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; // Parsing a received message - SYSTEM_CONFIG_PARSE = "system.config.parse"; - SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; + public static final String SYSTEM_CONFIG_PARSE = "system.config.parse"; + public static final Level SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; // Application of a parsed config message - SYSTEM_CONFIG_APPLY = "system.config.apply"; - SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; + public static final String SYSTEM_CONFIG_APPLY = "system.config.apply"; + public static final Level SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; // Connected to the network - SYSTEM_NETWORK_CONNECT = "system.network.connect"; - SYSTEM_NETWORK_CONNECT_LEVEL = NOTICE; + public static final String SYSTEM_NETWORK_CONNECT = "system.network.connect"; + public static final Level SYSTEM_NETWORK_CONNECT_LEVEL = NOTICE; // Disconnected from a network - SYSTEM_NETWORK_DISCONNECT = "system.network.disconnect"; - SYSTEM_NETWORK_DISCONNECT_LEVEL = NOTICE; + public static final String SYSTEM_NETWORK_DISCONNECT = "system.network.disconnect"; + public static final Level SYSTEM_NETWORK_DISCONNECT_LEVEL = NOTICE; // Successful login. The entry message should include the username and application - SYSTEM_AUTH_LOGIN = "system.auth.login"; - SYSTEM_AUTH_LOGIN_LEVEL = NOTICE; + public static final String SYSTEM_AUTH_LOGIN = "system.auth.login"; + public static final Level SYSTEM_AUTH_LOGIN_LEVEL = NOTICE; // Successful logout - SYSTEM_AUTH_LOGOUT = "system.auth.logout"; - SYSTEM_AUTH_LOGOUT_LEVEL = NOTICE; + public static final String SYSTEM_AUTH_LOGOUT = "system.auth.logout"; + public static final Level SYSTEM_AUTH_LOGOUT_LEVEL = NOTICE; // Failed authentication attempt. The entry message should include the application - SYSTEM_AUTH_FAIL = "system.auth.fail"; - SYSTEM_AUTH_FAIL_LEVEL = WARNING; + public static final String SYSTEM_AUTH_FAIL = "system.auth.fail"; + public static final Level SYSTEM_AUTH_FAIL_LEVEL = WARNING; // The `set_value` for a point has been applied - POINTSET_POINT_APPLIED = "pointset.point.applied"; - POINTSET_POINT_APPLIED_LEVEL = INFO; + public static final String POINTSET_POINT_APPLIED = "pointset.point.applied"; + public static final Level POINTSET_POINT_APPLIED_LEVEL = INFO; // The point is in the process of updating - POINTSET_POINT_UPDATING = "pointset.point.updating"; - POINTSET_POINT_UPDATING_LEVEL = NOTICE; + public static final String POINTSET_POINT_UPDATING = "pointset.point.updating"; + public static final Level POINTSET_POINT_UPDATING_LEVEL = NOTICE; // The reported value has been overridden locally - POINTSET_POINT_OVERRIDDEN = "pointset.point.overridden"; - POINTSET_POINT_OVERRIDDEN_LEVEL = WARNING; + public static final String POINTSET_POINT_OVERRIDDEN = "pointset.point.overridden"; + public static final Level POINTSET_POINT_OVERRIDDEN_LEVEL = WARNING; // The system failed to read/write the point - POINTSET_POINT_FAILURE = "pointset.point.failure"; - POINTSET_POINT_FAILURE_LEVEL = ERROR; + public static final String POINTSET_POINT_FAILURE = "pointset.point.failure"; + public static final Level POINTSET_POINT_FAILURE_LEVEL = ERROR; // A `config` parameter for the point is invalid in some way - POINTSET_POINT_INVALID = "pointset.point.invalid"; - POINTSET_POINT_INVALID_LEVEL = ERROR; + public static final String POINTSET_POINT_INVALID = "pointset.point.invalid"; + public static final Level POINTSET_POINT_INVALID_LEVEL = ERROR; // Relating to scanning a particular address family - DISCOVERY_FAMILY_SCAN = "discovery.family.scan"; - DISCOVERY_FAMILY_SCAN_LEVEL = INFO; + public static final String DISCOVERY_FAMILY_SCAN = "discovery.family.scan"; + public static final Level DISCOVERY_FAMILY_SCAN_LEVEL = INFO; // Handling point enumeration for a given device - DISCOVERY_DEVICE_ENUMERATE = "discovery.device.enumerate"; - DISCOVERY_DEVICE_ENUMERATE_LEVEL = INFO; + public static final String DISCOVERY_DEVICE_ENUMERATE = "discovery.device.enumerate"; + public static final Level DISCOVERY_DEVICE_ENUMERATE_LEVEL = INFO; // Relating to describing a particular point - DISCOVERY_POINT_DESCRIBE = "discovery.point.describe"; - DISCOVERY_POINT_DESCRIBE_LEVEL = INFO; + public static final String DISCOVERY_POINT_DESCRIBE = "discovery.point.describe"; + public static final Level DISCOVERY_POINT_DESCRIBE_LEVEL = INFO; // Request for an update has been received - BLOBSET_BLOB_RECEIVED = "blobset.blob.received"; - BLOBSET_BLOB_RECEIVED_LEVEL = DEBUG; + public static final String BLOBSET_BLOB_RECEIVED = "blobset.blob.received"; + public static final Level BLOBSET_BLOB_RECEIVED_LEVEL = DEBUG; // Update blob has been successfully fetched - BLOBSET_BLOB_FETCHED = "blobset.blob.fetched"; - BLOBSET_BLOB_FETCHED_LEVEL = DEBUG; + public static final String BLOBSET_BLOB_FETCHED = "blobset.blob.fetched"; + public static final Level BLOBSET_BLOB_FETCHED_LEVEL = DEBUG; // Update has been successfully applied - BLOBSET_BLOB_APPLIED = "blobset.blob.applied"; - BLOBSET_BLOB_APPLIED_LEVEL = NOTICE; + public static final String BLOBSET_BLOB_APPLIED = "blobset.blob.applied"; + public static final Level BLOBSET_BLOB_APPLIED_LEVEL = NOTICE; } From edc473c5f1c1aa6f90b04236d021acf4aeb75aca Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 14:53:31 -0700 Subject: [PATCH 16/70] Fixing gencode --- .gencode_hash.txt | 14 +- bin/gencode_categories | 1 + gencode/docs/event_discovery.html | 2382 ++++-- gencode/docs/event_system.html | 640 +- gencode/docs/event_validation.html | 3910 ++++++--- gencode/docs/state.html | 10088 +++++++++++++++++------ gencode/python/udmi/schema/__init__.py | 2 +- gencode/python/udmi/schema/category.py | 6 +- 8 files changed, 12956 insertions(+), 4087 deletions(-) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 9a7efaece6..5b035bd2ee 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,22 +1,22 @@ f5cf191b0151d2142fa634d1deafb93e35041d5b9ae89b26beab32fa25fb9521 gencode/docs/config.html 90679d3d866579501e7aa00b515af05d42fc9fe399eafacaacf297d1e4a22884 gencode/docs/envelope.html -fce52420e4567cd205fbc391e3eafd86f6b0bd652c9fc39f3584eabb75becd05 gencode/docs/event_discovery.html +9362682fa830ce9d98b3c074cab05ba44fae96a82de316a3520df3956e9325dc gencode/docs/event_discovery.html 8133e380e40f27c56accbffc665b2eeb56ec84a4da3b52ba7aa5e439c9c40572 gencode/docs/event_pointset.html -528c17ecd3d8faf899a262fb197401e98ea493ab544f42ffc29457eae6889971 gencode/docs/event_system.html -0fb7c664009830023095e254c8f143d3554be64fee28bde8b93cdf51e37d1b68 gencode/docs/event_validation.html +06a8831025ad3cba59ed1831842db537525c26a713de92f6dd6c48656e3d772d gencode/docs/event_system.html +a471b2ded89ceb93dd4c70e9702db179fdd517fd45bfd2b43a95f8b9f287b50b gencode/docs/event_validation.html f48026471ae3cd7867bce416dc21c2fb728f48d8476a8d6e95f6acaf1d8b6cf3 gencode/docs/index.html 6d5081d04c86f8bd444efb41cd788826aa66802d37e8f98e93b6b75425542d5e gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js -3737c048cda80c9296206697e43c98dbe9ef4b246719c16b7450c4d68a194088 gencode/docs/state.html +ffe0596792d14a35c395f84d5ee1ec76032fd29e0dd9c440984db8f8a5f1be1d gencode/docs/state.html d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/udmi/schema/Asset.java 0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java d326a550d75ab7f558f165f1a5e8c24eee2b0b52290a7472f529bb1e15d79fb2 gencode/java/udmi/schema/BlobBlobsetConfig.java 2c03651cb2ecda072b1418222eebb5560185669f8ffdd03021ad5ad8ff7ba3b0 gencode/java/udmi/schema/BlobBlobsetState.java 3fccb6bc6714fdc3dd912c8b1155e7ce19b0ac8a7ec48a01be9eb27bdd034a75 gencode/java/udmi/schema/BlobsetConfig.java fcbed49f1af8b791d8c52bcbe18f65521a79d9ac3eb33ec3afd9b342ab2bfc56 gencode/java/udmi/schema/BlobsetState.java -eb457036f822e67c87f203493c29bfebfe5118de2c3a8b5b71b3e623e66e8535 gencode/java/udmi/schema/Category.java +5504f264b95ad84dc2e9ce05215964bbd94917173a55eae9cb4ccffa7f642f68 gencode/java/udmi/schema/Category.java d6875f63ce67d1b945a0b75a4a660bd083cc52492371a7350c4109f6bf54968b gencode/java/udmi/schema/CloudIotConfig.java a2eeff86f4302272736d84602e2ca36a64d27c8ef6761cc05ffb8ad17b030d4d gencode/java/udmi/schema/CloudModel.java ff79de9390aa25bb45fb3e2ebb682c865ccab764f56d9644377d9d28c0ab10e4 gencode/java/udmi/schema/Config.java @@ -74,9 +74,9 @@ e0f70f8e2c4793ebd05a38dc249d329eaa5b0171097ecc5fad4630fa0df3536d gencode/java/u d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/udmi/schema/TestingModel.java 347da3d586ff6e5dcf3ce8ec0c800ec0efd5fed4e0c80eef35de65ad92ae48bf gencode/java/udmi/schema/ValidationEvent.java e007ddd1ceeae3603c85110c33e1bb4a418ff9c7a791ca0df25b7ea3caeafd36 gencode/java/udmi/schema/ValidationSummary.java -c9c472f3d4b19603f0fb9c20539da700ab02bc95deed739c325a4f0df5cf25c0 gencode/python/udmi/schema/__init__.py +b72f0fb856ce0603cd8b98f037375d71ff8bc6ee08667100331a6abfcae34ab0 gencode/python/udmi/schema/__init__.py 4b25dd95f863059b761269f93adcae7049507924a1c6e74d6856849203c179db gencode/python/udmi/schema/ancillary_properties.py -48a75ea67083eb6cb1546cda3756468baaf449fc2f26e72a10b6cb58533aa904 gencode/python/udmi/schema/category.py +70f9b662321b8acded5943749539fb9376f1247e986918ea2cfac65e3d307953 gencode/python/udmi/schema/category.py a61b1c5732f01b7efda41a773d5786fad755f371193ce4478b458387ca2a8fe8 gencode/python/udmi/schema/cloud_iot_config.py 6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 2082a9f3ff4d37bb13a647932fcacb99499f71569cd9dc12d5e63dead34fee63 gencode/python/udmi/schema/common.py diff --git a/bin/gencode_categories b/bin/gencode_categories index 60d6eb2507..957f8856a5 100755 --- a/bin/gencode_categories +++ b/bin/gencode_categories @@ -73,6 +73,7 @@ def write_schema_categories(out, indent, categories): out.write('\n') def write_java_out(categories): + os.makedirs(os.path.dirname(java_out), exist_ok=True) with open(java_in) as inp: with open(java_out, 'w') as out: while line := inp.readline(): diff --git a/gencode/docs/event_discovery.html b/gencode/docs/event_discovery.html index 2a6f334a3b..140b81682c 100644 --- a/gencode/docs/event_discovery.html +++ b/gencode/docs/event_discovery.html @@ -339,6 +339,66 @@

id="status_category_oneOf_i9" data-toggle="tab" href="#tab-pane_status_category_oneOf_i9" role="tab" onclick="setAnchor('#status_category_oneOf_i9')" >Option 10 +
@@ -453,7 +513,7 @@

/> item 2

Type: object
-Must match regular expression: ^system\.config\.receive$ +Must match regular expression: ^system\.base\.ready$ @@ -493,7 +553,7 @@

/> item 3

Type: object
-Must match regular expression: ^system\.config\.parse$ +Must match regular expression: ^system\.config\.receive$ @@ -533,7 +593,7 @@

/> item 4

Type: object
-Must match regular expression: ^system\.config\.apply$ +Must match regular expression: ^system\.config\.parse$ @@ -573,7 +633,7 @@

/> item 5

Type: object
-Must match regular expression: ^system\.network\.connect$ +Must match regular expression: ^system\.config\.apply$ @@ -613,7 +673,7 @@

/> item 6

Type: object
-Must match regular expression: ^system\.network\.disconnect$ +Must match regular expression: ^system\.network\.connect$ @@ -653,7 +713,7 @@

/> item 7

Type: object
-Must match regular expression: ^system\.auth\.login$ +Must match regular expression: ^system\.network\.disconnect$ @@ -693,7 +753,7 @@

/> item 8

Type: object
-Must match regular expression: ^system\.auth\.logout$ +Must match regular expression: ^system\.auth\.login$ @@ -733,37 +793,16 @@

/> item 9

Type: object
-Must match regular expression: ^system\.auth\.fail$ +Must match regular expression: ^system\.auth\.logout$ -
- - - - - +
-
-
-
-
-
-
-
-

- -

-
- -
-
Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ category + + + + oneOf + + + + item 10
Type: object
+Must match regular expression: ^system\.auth\.fail$ -
-
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: string
-

The primary scan discovery address family

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

- -

-
- -
-
- - Type: string
-

The primary id of the device (for scan_family)

-
+ item 11
Type: object
+Must match regular expression: ^pointset\.point\.applied$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ 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 + oneOf + + + + item 12
Type: object
+Must match regular expression: ^pointset\.point\.updating$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

Device id in the namespace of the given family

-
Must match regular expression: ^[-_.:0-9A-Z]+$ + oneOf + + + + item 13
Type: object
+Must match regular expression: ^pointset\.point\.overridden$ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
-

Collection of data points available for this device.

-
No Additional Properties + status + + + + category + + + + oneOf + + + + item 14
Type: object
+Must match regular expression: ^pointset\.point\.failure$ -
-
-
-

- -

-
- -
-

- -

-

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

- Property name regular expression: ^[-_.:/a-zA-Z0-9]+$ -
+
+ Type: object
-

Object representation for for a single point enumeration

-
- - No Additional Properties + category + + + + oneOf + + + + item 15
Type: object
+Must match regular expression: ^pointset\.point\.invalid$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

Friendly name for the point, if known

-
+ oneOf + + + + item 16
Type: object
+Must match regular expression: ^discovery\.family\.scan$ -
-
-
-
-
-
-
-

- -

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

List of possible enumerated values for the point

-
+ oneOf + + + + item 17
Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ -

Each item of this array must be:

-
-
+ +
Type: string
- + item 18
Type: object
+Must match regular expression: ^discovery\.point\.describe$ -
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

Current or default unit for this point

-
+ oneOf + + + + item 19
Type: object
+Must match regular expression: ^blobset\.blob\.received$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

Current or default type for this point

-
+ oneOf + + + + item 20
Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

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

-
+ oneOf + + + + item 21
Type: object
+Must match regular expression: ^blobset\.blob\.applied$ + + + + + + +
@@ -1399,18 +1291,18 @@

-
+
-
+

- +

-
+
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: string
+

The primary scan discovery address family

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

+ +

+
+ +
+
+ + Type: string
+

The primary id of the device (for scan_family)

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

+ +

+
+ +
+
+ + 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-Z0-9]+$ +
+ + Type: object
+

Object representation for for a single point enumeration

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

+ +

+
+ +
+
+ + Type: string
+

Friendly name for the point, if known

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

+ +

+
+ +
+
+ + 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: object
+ + +

+ +

+
+ + + Type: object
+Must match regular expression: ^system\.base\.start$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.ready$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: boolean
-

Indicates if this point is writable or not

-
+ item 7
Type: object
+Must match regular expression: ^system\.network\.disconnect$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

Human-readable description of this point

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

- -

-
- -
-
- - Type: object
- - - No Additional Properties + item 8
Type: object
+Must match regular expression: ^system\.auth\.login$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ category + + + + oneOf + + + + item 9
Type: object
+Must match regular expression: ^system\.auth\.logout$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 10
Type: object
+Must match regular expression: ^system\.auth\.fail$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
+ category + + + + oneOf + + + + item 11
Type: object
+Must match regular expression: ^pointset\.point\.applied$ + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.base\.start$ + item 12
Type: object
+Must match regular expression: ^pointset\.point\.updating$ @@ -1807,7 +3055,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i13" role="tabpanel"> Type: object
-Must match regular expression: ^system\.base\.shutdown$ + item 13
Type: object
+Must match regular expression: ^pointset\.point\.overridden$ @@ -1861,7 +3109,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i14" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.receive$ + item 14
Type: object
+Must match regular expression: ^pointset\.point\.failure$ @@ -1915,7 +3163,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i15" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse$ + item 15
Type: object
+Must match regular expression: ^pointset\.point\.invalid$ @@ -1969,7 +3217,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i16" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply$ + item 16
Type: object
+Must match regular expression: ^discovery\.family\.scan$ @@ -2023,7 +3271,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i17" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.connect$ + item 17
Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ @@ -2077,7 +3325,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i18" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.disconnect$ + item 18
Type: object
+Must match regular expression: ^discovery\.point\.describe$ @@ -2131,7 +3379,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i19" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.login$ + item 19
Type: object
+Must match regular expression: ^blobset\.blob\.received$ @@ -2185,7 +3433,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i20" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.logout$ + item 20
Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ @@ -2239,7 +3487,7 @@

+ id="tab-pane_uniqs_pattern1_status_category_oneOf_i21" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.fail$ + item 21
Type: object
+Must match regular expression: ^blobset\.blob\.applied$ diff --git a/gencode/docs/event_system.html b/gencode/docs/event_system.html index d6912c3002..30eb7ad09a 100644 --- a/gencode/docs/event_system.html +++ b/gencode/docs/event_system.html @@ -348,6 +348,66 @@

id="logentries_items_category_oneOf_i9" data-toggle="tab" href="#tab-pane_logentries_items_category_oneOf_i9" role="tab" onclick="setAnchor('#logentries_items_category_oneOf_i9')" >Option 10 +
@@ -483,7 +543,7 @@

/> item 2

Type: object
-Must match regular expression: ^system\.config\.receive$ +Must match regular expression: ^system\.base\.ready$ @@ -530,7 +590,7 @@

/> item 3

Type: object
-Must match regular expression: ^system\.config\.parse$ +Must match regular expression: ^system\.config\.receive$ @@ -577,7 +637,7 @@

/> item 4

Type: object
-Must match regular expression: ^system\.config\.apply$ +Must match regular expression: ^system\.config\.parse$ @@ -624,7 +684,7 @@

/> item 5

Type: object
-Must match regular expression: ^system\.network\.connect$ +Must match regular expression: ^system\.config\.apply$ @@ -671,7 +731,7 @@

/> item 6

Type: object
-Must match regular expression: ^system\.network\.disconnect$ +Must match regular expression: ^system\.network\.connect$ @@ -718,7 +778,7 @@

/> item 7

Type: object
-Must match regular expression: ^system\.auth\.login$ +Must match regular expression: ^system\.network\.disconnect$ @@ -765,7 +825,7 @@

/> item 8

Type: object
-Must match regular expression: ^system\.auth\.logout$ +Must match regular expression: ^system\.auth\.login$ @@ -812,7 +872,571 @@

/> item 9

Type: object
-Must match regular expression: ^system\.auth\.fail$ +Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.applied$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.updating$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.overridden$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.failure$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.invalid$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.family\.scan$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.point\.describe$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.received$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.applied$ diff --git a/gencode/docs/event_validation.html b/gencode/docs/event_validation.html index 6d0cf434d9..632b1e9a07 100644 --- a/gencode/docs/event_validation.html +++ b/gencode/docs/event_validation.html @@ -403,6 +403,66 @@

id="status_category_oneOf_i9" data-toggle="tab" href="#tab-pane_status_category_oneOf_i9" role="tab" onclick="setAnchor('#status_category_oneOf_i9')" >Option 10 +
@@ -517,7 +577,7 @@

/> item 2

Type: object
-Must match regular expression: ^system\.config\.receive$ +Must match regular expression: ^system\.base\.ready$ @@ -557,7 +617,7 @@

/> item 3

Type: object
-Must match regular expression: ^system\.config\.parse$ +Must match regular expression: ^system\.config\.receive$ @@ -597,7 +657,7 @@

/> item 4

Type: object
-Must match regular expression: ^system\.config\.apply$ +Must match regular expression: ^system\.config\.parse$ @@ -637,7 +697,7 @@

/> item 5

Type: object
-Must match regular expression: ^system\.network\.connect$ +Must match regular expression: ^system\.config\.apply$ @@ -677,7 +737,7 @@

/> item 6

Type: object
-Must match regular expression: ^system\.network\.disconnect$ +Must match regular expression: ^system\.network\.connect$ @@ -717,7 +777,7 @@

/> item 7

Type: object
-Must match regular expression: ^system\.auth\.login$ +Must match regular expression: ^system\.network\.disconnect$ @@ -757,7 +817,7 @@

/> item 8

Type: object
-Must match regular expression: ^system\.auth\.logout$ +Must match regular expression: ^system\.auth\.login$ @@ -797,37 +857,16 @@

/> item 9

Type: object
-Must match regular expression: ^system\.auth\.fail$ +Must match regular expression: ^system\.auth\.logout$ -
- - - - - +
-
-
-
-
-
-
-
-

- -

-
- -
-
Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ category + + + + oneOf + + + + item 10
Type: object
+Must match regular expression: ^system\.auth\.fail$ -
-
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
-

Errors specific to pointset handling

-
No Additional Properties + oneOf + + + + item 11
Type: object
+Must match regular expression: ^pointset\.point\.applied$ -
-
-
-

- -

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

Missing points discovered while validating a device

-
+ category + + + + oneOf + + + + item 12
Type: object
+Must match regular expression: ^pointset\.point\.updating$ -

Each item of this array must be:

-
-
+ +
Type: string
- + oneOf + + + + item 13
Type: object
+Must match regular expression: ^pointset\.point\.overridden$ -
-
-
-
-
-
-
-
-
-

- -

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

Extra points discovered while validating a device

-
+ category + + + + oneOf + + + + item 14
Type: object
+Must match regular expression: ^pointset\.point\.failure$ -

Each item of this array must be:

-
-
+ +
Type: string
- + oneOf + + + + item 15
Type: object
+Must match regular expression: ^pointset\.point\.invalid$ -
-
-
-
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
- - Type: array
-

List of errors encountered while validating a device

-
- - - - - -

Each item of this array must be:

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

- -

-
- -
-
- - Type: string
-

A human-readable one-line description of the entry

-
+ item 16
Type: object
+Must match regular expression: ^discovery\.family\.scan$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ oneOf + + + + item 17
Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ -
-
-
-
-
-
-
-

- -

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

- -

-
- - - Type: object
+Must match regular expression: ^discovery\.point\.describe$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.base\.start$ + item 19
Type: object
+Must match regular expression: ^blobset\.blob\.received$ @@ -1392,7 +1265,7 @@

+ id="tab-pane_status_category_oneOf_i20" role="tabpanel"> Type: object
-Must match regular expression: ^system\.base\.shutdown$ + item 20
Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ @@ -1439,7 +1305,7 @@

+ id="tab-pane_status_category_oneOf_i21" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.receive$ + item 21
Type: object
+Must match regular expression: ^blobset\.blob\.applied$ -
+
- +
+
+
+
+
+

+ +

+
+ +
+
+ + 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
-Must match regular expression: ^system\.config\.parse$ + pointset
Type: object
+

Errors specific to pointset handling

+
No Additional Properties -
- +
+
+
+

+ +

+
+ +
+
Type: array of string
+

Missing points discovered while validating a device

+
+ + + + + +

Each item of this array must be:

+
+
+ + + Type: object
-Must match regular expression: ^system\.config\.apply$ + missing items
Type: string
+ -
- +
+
+
+
+
+
+
+
+
+

+ +

+
+ +
+
Type: array of string
+

Extra points discovered while validating a device

+
+ + + + + +

Each item of this array must be:

+
+
+ + + Type: object
-Must match regular expression: ^system\.network\.connect$ + extra items
Type: string
+ -
+
+
+
+
+
+
+
+ + + +
+
+
+

+ +

+
+ +
+
+ + Type: array
+

List of errors encountered while validating a device

+
+ + + + + +

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: object
+ + +

+ +

+
+ + + Type: object
+Must match regular expression: ^system\.base\.start$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.ready$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.applied$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.updating$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.overridden$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.failure$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.invalid$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.family\.scan$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.point\.describe$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.received$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.applied$ + + + + + + +
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + 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: array of string
+ + + + + + +

Each item of this array must be:

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

+ +

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

Each item of this array must be:

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

+ +

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

Each item of this array must be:

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

+ +

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

Each item of this array must be:

+
+
+ + + 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]{2,6}-[0-9]{1,6}$ +
+ + Type: object
+

Validation summary information for an individual device.

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

+ +

+
+ +
+
+ + Type: string
+

Last time any message from this device was received

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

+ +

+
+ +
+
+ + Type: string
+

Oldest recorded mark for this device

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

+ +

+
+ +
+
+ + 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: object
+ + +

+ +

+
Type: object
-Must match regular expression: ^system\.network\.disconnect$ - - - - - - -
- - - Type: object
-Must match regular expression: ^system\.auth\.login$ + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ @@ -1721,7 +3973,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i1" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.logout$ - - - - - - -
- - - Type: object
-Must match regular expression: ^system\.auth\.fail$ - - - + item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ -
+
- -
-
-
-
-
-
-
-

- -

-
- -
-
- 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).

-
+ item 2
Type: object
+Must match regular expression: ^system\.base\.ready$ -

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: array of string
- - - - - - -

Each item of this array must be:

-
-
- - - Type: string
- + oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.receive$ -
-
-
-
-
-
-
-
-
-

- -

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

Each item of this array must be:

-
- Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
-
-
-
-
-
-
-
-

- -

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

Each item of this array must be:

-
- Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
-
-
-
-
-
-
-
-

- -

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

Each item of this array must be:

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

- -

-
- -
-
- - Type: object
- No Additional Properties + item 6
Type: object
+Must match regular expression: ^system\.network\.connect$ -
-
-
-

- -

-
- -
-

- -

-

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

- Property name regular expression: ^[A-Z]{2,6}-[0-9]{1,6}$ -
+
+ Type: object
-

Validation summary information for an individual device.

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

- -

-
- -
-
- - Type: string
-

Last time any message from this device was received

-
+ item 7
Type: object
+Must match regular expression: ^system\.network\.disconnect$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: string
-

Oldest recorded mark for this device

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

- -

-
- -
-
- - Type: object
- - - No Additional Properties + item 8
Type: object
+Must match regular expression: ^system\.auth\.login$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ category + + + + oneOf + + + + item 9
Type: object
+Must match regular expression: ^system\.auth\.logout$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 10
Type: object
+Must match regular expression: ^system\.auth\.fail$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
+ category + + + + oneOf + + + + item 11
Type: object
+Must match regular expression: ^pointset\.point\.applied$ + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.base\.start$ + item 12
Type: object
+Must match regular expression: ^pointset\.point\.updating$ @@ -2749,7 +4621,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i13" role="tabpanel"> Type: object
-Must match regular expression: ^system\.base\.shutdown$ + item 13
Type: object
+Must match regular expression: ^pointset\.point\.overridden$ @@ -2803,7 +4675,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i14" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.receive$ + item 14
Type: object
+Must match regular expression: ^pointset\.point\.failure$ @@ -2857,7 +4729,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i15" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse$ + item 15
Type: object
+Must match regular expression: ^pointset\.point\.invalid$ @@ -2911,7 +4783,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i16" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply$ + item 16
Type: object
+Must match regular expression: ^discovery\.family\.scan$ @@ -2965,7 +4837,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i17" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.connect$ + item 17
Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ @@ -3019,7 +4891,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i18" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.disconnect$ + item 18
Type: object
+Must match regular expression: ^discovery\.point\.describe$ @@ -3073,7 +4945,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i19" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.login$ + item 19
Type: object
+Must match regular expression: ^blobset\.blob\.received$ @@ -3127,7 +4999,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i20" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.logout$ + item 20
Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ @@ -3181,7 +5053,7 @@

+ id="tab-pane_devices_pattern1_status_category_oneOf_i21" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.fail$ + item 21
Type: object
+Must match regular expression: ^blobset\.blob\.applied$ diff --git a/gencode/docs/state.html b/gencode/docs/state.html index 8e10909058..57169fa560 100644 --- a/gencode/docs/state.html +++ b/gencode/docs/state.html @@ -1080,6 +1080,66 @@

id="system_status_category_oneOf_i9" data-toggle="tab" href="#tab-pane_system_status_category_oneOf_i9" role="tab" onclick="setAnchor('#system_status_category_oneOf_i9')" >Option 10 +
@@ -1215,7 +1275,7 @@

/> item 2

Type: object
-Must match regular expression: ^system\.config\.receive$ +Must match regular expression: ^system\.base\.ready$ @@ -1262,7 +1322,7 @@

/> item 3

Type: object
-Must match regular expression: ^system\.config\.parse$ +Must match regular expression: ^system\.config\.receive$ @@ -1309,7 +1369,7 @@

/> item 4

Type: object
-Must match regular expression: ^system\.config\.apply$ +Must match regular expression: ^system\.config\.parse$ @@ -1356,7 +1416,7 @@

/> item 5

Type: object
-Must match regular expression: ^system\.network\.connect$ +Must match regular expression: ^system\.config\.apply$ @@ -1403,7 +1463,7 @@

/> item 6

Type: object
-Must match regular expression: ^system\.network\.disconnect$ +Must match regular expression: ^system\.network\.connect$ @@ -1450,7 +1510,7 @@

/> item 7Type: object
-Must match regular expression: ^system\.auth\.login$ +Must match regular expression: ^system\.network\.disconnect$ @@ -1497,7 +1557,7 @@

/> item 8Type: object
-Must match regular expression: ^system\.auth\.logout$ +Must match regular expression: ^system\.auth\.login$ @@ -1544,37 +1604,16 @@

/> item 9Type: object
-Must match regular expression: ^system\.auth\.fail$ +Must match regular expression: ^system\.auth\.logout$ - - - - - - +
-
- - - -
-
-
-

- -

-
- -
-
Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ category + + + + oneOf + + + + item 10
Type: object
+Must match regular expression: ^system\.auth\.fail$ -
-
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 + oneOf + + + + item 11
Type: object
+Must match regular expression: ^pointset\.point\.applied$ -
-
-
-

- -

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

- -

-
- -
-

Each additional property must conform to the following schema

- - Type: object
- No Additional Properties + item 12
Type: object
+Must match regular expression: ^pointset\.point\.updating$ -
-
-
-

- -

-
- -
-
+
+ Type: object
- - - No Additional Properties + oneOf + + + + item 13
Type: object
+Must match regular expression: ^pointset\.point\.overridden$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ item 14
Type: object
+Must match regular expression: ^pointset\.point\.failure$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ item 15
Type: object
+Must match regular expression: ^pointset\.point\.invalid$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
+ item 16
Type: object
+Must match regular expression: ^discovery\.family\.scan$ + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.base\.start$ + item 17
Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ @@ -2132,7 +1988,7 @@

+ id="tab-pane_system_status_category_oneOf_i18" role="tabpanel"> Type: object
-Must match regular expression: ^system\.base\.shutdown$ + item 18
Type: object
+Must match regular expression: ^discovery\.point\.describe$ @@ -2193,7 +2035,7 @@

+ id="tab-pane_system_status_category_oneOf_i19" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.receive$ + item 19
Type: object
+Must match regular expression: ^blobset\.blob\.received$ @@ -2254,7 +2082,7 @@

+ id="tab-pane_system_status_category_oneOf_i20" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse$ + item 20
Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ @@ -2315,7 +2129,7 @@

+ id="tab-pane_system_status_category_oneOf_i21" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply$ + item 21
Type: object
+Must match regular expression: ^blobset\.blob\.applied$ -
+
- +
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
-Must match regular expression: ^system\.network\.connect$ + timestamp
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
-Must match regular expression: ^system\.network\.disconnect$ + devices
Type: object
+ -
- +
+
+
+

+ +

+
+ +
+

Each additional property must conform to the following schema

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

+ +

+
+ +
+
+ + Type: object
-Must match regular expression: ^system\.auth\.login$ + status
Type: object
+ + + No Additional Properties -
- +
+
+
+

+ +

+
+ +
+
Type: string
+

A human-readable one-line description of the entry

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

+ +

+
+ +
+
+ + Type: object
-Must match regular expression: ^system\.auth\.logout$ + devices + + + + additionalProperties + + + + status + + + + detail
Type: string
+

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

+
-
+
+
+
+
+
+
+
+

+ +

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

+ +

+
Type: object
-Must match regular expression: ^system\.auth\.fail$ - - - + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ -
+
- -
-
-
-
-
-
-
-

- -

-
- -
-
- Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ category + + + + oneOf + + + + item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ -
-
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).

-
+ category + + + + oneOf + + + + item 2
Type: object
+Must match regular expression: ^system\.base\.ready$ -

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

-
+ oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.receive$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: boolean
-

Indicates if the discovery process is currently active

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

- -

-
- -
-
- - Type: object
-

Status information about the discovery operation

-
- - No Additional Properties + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
-
-

- -

-
- -
-
+
+ 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

-
+ item 5
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
+ status + + + + category + + + + oneOf + + + + item 6
Type: object
+Must match regular expression: ^system\.network\.connect$ + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.base\.start$ + oneOf + + + + item 7
Type: object
+Must match regular expression: ^system\.network\.disconnect$ @@ -3319,7 +3243,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i8" role="tabpanel"> Type: object
-Must match regular expression: ^system\.base\.shutdown$ + oneOf + + + + item 8
Type: object
+Must match regular expression: ^system\.auth\.login$ @@ -3373,7 +3304,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i9" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.receive$ + oneOf + + + + item 9
Type: object
+Must match regular expression: ^system\.auth\.logout$ @@ -3427,7 +3365,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i10" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse$ + oneOf + + + + item 10
Type: object
+Must match regular expression: ^system\.auth\.fail$ @@ -3481,7 +3426,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i11" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply$ + oneOf + + + + item 11
Type: object
+Must match regular expression: ^pointset\.point\.applied$ @@ -3535,7 +3487,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i12" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.connect$ + oneOf + + + + item 12
Type: object
+Must match regular expression: ^pointset\.point\.updating$ @@ -3589,7 +3548,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i13" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.disconnect$ + oneOf + + + + item 13
Type: object
+Must match regular expression: ^pointset\.point\.overridden$ @@ -3643,7 +3609,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i14" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.login$ + oneOf + + + + item 14
Type: object
+Must match regular expression: ^pointset\.point\.failure$ @@ -3697,7 +3670,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i15" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.logout$ + oneOf + + + + item 15
Type: object
+Must match regular expression: ^pointset\.point\.invalid$ @@ -3751,7 +3731,7 @@

+ id="tab-pane_gateway_devices_additionalProperties_status_category_oneOf_i16" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.fail$ - - - + oneOf + + + + item 16
Type: object
+Must match regular expression: ^discovery\.family\.scan$ -
+
- -
-
- - -
-
-
-

- -

-
- -
-
- Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ status + + + + category + + + + oneOf + + + + item 17
Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ -
-
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 + oneOf + + + + item 18
Type: object
+Must match regular expression: ^discovery\.point\.describe$ -
-
-
-

- -

-
- -
-

- -

-

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

-
+ item 19
Type: object
+Must match regular expression: ^blobset\.blob\.received$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: boolean
-

Indicates if the discovery process is currently active

-
+ status + + + + category + + + + oneOf + + + + item 20
Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
-

Status information about the discovery operation

-
+ status + + + + category + + + + oneOf + + + + item 21
Type: object
+Must match regular expression: ^blobset\.blob\.applied$ + - No Additional Properties + +
-
+ + + +
+
+
+
+
-
+

- +

-
+
Type: string
-

A human-readable one-line description of the entry

+ timestamp
Type: string
+

Timestamp the condition was triggered, or most recently updated

@@ -4251,25 +4166,25 @@


Example:
-
"Point is not writable"
+
"2018-08-26T21:39:28.364Z"
 

-
+
-
+

- +

-
+
Type: string
-

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

+ level
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: object
- - -

- -

-
Type: string
+

Generational marker for controlling discovery

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

+ +

+
+ +
+
+ Type: object
-Must match regular expression: ^system\.base\.start$ + active
Type: boolean
+

Indicates if the discovery process is currently active

+
-
- +
+
+
+
+
+
+
+

+ +

+
+ +
+
Type: object
+

Status information about the discovery operation

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

+ +

+
+ +
+
+ + Type: object
-Must match regular expression: ^system\.base\.shutdown$ + message
Type: string
+

A human-readable one-line description of the entry

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

+ +

+
+ +
+
Type: object
-Must match regular expression: ^system\.config\.receive$ + detail
Type: string
+

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

+
-
- +
+
+
+
+
+
+
+

+ +

+
+ +
+
Type: object
+ + +

+ +

+
+ + + Type: object
-Must match regular expression: ^system\.config\.parse$ + status + + + + category + + + + oneOf + + + + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ @@ -4670,7 +4795,7 @@

+ id="tab-pane_discovery_enumeration_status_category_oneOf_i1" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply$ + item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ @@ -4731,7 +4849,7 @@

+ id="tab-pane_discovery_enumeration_status_category_oneOf_i2" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.connect$ + item 2
Type: object
+Must match regular expression: ^system\.base\.ready$ @@ -4792,7 +4903,7 @@

+ id="tab-pane_discovery_enumeration_status_category_oneOf_i3" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.disconnect$ + item 3
Type: object
+Must match regular expression: ^system\.config\.receive$ @@ -4853,7 +4957,7 @@

+ id="tab-pane_discovery_enumeration_status_category_oneOf_i4" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.login$ + item 4
Type: object
+Must match regular expression: ^system\.config\.parse$ @@ -4914,7 +5011,7 @@

+ id="tab-pane_discovery_enumeration_status_category_oneOf_i5" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.logout$ + item 5
Type: object
+Must match regular expression: ^system\.config\.apply$ @@ -4975,7 +5065,7 @@

+ id="tab-pane_discovery_enumeration_status_category_oneOf_i6" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.fail$ - - - + item 6
Type: object
+Must match regular expression: ^system\.network\.connect$ -
+
- -
-
-
-
-
-
-
-

- -

-
- -
-
- Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.applied$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.updating$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.overridden$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.failure$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.invalid$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.family\.scan$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.point\.describe$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.received$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.applied$ + + + + + + +
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + 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: object
+ + +

+ +

+
+ + + Type: object
+Must match regular expression: ^system\.base\.start$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.ready$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.applied$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.updating$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.overridden$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.failure$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.invalid$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.family\.scan$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.point\.describe$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.received$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.applied$ + + + + + + +
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + 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: 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: 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: object
+ + +

+ +

+
+ + + Type: object
+Must match regular expression: ^system\.base\.start$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.shutdown$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.base\.ready$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.receive$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.parse$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.config\.apply$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.login$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.applied$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.updating$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.overridden$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.failure$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^pointset\.point\.invalid$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.family\.scan$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^discovery\.point\.describe$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.received$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ + + + + + + +
+ + + Type: object
+Must match regular expression: ^blobset\.blob\.applied$ + + + + + + +
+ + + + + + +
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + 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
-

Timestamp the condition was triggered, or most recently updated

+ state_etag
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

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

- +

-
+
Type: object
+

Optional status information about pointset

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

+ +

+
+ +
+
+ + 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).

+ message
Type: string
+

A human-readable one-line description of the entry

-

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

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

- +

-
+
Type: object
- - - No Additional Properties + pointset + + + + status + + + + detail
Type: string
+

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

+
-
+
+
+
+
+
-
+

- +

-
+
Type: object
+ + +

+ +

+
+ + + Type: object
- No Additional Properties + oneOf + + + + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ -
-
-
-

- -

-
- -
-

- -

-

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 + category + + + + oneOf + + + + item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ -
-
-
-

- -

-
- -
-
+
+ Type: object
- - - No Additional Properties + oneOf + + + + item 2
Type: object
+Must match regular expression: ^system\.base\.ready$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ item 3
Type: object
+Must match regular expression: ^system\.config\.receive$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ item 4
Type: object
+Must match regular expression: ^system\.config\.parse$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
+ item 5
Type: object
+Must match regular expression: ^system\.config\.apply$ + + + -

- -

-
+ +
Type: object
+Must match regular expression: ^system\.network\.connect$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.base\.start$ - - - - - - -
- - - Type: object
+Must match regular expression: ^system\.network\.disconnect$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.base\.shutdown$ + item 8
Type: object
+Must match regular expression: ^system\.auth\.login$ @@ -5719,7 +10946,7 @@

+ id="tab-pane_pointset_status_category_oneOf_i9" role="tabpanel"> Type: object
+Must match regular expression: ^system\.auth\.logout$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.config\.receive$ - - - - - - -
- - - Type: object
+Must match regular expression: ^system\.auth\.fail$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.config\.parse$ + oneOf + + + + item 11
Type: object
+Must match regular expression: ^pointset\.point\.applied$ @@ -5841,7 +11087,7 @@

+ id="tab-pane_pointset_status_category_oneOf_i12" role="tabpanel"> Type: object
+Must match regular expression: ^pointset\.point\.updating$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.config\.apply$ - - - - - - -
- - - Type: object
+Must match regular expression: ^pointset\.point\.overridden$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.network\.connect$ + oneOf + + + + item 14
Type: object
+Must match regular expression: ^pointset\.point\.failure$ @@ -5963,7 +11228,7 @@

+ id="tab-pane_pointset_status_category_oneOf_i15" role="tabpanel"> Type: object
+Must match regular expression: ^pointset\.point\.invalid$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.network\.disconnect$ - - - - - - -
- - - Type: object
+Must match regular expression: ^discovery\.family\.scan$ + + + + + + +
+ + + Type: object
-Must match regular expression: ^system\.auth\.login$ + item 17
Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ @@ -6085,7 +11369,7 @@

+ id="tab-pane_pointset_status_category_oneOf_i18" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.logout$ + item 18
Type: object
+Must match regular expression: ^discovery\.point\.describe$ @@ -6146,7 +11416,7 @@

+ id="tab-pane_pointset_status_category_oneOf_i19" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.fail$ + item 19
Type: object
+Must match regular expression: ^blobset\.blob\.received$ -
- - - - - +
-
-
-
-
-
-
-
-

- -

-
- -
-
Type: string
-

Timestamp the condition was triggered, or most recently updated

-
+ item 20
Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ -
-
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).

-
+ item 21
Type: object
+Must match regular expression: ^blobset\.blob\.applied$ -

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

+ timestamp
Type: string
+

Timestamp the condition was triggered, or most recently updated

@@ -6435,66 +11612,25 @@


Example:
-
"2019-01-17T14:02:29.364Z"
+
"2018-08-26T21:39:28.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

+ status + + + + level
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).

-

Must be at most 32 characters long

+

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

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

- +

-
+
Type: object
-

Optional status information about pointset

-
- - No Additional Properties + points
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: string
-

A human-readable one-line description of the entry

+ state_pointset_point.json#
Type: object
+

Object representation for for a single point

+ + No Additional Properties -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
+ +
-
+

- +

-
+
Type: string
-

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

+ Point Pointset State + + + + units
Type: string
+

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

@@ -6663,18 +11818,18 @@

-
+
-
+

- +

-
+
Type: object
- - -

- -

-
- - - Type: object
-Must match regular expression: ^system\.base\.start$ + value_state
Type: enum (of string)
+

Optional enumeration indicating the state of the points value.

+
+

Must be one of:

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

+ +

+
+ +
+
Type: object
-Must match regular expression: ^system\.base\.shutdown$ + status
Type: object
+

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

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

+ +

+
+ +
+
Type: object
-Must match regular expression: ^system\.config\.receive$ + message
Type: string
+

A human-readable one-line description of the entry

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

+ +

+
+ +
+
Type: object
-Must match regular expression: ^system\.config\.parse$ + detail
Type: string
+

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

+
-
- +
+
+
+
+
+
+
+

+ +

+
+ +
+
Type: object
-Must match regular expression: ^system\.config\.apply$ - + category
Type: object
- - - -
+

+ +

+
Type: object
-Must match regular expression: ^system\.network\.connect$ + category + + + + oneOf + + + + item 0
Type: object
+Must match regular expression: ^system\.base\.start$ @@ -7037,7 +12284,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i1" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.disconnect$ + category + + + + oneOf + + + + item 1
Type: object
+Must match regular expression: ^system\.base\.shutdown$ @@ -7084,7 +12345,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i2" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.login$ + item 2
Type: object
+Must match regular expression: ^system\.base\.ready$ @@ -7131,7 +12406,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i3" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.logout$ + category + + + + oneOf + + + + item 3
Type: object
+Must match regular expression: ^system\.config\.receive$ @@ -7178,7 +12467,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i4" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.fail$ - - - + category + + + + oneOf + + + + item 4
Type: object
+Must match regular expression: ^system\.config\.parse$ -
+
- -
-
-
-
-
-
-
-

- -

-
- -
-
- 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 + item 5
Type: object
+Must match regular expression: ^system\.config\.apply$ -
-
-
-

- -

-
- -
-

- -

-

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.

-
+ item 6
Type: object
+Must match regular expression: ^system\.network\.connect$ -
-
-
-
-
-
-
-

- -

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

Optional enumeration indicating the state of the points value.

-
-

Must be one of:

-
  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
-
+ item 7
Type: object
+Must match regular expression: ^system\.network\.disconnect$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
-

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

-
- - No Additional Properties + status + + + + category + + + + oneOf + + + + item 8
Type: object
+Must match regular expression: ^system\.auth\.login$ -
-
-
-

- -

-
- -
-
+
+ Type: string
-

A human-readable one-line description of the entry

-
+ category + + + + oneOf + + + + item 9
Type: object
+Must match regular expression: ^system\.auth\.logout$ -
-
Example:
-
"Point is not writable"
-
-
-
-
-
-
-
-
-
-

- -

-
- -
-
+ +
+ Type: string
-

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

-
+ category + + + + oneOf + + + + item 10
Type: object
+Must match regular expression: ^system\.auth\.fail$ -
-
-
-
-
-
-
-

- -

-
- -
-
+
+ Type: object
+ category + + + + oneOf + + + + item 11
Type: object
+Must match regular expression: ^pointset\.point\.applied$ + + + -

- -

-
+ +
Type: object
-Must match regular expression: ^system\.base\.start$ + item 12
Type: object
+Must match regular expression: ^pointset\.point\.updating$ @@ -7892,7 +13016,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i13" role="tabpanel"> Type: object
-Must match regular expression: ^system\.base\.shutdown$ + item 13
Type: object
+Must match regular expression: ^pointset\.point\.overridden$ @@ -7953,7 +13077,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i14" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.receive$ + item 14
Type: object
+Must match regular expression: ^pointset\.point\.failure$ @@ -8014,7 +13138,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i15" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.parse$ + item 15
Type: object
+Must match regular expression: ^pointset\.point\.invalid$ @@ -8075,7 +13199,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i16" role="tabpanel"> Type: object
-Must match regular expression: ^system\.config\.apply$ + item 16
Type: object
+Must match regular expression: ^discovery\.family\.scan$ @@ -8136,7 +13260,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i17" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.connect$ + item 17
Type: object
+Must match regular expression: ^discovery\.device\.enumerate$ @@ -8197,7 +13321,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i18" role="tabpanel"> Type: object
-Must match regular expression: ^system\.network\.disconnect$ + item 18
Type: object
+Must match regular expression: ^discovery\.point\.describe$ @@ -8258,7 +13382,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i19" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.login$ + item 19
Type: object
+Must match regular expression: ^blobset\.blob\.received$ @@ -8319,7 +13443,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i20" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.logout$ + item 20
Type: object
+Must match regular expression: ^blobset\.blob\.fetched$ @@ -8380,7 +13504,7 @@

+ id="tab-pane_pointset_points_pattern1_status_category_oneOf_i21" role="tabpanel"> Type: object
-Must match regular expression: ^system\.auth\.fail$ + item 21
Type: object
+Must match regular expression: ^blobset\.blob\.applied$ diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 0fe9b14afd..3990727921 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -1,5 +1,5 @@ from .ancillary_properties import AncillaryProperties -from .category import Object9194F77A +from .category import ObjectBC07E246 from .cloud_iot_config import CloudIotConfig from .command_discovery import DiscoveryCommand from .common import Common diff --git a/gencode/python/udmi/schema/category.py b/gencode/python/udmi/schema/category.py index 713f79b049..a8a9bd44f3 100644 --- a/gencode/python/udmi/schema/category.py +++ b/gencode/python/udmi/schema/category.py @@ -1,7 +1,7 @@ """Generated class for category.json""" -class Object9194F77A: +class ObjectBC07E246: """Generated schema class""" def __init__(self): @@ -11,7 +11,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = Object9194F77A() + result = ObjectBC07E246() return result @staticmethod @@ -20,7 +20,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = Object9194F77A.from_dict(source[key]) + result[key] = ObjectBC07E246.from_dict(source[key]) return result @staticmethod From 0ee5ebe17011d2ae45c44716adf1bf05638e9906 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 15:00:23 -0700 Subject: [PATCH 17/70] Fix gencode docs --- bin/gencode_docs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/gencode_docs b/bin/gencode_docs index 1257f69c0e..eec2ab4236 100755 --- a/bin/gencode_docs +++ b/bin/gencode_docs @@ -19,16 +19,21 @@ ROOT_DIR=$(realpath $(dirname $0)/..) cd $ROOT_DIR +OP= +if [[ -n $1 ]]; then + OP=$1 + shift +fi + OUTPUT_DIR=$ROOT_DIR/gencode/docs TMP_DIR=$ROOT_DIR/tmp/schema -rm -rf $OUTPUT_DIR $TMP_DIR schema_files=`ls schema/*.json` -if [ "$1" == gen_bucket ]; then - shift 1 +if [ "$OP" == gen_bucket ]; then + rm -rf $OUTPUT_DIR $TMP_DIR - input_file=$1 + input_file=$OP output_file=$2 tmp_file=$output_file.tmp @@ -51,7 +56,7 @@ if [ "$1" == gen_bucket ]; then fi -if [ "$1" == check_links ]; then +if [ "$OP" == check_links ]; then if [ -d venv ]; then source venv/bin/activate fi From 589300558f6064c782479bf20bce87b514341596 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 15:02:51 -0700 Subject: [PATCH 18/70] Fix gencode levels --- etc/Category.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/Category.java b/etc/Category.java index a4c2ed3bb7..7f5c75e6d3 100644 --- a/etc/Category.java +++ b/etc/Category.java @@ -1,7 +1,10 @@ package udmi.schema; import static udmi.schema.Level.DEBUG; +import static udmi.schema.Level.INFO; import static udmi.schema.Level.NOTICE; +import static udmi.schema.Level.WARNING; +import static udmi.schema.Level.ERROR; // This class is manually curated, auto-generated, and then copied into the gencode directory. // Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md From c23febadec9e5565407a06ce5722bcb775e51648 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 15:09:18 -0700 Subject: [PATCH 19/70] Fixing hash --- .gencode_hash.txt | 2 +- gencode/java/udmi/schema/Category.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 5b035bd2ee..38ed2b7bf3 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -16,7 +16,7 @@ d326a550d75ab7f558f165f1a5e8c24eee2b0b52290a7472f529bb1e15d79fb2 gencode/java/u 2c03651cb2ecda072b1418222eebb5560185669f8ffdd03021ad5ad8ff7ba3b0 gencode/java/udmi/schema/BlobBlobsetState.java 3fccb6bc6714fdc3dd912c8b1155e7ce19b0ac8a7ec48a01be9eb27bdd034a75 gencode/java/udmi/schema/BlobsetConfig.java fcbed49f1af8b791d8c52bcbe18f65521a79d9ac3eb33ec3afd9b342ab2bfc56 gencode/java/udmi/schema/BlobsetState.java -5504f264b95ad84dc2e9ce05215964bbd94917173a55eae9cb4ccffa7f642f68 gencode/java/udmi/schema/Category.java +a8b0e4d2e7b46f31b0fef43e50d9032d26ddfaa20f41f4623a9ab55185cc4959 gencode/java/udmi/schema/Category.java d6875f63ce67d1b945a0b75a4a660bd083cc52492371a7350c4109f6bf54968b gencode/java/udmi/schema/CloudIotConfig.java a2eeff86f4302272736d84602e2ca36a64d27c8ef6761cc05ffb8ad17b030d4d gencode/java/udmi/schema/CloudModel.java ff79de9390aa25bb45fb3e2ebb682c865ccab764f56d9644377d9d28c0ab10e4 gencode/java/udmi/schema/Config.java diff --git a/gencode/java/udmi/schema/Category.java b/gencode/java/udmi/schema/Category.java index ae0d511110..7bc7f32c43 100644 --- a/gencode/java/udmi/schema/Category.java +++ b/gencode/java/udmi/schema/Category.java @@ -1,7 +1,10 @@ package udmi.schema; import static udmi.schema.Level.DEBUG; +import static udmi.schema.Level.INFO; import static udmi.schema.Level.NOTICE; +import static udmi.schema.Level.WARNING; +import static udmi.schema.Level.ERROR; // This class is manually curated, auto-generated, and then copied into the gencode directory. // Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md From b17c0a5247c99a9e79f935fc05335343658c1856 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 15:16:17 -0700 Subject: [PATCH 20/70] Fix error count --- tests/event_system.tests/errors.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/event_system.tests/errors.out b/tests/event_system.tests/errors.out index 01ef773884..2e5a3a0146 100644 --- a/tests/event_system.tests/errors.out +++ b/tests/event_system.tests/errors.out @@ -1,5 +1,5 @@ 4 schema violations found - instance failed to match exactly one schema (matched 0 out of 18) + instance failed to match exactly one schema (matched 0 out of 22) instance type (string) does not match any allowed primitive type (allowed: ["object"]) numeric instance is lower than the required minimum (minimum: 100, found: 60) object has missing required properties (["message","timestamp"]) From a68b850c157dfd4223c64efdb4714718b011dd73 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 15:25:45 -0700 Subject: [PATCH 21/70] Fix simple trace test --- .../traces/simple.out/devices/AHU-1/event_system.out | 11 +++++++++++ .../traces/simple.out/devices/AHU-22/event_system.out | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 validator/traces/simple.out/devices/AHU-1/event_system.out create mode 100644 validator/traces/simple.out/devices/AHU-22/event_system.out diff --git a/validator/traces/simple.out/devices/AHU-1/event_system.out b/validator/traces/simple.out/devices/AHU-1/event_system.out new file mode 100644 index 0000000000..063b334192 --- /dev/null +++ b/validator/traces/simple.out/devices/AHU-1/event_system.out @@ -0,0 +1,11 @@ +{ + "timestamp" : "1999-10-20T01:02:03Z", + "version" : "1.3.14", + "sub_folder" : "system", + "sub_type" : "event", + "status" : { + "message" : "While converting to json node: 1 schema violations found", + "category" : "validation.error.simple", + "level" : 500 + } +} diff --git a/validator/traces/simple.out/devices/AHU-22/event_system.out b/validator/traces/simple.out/devices/AHU-22/event_system.out new file mode 100644 index 0000000000..063b334192 --- /dev/null +++ b/validator/traces/simple.out/devices/AHU-22/event_system.out @@ -0,0 +1,11 @@ +{ + "timestamp" : "1999-10-20T01:02:03Z", + "version" : "1.3.14", + "sub_folder" : "system", + "sub_type" : "event", + "status" : { + "message" : "While converting to json node: 1 schema violations found", + "category" : "validation.error.simple", + "level" : 500 + } +} From 467a51954a5b4dc2b3e4699fe24db16b6e13b647 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 22:21:32 -0700 Subject: [PATCH 22/70] Make sequencer verbose --- bin/test_sequencer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/test_sequencer b/bin/test_sequencer index b355765201..7aa688a00d 100755 --- a/bin/test_sequencer +++ b/bin/test_sequencer @@ -55,7 +55,7 @@ if [[ $i -eq $WAITING ]]; then false fi -bin/sequencer $site_path $project_id $device_id $serial_no +bin/sequencer -v $site_path $project_id $device_id $serial_no sed -i -e 's/.*sequencer RESULT/RESULT/' /tmp/sequencer.out From 8ad7c64897a2f0252da59e846e8d6f1ed8f82bc8 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Wed, 10 Aug 2022 23:34:18 -0700 Subject: [PATCH 23/70] FIxing some pubber logging --- .gencode_hash.txt | 6 ++-- bin/gencode_categories | 7 ++-- etc/Category.java | 5 +++ gencode/java/udmi/schema/Category.java | 27 +++++++++++++++ gencode/java/udmi/schema/PubberOptions.java | 6 +++- gencode/python/udmi/schema/pubber_options.py | 4 +++ pubber/.idea/runConfigurations/Pubber.xml | 2 +- pubber/src/main/java/daq/pubber/Pubber.java | 34 ++++++++++++------- schema/pubber_options.json | 3 ++ .../validations/ConfigValidator.java | 4 ++- 10 files changed, 77 insertions(+), 21 deletions(-) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 38ed2b7bf3..e13e5a8013 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -16,7 +16,7 @@ d326a550d75ab7f558f165f1a5e8c24eee2b0b52290a7472f529bb1e15d79fb2 gencode/java/u 2c03651cb2ecda072b1418222eebb5560185669f8ffdd03021ad5ad8ff7ba3b0 gencode/java/udmi/schema/BlobBlobsetState.java 3fccb6bc6714fdc3dd912c8b1155e7ce19b0ac8a7ec48a01be9eb27bdd034a75 gencode/java/udmi/schema/BlobsetConfig.java fcbed49f1af8b791d8c52bcbe18f65521a79d9ac3eb33ec3afd9b342ab2bfc56 gencode/java/udmi/schema/BlobsetState.java -a8b0e4d2e7b46f31b0fef43e50d9032d26ddfaa20f41f4623a9ab55185cc4959 gencode/java/udmi/schema/Category.java +0c908ea34ee54aa66f9ce472ad23ecaec3c091f2afbba7b509e1515b5557f82c gencode/java/udmi/schema/Category.java d6875f63ce67d1b945a0b75a4a660bd083cc52492371a7350c4109f6bf54968b gencode/java/udmi/schema/CloudIotConfig.java a2eeff86f4302272736d84602e2ca36a64d27c8ef6761cc05ffb8ad17b030d4d gencode/java/udmi/schema/CloudModel.java ff79de9390aa25bb45fb3e2ebb682c865ccab764f56d9644377d9d28c0ab10e4 gencode/java/udmi/schema/Config.java @@ -58,7 +58,7 @@ fc3a9415c04d8a06954dbdbfdff5d68ab113cce3948532c19df555778ffb04fa gencode/java/u ca2e7566106818ca7e5190c8041eb86f0c9b3251b0bda8c3ea7ce11a0c891a0a gencode/java/udmi/schema/Position.java 3df66bb1a37a9e0b2b6cf392f8c64d404a73c83e5e13c02bb4844f09b9a04b70 gencode/java/udmi/schema/Properties.java faa1cd11467f9e58742cfee7124d4af04dbf481eb5a80549bbd2eb77bcc8059d gencode/java/udmi/schema/PubberConfiguration.java -e767077a73430254f7365dbb3f242a1bb5a953a4016c116663d31ae3fbf00509 gencode/java/udmi/schema/PubberOptions.java +a5737c70324cf13322c019049f80e334bf699dea2f434859762fe3553fee8308 gencode/java/udmi/schema/PubberOptions.java 7bc53cb9a61df8f804a75aa4860403d19281f7c665cbddd5364a2aa746a1f651 gencode/java/udmi/schema/ReflectorConfig.java abe99dd74122c186403baa6982300a9d5968f8bbb7a67b1689104111b98f32fb gencode/java/udmi/schema/ReflectorState.java 5a44075bc03f2b9b2cc090f007fd1692832871f0981dcb02579d8dda96a96206 gencode/java/udmi/schema/SetupReflectorConfig.java @@ -115,7 +115,7 @@ aafe6e70c281152db958adf77a024e3e9fab8293927106297c5ec48c11f54e27 gencode/python 5c50847e136a033ea511209238bb570499b43fbee6189dae06603132dcb9f01f gencode/python/udmi/schema/model_testing_target.py a58f8c98e837a5b56126ca0f410e02f1e9cfcd80a8cb429e0ef522defab1f690 gencode/python/udmi/schema/properties.py 1b2dba2ff079366560c7106aecc5289db19312816fa34a86459e429c94972761 gencode/python/udmi/schema/pubber_configuration.py -68b34e6aed281e62e2b62d0aaea57a57f1d3a657ed39cbd849ddd69659d9d454 gencode/python/udmi/schema/pubber_options.py +0c895896f4bad5b50a9332706adb0f751618c37a125dbe6780ff92bd729923d7 gencode/python/udmi/schema/pubber_options.py 1f521678016ad267ad1c817896c7900ba30a85fc694669577b71148193db32c1 gencode/python/udmi/schema/reflect_config.py 1a4eef286957d77418777eb7f4cd1ee13aa24c2d916ec71a7ff4e56de76e303e gencode/python/udmi/schema/reflect_state.py 32bc70a30e37e89cfae14b44add18d546a6f9e00a3ec3519ede9c7486114d39c gencode/python/udmi/schema/state.py diff --git a/bin/gencode_categories b/bin/gencode_categories index 957f8856a5..84f1472b3e 100755 --- a/bin/gencode_categories +++ b/bin/gencode_categories @@ -15,6 +15,7 @@ JSON_FORMAT = '%s%s{ "pattern": "^%s$" }' JAVA_DESCRIPTION = "\n%s// %s\n" JAVA_TARGET = '%spublic static final String %s = "%s";\n' JAVA_LEVEL = '%spublic static final Level %s_LEVEL = %s;\n' +JAVA_MAP_ADD = '%sstatic { LEVEL.put(%s, %s); }\n' doc_in = os.path.join('docs/specs/categories.md') schema_in = os.path.join('etc/category.json') @@ -71,7 +72,7 @@ def write_schema_categories(out, indent, categories): out.write(JSON_FORMAT % (prefix, indent, target)) prefix = ',\n' out.write('\n') - + def write_java_out(categories): os.makedirs(os.path.dirname(java_out), exist_ok=True) with open(java_in) as inp: @@ -92,7 +93,9 @@ def write_java_categories(out, indent, categories): out.write(JAVA_DESCRIPTION % (indent, desc)) out.write(JAVA_TARGET % (indent, const, target)) out.write(JAVA_LEVEL % (indent, const, level)) - + out.write(JAVA_MAP_ADD % (indent, const, level)) + + categories = read_categories() write_schema_out(categories) write_java_out(categories) diff --git a/etc/Category.java b/etc/Category.java index 7f5c75e6d3..1f2e4ef28e 100644 --- a/etc/Category.java +++ b/etc/Category.java @@ -6,8 +6,13 @@ import static udmi.schema.Level.WARNING; import static udmi.schema.Level.ERROR; +import java.util.HashMap; +import java.util.Map; + // This class is manually curated, auto-generated, and then copied into the gencode directory. // Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md public class Category { + public static final Map LEVEL = new HashMap(); + @@ gencode stuff goes here } diff --git a/gencode/java/udmi/schema/Category.java b/gencode/java/udmi/schema/Category.java index 7bc7f32c43..55ebd11c0c 100644 --- a/gencode/java/udmi/schema/Category.java +++ b/gencode/java/udmi/schema/Category.java @@ -6,95 +6,122 @@ import static udmi.schema.Level.WARNING; import static udmi.schema.Level.ERROR; +import java.util.HashMap; +import java.util.Map; + // This class is manually curated, auto-generated, and then copied into the gencode directory. // Look for the proper source and don't be fooled! Ultimately sourced from docs/specs/categories.md public class Category { + public static final Map LEVEL = new HashMap(); + // System is in the process of (re)starting and essentially offline public static final String SYSTEM_BASE_START = "system.base.start"; public static final Level SYSTEM_BASE_START_LEVEL = NOTICE; + static { LEVEL.put(SYSTEM_BASE_START, NOTICE); } // System is shutting down public static final String SYSTEM_BASE_SHUTDOWN = "system.base.shutdown"; public static final Level SYSTEM_BASE_SHUTDOWN_LEVEL = NOTICE; + static { LEVEL.put(SYSTEM_BASE_SHUTDOWN, NOTICE); } // System is fully ready for operation public static final String SYSTEM_BASE_READY = "system.base.ready"; public static final Level SYSTEM_BASE_READY_LEVEL = NOTICE; + static { LEVEL.put(SYSTEM_BASE_READY, NOTICE); } // Receiving a config message public static final String SYSTEM_CONFIG_RECEIVE = "system.config.receive"; public static final Level SYSTEM_CONFIG_RECEIVE_LEVEL = DEBUG; + static { LEVEL.put(SYSTEM_CONFIG_RECEIVE, DEBUG); } // Parsing a received message public static final String SYSTEM_CONFIG_PARSE = "system.config.parse"; public static final Level SYSTEM_CONFIG_PARSE_LEVEL = DEBUG; + static { LEVEL.put(SYSTEM_CONFIG_PARSE, DEBUG); } // Application of a parsed config message public static final String SYSTEM_CONFIG_APPLY = "system.config.apply"; public static final Level SYSTEM_CONFIG_APPLY_LEVEL = NOTICE; + static { LEVEL.put(SYSTEM_CONFIG_APPLY, NOTICE); } // Connected to the network public static final String SYSTEM_NETWORK_CONNECT = "system.network.connect"; public static final Level SYSTEM_NETWORK_CONNECT_LEVEL = NOTICE; + static { LEVEL.put(SYSTEM_NETWORK_CONNECT, NOTICE); } // Disconnected from a network public static final String SYSTEM_NETWORK_DISCONNECT = "system.network.disconnect"; public static final Level SYSTEM_NETWORK_DISCONNECT_LEVEL = NOTICE; + static { LEVEL.put(SYSTEM_NETWORK_DISCONNECT, NOTICE); } // Successful login. The entry message should include the username and application public static final String SYSTEM_AUTH_LOGIN = "system.auth.login"; public static final Level SYSTEM_AUTH_LOGIN_LEVEL = NOTICE; + static { LEVEL.put(SYSTEM_AUTH_LOGIN, NOTICE); } // Successful logout public static final String SYSTEM_AUTH_LOGOUT = "system.auth.logout"; public static final Level SYSTEM_AUTH_LOGOUT_LEVEL = NOTICE; + static { LEVEL.put(SYSTEM_AUTH_LOGOUT, NOTICE); } // Failed authentication attempt. The entry message should include the application public static final String SYSTEM_AUTH_FAIL = "system.auth.fail"; public static final Level SYSTEM_AUTH_FAIL_LEVEL = WARNING; + static { LEVEL.put(SYSTEM_AUTH_FAIL, WARNING); } // The `set_value` for a point has been applied public static final String POINTSET_POINT_APPLIED = "pointset.point.applied"; public static final Level POINTSET_POINT_APPLIED_LEVEL = INFO; + static { LEVEL.put(POINTSET_POINT_APPLIED, INFO); } // The point is in the process of updating public static final String POINTSET_POINT_UPDATING = "pointset.point.updating"; public static final Level POINTSET_POINT_UPDATING_LEVEL = NOTICE; + static { LEVEL.put(POINTSET_POINT_UPDATING, NOTICE); } // The reported value has been overridden locally public static final String POINTSET_POINT_OVERRIDDEN = "pointset.point.overridden"; public static final Level POINTSET_POINT_OVERRIDDEN_LEVEL = WARNING; + static { LEVEL.put(POINTSET_POINT_OVERRIDDEN, WARNING); } // The system failed to read/write the point public static final String POINTSET_POINT_FAILURE = "pointset.point.failure"; public static final Level POINTSET_POINT_FAILURE_LEVEL = ERROR; + static { LEVEL.put(POINTSET_POINT_FAILURE, ERROR); } // A `config` parameter for the point is invalid in some way public static final String POINTSET_POINT_INVALID = "pointset.point.invalid"; public static final Level POINTSET_POINT_INVALID_LEVEL = ERROR; + static { LEVEL.put(POINTSET_POINT_INVALID, ERROR); } // Relating to scanning a particular address family public static final String DISCOVERY_FAMILY_SCAN = "discovery.family.scan"; public static final Level DISCOVERY_FAMILY_SCAN_LEVEL = INFO; + static { LEVEL.put(DISCOVERY_FAMILY_SCAN, INFO); } // Handling point enumeration for a given device public static final String DISCOVERY_DEVICE_ENUMERATE = "discovery.device.enumerate"; public static final Level DISCOVERY_DEVICE_ENUMERATE_LEVEL = INFO; + static { LEVEL.put(DISCOVERY_DEVICE_ENUMERATE, INFO); } // Relating to describing a particular point public static final String DISCOVERY_POINT_DESCRIBE = "discovery.point.describe"; public static final Level DISCOVERY_POINT_DESCRIBE_LEVEL = INFO; + static { LEVEL.put(DISCOVERY_POINT_DESCRIBE, INFO); } // Request for an update has been received public static final String BLOBSET_BLOB_RECEIVED = "blobset.blob.received"; public static final Level BLOBSET_BLOB_RECEIVED_LEVEL = DEBUG; + static { LEVEL.put(BLOBSET_BLOB_RECEIVED, DEBUG); } // Update blob has been successfully fetched public static final String BLOBSET_BLOB_FETCHED = "blobset.blob.fetched"; public static final Level BLOBSET_BLOB_FETCHED_LEVEL = DEBUG; + static { LEVEL.put(BLOBSET_BLOB_FETCHED, DEBUG); } // Update has been successfully applied public static final String BLOBSET_BLOB_APPLIED = "blobset.blob.applied"; public static final Level BLOBSET_BLOB_APPLIED_LEVEL = NOTICE; + static { LEVEL.put(BLOBSET_BLOB_APPLIED, NOTICE); } } diff --git a/gencode/java/udmi/schema/PubberOptions.java b/gencode/java/udmi/schema/PubberOptions.java index 50ac5d562d..abe27070fe 100644 --- a/gencode/java/udmi/schema/PubberOptions.java +++ b/gencode/java/udmi/schema/PubberOptions.java @@ -17,6 +17,7 @@ @JsonPropertyOrder({ "noHardware", "noConfigAck", + "messageTrace", "extraPoint", "missingPoint", "extraField", @@ -29,6 +30,8 @@ public class PubberOptions { public Boolean noHardware; @JsonProperty("noConfigAck") public Boolean noConfigAck; + @JsonProperty("messageTrace") + public Boolean messageTrace; @JsonProperty("extraPoint") public String extraPoint; @JsonProperty("missingPoint") @@ -44,6 +47,7 @@ public int hashCode() { result = ((result* 31)+((this.redirectRegistry == null)? 0 :this.redirectRegistry.hashCode())); result = ((result* 31)+((this.noHardware == null)? 0 :this.noHardware.hashCode())); result = ((result* 31)+((this.extraField == null)? 0 :this.extraField.hashCode())); + result = ((result* 31)+((this.messageTrace == null)? 0 :this.messageTrace.hashCode())); result = ((result* 31)+((this.missingPoint == null)? 0 :this.missingPoint.hashCode())); result = ((result* 31)+((this.noConfigAck == null)? 0 :this.noConfigAck.hashCode())); result = ((result* 31)+((this.extraPoint == null)? 0 :this.extraPoint.hashCode())); @@ -59,7 +63,7 @@ public boolean equals(Object other) { return false; } PubberOptions rhs = ((PubberOptions) other); - return (((((((this.redirectRegistry == rhs.redirectRegistry)||((this.redirectRegistry!= null)&&this.redirectRegistry.equals(rhs.redirectRegistry)))&&((this.noHardware == rhs.noHardware)||((this.noHardware!= null)&&this.noHardware.equals(rhs.noHardware))))&&((this.extraField == rhs.extraField)||((this.extraField!= null)&&this.extraField.equals(rhs.extraField))))&&((this.missingPoint == rhs.missingPoint)||((this.missingPoint!= null)&&this.missingPoint.equals(rhs.missingPoint))))&&((this.noConfigAck == rhs.noConfigAck)||((this.noConfigAck!= null)&&this.noConfigAck.equals(rhs.noConfigAck))))&&((this.extraPoint == rhs.extraPoint)||((this.extraPoint!= null)&&this.extraPoint.equals(rhs.extraPoint)))); + return ((((((((this.redirectRegistry == rhs.redirectRegistry)||((this.redirectRegistry!= null)&&this.redirectRegistry.equals(rhs.redirectRegistry)))&&((this.noHardware == rhs.noHardware)||((this.noHardware!= null)&&this.noHardware.equals(rhs.noHardware))))&&((this.extraField == rhs.extraField)||((this.extraField!= null)&&this.extraField.equals(rhs.extraField))))&&((this.messageTrace == rhs.messageTrace)||((this.messageTrace!= null)&&this.messageTrace.equals(rhs.messageTrace))))&&((this.missingPoint == rhs.missingPoint)||((this.missingPoint!= null)&&this.missingPoint.equals(rhs.missingPoint))))&&((this.noConfigAck == rhs.noConfigAck)||((this.noConfigAck!= null)&&this.noConfigAck.equals(rhs.noConfigAck))))&&((this.extraPoint == rhs.extraPoint)||((this.extraPoint!= null)&&this.extraPoint.equals(rhs.extraPoint)))); } } diff --git a/gencode/python/udmi/schema/pubber_options.py b/gencode/python/udmi/schema/pubber_options.py index bc74aa19ed..40d7446650 100644 --- a/gencode/python/udmi/schema/pubber_options.py +++ b/gencode/python/udmi/schema/pubber_options.py @@ -7,6 +7,7 @@ class PubberOptions: def __init__(self): self.noHardware = None self.noConfigAck = None + self.messageTrace = None self.extraPoint = None self.missingPoint = None self.extraField = None @@ -19,6 +20,7 @@ def from_dict(source): result = PubberOptions() result.noHardware = source.get('noHardware') result.noConfigAck = source.get('noConfigAck') + result.messageTrace = source.get('messageTrace') result.extraPoint = source.get('extraPoint') result.missingPoint = source.get('missingPoint') result.extraField = source.get('extraField') @@ -47,6 +49,8 @@ def to_dict(self): result['noHardware'] = self.noHardware # 5 if self.noConfigAck: result['noConfigAck'] = self.noConfigAck # 5 + if self.messageTrace: + result['messageTrace'] = self.messageTrace # 5 if self.extraPoint: result['extraPoint'] = self.extraPoint # 5 if self.missingPoint: diff --git a/pubber/.idea/runConfigurations/Pubber.xml b/pubber/.idea/runConfigurations/Pubber.xml index 71f95c4348..256b3f031d 100644 --- a/pubber/.idea/runConfigurations/Pubber.xml +++ b/pubber/.idea/runConfigurations/Pubber.xml @@ -2,7 +2,7 @@
+
+
+
+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Configuration parameters for device-under-test

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

+ +

+
+ +
+
+ + Type: string
+

The sequence name currently being tested (for debug logging)

+
+ + + + + + +
+
+
+
diff --git a/gencode/docs/envelope.html b/gencode/docs/envelope.html index 5a716deadd..97dbacfe56 100644 --- a/gencode/docs/envelope.html +++ b/gencode/docs/envelope.html @@ -218,7 +218,7 @@

subFolder

Type: enum (of string)

Must be one of:

-
  • "update"
  • "audit"
  • "discovery"
  • "system"
  • "gateway"
  • "swarm"
  • "localnet"
  • "pointset"
  • "blobset"
+
  • "update"
  • "audit"
  • "testing"
  • "discovery"
  • "system"
  • "gateway"
  • "swarm"
  • "localnet"
  • "pointset"
  • "blobset"
diff --git a/gencode/java/udmi/schema/Config.java b/gencode/java/udmi/schema/Config.java index f2031e8298..dea707886a 100644 --- a/gencode/java/udmi/schema/Config.java +++ b/gencode/java/udmi/schema/Config.java @@ -19,6 +19,7 @@ @JsonPropertyOrder({ "timestamp", "version", + "testing", "system", "gateway", "discovery", @@ -45,6 +46,15 @@ public class Config { @JsonProperty("version") @JsonPropertyDescription("Version of the UDMI schema") public String version; + /** + * Testing Config + *

+ * Configuration parameters for device-under-test + * + */ + @JsonProperty("testing") + @JsonPropertyDescription("Configuration parameters for device-under-test") + public TestingConfig testing; /** * System Config *

@@ -104,6 +114,7 @@ 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.testing == null)? 0 :this.testing.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())); @@ -122,7 +133,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.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)))); + 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.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing))))&&((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/Envelope.java b/gencode/java/udmi/schema/Envelope.java index 99ac30ca03..960ddfb592 100644 --- a/gencode/java/udmi/schema/Envelope.java +++ b/gencode/java/udmi/schema/Envelope.java @@ -100,6 +100,7 @@ public enum SubFolder { UPDATE("update"), AUDIT("audit"), + TESTING("testing"), DISCOVERY("discovery"), SYSTEM("system"), GATEWAY("gateway"), diff --git a/gencode/java/udmi/schema/TestingConfig.java b/gencode/java/udmi/schema/TestingConfig.java new file mode 100644 index 0000000000..aaf258e2c9 --- /dev/null +++ b/gencode/java/udmi/schema/TestingConfig.java @@ -0,0 +1,51 @@ + +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; + + +/** + * Testing Config + *

+ * Configuration parameters for device-under-test + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "sqeuence_name" +}) +@Generated("jsonschema2pojo") +public class TestingConfig { + + /** + * The sequence name currently being tested (for debug logging) + * + */ + @JsonProperty("sqeuence_name") + @JsonPropertyDescription("The sequence name currently being tested (for debug logging)") + public String sqeuence_name; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.sqeuence_name == null)? 0 :this.sqeuence_name.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof TestingConfig) == false) { + return false; + } + TestingConfig rhs = ((TestingConfig) other); + return ((this.sqeuence_name == rhs.sqeuence_name)||((this.sqeuence_name!= null)&&this.sqeuence_name.equals(rhs.sqeuence_name))); + } + +} diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 3990727921..984cba0cb3 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -13,6 +13,7 @@ from .config_pointset import PointsetConfig from .config_pointset_point import PointPointsetConfig from .config_system import SystemConfig +from .config_testing import TestingConfig from .envelope import Envelope from .event import Event from .event_discovery import DiscoveryEvent diff --git a/gencode/python/udmi/schema/config.py b/gencode/python/udmi/schema/config.py index 939b0a72c8..b5ca342e12 100644 --- a/gencode/python/udmi/schema/config.py +++ b/gencode/python/udmi/schema/config.py @@ -1,4 +1,5 @@ """Generated class for config.json""" +from .config_testing import TestingConfig from .config_system import SystemConfig from .config_gateway import GatewayConfig from .config_discovery import DiscoveryConfig @@ -13,6 +14,7 @@ class Config: def __init__(self): self.timestamp = None self.version = None + self.testing = None self.system = None self.gateway = None self.discovery = None @@ -27,6 +29,7 @@ def from_dict(source): result = Config() result.timestamp = source.get('timestamp') result.version = source.get('version') + result.testing = TestingConfig.from_dict(source.get('testing')) result.system = SystemConfig.from_dict(source.get('system')) result.gateway = GatewayConfig.from_dict(source.get('gateway')) result.discovery = DiscoveryConfig.from_dict(source.get('discovery')) @@ -57,6 +60,8 @@ def to_dict(self): result['timestamp'] = self.timestamp # 5 if self.version: result['version'] = self.version # 5 + if self.testing: + result['testing'] = self.testing.to_dict() # 4 if self.system: result['system'] = self.system.to_dict() # 4 if self.gateway: diff --git a/gencode/python/udmi/schema/config_testing.py b/gencode/python/udmi/schema/config_testing.py new file mode 100644 index 0000000000..4f88857c89 --- /dev/null +++ b/gencode/python/udmi/schema/config_testing.py @@ -0,0 +1,38 @@ +"""Generated class for config_testing.json""" + + +class TestingConfig: + """Generated schema class""" + + def __init__(self): + self.sqeuence_name = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = TestingConfig() + result.sqeuence_name = source.get('sqeuence_name') + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = TestingConfig.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.sqeuence_name: + result['sqeuence_name'] = self.sqeuence_name # 5 + return result diff --git a/schema/config.json b/schema/config.json index a930a1eb97..5b63f60d61 100644 --- a/schema/config.json +++ b/schema/config.json @@ -19,6 +19,9 @@ "description": "Version of the UDMI schema", "type": "string" }, + "testing": { + "$ref": "file:config_testing.json#" + }, "system": { "$ref": "file:config_system.json#" }, diff --git a/schema/config_testing.json b/schema/config_testing.json new file mode 100644 index 0000000000..014185f86d --- /dev/null +++ b/schema/config_testing.json @@ -0,0 +1,13 @@ +{ + "title": "Testing Config", + "description": "Configuration parameters for device-under-test", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "sqeuence_name": { + "description": "The sequence name currently being tested (for debug logging)", + "type": "string" + } + } +} diff --git a/schema/envelope.json b/schema/envelope.json index 4aec304079..3340fe286e 100644 --- a/schema/envelope.json +++ b/schema/envelope.json @@ -27,6 +27,7 @@ "enum": [ "update", "audit", + "testing", "discovery", "system", "gateway", 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 317c27268b..9373384373 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 @@ -55,6 +55,7 @@ import udmi.schema.State; import udmi.schema.SystemConfig; import udmi.schema.SystemEvent; +import udmi.schema.TestingConfig; /** * Validate a device using a sequence of message exchanges. @@ -177,6 +178,9 @@ public abstract class SequenceValidator { protected void starting(Description description) { try { testName = description.getMethodName(); + if (deviceConfig != null) { + deviceConfig.testing.sqeuence_name = testName; + } File testsOutputDir = new File(new File(deviceOutputDir, TESTS_OUT_DIR), testName); FileUtils.deleteDirectory(testsOutputDir); testsOutputDir.mkdirs(); @@ -191,6 +195,9 @@ protected void finished(Description description) { assert testName.equals(description.getMethodName()); notice("ending test " + testName); testName = null; + if (deviceConfig != null) { + deviceConfig.testing = null; + } } @Override @@ -281,14 +288,20 @@ protected static String getTimestamp() { return getTimestamp(CleanDateFormat.cleanDate()); } + private void resetDeviceConfig() { + deviceConfig = readGeneratedConfig(); + deviceConfig.system = Optional.ofNullable(deviceConfig.system).orElse(new SystemConfig()); + deviceConfig.system.min_loglevel = 400; + deviceConfig.testing = new TestingConfig(); + deviceConfig.testing.sqeuence_name = testName; + } + private Config readGeneratedConfig() { File deviceConfigFile = new File(String.format(DEVICE_CONFIG_FORMAT, siteModel, deviceId)); try { debug("Reading generated config file " + deviceConfigFile.getPath()); Config generatedConfig = OBJECT_MAPPER.readValue(deviceConfigFile, Config.class); - Config config = Optional.ofNullable(generatedConfig).orElse(new Config()); - config.system = Optional.ofNullable(config.system).orElse(new SystemConfig()); - return config; + return Optional.ofNullable(generatedConfig).orElse(new Config()); } catch (Exception e) { throw new RuntimeException("While loading " + deviceConfigFile.getAbsolutePath(), e); } @@ -309,9 +322,6 @@ public void setUp() { resetConfig(); - deviceConfig = readGeneratedConfig(); - deviceConfig.system.min_loglevel = 400; - clearLogs(); queryState(); @@ -321,13 +331,13 @@ public void setUp() { } protected void resetConfig() { - deviceConfig = new Config(); - deviceConfig.system = new SystemConfig(); sentConfig.clear(); + resetDeviceConfig(); extraField = "reset_config"; updateConfig(SubFolder.SYSTEM, augmentConfig(deviceConfig.system)); untilTrue("device config reset", this::configUpdateComplete); extraField = null; + updateConfig(); } private Date syncConfig() { @@ -468,10 +478,7 @@ public void tearDown() { if (debugLogLevel()) { warning("Not resetting config to enable post-execution debugging"); } else { - // Restore the config to a canonical state. resetConfig(); - deviceConfig = readGeneratedConfig(); - updateConfig(); } deviceConfig = null; deviceState = null; @@ -479,6 +486,7 @@ public void tearDown() { } protected void updateConfig() { + updateConfig(SubFolder.TESTING, deviceConfig.testing); updateConfig(SubFolder.SYSTEM, augmentConfig(deviceConfig.system)); updateConfig(SubFolder.POINTSET, deviceConfig.pointset); updateConfig(SubFolder.GATEWAY, deviceConfig.gateway); 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 31f83b8db9..f16a46f690 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 @@ -45,13 +45,12 @@ public void broken_config() { deviceConfig.system.min_loglevel = Level.DEBUG.value(); untilTrue("system operational", () -> deviceState.system.operational); untilTrue("last_config not null", () -> deviceState.system.last_config != null); - untilTrue("state no status", () -> deviceState.system.status == null); + untilTrue("no interesting status", this::noInterestingStatus); clearLogs(); untilTrue("previous config/state synced", () -> dateEquals(deviceConfig.timestamp, deviceState.system.last_config) ); extraField = "break_json"; - updateConfig(); hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); AtomicReference stableConfig = new AtomicReference<>(null); untilTrue("state has error status", () -> { @@ -75,10 +74,9 @@ public void broken_config() { assertTrue("system operational", deviceState.system.operational); hasLogged(SYSTEM_CONFIG_PARSE, Level.ERROR); hasNotLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); - resetConfig(); - extraField = null; + resetConfig(); // clears extra_field hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); - untilTrue("state no status", () -> deviceState.system.status == null); + untilTrue("no interesting status", this::noInterestingStatus); untilTrue("last_config updated", () -> !dateEquals(matchedConfig, deviceState.system.last_config) ); @@ -87,31 +85,34 @@ public void broken_config() { hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); } + private boolean noInterestingStatus() { + return deviceState.system.status == null || + deviceState.system.status.level < Level.WARNING.value(); + } + @Test public void extra_config() { deviceConfig.system.min_loglevel = Level.DEBUG.value(); untilTrue("last_config not null", () -> deviceState.system.last_config != null); untilTrue("system operational", () -> deviceState.system.operational); - untilTrue("state no status", () -> deviceState.system.status == null); + untilTrue("no interesting status", this::noInterestingStatus); clearLogs(); final Date prevConfig = deviceState.system.last_config; extraField = "Flabberguilstadt"; - updateConfig(); hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); untilTrue("last_config updated", () -> !deviceState.system.last_config.equals(prevConfig)); untilTrue("system operational", () -> deviceState.system.operational); - untilTrue("state no status", () -> deviceState.system.status == null); + untilTrue("no interesting status", this::noInterestingStatus); hasLogged(SYSTEM_CONFIG_PARSE, SYSTEM_CONFIG_PARSE_LEVEL); hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); final Date updatedConfig = deviceState.system.last_config; extraField = null; - updateConfig(); hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); 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); + untilTrue("no interesting status", this::noInterestingStatus); hasLogged(SYSTEM_CONFIG_PARSE, SYSTEM_CONFIG_PARSE_LEVEL); hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); } From 5fa2cd58008891992f75842c0784a09dadd91ff8 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 13:21:24 -0700 Subject: [PATCH 29/70] Linty --- .../daq/mqtt/validator/validations/ConfigValidator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 f16a46f690..240a68f4a1 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 @@ -86,8 +86,8 @@ public void broken_config() { } private boolean noInterestingStatus() { - return deviceState.system.status == null || - deviceState.system.status.level < Level.WARNING.value(); + return deviceState.system.status == null + || deviceState.system.status.level < Level.WARNING.value(); } @Test From f46dd239605c0b3e288c2a9a2268cc77c4d46f9f Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 13:24:14 -0700 Subject: [PATCH 30/70] Fix name type --- .gencode_hash.txt | 6 +++--- gencode/docs/config.html | 16 ++++++++-------- gencode/java/udmi/schema/TestingConfig.java | 10 +++++----- gencode/python/udmi/schema/config_testing.py | 8 ++++---- schema/config_testing.json | 2 +- .../daq/mqtt/validator/SequenceValidator.java | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.gencode_hash.txt b/.gencode_hash.txt index dcf5b0bae9..1edb540967 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,4 +1,4 @@ -b6c3d1a4e6c191f01b91e30fb11b1d3ac6d559a4da014925ad5d69035483ac5e gencode/docs/config.html +7ce008da1ec22a6dc9d4ca3ddc0f4a5b0c8ff6efca8e781edf0720676c9b8115 gencode/docs/config.html e5f11a58d744c5f82c4156e2c82b67a3424f0bf5157a6c666f80a3c6d46d2aa7 gencode/docs/envelope.html 9362682fa830ce9d98b3c074cab05ba44fae96a82de316a3520df3956e9325dc gencode/docs/event_discovery.html 8133e380e40f27c56accbffc665b2eeb56ec84a4da3b52ba7aa5e439c9c40572 gencode/docs/event_pointset.html @@ -71,7 +71,7 @@ e0f70f8e2c4793ebd05a38dc249d329eaa5b0171097ecc5fad4630fa0df3536d gencode/java/u 1c79bdb3da4c9127c75aa6660be0e62bfab1d1ee47c289637662fee2e37f1491 gencode/java/udmi/schema/SystemModel.java 127cd1f0f137cd79c8f42e289bd80e8509b7cc269f69d9ac10874706a7a1a0b6 gencode/java/udmi/schema/SystemState.java 7d6dd13e368e7f073738fee69c15e18652a9b7d7ac63bde0a200f747e3aa1b1d gencode/java/udmi/schema/TargetTestingModel.java -3f9518cdaaaaee8b1e3632c89015b3978af137e91594ab583c27b103ff00aa3d gencode/java/udmi/schema/TestingConfig.java +3360be8c937bd8cc592f8c67abdf1b240175a1748aa8e321b3360896961967e6 gencode/java/udmi/schema/TestingConfig.java d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/udmi/schema/TestingModel.java 347da3d586ff6e5dcf3ce8ec0c800ec0efd5fed4e0c80eef35de65ad92ae48bf gencode/java/udmi/schema/ValidationEvent.java e007ddd1ceeae3603c85110c33e1bb4a418ff9c7a791ca0df25b7ea3caeafd36 gencode/java/udmi/schema/ValidationSummary.java @@ -91,7 +91,7 @@ b461bdc24310ef972faf579b5be577b5af67fb0977d6afb4c42955211b26e3d5 gencode/python 9eab64849e04b25203d5da47856c3f8dda2b96903e4dc43ab932ee35014700bd gencode/python/udmi/schema/config_pointset.py 607c5047df878a1333df3ce88dcce34668959b0b315f6954bf1a4963dcf7839e gencode/python/udmi/schema/config_pointset_point.py 68685118163ea55f23938aafd10308faad1e2bf86c4f2fa9341cb53e19e2a260 gencode/python/udmi/schema/config_system.py -d0a4d6a93fd1fae78b6f6ff9e9cd73d5a9a540e63d05aea1681056507e4fe8fc gencode/python/udmi/schema/config_testing.py +b2f0867df30eeb3232674c34e2794297734766383736b81ac77bf60740b58c91 gencode/python/udmi/schema/config_testing.py 998ce105f88686f27b85f3630a396ed04b106f830c133a684ea5c505ca95b1c3 gencode/python/udmi/schema/envelope.py 1eb9019b9d0b4ff7de2df8beb625a4f89292d636ece0c02f160495c537bd6c2c gencode/python/udmi/schema/event.py 82182e3f569ad80dc0751027959c7db9135d10072fbe79f896d63a4cd2f4771f gencode/python/udmi/schema/event_discovery.py diff --git a/gencode/docs/config.html b/gencode/docs/config.html index 53084d45ea..bf7b948daf 100644 --- a/gencode/docs/config.html +++ b/gencode/docs/config.html @@ -133,18 +133,18 @@

-
+
-
+

- +

-
+
Type: string
+ sequence_name
Type: string

The sequence name currently being tested (for debug logging)

diff --git a/gencode/java/udmi/schema/TestingConfig.java b/gencode/java/udmi/schema/TestingConfig.java index aaf258e2c9..4ba7c617d1 100644 --- a/gencode/java/udmi/schema/TestingConfig.java +++ b/gencode/java/udmi/schema/TestingConfig.java @@ -16,7 +16,7 @@ */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ - "sqeuence_name" + "sequence_name" }) @Generated("jsonschema2pojo") public class TestingConfig { @@ -25,14 +25,14 @@ public class TestingConfig { * The sequence name currently being tested (for debug logging) * */ - @JsonProperty("sqeuence_name") + @JsonProperty("sequence_name") @JsonPropertyDescription("The sequence name currently being tested (for debug logging)") - public String sqeuence_name; + public String sequence_name; @Override public int hashCode() { int result = 1; - result = ((result* 31)+((this.sqeuence_name == null)? 0 :this.sqeuence_name.hashCode())); + result = ((result* 31)+((this.sequence_name == null)? 0 :this.sequence_name.hashCode())); return result; } @@ -45,7 +45,7 @@ public boolean equals(Object other) { return false; } TestingConfig rhs = ((TestingConfig) other); - return ((this.sqeuence_name == rhs.sqeuence_name)||((this.sqeuence_name!= null)&&this.sqeuence_name.equals(rhs.sqeuence_name))); + return ((this.sequence_name == rhs.sequence_name)||((this.sequence_name!= null)&&this.sequence_name.equals(rhs.sequence_name))); } } diff --git a/gencode/python/udmi/schema/config_testing.py b/gencode/python/udmi/schema/config_testing.py index 4f88857c89..5f847bafae 100644 --- a/gencode/python/udmi/schema/config_testing.py +++ b/gencode/python/udmi/schema/config_testing.py @@ -5,14 +5,14 @@ class TestingConfig: """Generated schema class""" def __init__(self): - self.sqeuence_name = None + self.sequence_name = None @staticmethod def from_dict(source): if not source: return None result = TestingConfig() - result.sqeuence_name = source.get('sqeuence_name') + result.sequence_name = source.get('sequence_name') return result @staticmethod @@ -33,6 +33,6 @@ def expand_dict(input): def to_dict(self): result = {} - if self.sqeuence_name: - result['sqeuence_name'] = self.sqeuence_name # 5 + if self.sequence_name: + result['sequence_name'] = self.sequence_name # 5 return result diff --git a/schema/config_testing.json b/schema/config_testing.json index 014185f86d..e8d1f37d69 100644 --- a/schema/config_testing.json +++ b/schema/config_testing.json @@ -5,7 +5,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { - "sqeuence_name": { + "sequence_name": { "description": "The sequence name currently being tested (for debug logging)", "type": "string" } 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 9373384373..da0ecb0331 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 @@ -179,7 +179,7 @@ protected void starting(Description description) { try { testName = description.getMethodName(); if (deviceConfig != null) { - deviceConfig.testing.sqeuence_name = testName; + deviceConfig.testing.sequence_name = testName; } File testsOutputDir = new File(new File(deviceOutputDir, TESTS_OUT_DIR), testName); FileUtils.deleteDirectory(testsOutputDir); @@ -293,7 +293,7 @@ private void resetDeviceConfig() { deviceConfig.system = Optional.ofNullable(deviceConfig.system).orElse(new SystemConfig()); deviceConfig.system.min_loglevel = 400; deviceConfig.testing = new TestingConfig(); - deviceConfig.testing.sqeuence_name = testName; + deviceConfig.testing.sequence_name = testName; } private Config readGeneratedConfig() { From 201f01a5080bc5fcc4d2e807618dfac55580734d Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 13:34:54 -0700 Subject: [PATCH 31/70] Augment logging --- pubber/src/main/java/daq/pubber/Pubber.java | 26 +++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index ea4ded416e..2a238161e1 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -114,13 +114,13 @@ public class Pubber { private static final int MESSAGE_REPORT_INTERVAL = 10; private static final Map> LOG_MAP = ImmutableMap.>builder() - .put(Level.TRACE, LOG::info) // TODO: Make debug/trace programmatically visible. - .put(Level.DEBUG, LOG::info) - .put(Level.INFO, LOG::info) - .put(Level.NOTICE, LOG::info) - .put(Level.WARNING, LOG::warn) - .put(Level.ERROR, LOG::error) - .build(); + .put(Level.TRACE, LOG::info) // TODO: Make debug/trace programmatically visible. + .put(Level.DEBUG, LOG::info) + .put(Level.INFO, LOG::info) + .put(Level.NOTICE, LOG::info) + .put(Level.WARNING, LOG::warn) + .put(Level.ERROR, LOG::error) + .build(); private static final Map DEFAULT_POINTS = ImmutableMap.of( "recalcitrant_angle", makePointPointsetModel(true, 50, 50, "Celsius"), "faulty_finding", makePointPointsetModel(true, 40, 0, "deg"), @@ -1076,7 +1076,7 @@ private void publishLogMessage(Entry report) { private void publishStateMessage() { long delay = lastStateTimeMs + STATE_THROTTLE_MS - System.currentTimeMillis(); if (delay > 0) { - warn(String.format("defer state update %d", delay)); + warn(String.format("State defer %dms", delay)); markStateDirty(delay); return; } @@ -1084,7 +1084,8 @@ private void publishStateMessage() { info(String.format("update state %s last_config %s", isoConvert(deviceState.timestamp), isoConvert(deviceState.system.last_config))); try { - debug("State update:\n" + OBJECT_MAPPER.writeValueAsString(deviceState)); + debug(String.format("State update:%s\n%s", getTestingTag(), + OBJECT_MAPPER.writeValueAsString(deviceState))); } catch (Exception e) { throw new RuntimeException("While converting new device state", e); } @@ -1158,10 +1159,15 @@ private void cloudLog(String message, Level level) { } private void localLog(Entry entry) { - String message = entry.category + " " + entry.message; + String message = String.format("Entry %s %s%s", entry.category, entry.message, getTestingTag()); localLog(message, Level.fromValue(entry.level), isoConvert(entry.timestamp)); } + private String getTestingTag() { + return deviceConfig.testing == null ? "" + : String.format(" (%s)", deviceConfig.testing.sequence_name; + } + private void localLog(String message, Level level, String timestamp) { String logMessage = String.format("%s %s", timestamp, message); LOG_MAP.get(level).accept(logMessage); From b2b3fd633f7a460204e812d0d8065681eb8504e8 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 13:44:19 -0700 Subject: [PATCH 32/70] Syntax --- pubber/src/main/java/daq/pubber/Pubber.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 2a238161e1..edbb775aef 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -1165,7 +1165,7 @@ private void localLog(Entry entry) { private String getTestingTag() { return deviceConfig.testing == null ? "" - : String.format(" (%s)", deviceConfig.testing.sequence_name; + : String.format(" (%s)", deviceConfig.testing.sequence_name); } private void localLog(String message, Level level, String timestamp) { From 5bdb6e46ce15f40be3cfb6be04e2114950c05b5f Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 13:44:56 -0700 Subject: [PATCH 33/70] Don't tag null --- pubber/src/main/java/daq/pubber/Pubber.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index edbb775aef..bb9305d64e 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -1164,7 +1164,7 @@ private void localLog(Entry entry) { } private String getTestingTag() { - return deviceConfig.testing == null ? "" + return deviceConfig.testing == null || deviceConfig.testing.sequence_name == null ? "" : String.format(" (%s)", deviceConfig.testing.sequence_name); } From a24430cff796efe45ffc2e821df5d0204dc629ed Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 13:54:16 -0700 Subject: [PATCH 34/70] Method ordering --- pubber/src/main/java/daq/pubber/Pubber.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index bb9305d64e..e758973791 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -1158,16 +1158,16 @@ private void cloudLog(String message, Level level) { } } - private void localLog(Entry entry) { - String message = String.format("Entry %s %s%s", entry.category, entry.message, getTestingTag()); - localLog(message, Level.fromValue(entry.level), isoConvert(entry.timestamp)); - } - private String getTestingTag() { return deviceConfig.testing == null || deviceConfig.testing.sequence_name == null ? "" : String.format(" (%s)", deviceConfig.testing.sequence_name); } + private void localLog(Entry entry) { + String message = String.format("Entry %s %s%s", entry.category, entry.message, getTestingTag()); + localLog(message, Level.fromValue(entry.level), isoConvert(entry.timestamp)); + } + private void localLog(String message, Level level, String timestamp) { String logMessage = String.format("%s %s", timestamp, message); LOG_MAP.get(level).accept(logMessage); From ab1705a12559889b5c96ade9910a0e50c97f455e Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 14:01:56 -0700 Subject: [PATCH 35/70] Fix tagging for config updates --- pubber/src/main/java/daq/pubber/Pubber.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index e758973791..747ee469e3 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -685,7 +685,8 @@ private void configHandler(Config config) { File configOut = new File(OUT_DIR, traceTimestamp() + "config.json"); try { OBJECT_MAPPER.writeValue(configOut, config); - debug("New config:\n" + OBJECT_MAPPER.writeValueAsString(config)); + debug(String.format("Config update%s:\n%s", getTestingTag(config), + OBJECT_MAPPER.writeValueAsString(config))); } catch (Exception e) { throw new RuntimeException("While writing config " + configOut.getPath(), e); } @@ -1084,7 +1085,7 @@ private void publishStateMessage() { info(String.format("update state %s last_config %s", isoConvert(deviceState.timestamp), isoConvert(deviceState.system.last_config))); try { - debug(String.format("State update:%s\n%s", getTestingTag(), + debug(String.format("State update%s:\n%s", getTestingTag(deviceConfig), OBJECT_MAPPER.writeValueAsString(deviceState))); } catch (Exception e) { throw new RuntimeException("While converting new device state", e); @@ -1158,13 +1159,14 @@ private void cloudLog(String message, Level level) { } } - private String getTestingTag() { - return deviceConfig.testing == null || deviceConfig.testing.sequence_name == null ? "" - : String.format(" (%s)", deviceConfig.testing.sequence_name); + private String getTestingTag(Config config) { + return config.testing == null || config.testing.sequence_name == null ? "" + : String.format(" (%s)", config.testing.sequence_name); } private void localLog(Entry entry) { - String message = String.format("Entry %s %s%s", entry.category, entry.message, getTestingTag()); + String message = String.format("Entry %s %s%s", entry.category, entry.message, + getTestingTag(deviceConfig)); localLog(message, Level.fromValue(entry.level), isoConvert(entry.timestamp)); } From dfabc924e6e752748a30b0f164f44194aa5cc778 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 16:30:16 -0700 Subject: [PATCH 36/70] Augment pubber logging --- pubber/src/main/java/daq/pubber/Pubber.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 747ee469e3..d14e667058 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -1165,8 +1165,8 @@ private String getTestingTag(Config config) { } private void localLog(Entry entry) { - String message = String.format("Entry %s %s%s", entry.category, entry.message, - getTestingTag(deviceConfig)); + String message = String.format("Entry %s %s %s%s", Level.fromValue(entry.level).name(), + entry.category, entry.message, getTestingTag(deviceConfig)); localLog(message, Level.fromValue(entry.level), isoConvert(entry.timestamp)); } From ea2cf1991aac7819db3626f823f54289fc918f24 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 16:53:22 -0700 Subject: [PATCH 37/70] Adjust test out --- .github/workflows/testing.yml | 2 +- bin/pubber | 3 +++ pubber/src/main/java/daq/pubber/Pubber.java | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 813d57a9f2..56307d8ea6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -128,4 +128,4 @@ jobs: if: ${{ always() }} run: | cat pubber.out || true - more out/*.json + more pubber/out/*.json diff --git a/bin/pubber b/bin/pubber index 35d7b03c82..505dd32b77 100755 --- a/bin/pubber +++ b/bin/pubber @@ -18,6 +18,9 @@ if [ ! -f $site_path/cloud_iot_config.json ]; then false fi +echo Cleaning output direction $ROOT_DIR/pubber/out +rm -rf $ROOT_DIR/pubber/out + echo Building pubber... $ROOT_DIR/pubber/bin/build diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index d14e667058..7333deff5f 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -99,7 +99,7 @@ public class Pubber { private static final int DEFAULT_REPORT_SEC = 10; private static final int CONFIG_WAIT_TIME_MS = 10000; private static final int STATE_THROTTLE_MS = 2000; - private static final String OUT_DIR = "out"; + private static final String OUT_DIR = "pubber/out"; private static final String PUBSUB_SITE = "PubSub"; private static final Set BOOLEAN_UNITS = ImmutableSet.of("No-units"); private static final double DEFAULT_BASELINE_VALUE = 50; @@ -148,6 +148,7 @@ public class Pubber { private String appliedEndpoint; private EndpointConfiguration extractedEndpoint; private SiteModel siteModel; + private PrintStream logPrintWriter; /** * Start an instance from a configuration file. @@ -555,8 +556,11 @@ private void initialize() { File outDir = new File(OUT_DIR); try { outDir.mkdir(); + File logOut = new File(OUT_DIR, traceTimestamp() + "pubber.log"); + logPrintWriter = new PrintStream(logOut); + logPrintWriter.println("Pubber log started at " + getTimestamp()); } catch (Exception e) { - throw new RuntimeException("While creating out dir " + outDir.getPath(), e); + throw new RuntimeException("While initializing out dir " + outDir.getPath(), e); } initializeMqtt(); @@ -1173,6 +1177,14 @@ private void localLog(Entry entry) { private void localLog(String message, Level level, String timestamp) { String logMessage = String.format("%s %s", timestamp, message); LOG_MAP.get(level).accept(logMessage); + try { + if (logPrintWriter != null) { + logPrintWriter.println(logMessage); + logPrintWriter.flush(); + } + } catch (Exception e) { + throw new RuntimeException("While writing log output file", e); + } } private void trace(String message) { From 8f5e0708c47b8ef341f3ec268a71da0d21908b5c Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 11 Aug 2022 17:25:32 -0700 Subject: [PATCH 38/70] Some logging cleanup --- ...aselineValidator_broken_config.xml => broken_config.xml} | 4 ++-- .../java/com/google/daq/mqtt/validator/CleanDateFormat.java | 6 ++++++ .../com/google/daq/mqtt/validator/SequenceValidator.java | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) rename validator/.idea/runConfigurations/{BaselineValidator_broken_config.xml => broken_config.xml} (78%) diff --git a/validator/.idea/runConfigurations/BaselineValidator_broken_config.xml b/validator/.idea/runConfigurations/broken_config.xml similarity index 78% rename from validator/.idea/runConfigurations/BaselineValidator_broken_config.xml rename to validator/.idea/runConfigurations/broken_config.xml index 1cb9a3930f..697bfa44e2 100644 --- a/validator/.idea/runConfigurations/BaselineValidator_broken_config.xml +++ b/validator/.idea/runConfigurations/broken_config.xml @@ -1,5 +1,5 @@ - + @@ -13,7 +13,7 @@
-
+
-
+

- +

-
+
Type: object
-

Configuration parameters for device-under-test

+ system
Type: object
+

System Config Documentation

No Additional Properties @@ -133,18 +133,18 @@

-
+
-
+

- +

-
+
Type: string
-

The sequence name currently being tested (for debug logging)

+ min_loglevel
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: object
-

System Config Documentation

+ system + + + + metrics_rate_sec
Type: integer Default: 600
+

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

- - No Additional Properties - +

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

-
+
+
+
+
+
-
+

- +

-
+
Type: integer Default: 300
-

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

+ mode
Type: enum (of string)
+

Operating mode for the device. Defaults is 'active'.

+ +
+

Must be one of:

+
  • "initial"
  • "active"
  • "restart"
+
-

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.

+ testing
Type: object
+

Configuration parameters for device-under-test

+ + No Additional Properties -

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

+ -
-
-
-
-
+
-
+

- +

-
+
Type: enum (of string)
-

Operating mode for the device. Defaults is 'active'.

+ testing + + + + sequence_name
Type: string
+

The sequence name currently being tested (for debug logging)

- -
-

Must be one of:

-
  • "initial"
  • "active"
  • "restart"
-
@@ -341,6 +351,10 @@

Must be one of:

+
+
+
+
diff --git a/gencode/docs/envelope.html b/gencode/docs/envelope.html index 97dbacfe56..5a716deadd 100644 --- a/gencode/docs/envelope.html +++ b/gencode/docs/envelope.html @@ -218,7 +218,7 @@

subFolder

Type: enum (of string)

Must be one of:

-
  • "update"
  • "audit"
  • "testing"
  • "discovery"
  • "system"
  • "gateway"
  • "swarm"
  • "localnet"
  • "pointset"
  • "blobset"
+
  • "update"
  • "audit"
  • "discovery"
  • "system"
  • "gateway"
  • "swarm"
  • "localnet"
  • "pointset"
  • "blobset"
diff --git a/gencode/java/udmi/schema/Config.java b/gencode/java/udmi/schema/Config.java index dea707886a..f2031e8298 100644 --- a/gencode/java/udmi/schema/Config.java +++ b/gencode/java/udmi/schema/Config.java @@ -19,7 +19,6 @@ @JsonPropertyOrder({ "timestamp", "version", - "testing", "system", "gateway", "discovery", @@ -46,15 +45,6 @@ public class Config { @JsonProperty("version") @JsonPropertyDescription("Version of the UDMI schema") public String version; - /** - * Testing Config - *

- * Configuration parameters for device-under-test - * - */ - @JsonProperty("testing") - @JsonPropertyDescription("Configuration parameters for device-under-test") - public TestingConfig testing; /** * System Config *

@@ -114,7 +104,6 @@ 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.testing == null)? 0 :this.testing.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())); @@ -133,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.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing))))&&((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/Envelope.java b/gencode/java/udmi/schema/Envelope.java index 960ddfb592..99ac30ca03 100644 --- a/gencode/java/udmi/schema/Envelope.java +++ b/gencode/java/udmi/schema/Envelope.java @@ -100,7 +100,6 @@ public enum SubFolder { UPDATE("update"), AUDIT("audit"), - TESTING("testing"), DISCOVERY("discovery"), SYSTEM("system"), GATEWAY("gateway"), diff --git a/gencode/java/udmi/schema/SystemConfig.java b/gencode/java/udmi/schema/SystemConfig.java index 4f6d3752c2..6f7840febe 100644 --- a/gencode/java/udmi/schema/SystemConfig.java +++ b/gencode/java/udmi/schema/SystemConfig.java @@ -22,7 +22,8 @@ @JsonPropertyOrder({ "min_loglevel", "metrics_rate_sec", - "mode" + "mode", + "testing" }) @Generated("jsonschema2pojo") public class SystemConfig { @@ -50,6 +51,15 @@ public class SystemConfig { @JsonProperty("mode") @JsonPropertyDescription("Operating mode for the device. Defaults is 'active'.") public SystemConfig.SystemMode mode; + /** + * Testing System Config + *

+ * Configuration parameters for device-under-test + * + */ + @JsonProperty("testing") + @JsonPropertyDescription("Configuration parameters for device-under-test") + public TestingSystemConfig testing; @Override public int hashCode() { @@ -57,6 +67,7 @@ public int hashCode() { result = ((result* 31)+((this.metrics_rate_sec == null)? 0 :this.metrics_rate_sec.hashCode())); result = ((result* 31)+((this.mode == null)? 0 :this.mode.hashCode())); result = ((result* 31)+((this.min_loglevel == null)? 0 :this.min_loglevel.hashCode())); + result = ((result* 31)+((this.testing == null)? 0 :this.testing.hashCode())); return result; } @@ -69,7 +80,7 @@ public boolean equals(Object other) { return false; } SystemConfig rhs = ((SystemConfig) other); - return ((((this.metrics_rate_sec == rhs.metrics_rate_sec)||((this.metrics_rate_sec!= null)&&this.metrics_rate_sec.equals(rhs.metrics_rate_sec)))&&((this.mode == rhs.mode)||((this.mode!= null)&&this.mode.equals(rhs.mode))))&&((this.min_loglevel == rhs.min_loglevel)||((this.min_loglevel!= null)&&this.min_loglevel.equals(rhs.min_loglevel)))); + return (((((this.metrics_rate_sec == rhs.metrics_rate_sec)||((this.metrics_rate_sec!= null)&&this.metrics_rate_sec.equals(rhs.metrics_rate_sec)))&&((this.mode == rhs.mode)||((this.mode!= null)&&this.mode.equals(rhs.mode))))&&((this.min_loglevel == rhs.min_loglevel)||((this.min_loglevel!= null)&&this.min_loglevel.equals(rhs.min_loglevel))))&&((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing)))); } diff --git a/gencode/java/udmi/schema/TestingConfig.java b/gencode/java/udmi/schema/TestingSystemConfig.java similarity index 86% rename from gencode/java/udmi/schema/TestingConfig.java rename to gencode/java/udmi/schema/TestingSystemConfig.java index 4ba7c617d1..088a194404 100644 --- a/gencode/java/udmi/schema/TestingConfig.java +++ b/gencode/java/udmi/schema/TestingSystemConfig.java @@ -9,7 +9,7 @@ /** - * Testing Config + * Testing System Config *

* Configuration parameters for device-under-test * @@ -19,7 +19,7 @@ "sequence_name" }) @Generated("jsonschema2pojo") -public class TestingConfig { +public class TestingSystemConfig { /** * The sequence name currently being tested (for debug logging) @@ -41,10 +41,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof TestingConfig) == false) { + if ((other instanceof TestingSystemConfig) == false) { return false; } - TestingConfig rhs = ((TestingConfig) other); + TestingSystemConfig rhs = ((TestingSystemConfig) other); return ((this.sequence_name == rhs.sequence_name)||((this.sequence_name!= null)&&this.sequence_name.equals(rhs.sequence_name))); } diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 984cba0cb3..c580a9dfcc 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -13,7 +13,7 @@ from .config_pointset import PointsetConfig from .config_pointset_point import PointPointsetConfig from .config_system import SystemConfig -from .config_testing import TestingConfig +from .config_system_testing import TestingSystemConfig from .envelope import Envelope from .event import Event from .event_discovery import DiscoveryEvent diff --git a/gencode/python/udmi/schema/config.py b/gencode/python/udmi/schema/config.py index b5ca342e12..939b0a72c8 100644 --- a/gencode/python/udmi/schema/config.py +++ b/gencode/python/udmi/schema/config.py @@ -1,5 +1,4 @@ """Generated class for config.json""" -from .config_testing import TestingConfig from .config_system import SystemConfig from .config_gateway import GatewayConfig from .config_discovery import DiscoveryConfig @@ -14,7 +13,6 @@ class Config: def __init__(self): self.timestamp = None self.version = None - self.testing = None self.system = None self.gateway = None self.discovery = None @@ -29,7 +27,6 @@ def from_dict(source): result = Config() result.timestamp = source.get('timestamp') result.version = source.get('version') - result.testing = TestingConfig.from_dict(source.get('testing')) result.system = SystemConfig.from_dict(source.get('system')) result.gateway = GatewayConfig.from_dict(source.get('gateway')) result.discovery = DiscoveryConfig.from_dict(source.get('discovery')) @@ -60,8 +57,6 @@ def to_dict(self): result['timestamp'] = self.timestamp # 5 if self.version: result['version'] = self.version # 5 - if self.testing: - result['testing'] = self.testing.to_dict() # 4 if self.system: result['system'] = self.system.to_dict() # 4 if self.gateway: diff --git a/gencode/python/udmi/schema/config_system.py b/gencode/python/udmi/schema/config_system.py index 289b48c7ef..5ff3a74d0c 100644 --- a/gencode/python/udmi/schema/config_system.py +++ b/gencode/python/udmi/schema/config_system.py @@ -1,4 +1,5 @@ """Generated class for config_system.json""" +from .config_system_testing import TestingSystemConfig class SystemConfig: @@ -8,6 +9,7 @@ def __init__(self): self.min_loglevel = None self.metrics_rate_sec = None self.mode = None + self.testing = None @staticmethod def from_dict(source): @@ -17,6 +19,7 @@ def from_dict(source): result.min_loglevel = source.get('min_loglevel') result.metrics_rate_sec = source.get('metrics_rate_sec') result.mode = source.get('mode') + result.testing = TestingSystemConfig.from_dict(source.get('testing')) return result @staticmethod @@ -43,4 +46,6 @@ def to_dict(self): result['metrics_rate_sec'] = self.metrics_rate_sec # 5 if self.mode: result['mode'] = self.mode # 5 + if self.testing: + result['testing'] = self.testing.to_dict() # 4 return result diff --git a/gencode/python/udmi/schema/config_testing.py b/gencode/python/udmi/schema/config_system_testing.py similarity index 79% rename from gencode/python/udmi/schema/config_testing.py rename to gencode/python/udmi/schema/config_system_testing.py index 5f847bafae..e6be8a1b9f 100644 --- a/gencode/python/udmi/schema/config_testing.py +++ b/gencode/python/udmi/schema/config_system_testing.py @@ -1,7 +1,7 @@ -"""Generated class for config_testing.json""" +"""Generated class for config_system_testing.json""" -class TestingConfig: +class TestingSystemConfig: """Generated schema class""" def __init__(self): @@ -11,7 +11,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = TestingConfig() + result = TestingSystemConfig() result.sequence_name = source.get('sequence_name') return result @@ -21,7 +21,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = TestingConfig.from_dict(source[key]) + result[key] = TestingSystemConfig.from_dict(source[key]) return result @staticmethod diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 266edbb016..2e9c090fe0 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -1170,8 +1170,9 @@ private void cloudLog(String message, Level level, String detail) { } private String getTestingTag(Config config) { - return config.testing == null || config.testing.sequence_name == null ? "" - : String.format(" (%s)", config.testing.sequence_name); + return config.system == null || config.system.testing == null + || config.system.testing.sequence_name == null ? "" + : String.format(" (%s)", config.system.testing.sequence_name); } private void localLog(Entry entry) { diff --git a/schema/config.json b/schema/config.json index 5b63f60d61..a930a1eb97 100644 --- a/schema/config.json +++ b/schema/config.json @@ -19,9 +19,6 @@ "description": "Version of the UDMI schema", "type": "string" }, - "testing": { - "$ref": "file:config_testing.json#" - }, "system": { "$ref": "file:config_system.json#" }, diff --git a/schema/config_system.json b/schema/config_system.json index 6885009848..e1a711ead6 100644 --- a/schema/config_system.json +++ b/schema/config_system.json @@ -21,6 +21,9 @@ }, "mode": { "$ref": "file:common.json#/definitions/mode" + }, + "testing": { + "$ref": "file:config_system_testing.json#" } } } diff --git a/schema/config_testing.json b/schema/config_system_testing.json similarity index 90% rename from schema/config_testing.json rename to schema/config_system_testing.json index e8d1f37d69..ee8cc70e40 100644 --- a/schema/config_testing.json +++ b/schema/config_system_testing.json @@ -1,5 +1,5 @@ { - "title": "Testing Config", + "title": "Testing System Config", "description": "Configuration parameters for device-under-test", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/schema/envelope.json b/schema/envelope.json index 3340fe286e..4aec304079 100644 --- a/schema/envelope.json +++ b/schema/envelope.json @@ -27,7 +27,6 @@ "enum": [ "update", "audit", - "testing", "discovery", "system", "gateway", 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 57ff539fb2..25fa9cbc99 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 @@ -55,7 +55,7 @@ import udmi.schema.State; import udmi.schema.SystemConfig; import udmi.schema.SystemEvent; -import udmi.schema.TestingConfig; +import udmi.schema.TestingSystemConfig; /** * Validate a device using a sequence of message exchanges. @@ -178,7 +178,7 @@ protected void starting(Description description) { try { testName = description.getMethodName(); if (deviceConfig != null) { - deviceConfig.testing.sequence_name = testName; + deviceConfig.system.testing.sequence_name = testName; } File testsOutputDir = new File(new File(deviceOutputDir, TESTS_OUT_DIR), testName); FileUtils.deleteDirectory(testsOutputDir); @@ -195,7 +195,7 @@ protected void finished(Description description) { notice("ending test " + testName); testName = null; if (deviceConfig != null) { - deviceConfig.testing = null; + deviceConfig.system.testing = null; } } @@ -291,8 +291,8 @@ private void resetDeviceConfig() { deviceConfig = readGeneratedConfig(); deviceConfig.system = Optional.ofNullable(deviceConfig.system).orElse(new SystemConfig()); deviceConfig.system.min_loglevel = 400; - deviceConfig.testing = new TestingConfig(); - deviceConfig.testing.sequence_name = testName; + deviceConfig.system.testing = new TestingSystemConfig(); + deviceConfig.system.testing.sequence_name = testName; } private Config readGeneratedConfig() { @@ -332,12 +332,12 @@ public void setUp() { protected void resetConfig() { resetDeviceConfig(); extraField = "reset_config"; - deviceConfig.testing.sequence_name = extraField; + deviceConfig.system.testing.sequence_name = extraField; sentConfig.clear(); updateConfig(SubFolder.SYSTEM, augmentConfig(deviceConfig.system)); untilTrue("device config reset", this::configUpdateComplete); extraField = null; - deviceConfig.testing.sequence_name = testName; + deviceConfig.system.testing.sequence_name = testName; updateConfig(); } @@ -507,7 +507,6 @@ public void tearDown() { } protected void updateConfig() { - updateConfig(SubFolder.TESTING, deviceConfig.testing); updateConfig(SubFolder.SYSTEM, augmentConfig(deviceConfig.system)); updateConfig(SubFolder.POINTSET, deviceConfig.pointset); updateConfig(SubFolder.GATEWAY, deviceConfig.gateway); From f6814bcb4112e915008cb0895a425d64bf235a7a Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 14:06:58 -0700 Subject: [PATCH 48/70] reset debug --- docs/tools/pubber.md | 32 +++++++++++++++---- docs/tools/sequencer.md | 18 +++++++++++ .../daq/mqtt/validator/SequenceValidator.java | 5 +-- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/docs/tools/pubber.md b/docs/tools/pubber.md index b3ff10437a..cb125e342a 100644 --- a/docs/tools/pubber.md +++ b/docs/tools/pubber.md @@ -22,22 +22,24 @@ Pubber is run from the CLI within the UDMI directory. * `SERIAL_NO` - serial number to use (can be any alphanumeric string) * `[options]` - optional configuration parameters which change pubber behavior +Output will be collected in `pubber/out/`, including a complete log and message traces. + ### Options The following parameters are currently supported from the CLI: -* `extraPoint=` - adds an extra point with the given name to the device +* `extraPoint=`: Adds an extra point with the given name to the device which does not exist in device's metadata with a random value (will trigger validation additional point error) -* `missingPoint=` - removes the point with the given name (if exists) from +* `missingPoint=`: Removes the point with the given name (if exists) from the device's active pointset at initialization (will trigger validation missing point) -* `extraField=` - adds an extra schema invalidating field to pointset events +* `extraField=`: Adds an extra schema invalidating field to pointset events (will trigger validation schema error) -* `noHardware` - omits the `system.hardware` field from state messages (will +* `noHardware`: Omits the `system.hardware` field from state messages (will trigger validation error, missing required field) -* `noConfigAck` - subscribes to the `config` topic with a QoS of 0, therefore +* `noConfigAck`: Subscribes to the `config` topic with a QoS of 0, therefore will not send PUBACK's for config messages - +* `messageTrace`: More verbose output of captured messages (to `pubber/out/`) More advanced options can be set by by calling pubber directly with the path a configuration file: `pubber/bin/run path/to/config.json` @@ -153,3 +155,21 @@ specific setup. The relevant bits of configuration are the information in the evaluator, String description) { - updateConfig(); waitingCondition = "waiting for " + description; info("start " + waitingCondition); + updateConfig(); while (evaluator.get()) { receiveMessage(); } From dde53e3bc5f75aa0e9708549cb66107d5e137ab9 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 14:17:02 -0700 Subject: [PATCH 49/70] Clean reset --- .../google/daq/mqtt/validator/SequenceValidator.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 7df6dacf6a..887298a1a2 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 @@ -288,7 +288,11 @@ protected static String getTimestamp() { } private void resetDeviceConfig() { - deviceConfig = readGeneratedConfig(); + resetDeviceConfig(false); + } + + private void resetDeviceConfig(boolean clean) { + deviceConfig = clean ? new Config() : readGeneratedConfig(); deviceConfig.system = Optional.ofNullable(deviceConfig.system).orElse(new SystemConfig()); deviceConfig.system.min_loglevel = 400; deviceConfig.system.testing = new TestingSystemConfig(); @@ -331,13 +335,12 @@ public void setUp() { protected void resetConfig() { debug("Starting reset config flow"); - resetDeviceConfig(); + resetDeviceConfig(true); extraField = "reset_config"; deviceConfig.system.testing.sequence_name = extraField; sentConfig.clear(); untilTrue("device config reset", this::configUpdateComplete); - extraField = null; - deviceConfig.system.testing.sequence_name = testName; + resetDeviceConfig(); updateConfig(); debug("Done with reset config flow"); } From 0f91a407fb69ca175691d694e70c2e449205c22e Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 19:55:38 -0700 Subject: [PATCH 50/70] Add config/state update counts --- .../google/daq/mqtt/validator/SequenceValidator.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 887298a1a2..a37751f02e 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 @@ -29,6 +29,7 @@ import java.util.Objects; import java.util.Optional; 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; @@ -107,6 +108,7 @@ public abstract class SequenceValidator { ); private static final String UDMI_VERSION = Objects.requireNonNullElse( System.getenv("UDMI_VERSION"), "unknown"); + private static final Map UPDATE_COUNTS = new HashMap<>(); private static Date stateTimestamp; // Because of the way tests are run and configured, these parameters need to be @@ -778,6 +780,8 @@ private synchronized void handleReflectorMessage(String subFolderRaw, } Object converted = convertTo(expectedUpdates.get(subFolderRaw), message); receivedUpdates.put(subFolderRaw, converted); + int updateCount = UPDATE_COUNTS.computeIfAbsent(subFolderRaw, key -> new AtomicInteger()) + .incrementAndGet(); if (converted instanceof Config) { String extraField = getExtraField(message); if ("reset_config".equals(extraField)) { @@ -790,10 +794,12 @@ private synchronized void handleReflectorMessage(String subFolderRaw, deviceConfig.timestamp = config.timestamp; deviceConfig.version = config.version; info("Updated config with timestamp " + getTimestamp(config.timestamp)); - debug("Updated config:\n" + OBJECT_MAPPER.writeValueAsString(converted)); + debug(String.format("Updated config #%03d:\n%s", updateCount, + OBJECT_MAPPER.writeValueAsString(converted))); recordDeviceConfig(); } else if (converted instanceof AugmentedState) { - debug("Updated state:\n" + OBJECT_MAPPER.writeValueAsString(converted)); + debug(String.format("Updated state #%03d:\n%s", updateCount, + OBJECT_MAPPER.writeValueAsString(converted))); deviceState = (State) converted; updateConfigAcked((AugmentedState) converted); validSerialNo(); From 92538bdc8cedf5fe216cba3d7880873cdd8cf7f0 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 22:14:18 -0700 Subject: [PATCH 51/70] Cleaning break_config --- .../daq/mqtt/validator/SequenceValidator.java | 9 +++++ .../validations/ConfigValidator.java | 38 ++++++++----------- 2 files changed, 25 insertions(+), 22 deletions(-) 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 a37751f02e..2676826fc2 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 @@ -628,6 +628,11 @@ protected boolean catchToFalse(Supplier evaluator) { return value != null && value; } + protected boolean catchToTrue(Supplier evaluator) { + Boolean value = catchToNull(evaluator); + return value == null || value; + } + protected T catchToNull(Supplier evaluator) { try { return evaluator.get(); @@ -706,6 +711,10 @@ protected void untilTrue(String description, Supplier evaluator) { untilLoop(() -> !catchToFalse(evaluator), description); } + protected void untilFalse(String description, Supplier evaluator) { + untilLoop(() -> catchToTrue(evaluator), 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/ConfigValidator.java b/validator/src/main/java/com/google/daq/mqtt/validator/validations/ConfigValidator.java index 240a68f4a1..5c205f7686 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 @@ -45,49 +45,43 @@ public void broken_config() { deviceConfig.system.min_loglevel = Level.DEBUG.value(); untilTrue("system operational", () -> deviceState.system.operational); untilTrue("last_config not null", () -> deviceState.system.last_config != null); - untilTrue("no interesting status", this::noInterestingStatus); + untilFalse("no interesting status", this::hasInterestingStatus); clearLogs(); untilTrue("previous config/state synced", () -> dateEquals(deviceConfig.timestamp, deviceState.system.last_config) ); + Date stableConfig = deviceConfig.timestamp; + assertTrue("initial stable_config matches last_config", + dateEquals(stableConfig, deviceState.system.last_config)); extraField = "break_json"; hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); - AtomicReference stableConfig = new AtomicReference<>(null); - untilTrue("state has error status", () -> { - boolean hasStatus = deviceState.system.status != null - && deviceState.system.status.level >= Level.ERROR.value(); - if (!hasStatus) { - stableConfig.set(deviceState.system.last_config); - } - return hasStatus; - }); + untilTrue("has interesting status", this::hasInterestingStatus); Entry stateStatus = deviceState.system.status; info("Error message: " + stateStatus.message); info("Error detail: " + stateStatus.detail); assertEquals(SYSTEM_CONFIG_PARSE, stateStatus.category); assertEquals(Level.ERROR.value(), (int) stateStatus.level); - Date matchedConfig = stableConfig.get(); - info("stable_config " + getTimestamp(matchedConfig)); + info("stable_config " + getTimestamp(stableConfig)); info("last_config " + getTimestamp(deviceState.system.last_config)); - assertTrue("last_config matches config timestamp", - dateEquals(matchedConfig, deviceState.system.last_config)); + assertTrue("following stable_config matches last_config", + dateEquals(stableConfig, deviceState.system.last_config)); assertTrue("system operational", deviceState.system.operational); hasLogged(SYSTEM_CONFIG_PARSE, Level.ERROR); hasNotLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); resetConfig(); // clears extra_field hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); - untilTrue("no interesting status", this::noInterestingStatus); + untilFalse("no interesting status", this::hasInterestingStatus); untilTrue("last_config updated", - () -> !dateEquals(matchedConfig, deviceState.system.last_config) + () -> !dateEquals(stableConfig, deviceState.system.last_config) ); assertTrue("system operational", deviceState.system.operational); hasLogged(SYSTEM_CONFIG_PARSE, SYSTEM_CONFIG_PARSE_LEVEL); hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); } - private boolean noInterestingStatus() { - return deviceState.system.status == null - || deviceState.system.status.level < Level.WARNING.value(); + private boolean hasInterestingStatus() { + return deviceState.system.status != null + && deviceState.system.status.level >= Level.WARNING.value(); } @Test @@ -95,14 +89,14 @@ public void extra_config() { deviceConfig.system.min_loglevel = Level.DEBUG.value(); untilTrue("last_config not null", () -> deviceState.system.last_config != null); untilTrue("system operational", () -> deviceState.system.operational); - untilTrue("no interesting status", this::noInterestingStatus); + untilFalse("no interesting status", this::hasInterestingStatus); clearLogs(); final Date prevConfig = deviceState.system.last_config; extraField = "Flabberguilstadt"; hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); untilTrue("last_config updated", () -> !deviceState.system.last_config.equals(prevConfig)); untilTrue("system operational", () -> deviceState.system.operational); - untilTrue("no interesting status", this::noInterestingStatus); + untilFalse("no interesting status", this::hasInterestingStatus); hasLogged(SYSTEM_CONFIG_PARSE, SYSTEM_CONFIG_PARSE_LEVEL); hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); final Date updatedConfig = deviceState.system.last_config; @@ -112,7 +106,7 @@ public void extra_config() { () -> !deviceState.system.last_config.equals(updatedConfig) ); untilTrue("system operational", () -> deviceState.system.operational); - untilTrue("no interesting status", this::noInterestingStatus); + untilFalse("no interesting status", this::hasInterestingStatus); hasLogged(SYSTEM_CONFIG_PARSE, SYSTEM_CONFIG_PARSE_LEVEL); hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); } From b5bfc8cd89c6dbdcd0a20e51d5ab7746676ae6cb Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 22:29:41 -0700 Subject: [PATCH 52/70] broken_config logic --- .../daq/mqtt/validator/SequenceValidator.java | 5 ++++- .../validator/validations/ConfigValidator.java | 14 ++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) 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 2676826fc2..02ee0e6ce3 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 @@ -109,6 +109,7 @@ public abstract class SequenceValidator { private static final String UDMI_VERSION = Objects.requireNonNullElse( System.getenv("UDMI_VERSION"), "unknown"); private static final Map UPDATE_COUNTS = new HashMap<>(); + private static final long LOG_CLEAR_TIME_MS = 1000; private static Date stateTimestamp; // Because of the way tests are run and configured, these parameters need to be @@ -663,6 +664,8 @@ private String stackTraceString(Exception e) { } protected List> clearLogs() { + long waitStart = System.currentTimeMillis(); + untilTrue("logs to clear", () -> System.currentTimeMillis() > waitStart + LOG_CLEAR_TIME_MS); lastLog = null; debug("logs cleared"); return receivedEvents.remove(SubFolder.SYSTEM); @@ -864,7 +867,7 @@ private T convertTo(Class targetClass, Object message) { } } - private synchronized boolean configUpdateComplete() { + protected synchronized boolean configUpdateComplete() { return deviceConfig.equals(receivedUpdates.get("config")); } 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 5c205f7686..0772f4f49b 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 @@ -43,16 +43,14 @@ public void device_config_acked() { @Test public void broken_config() { deviceConfig.system.min_loglevel = Level.DEBUG.value(); - untilTrue("system operational", () -> deviceState.system.operational); - untilTrue("last_config not null", () -> deviceState.system.last_config != null); + untilTrue("clean config/state synced", this::configUpdateComplete); untilFalse("no interesting status", this::hasInterestingStatus); - clearLogs(); - untilTrue("previous config/state synced", - () -> dateEquals(deviceConfig.timestamp, deviceState.system.last_config) - ); Date stableConfig = deviceConfig.timestamp; + info("initial stable_config " + getTimestamp(stableConfig)); + info("initial last_config " + getTimestamp(deviceState.system.last_config)); assertTrue("initial stable_config matches last_config", dateEquals(stableConfig, deviceState.system.last_config)); + clearLogs(); extraField = "break_json"; hasLogged(SYSTEM_CONFIG_RECEIVE, SYSTEM_CONFIG_RECEIVE_LEVEL); untilTrue("has interesting status", this::hasInterestingStatus); @@ -61,8 +59,8 @@ public void broken_config() { info("Error detail: " + stateStatus.detail); assertEquals(SYSTEM_CONFIG_PARSE, stateStatus.category); assertEquals(Level.ERROR.value(), (int) stateStatus.level); - info("stable_config " + getTimestamp(stableConfig)); - info("last_config " + getTimestamp(deviceState.system.last_config)); + info("following stable_config " + getTimestamp(stableConfig)); + info("following last_config " + getTimestamp(deviceState.system.last_config)); assertTrue("following stable_config matches last_config", dateEquals(stableConfig, deviceState.system.last_config)); assertTrue("system operational", deviceState.system.operational); From 2502e4d548a4a940297ab9d0a18b3db107a454d6 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 22:43:16 -0700 Subject: [PATCH 53/70] Local prefix logging --- .../google/bos/iot/core/proxy/ProxyTarget.java | 2 +- .../daq/mqtt/validator/SequenceValidator.java | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/validator/src/main/java/com/google/bos/iot/core/proxy/ProxyTarget.java b/validator/src/main/java/com/google/bos/iot/core/proxy/ProxyTarget.java index fb96d09388..69f43715b4 100644 --- a/validator/src/main/java/com/google/bos/iot/core/proxy/ProxyTarget.java +++ b/validator/src/main/java/com/google/bos/iot/core/proxy/ProxyTarget.java @@ -229,7 +229,7 @@ private void errorHandler(MqttPublisher publisher, Throwable error) { } private void messageHandler(String topic, String message) { - info("Received message for " + topic); + info("Received on " + topic); if (topic.endsWith(CONFIG_TOPIC)) { try { String deviceId = topic 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 02ee0e6ce3..49d4974dea 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 @@ -110,6 +110,7 @@ public abstract class SequenceValidator { System.getenv("UDMI_VERSION"), "unknown"); private static final Map UPDATE_COUNTS = new HashMap<>(); private static final long LOG_CLEAR_TIME_MS = 1000; + private static final String LOCAL_PREFIX = "local_"; private static Date stateTimestamp; // Because of the way tests are run and configured, these parameters need to be @@ -414,18 +415,18 @@ private void recordRawMessage(Map message, String messageBase) { String testOutDirName = TESTS_OUT_DIR + "/" + checkNotNull(testName); File testOutDir = new File(deviceOutputDir, testOutDirName); - + String prefix = messageBase.startsWith(LOCAL_PREFIX) ? "setting " : "received "; File messageFile = new File(testOutDir, messageBase + ".json"); try { OBJECT_MAPPER.writeValue(messageFile, message); if (traceLogLevel() && !messageBase.startsWith(EVENT_PREFIX)) { String postfix = message == null ? ": (null)" : ":\n" + OBJECT_MAPPER.writeValueAsString(message); - trace("received " + messageBase + postfix); + trace(prefix + messageBase + postfix); } else if (messageBase.startsWith(SYSTEM_EVENT_MESSAGE_BASE)) { logSystemEvent(messageBase, message); } else { - debug("received " + messageBase); + debug(prefix + messageBase); } } catch (Exception e) { throw new RuntimeException("While writing message to " + messageFile.getAbsolutePath(), e); @@ -434,12 +435,13 @@ private void recordRawMessage(Map message, String messageBase) { private void logSystemEvent(String messageBase, Map message) { try { + String prefix = messageBase.startsWith(LOCAL_PREFIX) ? "setting " : "received "; SystemEvent event = convertTo(SystemEvent.class, message); if (event.logentries == null || event.logentries.isEmpty()) { - debug("received " + SYSTEM_EVENT_MESSAGE_BASE + " (no logs)"); + debug(prefix + SYSTEM_EVENT_MESSAGE_BASE + " (no logs)"); } else { for (Entry logEntry : event.logentries) { - debug(String.format("received %s %s %s: %s", messageBase, + debug(String.format("%s%s %s %s: %s", prefix, messageBase, Level.fromValue(logEntry.level).name(), logEntry.category, logEntry.message)); } } @@ -530,7 +532,7 @@ private void updateConfig(SubFolder subBlock, Object data) { if (updated) { final Object augmentedData = augmentData(data); sentConfig.put(subBlock, messageData); - recordRawMessage(augmentedData, "local_" + subBlock.value()); + recordRawMessage(augmentedData, LOCAL_PREFIX + subBlock.value()); String augmentedMessage = OBJECT_MAPPER.writeValueAsString(augmentedData); debug(String.format("update %s_%s", "config", subBlock)); String topic = subBlock + "/config"; @@ -566,7 +568,7 @@ private boolean recordDeviceConfig() { String messageData = OBJECT_MAPPER.writeValueAsString(deviceConfig); boolean updated = !messageData.equals(sentDeviceConfig); if (updated) { - recordRawMessage(deviceConfig, "local_config"); + recordRawMessage(deviceConfig, LOCAL_PREFIX + "config"); sentDeviceConfig = messageData; } return updated; From 2251bf7651ac0a53bb7cd6c565e49c327ba67ad1 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 22:51:09 -0700 Subject: [PATCH 54/70] Fix reset_config --- .../com/google/daq/mqtt/validator/SequenceValidator.java | 5 +++-- .../daq/mqtt/validator/validations/ConfigValidator.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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 49d4974dea..85bac4671c 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 @@ -338,15 +338,16 @@ public void setUp() { } protected void resetConfig() { - debug("Starting reset config flow"); + debug("Starting reset_config"); resetDeviceConfig(true); extraField = "reset_config"; deviceConfig.system.testing.sequence_name = extraField; sentConfig.clear(); untilTrue("device config reset", this::configUpdateComplete); + extraField = null; resetDeviceConfig(); updateConfig(); - debug("Done with reset config flow"); + debug("Done with reset_config"); } private Date syncConfig() { 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 0772f4f49b..d89c5d30d9 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 @@ -43,8 +43,8 @@ public void device_config_acked() { @Test public void broken_config() { deviceConfig.system.min_loglevel = Level.DEBUG.value(); - untilTrue("clean config/state synced", this::configUpdateComplete); untilFalse("no interesting status", this::hasInterestingStatus); + untilTrue("clean config/state synced", this::configUpdateComplete); Date stableConfig = deviceConfig.timestamp; info("initial stable_config " + getTimestamp(stableConfig)); info("initial last_config " + getTimestamp(deviceState.system.last_config)); From 43fc5de3f65bdaece08976f5b6fb5dd395b661fd Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 23:38:55 -0700 Subject: [PATCH 55/70] Add long timeout to broken_config test --- pubber/src/main/java/daq/pubber/Pubber.java | 4 ++-- .../daq/mqtt/validator/SequenceValidator.java | 19 +++++++++++++------ .../validations/ConfigValidator.java | 4 ++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 2e9c090fe0..b477c421d5 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -1176,8 +1176,8 @@ private String getTestingTag(Config config) { } private void localLog(Entry entry) { - String message = String.format("Entry %s %s %s%s", Level.fromValue(entry.level).name(), - entry.category, entry.message, getTestingTag(deviceConfig)); + String message = String.format("Entry %s %s %s %s%s", Level.fromValue(entry.level).name(), + entry.category, entry.message, isoConvert(entry.timestamp), getTestingTag(deviceConfig)); localLog(message, Level.fromValue(entry.level), isoConvert(entry.timestamp), null); } 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 85bac4671c..eadc345fe3 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,8 @@ public abstract class SequenceValidator { public static final String EVENT_PREFIX = "event_"; public static final String SYSTEM_EVENT_MESSAGE_BASE = "event_system"; public static final int CONFIG_UPDATE_DELAY_MS = 2000; - public static final int UDMI_TEST_TIMEOUT_SEC = 60; + public static final int NORM_TIMEOUT_MS = 60 * 1000; + public static final long LONG_TIMEOUT_MS = NORM_TIMEOUT_MS + 2; public static final String PACKAGE_MATCH_SNIPPET = "validator.validations"; protected static final Metadata deviceMetadata; protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() @@ -164,7 +165,7 @@ public abstract class SequenceValidator { private final Map>> receivedEvents = new HashMap<>(); private final Map receivedUpdates = new HashMap<>(); @Rule - public Timeout globalTimeout = new Timeout(UDMI_TEST_TIMEOUT_SEC, TimeUnit.SECONDS); + public Timeout globalTimeout = new Timeout(NORM_TIMEOUT_MS, TimeUnit.MILLISECONDS); protected String extraField; protected Config deviceConfig; protected State deviceState; @@ -442,8 +443,9 @@ private void logSystemEvent(String messageBase, Map message) { debug(prefix + SYSTEM_EVENT_MESSAGE_BASE + " (no logs)"); } else { for (Entry logEntry : event.logentries) { - debug(String.format("%s%s %s %s: %s", prefix, messageBase, - Level.fromValue(logEntry.level).name(), logEntry.category, logEntry.message)); + debug(String.format("%s%s %s %s %s: %s", prefix, messageBase, + Level.fromValue(logEntry.level).name(), logEntry.category, + getTimestamp(logEntry.timestamp), logEntry.message)); } } } catch (Exception e) { @@ -827,9 +829,14 @@ private synchronized void handleReflectorMessage(String subFolderRaw, } } + /** + * Check/remember the configAcked field of a state update. This field is only populated by the + * supporting cloud functions in response to an explicit state query, and checks that the device + * has acked (in an MQTT sense) a previously sent config. + * + * @param converted received message to pull the ack from + */ private void updateConfigAcked(AugmentedState converted) { - // The configAcked field is only defined if this state update comes from an - // explicit query, otherwise it'll be null (which means 'unknown'). if (converted.configAcked != null) { configAcked = "true".equals(converted.configAcked); } 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 d89c5d30d9..2997e9a0dc 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 @@ -13,7 +13,6 @@ import com.google.daq.mqtt.validator.SequenceValidator; import java.util.Date; -import java.util.concurrent.atomic.AtomicReference; import org.junit.Test; import udmi.schema.Entry; import udmi.schema.Level; @@ -40,12 +39,13 @@ public void device_config_acked() { untilTrue("config acked", () -> configAcked); } - @Test + @Test(timeout = LONG_TIMEOUT_MS) public void broken_config() { deviceConfig.system.min_loglevel = Level.DEBUG.value(); untilFalse("no interesting status", this::hasInterestingStatus); untilTrue("clean config/state synced", this::configUpdateComplete); Date stableConfig = deviceConfig.timestamp; + untilTrue("state synchronized", () -> dateEquals(stableConfig, deviceState.system.last_config)); info("initial stable_config " + getTimestamp(stableConfig)); info("initial last_config " + getTimestamp(deviceState.system.last_config)); assertTrue("initial stable_config matches last_config", From bb10d871443891440b2845349037d7afdc6e2a02 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 12 Aug 2022 23:42:40 -0700 Subject: [PATCH 56/70] Test timing --- .../com/google/daq/mqtt/validator/SequenceValidator.java | 5 ++++- 1 file changed, 4 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 eadc345fe3..86d4e46764 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 @@ -176,6 +176,7 @@ public abstract class SequenceValidator { private String waitingCondition; private boolean enforceSerial; private String testName; + private long testStartTimeMs; @Rule public TestWatcher testWatcher = new TestWatcher() { @Override @@ -189,6 +190,7 @@ protected void starting(Description description) { FileUtils.deleteDirectory(testsOutputDir); testsOutputDir.mkdirs(); notice("starting test " + testName); + testStartTimeMs = System.currentTimeMillis(); } catch (Exception e) { throw new RuntimeException("While preparing " + deviceOutputDir.getAbsolutePath(), e); } @@ -197,7 +199,8 @@ protected void starting(Description description) { @Override protected void finished(Description description) { assert testName.equals(description.getMethodName()); - notice("ending test " + testName); + long stopTimeMs = System.currentTimeMillis(); + notice("ending test " + testName + " after " + (stopTimeMs - testStartTimeMs) / 1000 + "s"); testName = null; if (deviceConfig != null) { deviceConfig.system.testing = null; From 5edd12ec1044ba4c8cab5a9b8d7de8049e0a1761 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sat, 13 Aug 2022 09:57:25 -0700 Subject: [PATCH 57/70] Cleanup loglevel checks --- .../main/java/daq/pubber/MqttPublisher.java | 21 +++++++++++++++++-- pubber/src/main/java/daq/pubber/Pubber.java | 15 ++++++++----- .../daq/mqtt/validator/SequenceValidator.java | 5 ++--- .../validations/ConfigValidator.java | 12 +++++++++-- 4 files changed, 41 insertions(+), 12 deletions(-) diff --git a/pubber/src/main/java/daq/pubber/MqttPublisher.java b/pubber/src/main/java/daq/pubber/MqttPublisher.java index a9af198dba..9e5f7ea3e4 100644 --- a/pubber/src/main/java/daq/pubber/MqttPublisher.java +++ b/pubber/src/main/java/daq/pubber/MqttPublisher.java @@ -17,6 +17,7 @@ import java.security.PrivateKey; import java.security.spec.PKCS8EncodedKeySpec; import java.time.Instant; +import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -41,7 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import udmi.schema.PubberConfiguration; -import udmi.schema.PubberOptions; /** * Handle publishing sensor data to a Cloud IoT MQTT endpoint. @@ -73,6 +73,8 @@ public class MqttPublisher { private static final int QOS_AT_MOST_ONCE = 0; private static final int QOS_AT_LEAST_ONCE = 1; private static final long CONFIG_WAIT_TIME_MS = 10000; + private static final String EVENT_MARK_PREFIX = "events/"; + private static final Map EVENT_SERIAL = new HashMap<>(); private final Semaphore connectionLock = new Semaphore(1); @@ -105,7 +107,22 @@ void publish(String deviceId, String topic, Object data, Runnable callback) { throw new RuntimeException("Publisher shutdown."); } debug("Publishing in background " + topic); - publisherExecutor.submit(() -> publishCore(deviceId, topic, data, callback)); + Object marked = topic.startsWith(EVENT_MARK_PREFIX) ? decorateMessage(topic, data) : data; + publisherExecutor.submit(() -> publishCore(deviceId, topic, marked, callback)); + } + + @SuppressWarnings("unchecked") + private Object decorateMessage(String topic, Object data) { + try { + Map mapped = OBJECT_MAPPER.convertValue(data, Map.class); + String timestamp = (String) mapped.get("timestamp"); + int serialNo = EVENT_SERIAL + .computeIfAbsent(topic, key -> new AtomicInteger()).incrementAndGet(); + mapped.put("timestamp", timestamp.replace("Z", String.format(".%03dZ", serialNo % 1000))); + return mapped; + } catch (Exception e) { + throw new RuntimeException("While decorating message", e); + } } private void publishCore(String deviceId, String topic, Object data, diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index b477c421d5..3102585ac2 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -41,6 +41,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import org.apache.http.ConnectionClosedException; +import org.checkerframework.checker.units.qual.A; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import udmi.schema.BlobBlobsetConfig; @@ -128,6 +129,7 @@ public class Pubber { ); private static final Date DEVICE_START_TIME = new Date(); private static final int RESTART_EXIT_CODE = 192; + private static final Map MESSAGE_COUNTS = new HashMap<>(); private final ScheduledExecutorService executor = new CatchingScheduledThreadPoolExecutor(1); private final PubberConfiguration configuration; private final AtomicInteger messageDelayMs = new AtomicInteger(DEFAULT_REPORT_SEC * 1000); @@ -556,7 +558,7 @@ private void initialize() { File outDir = new File(OUT_DIR); try { outDir.mkdir(); - File logOut = new File(OUT_DIR, traceTimestamp() + "pubber.log"); + File logOut = new File(OUT_DIR, traceTimestamp("pubber") + ".log"); logPrintWriter = new PrintStream(logOut); logPrintWriter.println("Pubber log started at " + getTimestamp()); } catch (Exception e) { @@ -686,7 +688,7 @@ private void gatewayHandler(Config config) { private void configHandler(Config config) { try { info("Config handler"); - File configOut = new File(OUT_DIR, traceTimestamp() + "config.json"); + File configOut = new File(OUT_DIR, traceTimestamp("config") + ".json"); try { OBJECT_MAPPER.writeValue(configOut, config); debug(String.format("Config update%s", getTestingTag(config)), @@ -1121,7 +1123,8 @@ private void publishDeviceMessage(Object message, Runnable callback) { augmentDeviceMessage(message); mqttPublisher.publish(configuration.deviceId, topic, message, callback); - String fileName = traceTimestamp() + topic.replace("/", "_") + ".json"; + String messageBase = topic.replace("/", "_"); + String fileName = traceTimestamp(messageBase) + ".json"; File messageOut = new File(OUT_DIR, fileName); try { OBJECT_MAPPER.writeValue(messageOut, message); @@ -1130,8 +1133,10 @@ private void publishDeviceMessage(Object message, Runnable callback) { } } - private String traceTimestamp() { - return TRUE.equals(configuration.options.messageTrace) ? (getTimestamp() + "_") : ""; + private String traceTimestamp(String messageBase) { + int serial = MESSAGE_COUNTS.computeIfAbsent(messageBase, key -> new AtomicInteger()).incrementAndGet(); + String timestamp = getTimestamp().replace("Z", String.format(".%03dZ", serial)); + return messageBase + (TRUE.equals(configuration.options.messageTrace) ? ("_" + timestamp) : ""); } private void augmentDeviceMessage(Object message) { 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 86d4e46764..4942f2ea78 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 @@ -74,7 +74,6 @@ public abstract class SequenceValidator { public static final String SYSTEM_EVENT_MESSAGE_BASE = "event_system"; public static final int CONFIG_UPDATE_DELAY_MS = 2000; public static final int NORM_TIMEOUT_MS = 60 * 1000; - public static final long LONG_TIMEOUT_MS = NORM_TIMEOUT_MS + 2; public static final String PACKAGE_MATCH_SNIPPET = "validator.validations"; protected static final Metadata deviceMetadata; protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() @@ -302,7 +301,7 @@ private void resetDeviceConfig() { private void resetDeviceConfig(boolean clean) { deviceConfig = clean ? new Config() : readGeneratedConfig(); deviceConfig.system = Optional.ofNullable(deviceConfig.system).orElse(new SystemConfig()); - deviceConfig.system.min_loglevel = 400; + deviceConfig.system.min_loglevel = Level.INFO.value(); deviceConfig.system.testing = new TestingSystemConfig(); deviceConfig.system.testing.sequence_name = testName; } @@ -385,8 +384,8 @@ private void recordRawMessage(Map message, Map a } String subType = attributes.get("subType"); String subFolder = attributes.get("subFolder"); - String messageBase = String.format("%s_%s", subType, subFolder, getTimestamp()); String timestamp = message == null ? getTimestamp() : (String) message.get("timestamp"); + String messageBase = String.format("%s_%s", subType, subFolder, getTimestamp()); if (traceLogLevel()) { messageBase = messageBase + "_" + timestamp; } 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 2997e9a0dc..dd7a2f8beb 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 @@ -24,7 +24,6 @@ public class ConfigValidator extends SequenceValidator { @Test public void system_last_update() { - deviceConfig.system.min_loglevel = Level.WARNING.value(); untilTrue("state last_config match", () -> { Date expectedConfig = deviceConfig.timestamp; Date lastConfig = deviceState.system.last_config; @@ -34,12 +33,21 @@ public void system_last_update() { }); } + @Test void system_min_loglevel() { + clearLogs() + Integer savedLevel = deviceConfig.system.min_loglevel; + deviceConfig.system.min_loglevel = Level.WARNING.value(); + hasNotLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); + deviceConfig.system.min_loglevel = savedLevel; + hasLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); + } + @Test public void device_config_acked() { untilTrue("config acked", () -> configAcked); } - @Test(timeout = LONG_TIMEOUT_MS) + @Test public void broken_config() { deviceConfig.system.min_loglevel = Level.DEBUG.value(); untilFalse("no interesting status", this::hasInterestingStatus); From 8b6c9ad46d26974147a84e65e1c212b9e90b4a0a Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sat, 13 Aug 2022 10:00:13 -0700 Subject: [PATCH 58/70] Fix typo --- .../google/daq/mqtt/validator/validations/ConfigValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 dd7a2f8beb..d478285ca2 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 @@ -34,7 +34,7 @@ public void system_last_update() { } @Test void system_min_loglevel() { - clearLogs() + clearLogs(); Integer savedLevel = deviceConfig.system.min_loglevel; deviceConfig.system.min_loglevel = Level.WARNING.value(); hasNotLogged(SYSTEM_CONFIG_APPLY, SYSTEM_CONFIG_APPLY_LEVEL); From a3ee0bd49c6b679ddbda8191bf541df2d002c347 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sat, 13 Aug 2022 11:00:12 -0700 Subject: [PATCH 59/70] Fix style --- 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 3102585ac2..e465dc4f83 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -1134,7 +1134,8 @@ private void publishDeviceMessage(Object message, Runnable callback) { } private String traceTimestamp(String messageBase) { - int serial = MESSAGE_COUNTS.computeIfAbsent(messageBase, key -> new AtomicInteger()).incrementAndGet(); + int serial = MESSAGE_COUNTS.computeIfAbsent(messageBase, key -> new AtomicInteger()) + .incrementAndGet(); String timestamp = getTimestamp().replace("Z", String.format(".%03dZ", serial)); return messageBase + (TRUE.equals(configuration.options.messageTrace) ? ("_" + timestamp) : ""); } From a5a9b926ebf579e5cbdf157e236930ab348573ba Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sat, 13 Aug 2022 15:04:44 -0700 Subject: [PATCH 60/70] Make test public --- .../google/daq/mqtt/validator/validations/ConfigValidator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 d478285ca2..1ba3896434 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 @@ -33,7 +33,8 @@ public void system_last_update() { }); } - @Test void system_min_loglevel() { + @Test + public void system_min_loglevel() { clearLogs(); Integer savedLevel = deviceConfig.system.min_loglevel; deviceConfig.system.min_loglevel = Level.WARNING.value(); From 4b9a1e1495582aa895e862ef0123af58c7e600d6 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sat, 13 Aug 2022 19:19:49 -0700 Subject: [PATCH 61/70] Add update --- .../java/com/google/daq/mqtt/validator/SequenceValidator.java | 1 + 1 file changed, 1 insertion(+) 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 4942f2ea78..91934fe4b4 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 @@ -703,6 +703,7 @@ protected void hasLogged(String category, Level level) { } protected void hasNotLogged(String category, Level level) { + updateConfig(); warning("WARNING HASNOTLOGGED IS NOT COMPLETE"); } From 6c57fa6da083aad99e53992f1e460425d5772e1d Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sat, 13 Aug 2022 19:37:36 -0700 Subject: [PATCH 62/70] Adding expectations --- etc/sequencer.out | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/sequencer.out b/etc/sequencer.out index eeddae8818..c76eaf0044 100644 --- a/etc/sequencer.out +++ b/etc/sequencer.out @@ -5,6 +5,7 @@ RESULT pass periodic_scan Sequence complete RESULT pass self_enumeration Sequence complete RESULT pass single_scan Sequence complete RESULT pass system_last_update Sequence complete +RESULT pass system_min_loglevel Sequence complete RESULT pass valid_serial_no Sequence complete RESULT pass valid_serial_no Sequence complete RESULT pass valid_serial_no Sequence complete From 81e02f83262a76dcd399da3e1370f8ce02b4b677 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sat, 13 Aug 2022 19:47:17 -0700 Subject: [PATCH 63/70] Import cleanup --- .../java/com/google/bos/iot/core/proxy/IotReflectorClient.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/validator/src/main/java/com/google/bos/iot/core/proxy/IotReflectorClient.java b/validator/src/main/java/com/google/bos/iot/core/proxy/IotReflectorClient.java index 776241e38e..c8e2b2b506 100644 --- a/validator/src/main/java/com/google/bos/iot/core/proxy/IotReflectorClient.java +++ b/validator/src/main/java/com/google/bos/iot/core/proxy/IotReflectorClient.java @@ -6,10 +6,7 @@ import com.google.api.client.util.Base64; import com.google.common.collect.ImmutableSet; import com.google.daq.mqtt.util.CloudIotConfig; -import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.OutputStream; -import java.io.PrintStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; From 26ba640964163b3497bad1397c2dfadee22b5ffa Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sun, 14 Aug 2022 08:56:28 -0700 Subject: [PATCH 64/70] Add sequencer test run debug --- bin/test_sequencer | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/test_sequencer b/bin/test_sequencer index 0d2093602f..f7f12c9b21 100755 --- a/bin/test_sequencer +++ b/bin/test_sequencer @@ -56,14 +56,18 @@ if [[ $i -eq $WAITING ]]; then fi bin/sequencer -vv $site_path $project_id $device_id $serial_no +echo Completed execution of sequencer test run. sed -i -e 's/.*sequencer RESULT/RESULT/' /tmp/sequencer.out +echo Copied output to /tmp/sequencer.out for later examination. pids=`ps ax | fgrep pubber | fgrep java | awk '{print $1}'` if [[ -n $pids ]]; then echo Killing pubber pids $pids kill $pids else - echo No pubber pids found, likely due to premature termination. + echo No pubber pids found, likely due to premature termination: failing test run. false fi + +echo Done with base test_sequencer run. From 17772c6bfb3921986646237fb68a8e0a2f18dc40 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sun, 14 Aug 2022 08:58:06 -0700 Subject: [PATCH 65/70] Diagnostics --- .github/workflows/testing.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 56307d8ea6..40f5b0acfc 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -106,15 +106,16 @@ jobs: run: | bin/test_sequencer $GCP_TARGET_PROJECT more /tmp/sequencer.out + echo Comparing test run results with golden file: diff -u /tmp/sequencer.out etc/sequencer.out && echo No output diff detected. - name: telemetry validator env: GCP_TARGET_PROJECT: ${{ secrets.GCP_TARGET_PROJECT }} if: "${{ env.GCP_TARGET_PROJECT != '' }}" run: | - # Run after sequencer to device config starts in a known state bin/test_validator $GCP_TARGET_PROJECT more /tmp/validator.out + echo Comparing test run results with golden file: diff -u /tmp/validator.out etc/validator.out && echo No validator diff detected. - name: output logs env: From 6efafd9327e1c069698b883b1b9de9de400bbea9 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sun, 14 Aug 2022 09:11:35 -0700 Subject: [PATCH 66/70] Add sequence name to reset configs --- bin/reset_config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/reset_config b/bin/reset_config index b084c514f9..f40201868f 100755 --- a/bin/reset_config +++ b/bin/reset_config @@ -24,7 +24,8 @@ dst_config=/tmp/${device_id}_config.json src_config=${site_dir}/devices/${device_id}/out/$config_file now_date=$(python3 -c 'import datetime; print(datetime.datetime.utcnow().isoformat() + "Z")') echo Setting config timestamp ${now_date} -jq .timestamp=\"${now_date}\" < ${src_config} > ${dst_config} +jq < ${src_config} .timestamp=\"${now_date}\" |\ + jq .system.testing.sqeuence_name=\"${config_file%.json}\" > ${dst_config} echo Resetting device ${device_id} config... validator/bin/reflector ${site_dir} ${project_id} ${device_id} update/config:${dst_config} From d961dc4560703bfa0891088a0db8a3a1473b8d6e Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sun, 14 Aug 2022 09:41:51 -0700 Subject: [PATCH 67/70] Adding some wiggleroom --- .../daq/mqtt/validator/validations/DiscoveryValidator.java | 2 +- 1 file changed, 1 insertion(+), 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 6d03b55904..6fbd4d38ea 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 @@ -50,7 +50,7 @@ public void self_enumeration() { ); untilUntrue("enumeration still not active", () -> deviceState.discovery.enumeration.active); List events = getReceivedEvents(DiscoveryEvent.class); - assertEquals("one event received", 1, events.size()); + assertTrue("a few events received", events.size() >= 1 && events.size() <= 2); DiscoveryEvent discoveryEvent = events.get(0); info("Received discovery generation " + getTimestamp(discoveryEvent.generation)); assertEquals("matching event generation", startTime, discoveryEvent.generation); From 2f5e0d8e4fbe939991d29b5057f981cd8322833b Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sun, 14 Aug 2022 13:52:52 -0700 Subject: [PATCH 68/70] Adding system event --- etc/validator.out | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/etc/validator.out b/etc/validator.out index 2383f0c1aa..7746ae533b 100644 --- a/etc/validator.out +++ b/etc/validator.out @@ -16,3 +16,17 @@ sites/udmi_site_model/out/devices/AHU-1/event_pointset.out }, "pointset" : { } } +:::::::::::::: +sites/udmi_site_model/out/devices/AHU-1/event_system.out +:::::::::::::: +{ + "timestamp" : "1999-10-20T01:02:03Z", + "version" : "1.3.14", + "sub_folder" : "system", + "sub_type" : "event", + "status" : { + "message" : "While converting to json node: 1 schema violations found", + "category" : "validation.error.simple", + "level" : 500 + } +} From fb1a4a499e7b12c3914ec314ae0c2d472222952b Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sun, 14 Aug 2022 17:20:41 -0700 Subject: [PATCH 69/70] Add delay debug --- pubber/src/main/java/daq/pubber/Pubber.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index e465dc4f83..7f3608822d 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -882,6 +882,7 @@ private FamilyDiscoveryState getFamilyDiscoveryState(String family) { private long scheduleFuture(Date futureTime, Runnable futureTask) { long delay = futureTime.getTime() - new Date().getTime(); + debug(String.format("Scheduling future in %dms", delay)); executor.schedule(futureTask, delay, TimeUnit.MILLISECONDS); return delay; } From f4998040e0f2d825f4adde7a5af977f76e81ee34 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Sun, 14 Aug 2022 18:07:26 -0700 Subject: [PATCH 70/70] Fix syntax --- pubber/src/main/java/daq/pubber/Pubber.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pubber/src/main/java/daq/pubber/Pubber.java b/pubber/src/main/java/daq/pubber/Pubber.java index 7f3608822d..e06ba86e26 100644 --- a/pubber/src/main/java/daq/pubber/Pubber.java +++ b/pubber/src/main/java/daq/pubber/Pubber.java @@ -1206,6 +1206,10 @@ private void trace(String message) { cloudLog(message, Level.TRACE); } + private void debug(String message) { + cloudLog(message, Level.DEBUG); + } + private void debug(String message, String detail) { cloudLog(message, Level.DEBUG, detail); }