diff --git a/.gencode_hash.txt b/.gencode_hash.txt index dfd2ceb493..664d5549ac 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,10 +1,10 @@ 97695067e507720ef649cca27a0eb9ebf9ba8bebe31898289b7d6586a9ada6db gencode/docs/config.html e2944b13db5ff06be9caea51d03bca48f2cb093a8bb583dca14051255d34ea6b gencode/docs/envelope.html -559379abd267e9719a2bee98e56c21301853b6f69bc37fddc501acc57ce7cd63 gencode/docs/event_discovery.html +cecc213148404cd2ad83ee519369c2e2f8b611798bcd6dce441d2f9c02804073 gencode/docs/event_discovery.html 987503860562a3971314a98d75890b6c7615fee84bff6bede7010231f469c035 gencode/docs/event_pointset.html e3fb2b1a96f6fcb06f5af6cff32829abc825065ed52de81c3d379c8c8070fe09 gencode/docs/event_system.html a82821e72af6d0ee35800e6262eb9bb05256309b98aed2dad1a368fd2d6882bb gencode/docs/index.html -9cd65f81a5c6441faba3424922520f29e4987a8827c39dc031b6611f8c920533 gencode/docs/metadata.html +2e2fd3af888c3e784f632ad31115f1029a9af7832c2064871ebb6bb3ec34a58e gencode/docs/metadata.html 741b880216be3743f6747800a042f2dbd89f3b0344c6b0a965f4bc010f03a930 gencode/docs/schema_doc.css 878ea88206c974f40643c3cc430875f9c4e8c5e3fd6bcd6358bd3eb6d48699a9 gencode/docs/schema_doc.min.js 7ed934930aee763e0beebc349725ba3909115e8d346bb762f28bcbe745bb163a gencode/docs/schema_extras.js @@ -15,52 +15,54 @@ d39d7fe37a41c74a40080af7b0a429d201ab1fdff7444428c4b98eb7b38c332b gencode/java/u 0825a5cec83003bb0a6488c4ed7010a04ae0d3848ef36fe01bb4e6718ba7b96d gencode/java/udmi/schema/Aux.java 724ad8db7982f4d703c05245119dc7f7ff731d2141dd861893b55684e3cd6224 gencode/java/udmi/schema/BlobBlobsetConfig.java 7f54da38284a1010de1a2590381022fa16d27fd141d76d1ba6eb471de4d94781 gencode/java/udmi/schema/BlobBlobsetState.java -60279d5d9aa911f25e934aabee3ca06c64a36cd438fe9b255df391c04d540814 gencode/java/udmi/schema/BlobEnumerationEvent.java d2c5b5aae8db27b68104fc83a1f38de0a3f1b5d683f2b13599adf24e96c7d124 gencode/java/udmi/schema/BlobsetConfig.java b6ff9b8739a9c3bb6972f73db6fc54f451189c13b273e58bc11cb3d82c74ad40 gencode/java/udmi/schema/BlobsetState.java -90d6e869087d4dfdc2c29c7f51872e630ad8135542dd432629bf4edac807053a gencode/java/udmi/schema/CloudMetadata.java +a2eeff86f4302272736d84602e2ca36a64d27c8ef6761cc05ffb8ad17b030d4d gencode/java/udmi/schema/CloudModel.java 28001569e7902d3aa39aa3749ca08fb8e29460ba97a4b560d266b365bf5f8c46 gencode/java/udmi/schema/Config.java -3d9a243dcdc6dce31a2b0671d473c60d4cc972087025c7e099f8b4bf85a800da gencode/java/udmi/schema/DiscoveryConfig.java -eb3df3042d3c2008e51c35f35074741ba94a5a7fd590b5f1e59bd30ec19b4c2f gencode/java/udmi/schema/DiscoveryEvent.java -b9b1c6dc52c28630021c76d51305cb2fe634c557f3cf9b8e5c8c8abf456e6216 gencode/java/udmi/schema/DiscoveryState.java +67ac3441ce6d5d4450741ee7e639174756498e1b3780c2d18ce20562b5a88c26 gencode/java/udmi/schema/DiscoveryCommand.java +d8a80ab3180d33bfa17564c969018e1d4350a47dbc70c4ae8a5abbfb25cfedc9 gencode/java/udmi/schema/DiscoveryConfig.java +0d4d7461494578c3530998ae203b43b422d2d7f3722e1095c3d81eb4bc0a1fd6 gencode/java/udmi/schema/DiscoveryEvent.java +04112dd47b0f761131c276c67d3cd8b789d25e6716b5732be9fef14fc6831f1d gencode/java/udmi/schema/DiscoveryModel.java +9962b0eb7d5adf52af6160e9f3131f8eeb52ae9e518954dbb6aead1bcad0245e gencode/java/udmi/schema/DiscoveryState.java 090bbaf1508aa6ca8380af936af990673f300eb5a940c9e8ab94deb64efa2b7b gencode/java/udmi/schema/Entry.java 8f71ecd4c32044eccd74225006887d58827976f699ea03efaa5b7ed1b69849d0 gencode/java/udmi/schema/Envelope.java e9f5c77be81486b6b8c6d88f70f2d50583d8c3fafa2ac09ead80f44b8d5e751e gencode/java/udmi/schema/Event.java -70ac42b1f93211420e8b40add27a4388dffcaaac60ead45852412aa815520605 gencode/java/udmi/schema/Families.java aa0885ca43ab38c7597eacc38b7c512940a1a9fa061abd47d02c28e66b6fd93e gencode/java/udmi/schema/FamilyDiscoveryConfig.java ae4a645f199c8e24b3303463d428ca17af7603ae9ae9238397a6a82e752ab454 gencode/java/udmi/schema/FamilyDiscoveryEvent.java 0afc15acd72874e5a0c47f546abc0c4569f5bc37838fdcac77bc7bd55cc53a6d gencode/java/udmi/schema/FamilyDiscoveryState.java -d7aeee0fe20a8dd8d92e43e10d5b563ba4d70cb259f17c5818f3a0a4eed1e2ec gencode/java/udmi/schema/FamilyLocalnetMetadata.java +9959a84eea3e549c142c3edf637c86eb56eca138108ebd51fc2985e45aa41484 gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java +efb376cd7a80ca74fbf74d3ef3f4101d393341a91d01db36456aa84f6be3d0a5 gencode/java/udmi/schema/FamilyLocalnetModel.java 60a8115ae1acae7c199b63180823198d38ec50d57b48dd85aca1ccc865058f85 gencode/java/udmi/schema/GatewayConfig.java -d79f50da651f376ec06bfe3b16bc76eae599d313240022894164ddbcc25c081c gencode/java/udmi/schema/GatewayMetadata.java +56b46f4914ef1f4baa59bf597186ff7901b7c8b607720ec798f4e4e6ad59aa08 gencode/java/udmi/schema/GatewayModel.java e0e7739046e834c0f0ca6a70b38b4579618899be3162887a0fa7ab60bbff22a5 gencode/java/udmi/schema/GatewayState.java a5e5adfc187709e8646a11c92e804acfb67743f9d72149008aaca954df3177f6 gencode/java/udmi/schema/Level.java 07fd4911363437b274c19b024759b04b116152176702da8d4203c4ff4cb55b7f gencode/java/udmi/schema/LocalnetConfig.java -419f04e56922a444c6cc1148796108df2c804cbe139f42b5505c3c48303a573c gencode/java/udmi/schema/LocalnetMetadata.java +910c68183db7703b00bcb81146ad73e6fe0d4bbc4caec4dc9c621f3cc2e5eee5 gencode/java/udmi/schema/LocalnetModel.java 2df4ae32d0bbecc21f7c3f6a416a195baa766a6210cfa8abca4a7bb45b9c7961 gencode/java/udmi/schema/Location.java -ceba95d0586f995eacc52defcf91cd91226e88891a01a0761770853de9dcdf5d gencode/java/udmi/schema/Metadata.java +a1b17e0a1bc10f8e2ea105649a4254fd81c67c3dbe5d78af661fadb739b5be54 gencode/java/udmi/schema/Metadata.java a4e8f69100ab678a8236f481c558d677bbaea3e76c853bbd9262113d2a9c031d gencode/java/udmi/schema/Metrics.java 5e1c5411fae4d7c47391ceb5d19ae864fcd484df75ac6b6db39fd2d12647dec8 gencode/java/udmi/schema/Physical_tag.java 0868f0a9beb671dd08f066e7e7e796531fe151307a0b853b1f1a1aafe50ee746 gencode/java/udmi/schema/PointEnumerationEvent.java 2cca321fb2fbc00d2082fd918062f6b02e8f2dbe1359c0fbb6a3f47a946838c7 gencode/java/udmi/schema/PointPointsetConfig.java 8f3fc1cdc2dcd3e524863f4675aebabc450a35f5fd1cdc3fd37289b5cab7f2ec gencode/java/udmi/schema/PointPointsetEvent.java -09a99eddb418ef56a4744f94a1d15815e5c460c5e2bd0ea2badfc0662986a853 gencode/java/udmi/schema/PointPointsetMetadata.java +1372dc65268324a65a5854008b5dc5d2492328c145799dc4fda2a520e9f8198b gencode/java/udmi/schema/PointPointsetModel.java db8d6dd3498019ad12e0f328b6237d07e52f133f8b08858b712611a52c198009 gencode/java/udmi/schema/PointPointsetState.java c6a0571e228490defcb8fba335220b23247aea0e0cb9b657efc1e1e6dbcc0fb3 gencode/java/udmi/schema/PointsetConfig.java f3aea029530d0d8c6f50a75f266fd222d3f5ad92004f40675d6a99c906d22c82 gencode/java/udmi/schema/PointsetEvent.java -7987adebea9103a857493bb7698913d0891fcb4a77cec0e208c655953df82243 gencode/java/udmi/schema/PointsetMetadata.java +580dd48ce15879fcedf2150e9b87de99c3b6bdf3b631372b1391af048ba6771f gencode/java/udmi/schema/PointsetModel.java fc3a9415c04d8a06954dbdbfdff5d68ab113cce3948532c19df555778ffb04fa gencode/java/udmi/schema/PointsetState.java ca2e7566106818ca7e5190c8041eb86f0c9b3251b0bda8c3ea7ce11a0c891a0a gencode/java/udmi/schema/Position.java 6ddce136f5e34e7e8c7d101c8a729f1fdd323befdfa52590ebdf0028f970bdf5 gencode/java/udmi/schema/Properties.java 0a1a025dde88fd46925cbb56f5179ed2803ea97948292809ff328a5201d90a3e gencode/java/udmi/schema/State.java 6b8b054c5fa2baef5163d42cd6bf1b0aeb4d07aa881529d81f4ae7dfa4c2906e gencode/java/udmi/schema/SystemConfig.java 8075f2133463e55ac24fccf9391c94698c580b860ad1a0901d5346a2f369030b gencode/java/udmi/schema/SystemEvent.java -c46848327791cec1f1e62dbee2ad66951af7f61ed3c56eeaa8e563774e305bf4 gencode/java/udmi/schema/SystemMetadata.java +9cad2475189fa1115ca78978cbacaeac62fcb875494d72efa4bc40781e8072f9 gencode/java/udmi/schema/SystemModel.java 451217e2cce0ae9224a86f35b3bdea14b36658efe6f94f4a2dff4f4b1dc51cf7 gencode/java/udmi/schema/SystemState.java dfe4bb7c9ba6e366a967ff475883a8ff33fc558ae51db5c71fafae2323d0f8eb gencode/java/udmi/schema/Target.java 7d6dd13e368e7f073738fee69c15e18652a9b7d7ac63bde0a200f747e3aa1b1d gencode/java/udmi/schema/TargetTestingModel.java d3968b92497e83a63f18cc0e74484a9807f1bb92db0c92d556ec2caaa143d645 gencode/java/udmi/schema/TestingModel.java -dbc4084bb91080a350e862ecd8ffab786e677a0d18d4c77857c7546d78d9fe25 gencode/python/udmi/schema/__init__.py +256831be7080ab66aac89d7027d9fa174a12ef4182de6123efa7f4c3f1e7ff04 gencode/python/udmi/schema/__init__.py +6578d68f65b87b781086e72566de910db4bef365599fe3188862d4d8a81e84fb gencode/python/udmi/schema/command_discovery.py 704c8f0eec0b87015af8f7e524375f651b3d35f659ec89b4b022f8c1d0813ec5 gencode/python/udmi/schema/common.py b975892df78076dabc797b4c0be87f20b33eacda11f9d1ac1c09be33d4937a87 gencode/python/udmi/schema/config.py 191e1926c16b55f4ef350a711f540eef17a0ec60bec8c193c94182786dc3624b gencode/python/udmi/schema/config_blobset.py @@ -75,21 +77,23 @@ b461bdc24310ef972faf579b5be577b5af67fb0977d6afb4c42955211b26e3d5 gencode/python 631371489cb1275517bebcc4040cbc655d18ca147ab540701b3fd9cedba138c5 gencode/python/udmi/schema/envelope.py 1eb9019b9d0b4ff7de2df8beb625a4f89292d636ece0c02f160495c537bd6c2c gencode/python/udmi/schema/event.py c93eced8341bc7db0d6b36949c24229e0ec1b2d54543986cb0aab6e835524153 gencode/python/udmi/schema/event_audit.py -f74b62b11bbbd37ea8968ead811dc2534c4996a3dcfd3671807988b7874de347 gencode/python/udmi/schema/event_discovery.py -3ea3e50436e6b87fbcd773361f4a5cd1662b554a1f3eba47c1670c7f82a765ea gencode/python/udmi/schema/event_discovery_blob.py +0ad4a9225ce8d995f331d0b95dfe253ec961f6ad9aca14a5fba9f9a8e3b585f4 gencode/python/udmi/schema/event_discovery.py ad33b91a7fabb4eed7e49c30a983a2106c96330facbe0f376f94d06e2263d6d0 gencode/python/udmi/schema/event_discovery_family.py 266c36a6174c959017894de6051f7d6071ac59ed3f049df9cbb49b894c11c84e gencode/python/udmi/schema/event_discovery_point.py +abe4044d2e3be6693ed39edc8ccaed4eee4eb8acad991e820b21d6ecf3812dd9 gencode/python/udmi/schema/event_mapping.py ddf849bfeb2b87d071cefd5e6feacabc57375a7fff6d72b6d42ffb89f33c859b gencode/python/udmi/schema/event_pointset.py 44aff1bc930dbdbadd51ac3fe0e7d9c83ad84a6a9f9d1c809b3fce66cbcd5e00 gencode/python/udmi/schema/event_pointset_point.py a27b3b2ace3f301b5fa08a3763f792158f9725a5fbed5cd7b5fac8a6701080e4 gencode/python/udmi/schema/event_system.py -5052a13ce3b3b7affd607a62a8d919b79b464e1352e03fc35799f22996a4aa7a gencode/python/udmi/schema/metadata.py -defe9fcce671ff4ac1a91b9d60ff2260f60865a13fba29c032ff356b1b79f471 gencode/python/udmi/schema/model_cloud.py -1fb8473dd0f2b083ce7daf00a65121893ee5c88ba6999b4950813e4b914a514c gencode/python/udmi/schema/model_gateway.py -89ce7a460f6cba70b067329d2b58814fc2adfee9f783890b148babdceb1f5d2a gencode/python/udmi/schema/model_localnet.py -c1ebc4c6885a3299156300e27cefe63e3b745f595882e0e2be88bb61435d0752 gencode/python/udmi/schema/model_localnet_family.py -b0cfc2a86539f3525f2da52d7b0422bb8934348690f25d9ab64c38e7a8a20536 gencode/python/udmi/schema/model_pointset.py -347b1ee16f74b8cdfa83aa4e179af5a5529545daf1736baf401936c7cf9e7809 gencode/python/udmi/schema/model_pointset_point.py -cd00563a4e0be9112f6d8af3335acc12b0d3354beab602ab924aac59a0f588e4 gencode/python/udmi/schema/model_system.py +42f3429edf4a187be6ebfe9760f5e14821a25afa8f7c65b69e0e34fb29a7932e gencode/python/udmi/schema/metadata.py +b2227a48f21594f78c07c427de64e7ce51dc0ecd4b8091601d739a5f5038a2c9 gencode/python/udmi/schema/model_cloud.py +805cc8dcb29732d1965bbd533b12d2bc4966d584f05b8a478dd2cac98fd99d52 gencode/python/udmi/schema/model_discovery.py +44d057dffcac3a994e7b894f8e1ebb643ba49d7dbfbb0bfea9cc04f97af0bc47 gencode/python/udmi/schema/model_discovery_family.py +9416018a6d01094ab7af77c35ae4e5e2271a5d52c3bd3e381a541650415048b2 gencode/python/udmi/schema/model_gateway.py +ae6a7bc93b520cdc90cd158f876a58e98a3e000402ebb1ca632f01ee492d408a gencode/python/udmi/schema/model_localnet.py +4718368765cacc2cbf552a65346452a14690d0175e9cc921fc576a5c7691fa1d gencode/python/udmi/schema/model_localnet_family.py +2b68c4bdc6d512d12881c1e3ad1d1d31e8422a120f71f3b55abd7c3045ff91ba gencode/python/udmi/schema/model_pointset.py +7125a56680e83c874a35caa6c26f0aa0127fa7a3990aef198090af133d109eab gencode/python/udmi/schema/model_pointset_point.py +75832b261c613b963012b96c406d7e7d22d12aab4f5ad649a5d9d1dd28235345 gencode/python/udmi/schema/model_system.py aafe6e70c281152db958adf77a024e3e9fab8293927106297c5ec48c11f54e27 gencode/python/udmi/schema/model_testing.py 5c50847e136a033ea511209238bb570499b43fbee6189dae06603132dcb9f01f gencode/python/udmi/schema/model_testing_target.py a58f8c98e837a5b56126ca0f410e02f1e9cfcd80a8cb429e0ef522defab1f690 gencode/python/udmi/schema/properties.py diff --git a/bin/clone_model b/bin/clone_model index 36c33ae377..7217c449c7 100755 --- a/bin/clone_model +++ b/bin/clone_model @@ -4,7 +4,7 @@ ROOT_DIR=$(dirname $0)/.. cd $ROOT_DIR MODEL_DIR=udmi_site_model -MODEL_VER=1.6 +MODEL_VER=1.7 TEST_SITE_GIT=https://github.com/faucetsdn/$MODEL_DIR.git if [[ -d $MODEL_DIR ]]; then diff --git a/bin/loop_sequences b/bin/loop_sequences index e4fa826afb..e8ccee1074 100755 --- a/bin/loop_sequences +++ b/bin/loop_sequences @@ -51,6 +51,7 @@ JAVA_CMD="java -cp $JARFILE com.google.daq.mqtt.validator.SequenceTestRunner" rm -rf $site_model/out/devices/$device_id test_srces=`cd validator/src/main/java/com/google/daq/mqtt/validator/validations; ls *.java` +echo Processing test sources $test_srces exit_code=2 for test_name in $test_names; do @@ -62,8 +63,8 @@ for test_name in $test_names; do target=$test_class$test_prefix$test_name CLASS=com.google.daq.mqtt.validator.validations.$target echo $JAVA_CMD $CLASS - timeout 5m $JAVA_CMD $CLASS - result=$? + result=0 + timeout 5m $JAVA_CMD $CLASS || result=$? if [[ $result == 2 ]]; then echo Sequence test $target found no matching tests. @@ -71,7 +72,7 @@ for test_name in $test_names; do echo Sequence test $target exited with error code $result. exit_code=$result elif [[ $exit_code == 2 ]]; then - exit_code=0; + exit_code=0 fi done done diff --git a/docs/messages/pointset.md b/docs/messages/pointset.md index 7f7b3d8297..0cf72a8117 100644 --- a/docs/messages/pointset.md +++ b/docs/messages/pointset.md @@ -25,8 +25,7 @@ Pointset is represented in four locations The `metadata.pointset` subblock represents 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, along with, if the field is numeric, the expected units of those points. -The general structure of a `pointset` block exists inside of a complete -metadata message +The general structure of a `pointset` block exists inside of a complete metadata message * `pointset`: Top level block designator. * `points`: Collection of point names. diff --git a/docs/specs/mapping.md b/docs/specs/mapping.md new file mode 100644 index 0000000000..82d8eafa0f --- /dev/null +++ b/docs/specs/mapping.md @@ -0,0 +1,7 @@ +[**UDMI**](../../) / [**Docs**](../) / [**Specs**](./) / [Mapping](#) + +# Mapping Interface + +* state: indicates what is ready for external action +* event: details about the mapping itself +* config: external information about how mapping is behaving diff --git a/docs/specs/onboarding.md b/docs/specs/onboarding.md new file mode 100644 index 0000000000..f1d3c0a182 --- /dev/null +++ b/docs/specs/onboarding.md @@ -0,0 +1,98 @@ +[**UDMI**](../../) / [**Docs**](../) / [**Specs**](./) / [Onboarding](#) + +# Onboarding + +The overall "onboarding" flow consists of a number of separate subflows stitched together for a complete +end-to-end process. This generall starts from an "unknown" device in the system through to a UDMI-compliant +device that's properly integrated with backend services. + +At a high-level, the overall process involves different message subgroups that handle slightly different +scopes of device data: +* **(Native)**: Device communicaiton using some non-UDMI native protocol (e.g. BACnet, Modbus, etc...) +* **[Discovery](discovery.md)**: Messages relating to the discovery (and provisioning) of devices (e.g. messy BACnet info) +* **[Mapping](mapping.md)**: Messages relating to a 'resolved' device type and ID (e.g. the device is an `AHU` called `AHU-1`) +* **[Pointset](../messages/pointset.md)**: Messages relating to actual data flow (e.g. temperature reading), essentially the interesting stuff + +## Sequence Diagram + +The overall onboarding sequence involves multiple components that work together to provide the overall flow: +* **Device**: The target thing that needs to be discovered, configured, and ultimately communications point data +* **Node**: A 'discovery node' responsible for handling on-prem non-UDMI discovery communication with a device +* **Cloud**: The on-prem/in-cloud boundary. Things to the left are things in the building, to the right are in the cloud +* **Agent**: Responsible for managing the overall _discovery_ process (how often, what color, etc...) +* **Mapper**: Uses hueristics, ML, or a UI to convert discovery information into a concrete device/sink mapping +* **Sink**: Ultimate recepient of pointset information. The thing that cares about 'temperature' in a room + +Notes & Caveats: +1. Only "interesting" messages are shown in the diagram, there's other control flow things that go on (e.g. +to configure when the discovery *Node* should activate) to complete the overall flow. +2. This just shows one-of-many potential provisioning (handling keys) techniques. There's other paths +that would be possible (including manually, which is the baseline default). +3. This shows the flow for a direct-connect (no IoT Gateway) device. The overall flow for a proxied device +(with IoT Gateway) would more or less be the same, just different details about exact communication mechanisms. + +``` ++---------+ +-------+ +-------+ +-------+ +--------+ +-------+ +| Device | | Node | | Cloud | | Agent | | Mapper | | Sink | ++---------+ +-------+ +-------+ +-------+ +--------+ +-------+ + | | | | | | + | (Info) | | | | | + |----------------------->| | | | | + | | | | | | + | | Discovery Event | | | + | |----------------------------------------------------->| | + | | | | | | + | | | | | Mapping Event | + | | | | |------------------>| + | | | | | | + | | | | Mapping Event | | + | | | |<-------------------| | + | | | | | | + | | | (Cloud Provision) | | | + | | |<----------------------| | | + | | | | | | + | | | Discovery Command | | | + | |<--------------------------------| | | + | | | | | | + | (Device Provision) | | | | | + |<-----------------------| | | | | + | | | | | | + | | | | | Pointset Config | + |<--------------------------------------------------------------------------------------------------| + | | | | | | + | Pointset Event | | | | | + |-------------------------------------------------------------------------------------------------->| + | | | | | | +``` + +1. **(Info)** contains natively-encoded _Device_ information (format out of scope for UDMI) + * "I am device `78F936`, with points { `room_temp`, `step_size`, and `operation_count` }, and public key `XYZZYZ`" +2. **[Discovery Event](../../tests/event_discovery.tests/enumeration.json)** from _Node_ wraps up the device info into a UDMI-normalized format + * "Device `78F936` has points { }, with a public key `XYZZYZ`" +3. **Mapping Event** from the _Mapper_ (recieved by both _Sink_ and _Agent_) + * "Device `78F936` is an `AHU` called `AHU-183`, and `room_temp` is really a `flow_temperatue`" +5. **(Cloud Provision)** from _Agent_ sets up the _Cloud_ layer using the IoT Core API. + * "Device `AHU-183` exists and has public key `XYZZYZ`" +4. **[Discovery Command](../../tests/command_discovery.tests/provision.json)** from the _Agent_ to the discovery _Node_ contains information necessary to provision the device + * "Device `78F936` should call itself `AHU-183` when connecting to the cloud" +5. **(Device Provision)** uses some natively-encoded mechanism for setting up the device with relevant cloud info + * "Device `78F936`, you are celled `AHU-183` when connecting to the cloud" +7. **[Pointset Config](../../tests/config.tests/example.json)** from the _Sink_ can go directly to the _Device_ (after it connects to the cloud) + * "Device `AHU-183`, you should send the `room_temp` data point every `10 minutes`" +8. **[Pointset Events](../../tests/event_pointset.tests/example.json)** sends telemetry events from the _Device_ to _Sink_... business as usual! + * "I am `AHU-183`, and my `room_temp` is `73`" + +## Source +Created using https://textart.io/sequence# +``` +object Device Node Cloud Agent Mapper Sink +Device->Node: (Info) +Node->Mapper: Discovery Event +Mapper->Sink: Mapping Event +Mapper->Agent: Mapping Event +Agent->Cloud: (Cloud Provision) +Agent->Node: Discovery Command +Node->Device: (Device Provision) +Sink->Device: Pointset Config +Device->Sink: Pointset Event +``` diff --git a/docs/specs/readme.md b/docs/specs/readme.md index ef1b3d50fa..5ed3bbeaa0 100644 --- a/docs/specs/readme.md +++ b/docs/specs/readme.md @@ -5,14 +5,16 @@ - [UDMI Compliance](compliance.md) - [Tech Stack](tech_stack.md) - [Discovery](discovery.md) +- [Onboarding](onboarding.md) - [Messages](../messages/) - [Message Walk](message_walk.md) -- [Sequences](sequences/) - [Connection Models](connecting.md) - [IoT Gateway](gateway.md) - [MQTT Client](mqtt_client.md) - [Point Mapping](point_mapping.md) - [Proxy](proxy.md) +- [Sequences](sequences/) (device-to-cloud API) +- [Subblocks](subblocks.md) (core-to-apps API) - [Site Model](site_model.md) - [Metadata](metadata.md) - [Tech Stack](tech_stack.md) diff --git a/docs/specs/subblocks.md b/docs/specs/subblocks.md new file mode 100644 index 0000000000..8184f337de --- /dev/null +++ b/docs/specs/subblocks.md @@ -0,0 +1,98 @@ +[**UDMI**](../../) / [**Docs**](../) / [**Specs**](./) / [Subblocks](#) + +# Subblocks API + +The _Subblocks API_ defines a high-level interface between UDMI core services and ancillary +applications. These messages are similar to those used for device communication, but are +Specifically segmented by designated _subblocks_ that partition functionality into atomic +chunks. Specficialy, the subblock _state_/_config_ are a limited form of the overall +device _state_/_config_, and only expose the relevant pieces. + +The basic mode of this interface is a "read only" subscription to a PubSub topic (normally +`udmi_target`) that then provides a complete view of updates as they flow through the system. +For example, a cloud-to-device _config_ update would be published on this topic as a "update +to device config." This level of visability should be sufficient to completely mirror the +visible state of the system (barring issues like loss-of-message etc...). + +The various _subblocks_ are detailed below. Each _subblock_ (or _subFolder_ if you're looking +at the PubSub _message envelope_), has several basic _subTypes_ that manifest themselves from +different sources: + +* **Model**: Model-based description of this device. Unlike the other messages, this exists + independent of any actual physical device, and will be injected by the syste through something + like the `registrar` tool. The _model_ is typically also refleced in a _site\_model_ as a + static set of files somewhere. +* **Event**: Streaming telemetry. This is essentially a raw feed from the device itself, + and will always be segmented by subblock (e.g. for a + [pointset event](../../tests/event_pointset.tests/example.json)). Streaming telemetry + is sent from the device, so will be _received by_ a client app. +* **State**: Device state for this subblock. Unlike a + [comprehensive device state message](../../tests/state.tests/example.json) + this message contains information _only_ for a single subblock. Used for reporting any 'sticky' + state from a device, so will be _received by_ a client app. +* **Config**: Device config for this subblock. Unlike a + [comprehensive device config message](../../tests/config.tests/example.json) + this message contains information _only_ for a single subblock. Used for writing configuration + changes to a device, so will be _sent from_ a client app. +* **Commands**: Streaming commands from cloud to the device. Generally not used because a model-based + approach using device state is preferred. + +In all cases, the _Subblock API_ messages encode the relevant subblock ID { pointset, discovery, ... } +in the [message envelope's](../../tests/envelope.tests/example.json) _subFolder_ field. +The _subType_ field encodes the relevant type { _event_, _config_, _state_, _model_ }. + +## System + +* **Model** +* **Event** +* **State** +* **Config** + +## [Pointset](../messages/pointset.md) + +A _pointset_ covers the structures necessary to model a device _point_ with associated data readings. +This is typically what is thought of as 'device telemetry' and represents the expected end value of +the device-to-cloud connection. + +* [**Model**](../../tests/model_pointset.tests/example.json): Expected model for what the device should + be reporting. +* [**Event**](../../tests/event_pointset.tests/example.json): Streaming telemetry events from the device + containing the actual data points. +* [**State**](../../tests/state_pointset.tests/example.json): State of the device points, indicating any + sticky errors or status of any cloud-to-device config. +* [**Config**](../../tests/config_pointset.tests/example.json): Configuration of the device points, + indicating the expected points, cloud-to-device control, etc... + +## Discovery + +_Discovery_ covers systems that are actively searching for systems on a network (of some kind), and +returning results about what was discovered and what their capabilities are. This provides a mechanism +for doing things like a BACnet discovery sequence. + +* **Model** +* **Event** +* **State** +* **Config** + +## Audit + +_Audit_ covers an external "black box" audit of a system for vunerabilities or other characteristics. +E.g., doing a port-scan of a device to see what network ports are open would be part of a network +exposure autit. + +* **Model** +* **Event** +* **State** +* **Config** + +## Mapping + +The _mapping_ process covers the determination of a translation from a set of identifiers or points to +a canonical or other set of identifiers or points. E.g., there's a mapping process that goes on to +correlate a BACnet MAC address (such as `9832C2`) with an associated IoT ID (such as `FCU-323`). + +* **Model** +* **Event** +* **State** +* **Config** + diff --git a/etc/sequencer.out b/etc/sequencer.out index 6f806f8352..0d25bea7cc 100644 --- a/etc/sequencer.out +++ b/etc/sequencer.out @@ -1,6 +1,10 @@ RESULT pass broken_config Sequence complete +RESULT pass continuous_scan Sequence complete RESULT pass extra_config Sequence complete +RESULT pass self_enumeration Sequence complete +RESULT pass single_scan Sequence complete RESULT pass system_last_update Sequence complete RESULT pass valid_serial_no Sequence complete RESULT pass valid_serial_no Sequence complete +RESULT pass valid_serial_no Sequence complete RESULT skip writeback_states Missing 'invalid' target specification diff --git a/gencode/docs/event_discovery.html b/gencode/docs/event_discovery.html index 4ca55f153f..0b64ad35b2 100644 --- a/gencode/docs/event_discovery.html +++ b/gencode/docs/event_discovery.html @@ -391,6 +391,40 @@

+ + + + +
+
+
+

+ +

+
+ +
+
+ + Type: string
+

The primary scan discovery address family

+
+ + + + + +
@@ -1313,184 +1347,6 @@

-

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

- -

-
- -
-
- - Type: object
-

Collection of data blobs recognized by this device.

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

- -

-
- -
-

- -

-

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

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

Object representation for for a single blob enumeration

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

- -

-
- -
-
- - Type: string
-

Description of this blob

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

- -

-
- -
-
- - Type: boolean
-

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

-
- - - - - -
diff --git a/gencode/docs/metadata.html b/gencode/docs/metadata.html index 9c162681da..b80a8bb7f0 100644 --- a/gencode/docs/metadata.html +++ b/gencode/docs/metadata.html @@ -51,7 +51,7 @@

/> timestamp

Type: string
-

RFC 3339 timestamp the metadata was generated

+

RFC 3339 timestamp the message was generated

@@ -353,7 +353,7 @@

/> system

Type: object
-

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

+

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

No Additional Properties @@ -1345,6 +1345,136 @@

Each item of this array must be:

+
+
+
+

+ +

+
+ +
+
+ + Type: object
+

Discovery target parameters

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

+ +

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

+ +

+
+ +
+

+ +

+

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

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

d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Family Localnet Metadata + Family Localnet Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" /> - Point Pointset Metadata + Point Pointset Model - * Object representation for for a single blob enumeration - * - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "description", - "firmware_set" -}) -@Generated("jsonschema2pojo") -public class BlobEnumerationEvent { - - /** - * Description of this blob - * - */ - @JsonProperty("description") - @JsonPropertyDescription("Description of this blob") - public String description; - /** - * Indicating if this blob is part of the device's firmware set - * - */ - @JsonProperty("firmware_set") - @JsonPropertyDescription("Indicating if this blob is part of the device's firmware set") - public Boolean firmware_set; - - @Override - public int hashCode() { - int result = 1; - result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); - result = ((result* 31)+((this.firmware_set == null)? 0 :this.firmware_set.hashCode())); - return result; - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - if ((other instanceof BlobEnumerationEvent) == false) { - return false; - } - BlobEnumerationEvent rhs = ((BlobEnumerationEvent) other); - return (((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.firmware_set == rhs.firmware_set)||((this.firmware_set!= null)&&this.firmware_set.equals(rhs.firmware_set)))); - } - -} diff --git a/gencode/java/udmi/schema/CloudMetadata.java b/gencode/java/udmi/schema/CloudModel.java similarity index 86% rename from gencode/java/udmi/schema/CloudMetadata.java rename to gencode/java/udmi/schema/CloudModel.java index 2581ceda9f..97f60410e6 100644 --- a/gencode/java/udmi/schema/CloudMetadata.java +++ b/gencode/java/udmi/schema/CloudModel.java @@ -13,7 +13,7 @@ /** - * Cloud Metadata + * Cloud Model *

* Information specific to how the device communicates with the cloud. * @@ -25,7 +25,7 @@ "is_gateway" }) @Generated("jsonschema2pojo") -public class CloudMetadata { +public class CloudModel { /** * The key type used for cloud communication. @@ -34,7 +34,7 @@ public class CloudMetadata { */ @JsonProperty("auth_type") @JsonPropertyDescription("The key type used for cloud communication.") - public CloudMetadata.Auth_type auth_type; + public CloudModel.Auth_type auth_type; /** * Whether the device authenticates via a private key. Typically false for devices which are proxied for by an IoT core gateway * @@ -64,10 +64,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof CloudMetadata) == false) { + if ((other instanceof CloudModel) == false) { return false; } - CloudMetadata rhs = ((CloudMetadata) other); + CloudModel rhs = ((CloudModel) other); return ((((this.is_gateway == rhs.is_gateway)||((this.is_gateway!= null)&&this.is_gateway.equals(rhs.is_gateway)))&&((this.auth_type == rhs.auth_type)||((this.auth_type!= null)&&this.auth_type.equals(rhs.auth_type))))&&((this.device_key == rhs.device_key)||((this.device_key!= null)&&this.device_key.equals(rhs.device_key)))); } @@ -84,10 +84,10 @@ public enum Auth_type { RS_256("RS256"), RS_256_X_509("RS256_X509"); private final String value; - private final static Map CONSTANTS = new HashMap(); + private final static Map CONSTANTS = new HashMap(); static { - for (CloudMetadata.Auth_type c: values()) { + for (CloudModel.Auth_type c: values()) { CONSTANTS.put(c.value, c); } } @@ -107,8 +107,8 @@ public String value() { } @JsonCreator - public static CloudMetadata.Auth_type fromValue(String value) { - CloudMetadata.Auth_type constant = CONSTANTS.get(value); + public static CloudModel.Auth_type fromValue(String value) { + CloudModel.Auth_type constant = CONSTANTS.get(value); if (constant == null) { throw new IllegalArgumentException(value); } else { diff --git a/gencode/java/udmi/schema/DiscoveryCommand.java b/gencode/java/udmi/schema/DiscoveryCommand.java new file mode 100644 index 0000000000..2bf4f0061b --- /dev/null +++ b/gencode/java/udmi/schema/DiscoveryCommand.java @@ -0,0 +1,63 @@ + +package udmi.schema; + +import java.util.Date; +import javax.annotation.processing.Generated; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Discovery Command + *

+ * [Discovery command](../docs/specs/discovery.md) for provisioning + * + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "timestamp", + "version" +}) +@Generated("jsonschema2pojo") +public class DiscoveryCommand { + + /** + * RFC 3339 timestamp the discover telemetry event was generated + * (Required) + * + */ + @JsonProperty("timestamp") + @JsonPropertyDescription("RFC 3339 timestamp the discover telemetry event was generated") + public Date timestamp; + /** + * Major version of the UDMI schema + * (Required) + * + */ + @JsonProperty("version") + @JsonPropertyDescription("Major version of the UDMI schema") + public String version; + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.version == null)? 0 :this.version.hashCode())); + result = ((result* 31)+((this.timestamp == null)? 0 :this.timestamp.hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof DiscoveryCommand) == false) { + return false; + } + DiscoveryCommand rhs = ((DiscoveryCommand) other); + return (((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version)))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + } + +} diff --git a/gencode/java/udmi/schema/DiscoveryConfig.java b/gencode/java/udmi/schema/DiscoveryConfig.java index 86868ce5bd..489322422d 100644 --- a/gencode/java/udmi/schema/DiscoveryConfig.java +++ b/gencode/java/udmi/schema/DiscoveryConfig.java @@ -1,6 +1,7 @@ package udmi.schema; +import java.util.HashMap; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -30,14 +31,14 @@ public class DiscoveryConfig { */ @JsonProperty("enumeration") @JsonPropertyDescription("Configuration for [discovery](../docs/specs/discovery.md)") - public FamilyDiscoveryConfig enumeration; + public udmi.schema.FamilyDiscoveryConfig enumeration; /** * Address family results for a scan. Not included for device enumeration messages. * */ @JsonProperty("families") @JsonPropertyDescription("Address family results for a scan. Not included for device enumeration messages.") - public Object families; + public HashMap families; @Override public int hashCode() { diff --git a/gencode/java/udmi/schema/DiscoveryEvent.java b/gencode/java/udmi/schema/DiscoveryEvent.java index 9f51ef68bb..a357e02426 100644 --- a/gencode/java/udmi/schema/DiscoveryEvent.java +++ b/gencode/java/udmi/schema/DiscoveryEvent.java @@ -2,7 +2,6 @@ package udmi.schema; import java.util.Date; -import java.util.HashMap; import java.util.Map; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; @@ -23,9 +22,9 @@ "version", "generation", "status", + "scan_family", "families", - "points", - "blobs" + "points" }) @Generated("jsonschema2pojo") public class DiscoveryEvent { @@ -62,13 +61,20 @@ public class DiscoveryEvent { */ @JsonProperty("status") public Entry status; + /** + * The primary scan discovery address family + * + */ + @JsonProperty("scan_family") + @JsonPropertyDescription("The primary scan discovery address family") + public java.lang.String scan_family; /** * Address family results for a scan. Not included for device enumeration messages. * */ @JsonProperty("families") @JsonPropertyDescription("Address family results for a scan. Not included for device enumeration messages.") - public Families families; + public Map families; /** * Collection of data points available for this device. * @@ -76,19 +82,12 @@ public class DiscoveryEvent { @JsonProperty("points") @JsonPropertyDescription("Collection of data points available for this device.") public Map points; - /** - * Collection of data blobs recognized by this device. - * - */ - @JsonProperty("blobs") - @JsonPropertyDescription("Collection of data blobs recognized by this device.") - public HashMap blobs; @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.generation == null)? 0 :this.generation.hashCode())); - result = ((result* 31)+((this.blobs == null)? 0 :this.blobs.hashCode())); + result = ((result* 31)+((this.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())); @@ -106,7 +105,7 @@ public boolean equals(Object other) { return false; } DiscoveryEvent rhs = ((DiscoveryEvent) other); - return ((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.blobs == rhs.blobs)||((this.blobs!= null)&&this.blobs.equals(rhs.blobs))))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); + return ((((((((this.generation == rhs.generation)||((this.generation!= null)&&this.generation.equals(rhs.generation)))&&((this.scan_family == rhs.scan_family)||((this.scan_family!= null)&&this.scan_family.equals(rhs.scan_family))))&&((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp))))&&((this.status == rhs.status)||((this.status!= null)&&this.status.equals(rhs.status))))&&((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points)))); } } diff --git a/gencode/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 index cf8a554a00..6358c95fee 100644 --- a/gencode/java/udmi/schema/DiscoveryState.java +++ b/gencode/java/udmi/schema/DiscoveryState.java @@ -1,6 +1,7 @@ package udmi.schema; +import java.util.HashMap; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -30,14 +31,14 @@ public class DiscoveryState { */ @JsonProperty("enumeration") @JsonPropertyDescription("State for [discovery](../docs/specs/discovery.md)") - public FamilyDiscoveryState enumeration; + public udmi.schema.FamilyDiscoveryState enumeration; /** * Discovery protocol families * */ @JsonProperty("families") @JsonPropertyDescription("Discovery protocol families") - public Object families; + public HashMap families; @Override public int hashCode() { diff --git a/gencode/java/udmi/schema/Families.java b/gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java similarity index 70% rename from gencode/java/udmi/schema/Families.java rename to gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java index a32487353f..89c4ccbe58 100644 --- a/gencode/java/udmi/schema/Families.java +++ b/gencode/java/udmi/schema/FamilyDiscoveryTestingModel.java @@ -7,7 +7,9 @@ /** - * Address family results for a scan. Not included for device enumeration messages. + * Family Discovery Testing Model + *

+ * * */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -15,7 +17,7 @@ }) @Generated("jsonschema2pojo") -public class Families { +public class FamilyDiscoveryTestingModel { @Override @@ -29,10 +31,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof Families) == false) { + if ((other instanceof FamilyDiscoveryTestingModel) == false) { return false; } - Families rhs = ((Families) other); + FamilyDiscoveryTestingModel rhs = ((FamilyDiscoveryTestingModel) other); return true; } diff --git a/gencode/java/udmi/schema/FamilyLocalnetMetadata.java b/gencode/java/udmi/schema/FamilyLocalnetModel.java similarity index 84% rename from gencode/java/udmi/schema/FamilyLocalnetMetadata.java rename to gencode/java/udmi/schema/FamilyLocalnetModel.java index c4302f226d..efeb8caca9 100644 --- a/gencode/java/udmi/schema/FamilyLocalnetMetadata.java +++ b/gencode/java/udmi/schema/FamilyLocalnetModel.java @@ -9,7 +9,7 @@ /** - * Family Localnet Metadata + * Family Localnet Model *

* The type of network * @@ -19,7 +19,7 @@ "id" }) @Generated("jsonschema2pojo") -public class FamilyLocalnetMetadata { +public class FamilyLocalnetModel { /** * The address of a device on the local network @@ -42,10 +42,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof FamilyLocalnetMetadata) == false) { + if ((other instanceof FamilyLocalnetModel) == false) { return false; } - FamilyLocalnetMetadata rhs = ((FamilyLocalnetMetadata) other); + FamilyLocalnetModel rhs = ((FamilyLocalnetModel) other); return ((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))); } diff --git a/gencode/java/udmi/schema/GatewayMetadata.java b/gencode/java/udmi/schema/GatewayModel.java similarity index 92% rename from gencode/java/udmi/schema/GatewayMetadata.java rename to gencode/java/udmi/schema/GatewayModel.java index b1d03e53c8..dd8d54748b 100644 --- a/gencode/java/udmi/schema/GatewayMetadata.java +++ b/gencode/java/udmi/schema/GatewayModel.java @@ -11,7 +11,7 @@ /** - * Gateway Metadata + * Gateway Model *

* [Gateway Documentation](../docs/specs/gateway.md) * @@ -23,7 +23,7 @@ "proxy_ids" }) @Generated("jsonschema2pojo") -public class GatewayMetadata { +public class GatewayModel { /** * The device ID of the gateway the device is bound to @@ -61,10 +61,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof GatewayMetadata) == false) { + if ((other instanceof GatewayModel) == false) { return false; } - GatewayMetadata rhs = ((GatewayMetadata) other); + GatewayModel rhs = ((GatewayModel) other); return ((((this.proxy_ids == rhs.proxy_ids)||((this.proxy_ids!= null)&&this.proxy_ids.equals(rhs.proxy_ids)))&&((this.family == rhs.family)||((this.family!= null)&&this.family.equals(rhs.family))))&&((this.gateway_id == rhs.gateway_id)||((this.gateway_id!= null)&&this.gateway_id.equals(rhs.gateway_id)))); } diff --git a/gencode/java/udmi/schema/LocalnetMetadata.java b/gencode/java/udmi/schema/LocalnetModel.java similarity index 80% rename from gencode/java/udmi/schema/LocalnetMetadata.java rename to gencode/java/udmi/schema/LocalnetModel.java index 7a691ac711..cebd3c0561 100644 --- a/gencode/java/udmi/schema/LocalnetMetadata.java +++ b/gencode/java/udmi/schema/LocalnetModel.java @@ -9,7 +9,7 @@ /** - * Localnet Metadata + * Localnet Model *

* Used to describe device local network parameters * @@ -19,7 +19,7 @@ "families" }) @Generated("jsonschema2pojo") -public class LocalnetMetadata { +public class LocalnetModel { /** * @@ -27,7 +27,7 @@ public class LocalnetMetadata { * */ @JsonProperty("families") - public HashMap families; + public HashMap families; @Override public int hashCode() { @@ -41,10 +41,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof LocalnetMetadata) == false) { + if ((other instanceof LocalnetModel) == false) { return false; } - LocalnetMetadata rhs = ((LocalnetMetadata) other); + LocalnetModel rhs = ((LocalnetModel) other); return ((this.families == rhs.families)||((this.families!= null)&&this.families.equals(rhs.families))); } diff --git a/gencode/java/udmi/schema/Metadata.java b/gencode/java/udmi/schema/Metadata.java index 47303a831f..ac7297f3b1 100644 --- a/gencode/java/udmi/schema/Metadata.java +++ b/gencode/java/udmi/schema/Metadata.java @@ -24,6 +24,7 @@ "cloud", "system", "gateway", + "discovery", "localnet", "testing", "pointset" @@ -32,12 +33,12 @@ public class Metadata { /** - * RFC 3339 timestamp the metadata was generated + * RFC 3339 timestamp the message was generated * (Required) * */ @JsonProperty("timestamp") - @JsonPropertyDescription("RFC 3339 timestamp the metadata was generated") + @JsonPropertyDescription("RFC 3339 timestamp the message was generated") public Date timestamp; /** * Major version of the UDMI schema @@ -62,42 +63,51 @@ public class Metadata { @JsonPropertyDescription("Automatically generated field that contains the hash of file contents.") public String hash; /** - * Cloud Metadata + * Cloud Model *

* Information specific to how the device communicates with the cloud. * */ @JsonProperty("cloud") @JsonPropertyDescription("Information specific to how the device communicates with the cloud.") - public CloudMetadata cloud; + public CloudModel cloud; /** - * System Metadata + * System Model *

- * High-level system information about the device. [System Metadata Documentation](../docs/messages/system.md) + * High-level system information about the device. [System Model Documentation](../docs/messages/system.md) * (Required) * */ @JsonProperty("system") - @JsonPropertyDescription("High-level system information about the device. [System Metadata Documentation](../docs/messages/system.md)") - public SystemMetadata system; + @JsonPropertyDescription("High-level system information about the device. [System Model Documentation](../docs/messages/system.md)") + public SystemModel system; /** - * Gateway Metadata + * Gateway Model *

* [Gateway Documentation](../docs/specs/gateway.md) * */ @JsonProperty("gateway") @JsonPropertyDescription("[Gateway Documentation](../docs/specs/gateway.md)") - public GatewayMetadata gateway; + public GatewayModel gateway; /** - * Localnet Metadata + * Discovery Model + *

+ * Discovery target parameters + * + */ + @JsonProperty("discovery") + @JsonPropertyDescription("Discovery target parameters") + public DiscoveryModel discovery; + /** + * Localnet Model *

* Used to describe device local network parameters * */ @JsonProperty("localnet") @JsonPropertyDescription("Used to describe device local network parameters") - public LocalnetMetadata localnet; + public LocalnetModel localnet; /** * Testing Model *

@@ -108,20 +118,21 @@ public class Metadata { @JsonPropertyDescription("Testing target parameters") public TestingModel testing; /** - * Pointset Metadata + * Pointset Model *

* Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds * */ @JsonProperty("pointset") @JsonPropertyDescription("Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds") - public PointsetMetadata pointset; + public PointsetModel pointset; @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.cloud == null)? 0 :this.cloud.hashCode())); result = ((result* 31)+((this.system == null)? 0 :this.system.hashCode())); + result = ((result* 31)+((this.discovery == null)? 0 :this.discovery.hashCode())); result = ((result* 31)+((this.testing == null)? 0 :this.testing.hashCode())); result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); result = ((result* 31)+((this.pointset == null)? 0 :this.pointset.hashCode())); @@ -142,7 +153,7 @@ public boolean equals(Object other) { return false; } Metadata rhs = ((Metadata) other); - return (((((((((((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud)))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); + return ((((((((((((this.cloud == rhs.cloud)||((this.cloud!= null)&&this.cloud.equals(rhs.cloud)))&&((this.system == rhs.system)||((this.system!= null)&&this.system.equals(rhs.system))))&&((this.discovery == rhs.discovery)||((this.discovery!= null)&&this.discovery.equals(rhs.discovery))))&&((this.testing == rhs.testing)||((this.testing!= null)&&this.testing.equals(rhs.testing))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.pointset == rhs.pointset)||((this.pointset!= null)&&this.pointset.equals(rhs.pointset))))&&((this.version == rhs.version)||((this.version!= null)&&this.version.equals(rhs.version))))&&((this.hash == rhs.hash)||((this.hash!= null)&&this.hash.equals(rhs.hash))))&&((this.gateway == rhs.gateway)||((this.gateway!= null)&&this.gateway.equals(rhs.gateway))))&&((this.localnet == rhs.localnet)||((this.localnet!= null)&&this.localnet.equals(rhs.localnet))))&&((this.timestamp == rhs.timestamp)||((this.timestamp!= null)&&this.timestamp.equals(rhs.timestamp)))); } } diff --git a/gencode/java/udmi/schema/PointPointsetMetadata.java b/gencode/java/udmi/schema/PointPointsetModel.java similarity index 91% rename from gencode/java/udmi/schema/PointPointsetMetadata.java rename to gencode/java/udmi/schema/PointPointsetModel.java index 4083811251..a738745244 100644 --- a/gencode/java/udmi/schema/PointPointsetMetadata.java +++ b/gencode/java/udmi/schema/PointPointsetModel.java @@ -13,7 +13,7 @@ /** - * Point Pointset Metadata + * Point Pointset Model *

* Information about a specific point name of the device. * @@ -32,7 +32,7 @@ "sample_rate_sec" }) @Generated("jsonschema2pojo") -public class PointPointsetMetadata { +public class PointPointsetModel { /** * Expected unit configuration for the point @@ -68,7 +68,7 @@ public class PointPointsetMetadata { */ @JsonProperty("baseline_state") @JsonPropertyDescription("Expected state when `baseline_value` is set as the `set_value` for this point the config message") - public PointPointsetMetadata.Baseline_state baseline_state; + public PointPointsetModel.Baseline_state baseline_state; /** * Triggering threshold for partial cov update publishing * @@ -126,10 +126,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof PointPointsetMetadata) == false) { + if ((other instanceof PointPointsetModel) == false) { return false; } - PointPointsetMetadata rhs = ((PointPointsetMetadata) other); + PointPointsetModel rhs = ((PointPointsetModel) other); return (((((((((((this.sample_rate_sec == rhs.sample_rate_sec)||((this.sample_rate_sec!= null)&&this.sample_rate_sec.equals(rhs.sample_rate_sec)))&&((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref))))&&((this.baseline_value == rhs.baseline_value)||((this.baseline_value!= null)&&this.baseline_value.equals(rhs.baseline_value))))&&((this.min_loglevel == rhs.min_loglevel)||((this.min_loglevel!= null)&&this.min_loglevel.equals(rhs.min_loglevel))))&&((this.baseline_state == rhs.baseline_state)||((this.baseline_state!= null)&&this.baseline_state.equals(rhs.baseline_state))))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.baseline_tolerance == rhs.baseline_tolerance)||((this.baseline_tolerance!= null)&&this.baseline_tolerance.equals(rhs.baseline_tolerance))))&&((this.cov_increment == rhs.cov_increment)||((this.cov_increment!= null)&&this.cov_increment.equals(rhs.cov_increment))))&&((this.sample_limit_sec == rhs.sample_limit_sec)||((this.sample_limit_sec!= null)&&this.sample_limit_sec.equals(rhs.sample_limit_sec))))&&((this.writable == rhs.writable)||((this.writable!= null)&&this.writable.equals(rhs.writable)))); } @@ -147,10 +147,10 @@ public enum Baseline_state { INVALID("invalid"), FAILURE("failure"); private final String value; - private final static Map CONSTANTS = new HashMap(); + private final static Map CONSTANTS = new HashMap(); static { - for (PointPointsetMetadata.Baseline_state c: values()) { + for (PointPointsetModel.Baseline_state c: values()) { CONSTANTS.put(c.value, c); } } @@ -170,8 +170,8 @@ public String value() { } @JsonCreator - public static PointPointsetMetadata.Baseline_state fromValue(String value) { - PointPointsetMetadata.Baseline_state constant = CONSTANTS.get(value); + public static PointPointsetModel.Baseline_state fromValue(String value) { + PointPointsetModel.Baseline_state constant = CONSTANTS.get(value); if (constant == null) { throw new IllegalArgumentException(value); } else { diff --git a/gencode/java/udmi/schema/PointsetMetadata.java b/gencode/java/udmi/schema/PointsetModel.java similarity index 85% rename from gencode/java/udmi/schema/PointsetMetadata.java rename to gencode/java/udmi/schema/PointsetModel.java index dcdbcfe313..ab9f5cf298 100644 --- a/gencode/java/udmi/schema/PointsetMetadata.java +++ b/gencode/java/udmi/schema/PointsetModel.java @@ -10,7 +10,7 @@ /** - * Pointset Metadata + * Pointset Model *

* Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds * @@ -20,7 +20,7 @@ "points" }) @Generated("jsonschema2pojo") -public class PointsetMetadata { +public class PointsetModel { /** * Information about a specific point name of the device. @@ -29,7 +29,7 @@ public class PointsetMetadata { */ @JsonProperty("points") @JsonPropertyDescription("Information about a specific point name of the device.") - public HashMap points; + public HashMap points; @Override public int hashCode() { @@ -43,10 +43,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof PointsetMetadata) == false) { + if ((other instanceof PointsetModel) == false) { return false; } - PointsetMetadata rhs = ((PointsetMetadata) other); + PointsetModel rhs = ((PointsetModel) other); return ((this.points == rhs.points)||((this.points!= null)&&this.points.equals(rhs.points))); } diff --git a/gencode/java/udmi/schema/SystemMetadata.java b/gencode/java/udmi/schema/SystemModel.java similarity index 87% rename from gencode/java/udmi/schema/SystemMetadata.java rename to gencode/java/udmi/schema/SystemModel.java index 0a309521f9..579cbc4e81 100644 --- a/gencode/java/udmi/schema/SystemMetadata.java +++ b/gencode/java/udmi/schema/SystemModel.java @@ -9,9 +9,9 @@ /** - * System Metadata + * System Model *

- * High-level system information about the device. [System Metadata Documentation](../docs/messages/system.md) + * High-level system information about the device. [System Model Documentation](../docs/messages/system.md) * */ @JsonInclude(JsonInclude.Include.NON_NULL) @@ -21,7 +21,7 @@ "aux" }) @Generated("jsonschema2pojo") -public class SystemMetadata { +public class SystemModel { /** * Properties the expected physical location of the device. @@ -56,10 +56,10 @@ public boolean equals(Object other) { if (other == this) { return true; } - if ((other instanceof SystemMetadata) == false) { + if ((other instanceof SystemModel) == false) { return false; } - SystemMetadata rhs = ((SystemMetadata) other); + SystemModel rhs = ((SystemModel) other); return ((((this.location == rhs.location)||((this.location!= null)&&this.location.equals(rhs.location)))&&((this.physical_tag == rhs.physical_tag)||((this.physical_tag!= null)&&this.physical_tag.equals(rhs.physical_tag))))&&((this.aux == rhs.aux)||((this.aux!= null)&&this.aux.equals(rhs.aux)))); } diff --git a/gencode/python/udmi/schema/__init__.py b/gencode/python/udmi/schema/__init__.py index 58d486bae8..434b490555 100644 --- a/gencode/python/udmi/schema/__init__.py +++ b/gencode/python/udmi/schema/__init__.py @@ -1,3 +1,4 @@ +from .command_discovery import DiscoveryCommand from .common import Common from .config import Config from .config_blobset import BlobsetConfig @@ -13,20 +14,22 @@ from .event import Event from .event_audit import AuditEvent from .event_discovery import DiscoveryEvent -from .event_discovery_blob import BlobEnumerationEvent from .event_discovery_family import FamilyDiscoveryEvent from .event_discovery_point import PointEnumerationEvent +from .event_mapping import DiscoveryEvent from .event_pointset import PointsetEvent from .event_pointset_point import PointPointsetEvent from .event_system import SystemEvent from .metadata import Metadata -from .model_cloud import CloudMetadata -from .model_gateway import GatewayMetadata -from .model_localnet import LocalnetMetadata -from .model_localnet_family import FamilyLocalnetMetadata -from .model_pointset import PointsetMetadata -from .model_pointset_point import PointPointsetMetadata -from .model_system import SystemMetadata +from .model_cloud import CloudModel +from .model_discovery import DiscoveryModel +from .model_discovery_family import FamilyDiscoveryTestingModel +from .model_gateway import GatewayModel +from .model_localnet import LocalnetModel +from .model_localnet_family import FamilyLocalnetModel +from .model_pointset import PointsetModel +from .model_pointset_point import PointPointsetModel +from .model_system import SystemModel from .model_testing import TestingModel from .model_testing_target import TargetTestingModel from .properties import Properties diff --git a/gencode/python/udmi/schema/event_discovery_blob.py b/gencode/python/udmi/schema/command_discovery.py similarity index 51% rename from gencode/python/udmi/schema/event_discovery_blob.py rename to gencode/python/udmi/schema/command_discovery.py index f47311c5d4..1d243a5ce5 100644 --- a/gencode/python/udmi/schema/event_discovery_blob.py +++ b/gencode/python/udmi/schema/command_discovery.py @@ -1,20 +1,20 @@ -"""Generated class for event_discovery_blob.json""" +"""Generated class for command_discovery.json""" -class BlobEnumerationEvent: +class DiscoveryCommand: """Generated schema class""" def __init__(self): - self.description = None - self.firmware_set = None + self.timestamp = None + self.version = None @staticmethod def from_dict(source): if not source: return None - result = BlobEnumerationEvent() - result.description = source.get('description') - result.firmware_set = source.get('firmware_set') + result = DiscoveryCommand() + result.timestamp = source.get('timestamp') + result.version = source.get('version') return result @staticmethod @@ -23,7 +23,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = BlobEnumerationEvent.from_dict(source[key]) + result[key] = DiscoveryCommand.from_dict(source[key]) return result @staticmethod @@ -35,8 +35,8 @@ def expand_dict(input): def to_dict(self): result = {} - if self.description: - result['description'] = self.description # 5 - if self.firmware_set: - result['firmware_set'] = self.firmware_set # 5 + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 return result diff --git a/gencode/python/udmi/schema/event_discovery.py b/gencode/python/udmi/schema/event_discovery.py index f049294450..c1b457ecb7 100644 --- a/gencode/python/udmi/schema/event_discovery.py +++ b/gencode/python/udmi/schema/event_discovery.py @@ -2,7 +2,6 @@ from .common import Entry from .event_discovery_family import FamilyDiscoveryEvent from .event_discovery_point import PointEnumerationEvent -from .event_discovery_blob import BlobEnumerationEvent class DiscoveryEvent: @@ -13,9 +12,9 @@ def __init__(self): self.version = None self.generation = None self.status = None + self.scan_family = None self.families = None self.points = None - self.blobs = None @staticmethod def from_dict(source): @@ -26,9 +25,9 @@ def from_dict(source): result.version = source.get('version') result.generation = source.get('generation') result.status = Entry.from_dict(source.get('status')) + result.scan_family = source.get('scan_family') result.families = FamilyDiscoveryEvent.map_from(source.get('families')) result.points = PointEnumerationEvent.map_from(source.get('points')) - result.blobs = BlobEnumerationEvent.map_from(source.get('blobs')) return result @staticmethod @@ -57,10 +56,10 @@ def to_dict(self): result['generation'] = self.generation # 5 if self.status: result['status'] = self.status.to_dict() # 4 + if self.scan_family: + result['scan_family'] = self.scan_family # 5 if self.families: result['families'] = FamilyDiscoveryEvent.expand_dict(self.families) # 2 if self.points: result['points'] = PointEnumerationEvent.expand_dict(self.points) # 2 - if self.blobs: - result['blobs'] = BlobEnumerationEvent.expand_dict(self.blobs) # 2 return result diff --git a/gencode/python/udmi/schema/event_mapping.py b/gencode/python/udmi/schema/event_mapping.py new file mode 100644 index 0000000000..fac601b6a7 --- /dev/null +++ b/gencode/python/udmi/schema/event_mapping.py @@ -0,0 +1,47 @@ +"""Generated class for event_mapping.json""" +from .common import Entry + + +class DiscoveryEvent: + """Generated schema class""" + + def __init__(self): + self.timestamp = None + self.version = None + self.status = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryEvent() + result.timestamp = source.get('timestamp') + result.version = source.get('version') + result.status = Entry.from_dict(source.get('status')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryEvent.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.timestamp: + result['timestamp'] = self.timestamp # 5 + if self.version: + result['version'] = self.version # 5 + if self.status: + result['status'] = self.status.to_dict() # 4 + return result diff --git a/gencode/python/udmi/schema/metadata.py b/gencode/python/udmi/schema/metadata.py index 989df45da7..2787f38161 100644 --- a/gencode/python/udmi/schema/metadata.py +++ b/gencode/python/udmi/schema/metadata.py @@ -1,10 +1,11 @@ """Generated class for metadata.json""" -from .model_cloud import CloudMetadata -from .model_system import SystemMetadata -from .model_gateway import GatewayMetadata -from .model_localnet import LocalnetMetadata +from .model_cloud import CloudModel +from .model_system import SystemModel +from .model_gateway import GatewayModel +from .model_discovery import DiscoveryModel +from .model_localnet import LocalnetModel from .model_testing import TestingModel -from .model_pointset import PointsetMetadata +from .model_pointset import PointsetModel class Metadata: @@ -18,6 +19,7 @@ def __init__(self): self.cloud = None self.system = None self.gateway = None + self.discovery = None self.localnet = None self.testing = None self.pointset = None @@ -31,12 +33,13 @@ def from_dict(source): result.version = source.get('version') result.description = source.get('description') result.hash = source.get('hash') - result.cloud = CloudMetadata.from_dict(source.get('cloud')) - result.system = SystemMetadata.from_dict(source.get('system')) - result.gateway = GatewayMetadata.from_dict(source.get('gateway')) - result.localnet = LocalnetMetadata.from_dict(source.get('localnet')) + result.cloud = CloudModel.from_dict(source.get('cloud')) + result.system = SystemModel.from_dict(source.get('system')) + result.gateway = GatewayModel.from_dict(source.get('gateway')) + result.discovery = DiscoveryModel.from_dict(source.get('discovery')) + result.localnet = LocalnetModel.from_dict(source.get('localnet')) result.testing = TestingModel.from_dict(source.get('testing')) - result.pointset = PointsetMetadata.from_dict(source.get('pointset')) + result.pointset = PointsetModel.from_dict(source.get('pointset')) return result @staticmethod @@ -71,6 +74,8 @@ def to_dict(self): result['system'] = self.system.to_dict() # 4 if self.gateway: result['gateway'] = self.gateway.to_dict() # 4 + if self.discovery: + result['discovery'] = self.discovery.to_dict() # 4 if self.localnet: result['localnet'] = self.localnet.to_dict() # 4 if self.testing: diff --git a/gencode/python/udmi/schema/model_cloud.py b/gencode/python/udmi/schema/model_cloud.py index 8845ed988c..844fd9c8e1 100644 --- a/gencode/python/udmi/schema/model_cloud.py +++ b/gencode/python/udmi/schema/model_cloud.py @@ -1,7 +1,7 @@ """Generated class for model_cloud.json""" -class CloudMetadata: +class CloudModel: """Generated schema class""" def __init__(self): @@ -13,7 +13,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = CloudMetadata() + result = CloudModel() result.auth_type = source.get('auth_type') result.device_key = source.get('device_key') result.is_gateway = source.get('is_gateway') @@ -25,7 +25,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = CloudMetadata.from_dict(source[key]) + result[key] = CloudModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_discovery.py b/gencode/python/udmi/schema/model_discovery.py new file mode 100644 index 0000000000..92dc52ef13 --- /dev/null +++ b/gencode/python/udmi/schema/model_discovery.py @@ -0,0 +1,39 @@ +"""Generated class for model_discovery.json""" +from .model_discovery_family import FamilyDiscoveryTestingModel + + +class DiscoveryModel: + """Generated schema class""" + + def __init__(self): + self.families = None + + @staticmethod + def from_dict(source): + if not source: + return None + result = DiscoveryModel() + result.families = FamilyDiscoveryTestingModel.map_from(source.get('families')) + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = DiscoveryModel.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + if self.families: + result['families'] = FamilyDiscoveryTestingModel.expand_dict(self.families) # 2 + return result diff --git a/gencode/python/udmi/schema/model_discovery_family.py b/gencode/python/udmi/schema/model_discovery_family.py new file mode 100644 index 0000000000..aa2dd416ee --- /dev/null +++ b/gencode/python/udmi/schema/model_discovery_family.py @@ -0,0 +1,35 @@ +"""Generated class for model_discovery_family.json""" + + +class FamilyDiscoveryTestingModel: + """Generated schema class""" + + def __init__(self): + pass + + @staticmethod + def from_dict(source): + if not source: + return None + result = FamilyDiscoveryTestingModel() + return result + + @staticmethod + def map_from(source): + if not source: + return None + result = {} + for key in source: + result[key] = FamilyDiscoveryTestingModel.from_dict(source[key]) + return result + + @staticmethod + def expand_dict(input): + result = {} + for property in input: + result[property] = input[property].to_dict() if input[property] else {} + return result + + def to_dict(self): + result = {} + return result diff --git a/gencode/python/udmi/schema/model_gateway.py b/gencode/python/udmi/schema/model_gateway.py index e5826eb9e6..9106dd4e56 100644 --- a/gencode/python/udmi/schema/model_gateway.py +++ b/gencode/python/udmi/schema/model_gateway.py @@ -1,7 +1,7 @@ """Generated class for model_gateway.json""" -class GatewayMetadata: +class GatewayModel: """Generated schema class""" def __init__(self): @@ -13,7 +13,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = GatewayMetadata() + result = GatewayModel() result.gateway_id = source.get('gateway_id') result.family = source.get('family') result.proxy_ids = source.get('proxy_ids') @@ -25,7 +25,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = GatewayMetadata.from_dict(source[key]) + result[key] = GatewayModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_localnet.py b/gencode/python/udmi/schema/model_localnet.py index e83b150775..670be9fa0a 100644 --- a/gencode/python/udmi/schema/model_localnet.py +++ b/gencode/python/udmi/schema/model_localnet.py @@ -1,8 +1,8 @@ """Generated class for model_localnet.json""" -from .model_localnet_family import FamilyLocalnetMetadata +from .model_localnet_family import FamilyLocalnetModel -class LocalnetMetadata: +class LocalnetModel: """Generated schema class""" def __init__(self): @@ -12,8 +12,8 @@ def __init__(self): def from_dict(source): if not source: return None - result = LocalnetMetadata() - result.families = FamilyLocalnetMetadata.map_from(source.get('families')) + result = LocalnetModel() + result.families = FamilyLocalnetModel.map_from(source.get('families')) return result @staticmethod @@ -22,7 +22,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = LocalnetMetadata.from_dict(source[key]) + result[key] = LocalnetModel.from_dict(source[key]) return result @staticmethod @@ -35,5 +35,5 @@ def expand_dict(input): def to_dict(self): result = {} if self.families: - result['families'] = FamilyLocalnetMetadata.expand_dict(self.families) # 2 + result['families'] = FamilyLocalnetModel.expand_dict(self.families) # 2 return result diff --git a/gencode/python/udmi/schema/model_localnet_family.py b/gencode/python/udmi/schema/model_localnet_family.py index d0962cb651..af5933ec21 100644 --- a/gencode/python/udmi/schema/model_localnet_family.py +++ b/gencode/python/udmi/schema/model_localnet_family.py @@ -1,7 +1,7 @@ """Generated class for model_localnet_family.json""" -class FamilyLocalnetMetadata: +class FamilyLocalnetModel: """Generated schema class""" def __init__(self): @@ -11,7 +11,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = FamilyLocalnetMetadata() + result = FamilyLocalnetModel() result.id = source.get('id') return result @@ -21,7 +21,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = FamilyLocalnetMetadata.from_dict(source[key]) + result[key] = FamilyLocalnetModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_pointset.py b/gencode/python/udmi/schema/model_pointset.py index 91bba573ea..c994e65427 100644 --- a/gencode/python/udmi/schema/model_pointset.py +++ b/gencode/python/udmi/schema/model_pointset.py @@ -1,8 +1,8 @@ """Generated class for model_pointset.json""" -from .model_pointset_point import PointPointsetMetadata +from .model_pointset_point import PointPointsetModel -class PointsetMetadata: +class PointsetModel: """Generated schema class""" def __init__(self): @@ -12,8 +12,8 @@ def __init__(self): def from_dict(source): if not source: return None - result = PointsetMetadata() - result.points = PointPointsetMetadata.map_from(source.get('points')) + result = PointsetModel() + result.points = PointPointsetModel.map_from(source.get('points')) return result @staticmethod @@ -22,7 +22,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = PointsetMetadata.from_dict(source[key]) + result[key] = PointsetModel.from_dict(source[key]) return result @staticmethod @@ -35,5 +35,5 @@ def expand_dict(input): def to_dict(self): result = {} if self.points: - result['points'] = PointPointsetMetadata.expand_dict(self.points) # 2 + result['points'] = PointPointsetModel.expand_dict(self.points) # 2 return result diff --git a/gencode/python/udmi/schema/model_pointset_point.py b/gencode/python/udmi/schema/model_pointset_point.py index 5b9b37d393..9e92c11509 100644 --- a/gencode/python/udmi/schema/model_pointset_point.py +++ b/gencode/python/udmi/schema/model_pointset_point.py @@ -1,7 +1,7 @@ """Generated class for model_pointset_point.json""" -class PointPointsetMetadata: +class PointPointsetModel: """Generated schema class""" def __init__(self): @@ -20,7 +20,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = PointPointsetMetadata() + result = PointPointsetModel() result.units = source.get('units') result.writable = source.get('writable') result.baseline_value = source.get('baseline_value') @@ -39,7 +39,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = PointPointsetMetadata.from_dict(source[key]) + result[key] = PointPointsetModel.from_dict(source[key]) return result @staticmethod diff --git a/gencode/python/udmi/schema/model_system.py b/gencode/python/udmi/schema/model_system.py index 94ba79b70f..a574ef157c 100644 --- a/gencode/python/udmi/schema/model_system.py +++ b/gencode/python/udmi/schema/model_system.py @@ -210,7 +210,7 @@ def to_dict(self): return result -class SystemMetadata: +class SystemModel: """Generated schema class""" def __init__(self): @@ -222,7 +222,7 @@ def __init__(self): def from_dict(source): if not source: return None - result = SystemMetadata() + result = SystemModel() result.location = Object683EF6A1.from_dict(source.get('location')) result.physical_tag = Object45E20BB3.from_dict(source.get('physical_tag')) result.aux = ObjectCA9644FB.from_dict(source.get('aux')) @@ -234,7 +234,7 @@ def map_from(source): return None result = {} for key in source: - result[key] = SystemMetadata.from_dict(source[key]) + result[key] = SystemModel.from_dict(source[key]) return result @staticmethod diff --git a/pubber/.idea/codeStyles/Project.xml b/pubber/.idea/codeStyles/Project.xml new file mode 100644 index 0000000000..b51387564e --- /dev/null +++ b/pubber/.idea/codeStyles/Project.xml @@ -0,0 +1,582 @@ + + + +

+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .*:.*Style + + http://schemas.android.com/apk/res/android + + + BY_NAME + +
+
+ + + + .*:layout_width + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_height + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_weight + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_margin + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_marginTop + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_marginBottom + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_marginStart + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_marginEnd + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_marginLeft + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_marginRight + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:layout_.* + + http://schemas.android.com/apk/res/android + + + BY_NAME + +
+
+ + + + .*:padding + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:paddingTop + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:paddingBottom + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:paddingStart + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:paddingEnd + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:paddingLeft + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:paddingRight + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .* + http://schemas.android.com/apk/res/android + + + BY_NAME + +
+
+ + + + .* + http://schemas.android.com/apk/res-auto + + + BY_NAME + +
+
+ + + + .* + http://schemas.android.com/tools + + + BY_NAME + +
+
+ + + + .* + .* + + + BY_NAME + +
+ + + + + + + \ No newline at end of file diff --git a/pubber/.idea/codeStyles/codeStyleConfig.xml b/pubber/.idea/codeStyles/codeStyleConfig.xml index b9d18bf599..3c617fb8f5 100644 --- a/pubber/.idea/codeStyles/codeStyleConfig.xml +++ b/pubber/.idea/codeStyles/codeStyleConfig.xml @@ -1,5 +1,6 @@ + \ No newline at end of file diff --git a/pubber/.idea/runConfigurations/Pubber.xml b/pubber/.idea/runConfigurations/Pubber.xml index 96e39f8913..8b5722f726 100644 --- a/pubber/.idea/runConfigurations/Pubber.xml +++ b/pubber/.idea/runConfigurations/Pubber.xml @@ -2,7 +2,7 @@