From d81be96fdd9341457bbe64b1d09f50a3ca844e49 Mon Sep 17 00:00:00 2001 From: Noureddine Date: Wed, 26 May 2021 01:52:59 +0100 Subject: [PATCH 01/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d0914ac5f..29c83e53ec 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# UDMI Schema +# UDMI Schema The Universal Device Management Interface (UDMI) provides a high-level specification for the management and operation of physical IoT systems. This data is typically exchanged From 76b554f7a2a775f03b7b9eb2d64672d89d066f35 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Thu, 2 Sep 2021 21:03:13 +0100 Subject: [PATCH 02/10] add schema document generator and documents --- bin/gendocs | 33 ++++++ bin/gendocs.py | 17 ++++ docs/schema/config.html | 1 + docs/schema/envelope.html | 1 + docs/schema/event.html | 1 + docs/schema/index.html | 26 +++++ docs/schema/metadata.html | 1 + docs/schema/schema_doc.css | 180 +++++++++++++++++++++++++++++++++ docs/schema/schema_doc.min.js | 1 + docs/schema/state.html | 1 + etc/requirements.txt | 1 + etc/schema_index_template.html | 26 +++++ 12 files changed, 289 insertions(+) create mode 100755 bin/gendocs create mode 100644 bin/gendocs.py create mode 100644 docs/schema/config.html create mode 100644 docs/schema/envelope.html create mode 100644 docs/schema/event.html create mode 100644 docs/schema/index.html create mode 100644 docs/schema/metadata.html create mode 100644 docs/schema/schema_doc.css create mode 100644 docs/schema/schema_doc.min.js create mode 100644 docs/schema/state.html create mode 100644 etc/requirements.txt create mode 100644 etc/schema_index_template.html diff --git a/bin/gendocs b/bin/gendocs new file mode 100755 index 0000000000..ca4c6b0f34 --- /dev/null +++ b/bin/gendocs @@ -0,0 +1,33 @@ +#!/bin/bash + +ROOT_DIR=$(realpath $(dirname $0)/..) +cd $ROOT_DIR + +OUTPUT_DIR=docs/schema + +# Make a copy of the schema files into a tmp folder +rm -rf tmp/schema +mkdir -p tmp/schema +cp -r schema tmp + +# Remove file: prefix from references so document generator works +find tmp/schema -type f -exec sed -i '' 's/file://' {} \; + +schemas="state event config metadata envelope" + +for schema in $schemas; do + python3 bin/gendocs.py $schema $ROOT_DIR $OUTPUT_DIR +done + +#Cleanup tmp files +rm -rf tmp/schema + +# Create index page with links to different schemas +rm $OUTPUT_DIR/index.html +cp etc/schema_index_template.html $OUTPUT_DIR/index.html + +for schema in $schemas; do + sed -i '' "s//\ +
$schema<\/a><\/div>/"\ + $OUTPUT_DIR/index.html +done diff --git a/bin/gendocs.py b/bin/gendocs.py new file mode 100644 index 0000000000..06424b97fd --- /dev/null +++ b/bin/gendocs.py @@ -0,0 +1,17 @@ +import sys + +from json_schema_for_humans.generate import generate_from_filename +from json_schema_for_humans.generation_configuration import GenerationConfiguration + +config = GenerationConfiguration(copy_css=True, + expand_buttons=True, + minify=False) + +schema = sys.argv[1] +root_dir = sys.argv[2] +output_dir = sys.argv[3] + +file_name = root_dir + "/tmp/schema/" + schema + ".json" +output_file = root_dir + "/" + output_dir + "/" + schema + ".html" + +generate_from_filename(file_name, output_file, config=config) \ No newline at end of file diff --git a/docs/schema/config.html b/docs/schema/config.html new file mode 100644 index 0000000000..b32b68c654 --- /dev/null +++ b/docs/schema/config.html @@ -0,0 +1 @@ + Config

Config

Type: object
No Additional Properties

Type: integer

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

Type: object
No Additional Properties

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: object
No Additional Properties

Type: array of string

Each item of this array must be:

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

Type: object
No Additional Properties

Type: object

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

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

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

Must be at most 32 characters long

Type: string

Type: integer

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

Type: integer

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

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

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

Envelope

Type: object

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

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

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

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

Type: enum (of string)

Must be one of:

  • "config"
  • "discovery"
  • "system"
  • "metadata"
  • "pointset"
  • "state"

Additional Properties of any type are allowed.

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

Event

Type: object

Container object for all event schemas, not directly used.

No Additional Properties

Type: object
No Additional Properties

Type: string

Type: integer

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

Type: array

Each item of this array must be:

Type: object
No Additional Properties

Type: string

Type: string

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

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: integer

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

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

Type: enum (of integer)

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

Type: string
Must match regular expression: ^[-_.:/0-9a-zA-Z]+$
\ No newline at end of file diff --git a/docs/schema/index.html b/docs/schema/index.html new file mode 100644 index 0000000000..264afe8562 --- /dev/null +++ b/docs/schema/index.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + UDMI Schema + + +

UDMI Schema

+
+ + + diff --git a/docs/schema/metadata.html b/docs/schema/metadata.html new file mode 100644 index 0000000000..9dad97ceb4 --- /dev/null +++ b/docs/schema/metadata.html @@ -0,0 +1 @@ + Metadata

Metadata

Type: object
No Additional Properties

Type: string

Type: integer

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

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

Type: object
No Additional Properties

Type: enum (of string)

Must be one of:

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

Type: boolean

Type: boolean

Type: object
No Additional Properties

Type: object
No Additional Properties

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

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

Type: object
No Additional Properties

Type: number

Type: number

Type: object
No Additional Properties

Type: object
No Additional Properties

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

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

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

Type: object
No Additional Properties

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

Type: object
No Additional Properties

Type: object

The following properties are required:

  • gateway_id
Type: object

The following properties are required:

  • proxy_ids

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

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

Type: array of string

Each item of this array must be:

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

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-z0-9-]+$
Type: object
No Additional Properties

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: enum (of string)

Taken from standard BACnet engineering units

Must be one of:

  • "Square-meters"
  • "Square-feet"
  • "Milliamperes"
  • "Amperes"
  • "Ohms"
  • "Volts"
  • "Kilo-volts"
  • "Mega-volts"
  • "Volt-amperes"
  • "Kilo-volt-amperes"
  • "Mega-volt-amperes"
  • "Volt-amperes-reactive"
  • "Kilo-volt-amperes-reactive"
  • "Mega-volt-amperes-reactive"
  • "Volt-amperes-reactive-hours"
  • "Degrees-phase"
  • "Power-factor"
  • "Joules"
  • "Kilojoules"
  • "Watt-hours"
  • "Kilowatt-hours"
  • "BTUs"
  • "Therms"
  • "Ton-hours"
  • "Joules-per-kilogram-dry-air"
  • "BTUs-per-pound-dry-air"
  • "Cycles-per-hour"
  • "Cycles-per-minute"
  • "Hertz"
  • "Grams-of-water-per-kilogram-dry-air"
  • "Percent-relative-humidity"
  • "Millimeters"
  • "Meters"
  • "Inches"
  • "Feet"
  • "Watts-per-square-foot"
  • "Watts-per-square-meter"
  • "Lumens"
  • "Luxes"
  • "Foot-candles"
  • "Kilograms"
  • "Pounds-mass"
  • "Tons"
  • "Kilograms-per-second"
  • "Kilograms-per-minute"
  • "Kilograms-per-hour"
  • "Pounds-mass-per-minute"
  • "Pounds-mass-per-hour"
  • "Watts"
  • "Kilowatts"
  • "Megawatts"
  • "BTUs-per-hour"
  • "Horsepower"
  • "Tons-refrigeration"
  • "Pascals"
  • "Kilopascals"
  • "Bars"
  • "Pounds-force-per-square-inch"
  • "Centimeters-of-water"
  • "Inches-of-water"
  • "Millimeters-of-mercury"
  • "Centimeters-of-mercury"
  • "Inches-of-mercury"
  • "Degrees-Celsius"
  • "Degrees-Kelvin"
  • "Degrees-Fahrenheit"
  • "Degree-days-Celsius"
  • "Degree-days-Fahrenheit"
  • "Years"
  • "Months"
  • "Weeks"
  • "Days"
  • "Hours"
  • "Minutes"
  • "Seconds"
  • "Meters-per-second"
  • "Kilometers-per-hour"
  • "Feet-per-second"
  • "Feet-per-minute"
  • "Miles-per-hour"
  • "Cubic-feet"
  • "Cubic-meters"
  • "Imperial-gallons"
  • "Liters"
  • "Us-gallons"
  • "Cubic-feet-per-minute"
  • "Cubic-meters-per-second"
  • "Imperial-gallons-per-minute"
  • "Liters-per-second"
  • "Liters-per-minute"
  • "Us-gallons-per-minute"
  • "Degrees-angular"
  • "Degrees-Celsius-per-hour"
  • "Degrees-Celsius-per-minute"
  • "Degrees-Fahrenheit-per-hour"
  • "Degrees-Fahrenheit-per-minute"
  • "No-units"
  • "Parts-per-million"
  • "Parts-per-billion"
  • "Percent"
  • "Percent-per-second"
  • "Per-minute"
  • "Per-second"
  • "Psi-per-Degree-Fahrenheit"
  • "Radians"
  • "Revolutions-per-minute"
  • "Currency1"
  • "Currency2"
  • "Currency3"
  • "Currency4"
  • "Currency5"
  • "Currency6"
  • "Currency7"
  • "Currency8"
  • "Currency9"
  • "Currency10"
  • "Square-inches"
  • "Square-centimeters"
  • "BTUs-per-pound"
  • "Centimeters"
  • "Pounds-mass-per-second"
  • "Delta-Degrees-Fahrenheit"
  • "Delta-Degrees-Kelvin"
  • "Kilohms"
  • "Megohms"
  • "Millivolts"
  • "Kilojoules-per-kilogram"
  • "Megajoules"
  • "Joules-per-degree-Kelvin"
  • "Joules-per-kilogram-degree-Kelvin"
  • "Kilohertz"
  • "Megahertz"
  • "Per-hour"
  • "Milliwatts"
  • "Hectopascals"
  • "Millibars"
  • "Cubic-meters-per-hour"
  • "Liters-per-hour"
  • "Kilowatt-hours-per-square-meter"
  • "Kilowatt-hours-per-square-foot"
  • "Megajoules-per-square-meter"
  • "Megajoules-per-square-foot"
  • "Watts-per-square-meter-Degree-Kelvin"
  • "Cubic-feet-per-second"
  • "Percent-obscuration-per-foot"
  • "Percent-obscuration-per-meter"
  • "Milliohms"
  • "Megawatt-hours"
  • "Kilo-BTUs"
  • "Mega-BTUs"
  • "Kilojoules-per-kilogram-dry-air"
  • "Megajoules-per-kilogram-dry-air"
  • "Kilojoules-per-degree-Kelvin"
  • "Megajoules-per-degree-Kelvin"
  • "Newton"
  • "Grams-per-second"
  • "Grams-per-minute"
  • "Tons-per-hour"
  • "Kilo-BTUs-per-hour"
  • "Hundredths-seconds"
  • "Milliseconds"
  • "Newton-meters"
  • "Millimeters-per-second"
  • "Millimeters-per-minute"
  • "Meters-per-minute"
  • "Meters-per-hour"
  • "Cubic-meters-per-minute"
  • "Meters-per-second-per-second"
  • "Amperes-per-meter"
  • "Amperes-per-square-meter"
  • "Ampere-square-meters"
  • "Farads"
  • "Henrys"
  • "Ohm-meters"
  • "Siemens"
  • "Siemens-per-meter"
  • "Teslas"
  • "Volts-per-degree-Kelvin"
  • "Volts-per-meter"
  • "Webers"
  • "Candelas"
  • "Candelas-per-square-meter"
  • "Degrees-Kelvin-per-hour"
  • "Degrees-Kelvin-per-minute"
  • "Joule-seconds"
  • "Square-meters-per-Newton"
  • "Kilograms-per-cubic-meter"
  • "Newton-seconds"
  • "Newtons-per-meter"
  • "Watts-per-meter-per-degree-Kelvin"
\ No newline at end of file diff --git a/docs/schema/schema_doc.css b/docs/schema/schema_doc.css new file mode 100644 index 0000000000..83897d896b --- /dev/null +++ b/docs/schema/schema_doc.css @@ -0,0 +1,180 @@ +body { + font: 16px/1.5em "Overpass", "Open Sans", Helvetica, sans-serif; + color: #333; + font-weight: 300; + padding: 40px; +} + +.btn.btn-link { + font-size: 18px; +} + +.jsfh-animated-property { + animation: eclair; + animation-iteration-count: 1; + animation-fill-mode: forwards; + animation-duration: .75s; + +} + +@keyframes eclair { + 0%,100% { + transform: scale(1); + } + 50% { + transform: scale(1.03); + } +} + +.btn.btn-primary { + margin: 10px; +} + +.btn.example-show.collapsed:before { + content: "show" +} + +.btn.example-show:before { + content: "hide" +} + +.description.collapse:not(.show) { + max-height: 100px !important; + overflow: hidden; + + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.description.collapsing { + min-height: 100px !important; +} + +.collapse-description-link.collapsed:after { + content: '+ Read More'; +} + +.collapse-description-link:not(.collapsed):after { + content: '- Read Less'; +} + +.badge { + font-size: 100%; + margin-bottom: 0.5rem; + margin-top: 0.5rem; +} + +.badge.value-type { + font-size: 120%; + margin-right: 5px; + margin-bottom: 10px; +} + + +.badge.default-value { + font-size: 120%; + margin-left: 5px; + margin-bottom: 10px; +} + +.badge.restriction { + display: inline-block; +} + +.badge.required-property,.badge.deprecated-property,.badge.pattern-property,.badge.no-additional { + font-size: 100%; + margin-left: 10px; +} + +.accordion div.card:only-child { + border-bottom: 1px solid rgba(0, 0, 0, 0.125); +} + +.examples { + padding: 1rem !important; +} + +.examples pre { + margin-bottom: 0; +} + +.highlight.jumbotron { + padding: 1rem !important; +} + +.generated-by-footer { + margin-top: 1em; + text-align: right; +} + +/* From https://github.com/richleland/pygments-css/blob/master/friendly.css, see https://github.com/trentm/python-markdown2/wiki/fenced-code-blocks */ +.highlight { background: #e9ecef; } /* Changed from #f0f0f0 in the original style to be the same as bootstrap's jumbotron */ +.highlight .hll { background-color: #ffffcc } +.highlight .c { color: #60a0b0; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #60a0b0; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #60a0b0; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #40a070 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #40a070 } /* Literal.Number.Bin */ +.highlight .mf { color: #40a070 } /* Literal.Number.Float */ +.highlight .mh { color: #40a070 } /* Literal.Number.Hex */ +.highlight .mi { color: #40a070 } /* Literal.Number.Integer */ +.highlight .mo { color: #40a070 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287e } /* Name.Function.Magic */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ +.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/schema/schema_doc.min.js b/docs/schema/schema_doc.min.js new file mode 100644 index 0000000000..0d9c7882d8 --- /dev/null +++ b/docs/schema/schema_doc.min.js @@ -0,0 +1 @@ +function flashElement(t){myElement=document.getElementById(t),myElement.classList.add("jsfh-animated-property"),setTimeout(function(){myElement.classList.remove("jsfh-animated-property")},1e3)}function setAnchor(t){history.pushState({},"",t)}function anchorOnLoad(){let t=window.location.hash.split("?")[0].split("&")[0];"#"===t[0]&&(t=t.substr(1)),t.length>0&&anchorLink(t)}function anchorLink(t){$("#"+t).parents().addBack().filter(".collapse:not(.show), .tab-pane, [role='tab']").each(function(t){if($(this).hasClass("collapse"))$(this).collapse("show");else if($(this).hasClass("tab-pane")){const t=$("a[href='#"+$(this).attr("id")+"']");t&&t.tab("show")}else"tab"===$(this).attr("role")&&$(this).tab("show")}),setTimeout(function(){let e=document.getElementById(t);e&&(e.scrollIntoView({block:"center",behavior:"smooth"}),setTimeout(function(){flashElement(t)},500))},1e3)}$(document).on("click",'a[href^="#"]',function(t){t.preventDefault(),history.pushState({},"",this.href)}); \ No newline at end of file diff --git a/docs/schema/state.html b/docs/schema/state.html new file mode 100644 index 0000000000..e447dcb1da --- /dev/null +++ b/docs/schema/state.html @@ -0,0 +1 @@ + State

State

Type: object
No Additional Properties

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: string

Type: object
No Additional Properties

Type: string

Type: object
No Additional Properties

Type: string

Type: string

Type: boolean

Type: object
No Additional Properties

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

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

Type: string

Type: string

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

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: array of string

Each item of this array must be:

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

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: enum (of string)

Must be one of:

  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
\ No newline at end of file diff --git a/etc/requirements.txt b/etc/requirements.txt new file mode 100644 index 0000000000..454ceb70a4 --- /dev/null +++ b/etc/requirements.txt @@ -0,0 +1 @@ +json-schema-for-humans \ No newline at end of file diff --git a/etc/schema_index_template.html b/etc/schema_index_template.html new file mode 100644 index 0000000000..0c8226b9fa --- /dev/null +++ b/etc/schema_index_template.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + UDMI Schema + + +

UDMI Schema

+
+ + + \ No newline at end of file From 6ad6fc3f2a9b2addc496be5795543913af322c51 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Mon, 6 Sep 2021 23:13:37 +0100 Subject: [PATCH 03/10] Add existing descriptions from docs --- bin/gendocs | 11 +++++++++-- docs/schema/config.html | 7 ++++++- docs/schema/envelope.html | 2 +- docs/schema/event.html | 1 - docs/schema/event_discovery.html | 2 ++ docs/schema/event_pointset.html | 5 +++++ docs/schema/event_system.html | 6 ++++++ docs/schema/index.html | 2 +- docs/schema/metadata.html | 10 +++++++++- docs/schema/schema_doc.css | 2 +- docs/schema/schema_doc.min.js | 2 +- docs/schema/state.html | 12 +++++++++++- schema/common.json | 18 ++++++++++++++---- schema/config.json | 5 ++++- schema/config_gateway.json | 4 +++- schema/config_pointset.json | 4 ++++ schema/config_pointset_point.json | 2 ++ schema/config_system.json | 1 + schema/envelope.json | 1 + schema/event_discovery.json | 5 ++++- schema/event_pointset.json | 5 ++++- schema/event_pointset_point.json | 2 ++ schema/event_system.json | 5 ++++- schema/metadata.json | 6 +++++- schema/metadata_cloud.json | 3 +++ schema/metadata_gateway.json | 8 ++++++-- schema/metadata_pointset.json | 2 ++ schema/metadata_pointset_point.json | 4 +++- schema/metadata_system.json | 7 ++++++- schema/state.json | 5 ++++- schema/state_pointset.json | 4 ++++ schema/state_pointset_point.json | 3 +++ schema/state_system.json | 16 +++++++++++++--- 33 files changed, 144 insertions(+), 28 deletions(-) delete mode 100644 docs/schema/event.html create mode 100644 docs/schema/event_discovery.html create mode 100644 docs/schema/event_pointset.html create mode 100644 docs/schema/event_system.html diff --git a/bin/gendocs b/bin/gendocs index ca4c6b0f34..b584a89a98 100755 --- a/bin/gendocs +++ b/bin/gendocs @@ -5,6 +5,9 @@ cd $ROOT_DIR OUTPUT_DIR=docs/schema +#Delete existing HTML files +rm -rf OUTPUT_DIR + # Make a copy of the schema files into a tmp folder rm -rf tmp/schema mkdir -p tmp/schema @@ -13,15 +16,19 @@ cp -r schema tmp # Remove file: prefix from references so document generator works find tmp/schema -type f -exec sed -i '' 's/file://' {} \; -schemas="state event config metadata envelope" +schemas="state event_system event_pointset event_discovery config metadata envelope" for schema in $schemas; do python3 bin/gendocs.py $schema $ROOT_DIR $OUTPUT_DIR done -#Cleanup tmp files rm -rf tmp/schema +# Convert github doc links to relative links +RELATIVE_LINK="..\/" +ABSOLUTE_LINK="https:\/\/github.com\/faucetsdn\/udmi\/blob\/master\/docs\/" +find $OUTPUT_DIR -type f -exec sed -i '' "s/$ABSOLUTE_LINK/$RELATIVE_LINK/" {} \; + # Create index page with links to different schemas rm $OUTPUT_DIR/index.html cp etc/schema_index_template.html $OUTPUT_DIR/index.html diff --git a/docs/schema/config.html b/docs/schema/config.html index b32b68c654..888b3bfedf 100644 --- a/docs/schema/config.html +++ b/docs/schema/config.html @@ -1 +1,6 @@ - Config

Config

Type: object
No Additional Properties

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: object
No Additional Properties

Type: array of string

Each item of this array must be:

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

Type: object
No Additional Properties

Type: object

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

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

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

Must be at most 32 characters long

Type: string

Type: integer

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

Type: integer

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

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

\ No newline at end of file + Config

Config

Type: object
No Additional Properties

Type: string

Timestamp the configuration was generated in Zulu time


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: object
No Additional Properties

Type: integer

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

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

Type: object
No Additional Properties

Type: string

Type: object
No Additional Properties

Type: array of string

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

Each item of this array must be:

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

Example:

[
+    "AHU-22"
+]
+

Type: object
No Additional Properties

Type: object

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

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

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

Must be at most 32 characters long

Type: string

An expiry for the the device reverts to its operational state, and sends a state update to notify the cloud of the state change. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Type: integer

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

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

Type: integer

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

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

Type: object

The points defined in this dictionary is the authoritative source indicating the representative points for the device (in both telemetry and state messages). Read more: https://github.com/faucetsdn/udmi/blob/master/docs/pointset.md

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

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


Example:

22.4
+
diff --git a/docs/schema/envelope.html b/docs/schema/envelope.html index 39db46006f..7f3499bd79 100644 --- a/docs/schema/envelope.html +++ b/docs/schema/envelope.html @@ -1 +1 @@ - Envelope

Envelope

Type: object

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

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

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

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

Type: enum (of string)

Must be one of:

  • "config"
  • "discovery"
  • "system"
  • "metadata"
  • "pointset"
  • "state"

Additional Properties of any type are allowed.

Type: object
\ No newline at end of file + Envelope

Envelope

Type: object

The UDMI envelope is not a message itself, per se, but the attributes and other information that is delivered along with a message. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/envelope.md

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

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

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

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

Type: enum (of string)

Must be one of:

  • "config"
  • "discovery"
  • "system"
  • "metadata"
  • "pointset"
  • "state"

Additional Properties of any type are allowed.

Type: object
diff --git a/docs/schema/event.html b/docs/schema/event.html deleted file mode 100644 index abb6540cdf..0000000000 --- a/docs/schema/event.html +++ /dev/null @@ -1 +0,0 @@ - Event

Event

Type: object

Container object for all event schemas, not directly used.

No Additional Properties

Type: object
No Additional Properties

Type: string

Type: integer

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

Type: array

Each item of this array must be:

Type: object
No Additional Properties

Type: string

Type: string

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

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: integer

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

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

Type: enum (of integer)

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

Type: string
Must match regular expression: ^[-_.:/0-9a-zA-Z]+$
\ No newline at end of file diff --git a/docs/schema/event_discovery.html b/docs/schema/event_discovery.html new file mode 100644 index 0000000000..b0ff6789a5 --- /dev/null +++ b/docs/schema/event_discovery.html @@ -0,0 +1,2 @@ + Discovery

Discovery

Type: object
No Additional Properties

Type: string

RFC 3339 timestamp the discover telemetry event was generated


Example:

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

Type: enum (of integer)

Major version of the UDMI schema

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

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

diff --git a/docs/schema/event_pointset.html b/docs/schema/event_pointset.html new file mode 100644 index 0000000000..3c51a8cc2a --- /dev/null +++ b/docs/schema/event_pointset.html @@ -0,0 +1,5 @@ + Pointset Event

Pointset Event

Type: object
No Additional Properties

Type: string

RFC 3339 timestamp the telemetry event was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

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

The specific point data reading


Examples:

24.1
+
true
+
4
+
diff --git a/docs/schema/event_system.html b/docs/schema/event_system.html new file mode 100644 index 0000000000..677dcc4b9a --- /dev/null +++ b/docs/schema/event_system.html @@ -0,0 +1,6 @@ + System Event

System Event

Type: object
No Additional Properties

Type: string

RFC 3339 timestamp the event payload was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: array

Each item of this array must be:

Type: object
No Additional Properties

Type: string

A one-line representation of the triggering condition.


Example:

"Point is not writable"
+

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
+

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


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
+
diff --git a/docs/schema/index.html b/docs/schema/index.html index 264afe8562..12674bda4b 100644 --- a/docs/schema/index.html +++ b/docs/schema/index.html @@ -21,6 +21,6 @@

UDMI Schema


- + diff --git a/docs/schema/metadata.html b/docs/schema/metadata.html index 9dad97ceb4..9a8e266480 100644 --- a/docs/schema/metadata.html +++ b/docs/schema/metadata.html @@ -1 +1,9 @@ - Metadata

Metadata

Type: object
No Additional Properties

Type: string

Type: integer

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

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

Type: object
No Additional Properties

Type: enum (of string)

Must be one of:

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

Type: boolean

Type: boolean

Type: object
No Additional Properties

Type: object
No Additional Properties

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

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

Type: object
No Additional Properties

Type: number

Type: number

Type: object
No Additional Properties

Type: object
No Additional Properties

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

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

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

Type: object
No Additional Properties

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

Type: object
No Additional Properties

Type: object

The following properties are required:

  • gateway_id
Type: object

The following properties are required:

  • proxy_ids

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

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

Type: array of string

Each item of this array must be:

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

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-z0-9-]+$
Type: object
No Additional Properties

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: enum (of string)

Taken from standard BACnet engineering units

Must be one of:

  • "Square-meters"
  • "Square-feet"
  • "Milliamperes"
  • "Amperes"
  • "Ohms"
  • "Volts"
  • "Kilo-volts"
  • "Mega-volts"
  • "Volt-amperes"
  • "Kilo-volt-amperes"
  • "Mega-volt-amperes"
  • "Volt-amperes-reactive"
  • "Kilo-volt-amperes-reactive"
  • "Mega-volt-amperes-reactive"
  • "Volt-amperes-reactive-hours"
  • "Degrees-phase"
  • "Power-factor"
  • "Joules"
  • "Kilojoules"
  • "Watt-hours"
  • "Kilowatt-hours"
  • "BTUs"
  • "Therms"
  • "Ton-hours"
  • "Joules-per-kilogram-dry-air"
  • "BTUs-per-pound-dry-air"
  • "Cycles-per-hour"
  • "Cycles-per-minute"
  • "Hertz"
  • "Grams-of-water-per-kilogram-dry-air"
  • "Percent-relative-humidity"
  • "Millimeters"
  • "Meters"
  • "Inches"
  • "Feet"
  • "Watts-per-square-foot"
  • "Watts-per-square-meter"
  • "Lumens"
  • "Luxes"
  • "Foot-candles"
  • "Kilograms"
  • "Pounds-mass"
  • "Tons"
  • "Kilograms-per-second"
  • "Kilograms-per-minute"
  • "Kilograms-per-hour"
  • "Pounds-mass-per-minute"
  • "Pounds-mass-per-hour"
  • "Watts"
  • "Kilowatts"
  • "Megawatts"
  • "BTUs-per-hour"
  • "Horsepower"
  • "Tons-refrigeration"
  • "Pascals"
  • "Kilopascals"
  • "Bars"
  • "Pounds-force-per-square-inch"
  • "Centimeters-of-water"
  • "Inches-of-water"
  • "Millimeters-of-mercury"
  • "Centimeters-of-mercury"
  • "Inches-of-mercury"
  • "Degrees-Celsius"
  • "Degrees-Kelvin"
  • "Degrees-Fahrenheit"
  • "Degree-days-Celsius"
  • "Degree-days-Fahrenheit"
  • "Years"
  • "Months"
  • "Weeks"
  • "Days"
  • "Hours"
  • "Minutes"
  • "Seconds"
  • "Meters-per-second"
  • "Kilometers-per-hour"
  • "Feet-per-second"
  • "Feet-per-minute"
  • "Miles-per-hour"
  • "Cubic-feet"
  • "Cubic-meters"
  • "Imperial-gallons"
  • "Liters"
  • "Us-gallons"
  • "Cubic-feet-per-minute"
  • "Cubic-meters-per-second"
  • "Imperial-gallons-per-minute"
  • "Liters-per-second"
  • "Liters-per-minute"
  • "Us-gallons-per-minute"
  • "Degrees-angular"
  • "Degrees-Celsius-per-hour"
  • "Degrees-Celsius-per-minute"
  • "Degrees-Fahrenheit-per-hour"
  • "Degrees-Fahrenheit-per-minute"
  • "No-units"
  • "Parts-per-million"
  • "Parts-per-billion"
  • "Percent"
  • "Percent-per-second"
  • "Per-minute"
  • "Per-second"
  • "Psi-per-Degree-Fahrenheit"
  • "Radians"
  • "Revolutions-per-minute"
  • "Currency1"
  • "Currency2"
  • "Currency3"
  • "Currency4"
  • "Currency5"
  • "Currency6"
  • "Currency7"
  • "Currency8"
  • "Currency9"
  • "Currency10"
  • "Square-inches"
  • "Square-centimeters"
  • "BTUs-per-pound"
  • "Centimeters"
  • "Pounds-mass-per-second"
  • "Delta-Degrees-Fahrenheit"
  • "Delta-Degrees-Kelvin"
  • "Kilohms"
  • "Megohms"
  • "Millivolts"
  • "Kilojoules-per-kilogram"
  • "Megajoules"
  • "Joules-per-degree-Kelvin"
  • "Joules-per-kilogram-degree-Kelvin"
  • "Kilohertz"
  • "Megahertz"
  • "Per-hour"
  • "Milliwatts"
  • "Hectopascals"
  • "Millibars"
  • "Cubic-meters-per-hour"
  • "Liters-per-hour"
  • "Kilowatt-hours-per-square-meter"
  • "Kilowatt-hours-per-square-foot"
  • "Megajoules-per-square-meter"
  • "Megajoules-per-square-foot"
  • "Watts-per-square-meter-Degree-Kelvin"
  • "Cubic-feet-per-second"
  • "Percent-obscuration-per-foot"
  • "Percent-obscuration-per-meter"
  • "Milliohms"
  • "Megawatt-hours"
  • "Kilo-BTUs"
  • "Mega-BTUs"
  • "Kilojoules-per-kilogram-dry-air"
  • "Megajoules-per-kilogram-dry-air"
  • "Kilojoules-per-degree-Kelvin"
  • "Megajoules-per-degree-Kelvin"
  • "Newton"
  • "Grams-per-second"
  • "Grams-per-minute"
  • "Tons-per-hour"
  • "Kilo-BTUs-per-hour"
  • "Hundredths-seconds"
  • "Milliseconds"
  • "Newton-meters"
  • "Millimeters-per-second"
  • "Millimeters-per-minute"
  • "Meters-per-minute"
  • "Meters-per-hour"
  • "Cubic-meters-per-minute"
  • "Meters-per-second-per-second"
  • "Amperes-per-meter"
  • "Amperes-per-square-meter"
  • "Ampere-square-meters"
  • "Farads"
  • "Henrys"
  • "Ohm-meters"
  • "Siemens"
  • "Siemens-per-meter"
  • "Teslas"
  • "Volts-per-degree-Kelvin"
  • "Volts-per-meter"
  • "Webers"
  • "Candelas"
  • "Candelas-per-square-meter"
  • "Degrees-Kelvin-per-hour"
  • "Degrees-Kelvin-per-minute"
  • "Joule-seconds"
  • "Square-meters-per-Newton"
  • "Kilograms-per-cubic-meter"
  • "Newton-seconds"
  • "Newtons-per-meter"
  • "Watts-per-meter-per-degree-Kelvin"
\ No newline at end of file + Metadata

Metadata

Type: object
No Additional Properties

Type: string

RFC 3339 timestamp the metadata was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: string

Automatically generated field that contains the hash of file contents.

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

Type: object

Information specific to how the device communicates with the cloud.

No Additional Properties

Type: enum (of string)

The key type used for cloud communication.

Must be one of:

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

Type: boolean

Type: boolean

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

Type: object

High-level sytem informaiton about the device.

No Additional Properties

Type: object

Properties the expected physical location of the device.

No Additional Properties

Type: string

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

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

"US-SFO-XYY"
+

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

Type: object
No Additional Properties

Type: number

Type: number

Type: object

Information used to print a physical QR code label.

No Additional Properties

Type: object
No Additional Properties

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

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

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

Type: object
No Additional Properties

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

Type: object
No Additional Properties

Type: object

The following properties are required:

  • gateway_id
Type: object

The following properties are required:

  • proxy_ids

Type: string

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

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

"GAT-100"
+

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

Type: array of string

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

Each item of this array must be:

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

Example:

[
+    "AHU-22"
+]
+

Type: object
No Additional Properties

Type: object
No Additional Properties

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

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

Type: object

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

No Additional Properties

Type: object

Information about a specific point name of the device.

No Additional Properties

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

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

Type: enum (of string)

Taken from standard BACnet engineering units

Must be one of:

  • "Square-meters"
  • "Square-feet"
  • "Milliamperes"
  • "Amperes"
  • "Ohms"
  • "Volts"
  • "Kilo-volts"
  • "Mega-volts"
  • "Volt-amperes"
  • "Kilo-volt-amperes"
  • "Mega-volt-amperes"
  • "Volt-amperes-reactive"
  • "Kilo-volt-amperes-reactive"
  • "Mega-volt-amperes-reactive"
  • "Volt-amperes-reactive-hours"
  • "Degrees-phase"
  • "Power-factor"
  • "Joules"
  • "Kilojoules"
  • "Watt-hours"
  • "Kilowatt-hours"
  • "BTUs"
  • "Therms"
  • "Ton-hours"
  • "Joules-per-kilogram-dry-air"
  • "BTUs-per-pound-dry-air"
  • "Cycles-per-hour"
  • "Cycles-per-minute"
  • "Hertz"
  • "Grams-of-water-per-kilogram-dry-air"
  • "Percent-relative-humidity"
  • "Millimeters"
  • "Meters"
  • "Inches"
  • "Feet"
  • "Watts-per-square-foot"
  • "Watts-per-square-meter"
  • "Lumens"
  • "Luxes"
  • "Foot-candles"
  • "Kilograms"
  • "Pounds-mass"
  • "Tons"
  • "Kilograms-per-second"
  • "Kilograms-per-minute"
  • "Kilograms-per-hour"
  • "Pounds-mass-per-minute"
  • "Pounds-mass-per-hour"
  • "Watts"
  • "Kilowatts"
  • "Megawatts"
  • "BTUs-per-hour"
  • "Horsepower"
  • "Tons-refrigeration"
  • "Pascals"
  • "Kilopascals"
  • "Bars"
  • "Pounds-force-per-square-inch"
  • "Centimeters-of-water"
  • "Inches-of-water"
  • "Millimeters-of-mercury"
  • "Centimeters-of-mercury"
  • "Inches-of-mercury"
  • "Degrees-Celsius"
  • "Degrees-Kelvin"
  • "Degrees-Fahrenheit"
  • "Degree-days-Celsius"
  • "Degree-days-Fahrenheit"
  • "Years"
  • "Months"
  • "Weeks"
  • "Days"
  • "Hours"
  • "Minutes"
  • "Seconds"
  • "Meters-per-second"
  • "Kilometers-per-hour"
  • "Feet-per-second"
  • "Feet-per-minute"
  • "Miles-per-hour"
  • "Cubic-feet"
  • "Cubic-meters"
  • "Imperial-gallons"
  • "Liters"
  • "Us-gallons"
  • "Cubic-feet-per-minute"
  • "Cubic-meters-per-second"
  • "Imperial-gallons-per-minute"
  • "Liters-per-second"
  • "Liters-per-minute"
  • "Us-gallons-per-minute"
  • "Degrees-angular"
  • "Degrees-Celsius-per-hour"
  • "Degrees-Celsius-per-minute"
  • "Degrees-Fahrenheit-per-hour"
  • "Degrees-Fahrenheit-per-minute"
  • "No-units"
  • "Parts-per-million"
  • "Parts-per-billion"
  • "Percent"
  • "Percent-per-second"
  • "Per-minute"
  • "Per-second"
  • "Psi-per-Degree-Fahrenheit"
  • "Radians"
  • "Revolutions-per-minute"
  • "Currency1"
  • "Currency2"
  • "Currency3"
  • "Currency4"
  • "Currency5"
  • "Currency6"
  • "Currency7"
  • "Currency8"
  • "Currency9"
  • "Currency10"
  • "Square-inches"
  • "Square-centimeters"
  • "BTUs-per-pound"
  • "Centimeters"
  • "Pounds-mass-per-second"
  • "Delta-Degrees-Fahrenheit"
  • "Delta-Degrees-Kelvin"
  • "Kilohms"
  • "Megohms"
  • "Millivolts"
  • "Kilojoules-per-kilogram"
  • "Megajoules"
  • "Joules-per-degree-Kelvin"
  • "Joules-per-kilogram-degree-Kelvin"
  • "Kilohertz"
  • "Megahertz"
  • "Per-hour"
  • "Milliwatts"
  • "Hectopascals"
  • "Millibars"
  • "Cubic-meters-per-hour"
  • "Liters-per-hour"
  • "Kilowatt-hours-per-square-meter"
  • "Kilowatt-hours-per-square-foot"
  • "Megajoules-per-square-meter"
  • "Megajoules-per-square-foot"
  • "Watts-per-square-meter-Degree-Kelvin"
  • "Cubic-feet-per-second"
  • "Percent-obscuration-per-foot"
  • "Percent-obscuration-per-meter"
  • "Milliohms"
  • "Megawatt-hours"
  • "Kilo-BTUs"
  • "Mega-BTUs"
  • "Kilojoules-per-kilogram-dry-air"
  • "Megajoules-per-kilogram-dry-air"
  • "Kilojoules-per-degree-Kelvin"
  • "Megajoules-per-degree-Kelvin"
  • "Newton"
  • "Grams-per-second"
  • "Grams-per-minute"
  • "Tons-per-hour"
  • "Kilo-BTUs-per-hour"
  • "Hundredths-seconds"
  • "Milliseconds"
  • "Newton-meters"
  • "Millimeters-per-second"
  • "Millimeters-per-minute"
  • "Meters-per-minute"
  • "Meters-per-hour"
  • "Cubic-meters-per-minute"
  • "Meters-per-second-per-second"
  • "Amperes-per-meter"
  • "Amperes-per-square-meter"
  • "Ampere-square-meters"
  • "Farads"
  • "Henrys"
  • "Ohm-meters"
  • "Siemens"
  • "Siemens-per-meter"
  • "Teslas"
  • "Volts-per-degree-Kelvin"
  • "Volts-per-meter"
  • "Webers"
  • "Candelas"
  • "Candelas-per-square-meter"
  • "Degrees-Kelvin-per-hour"
  • "Degrees-Kelvin-per-minute"
  • "Joule-seconds"
  • "Square-meters-per-Newton"
  • "Kilograms-per-cubic-meter"
  • "Newton-seconds"
  • "Newtons-per-meter"
  • "Watts-per-meter-per-degree-Kelvin"

Type: string

A local network reference for a point, e.g. BACnet address or Modbus register


Examples:

"AI3.Present_Value"
+
"400070"
+
diff --git a/docs/schema/schema_doc.css b/docs/schema/schema_doc.css index 83897d896b..cd1fcd3580 100644 --- a/docs/schema/schema_doc.css +++ b/docs/schema/schema_doc.css @@ -177,4 +177,4 @@ body { .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ -.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ \ No newline at end of file +.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ diff --git a/docs/schema/schema_doc.min.js b/docs/schema/schema_doc.min.js index 0d9c7882d8..58eb600407 100644 --- a/docs/schema/schema_doc.min.js +++ b/docs/schema/schema_doc.min.js @@ -1 +1 @@ -function flashElement(t){myElement=document.getElementById(t),myElement.classList.add("jsfh-animated-property"),setTimeout(function(){myElement.classList.remove("jsfh-animated-property")},1e3)}function setAnchor(t){history.pushState({},"",t)}function anchorOnLoad(){let t=window.location.hash.split("?")[0].split("&")[0];"#"===t[0]&&(t=t.substr(1)),t.length>0&&anchorLink(t)}function anchorLink(t){$("#"+t).parents().addBack().filter(".collapse:not(.show), .tab-pane, [role='tab']").each(function(t){if($(this).hasClass("collapse"))$(this).collapse("show");else if($(this).hasClass("tab-pane")){const t=$("a[href='#"+$(this).attr("id")+"']");t&&t.tab("show")}else"tab"===$(this).attr("role")&&$(this).tab("show")}),setTimeout(function(){let e=document.getElementById(t);e&&(e.scrollIntoView({block:"center",behavior:"smooth"}),setTimeout(function(){flashElement(t)},500))},1e3)}$(document).on("click",'a[href^="#"]',function(t){t.preventDefault(),history.pushState({},"",this.href)}); \ No newline at end of file +function flashElement(t){myElement=document.getElementById(t),myElement.classList.add("jsfh-animated-property"),setTimeout(function(){myElement.classList.remove("jsfh-animated-property")},1e3)}function setAnchor(t){history.pushState({},"",t)}function anchorOnLoad(){let t=window.location.hash.split("?")[0].split("&")[0];"#"===t[0]&&(t=t.substr(1)),t.length>0&&anchorLink(t)}function anchorLink(t){$("#"+t).parents().addBack().filter(".collapse:not(.show), .tab-pane, [role='tab']").each(function(t){if($(this).hasClass("collapse"))$(this).collapse("show");else if($(this).hasClass("tab-pane")){const t=$("a[href='#"+$(this).attr("id")+"']");t&&t.tab("show")}else"tab"===$(this).attr("role")&&$(this).tab("show")}),setTimeout(function(){let e=document.getElementById(t);e&&(e.scrollIntoView({block:"center",behavior:"smooth"}),setTimeout(function(){flashElement(t)},500))},1e3)}$(document).on("click",'a[href^="#"]',function(t){t.preventDefault(),history.pushState({},"",this.href)}); diff --git a/docs/schema/state.html b/docs/schema/state.html index e447dcb1da..d0d0fc217d 100644 --- a/docs/schema/state.html +++ b/docs/schema/state.html @@ -1 +1,11 @@ - State

State

Type: object
No Additional Properties

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: string

Type: object
No Additional Properties

Type: string

Type: object
No Additional Properties

Type: string

Type: string

Type: boolean

Type: object
No Additional Properties

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

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

Type: string

Type: string

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

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: array of string

Each item of this array must be:

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

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: enum (of string)

Must be one of:

  • "applied"
  • "updating"
  • "overridden"
  • "invalid"
  • "failure"
\ No newline at end of file + State

State

Type: object
No Additional Properties

Type: string

RFC 3339 Timestamp the state payload was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: object
No Additional Properties

Type: string

The make and model of the physical device


Examples:

"Delta Controls O3-DIN-SRC"
+
"Arup Gateway"
+

Type: string

The serial number of the physical device


Examples:

"A1B2C3D4"
+
"00001"
+

Type: object
No Additional Properties

Type: string

Type: object

Information about the physical device firmware

No Additional Properties

Type: string

Version of the local firmware

Type: string

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


Example:

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

Type: boolean

Type: object

A map of 'sticky' conditions that are keyed on a value that can be used to manage updates by a particular (device dependent) subsystem.

No Additional Properties

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

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

Type: string

A one-line representation of the triggering condition.


Example:

"Point is not writable"
+

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
+

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


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
Must match regular expression: ^[A-Z]{3}-[1-9][0-9]{0,2}$

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: object

A set of points reporting telemetry data.

No Additional Properties

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: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Must be at most 32 characters long

Type: object

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

No Additional Properties

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

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

Object representation for for a single point

No Additional Properties

Type: enum (of string)

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

Must be one of:

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

Type: object

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

Same definition as entry
diff --git a/schema/common.json b/schema/common.json index 5aa814fc7f..2b9bfa5458 100644 --- a/schema/common.json +++ b/schema/common.json @@ -8,25 +8,35 @@ "additionalProperties": false, "properties": { "message": { - "type": "string" + "description": "A one-line representation of the triggering condition.", + "type": "string", + "examples": ["Point is not writable"] }, "detail": { + "description": "An optional be multi-line entry which can include more detail, e.g. a complete program stack-trace.", "type": "string" }, "category": { + "description": "A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.", "type": "string", - "pattern": "^[a-z][._a-zA-Z]*[a-zA-Z]$" + "pattern": "^[a-z][._a-zA-Z]*[a-zA-Z]$", + "examples": ["state.pointset.points.config.invalid"] }, "timestamp": { + "description": "Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message `timestamp` if the condition is not checked often or is sticky until it's cleared.", "type": "string", - "format": "date-time" + "format": "date-time", + "examples": ["2018-08-26T21:39:28.364Z"] + }, "level": { "$comment": "https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity", + "description": "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).", "type": "integer", "multipleOf": 1, "minimum": 100, - "maximum": 800 + "maximum": 800, + "examples": [600] } }, "required": [ diff --git a/schema/config.json b/schema/config.json index 9fa6c70446..9f5559424d 100644 --- a/schema/config.json +++ b/schema/config.json @@ -9,10 +9,13 @@ ], "properties": { "timestamp": { + "description": "Timestamp the configuration was generated in Zulu time", "type": "string", - "format": "date-time" + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] }, "version": { + "description": "Major version of the UDMI schema", "type": "integer", "minimum": 1, "maximum": 1 diff --git a/schema/config_gateway.json b/schema/config_gateway.json index 0c7b58fbd2..1e55147fbe 100644 --- a/schema/config_gateway.json +++ b/schema/config_gateway.json @@ -8,11 +8,13 @@ ], "properties": { "proxy_ids": { + "description": "An array of all the device IDs which are bound to the device", "type": "array", "items": { "type": "string", "pattern": "^[A-Z]{3}-[1-9][0-9]{0,2}$" - } + }, + "examples": [["AHU-22"]] } } } diff --git a/schema/config_pointset.json b/schema/config_pointset.json index 4113dacbbd..38f2676433 100644 --- a/schema/config_pointset.json +++ b/schema/config_pointset.json @@ -9,20 +9,24 @@ "maxLength": 32 }, "set_value_expiry": { + "description": "An expiry for the the device reverts to its operational state, and sends a state update to notify the cloud of the state change. Read more: ", "type": "string", "format": "date-time" }, "sample_limit_sec": { + "description": "Minimum time between sample updates for the device (including complete and COV updates). Updates more frequent than this should be coalesced into one update.", "type": "integer", "minimum": 1, "maximum": 86400 }, "sample_rate_sec": { + "description": "Maximum time between samples for the device to send out a complete update. It can send out updates more frequently than this.", "type": "integer", "minimum": 1, "maximum": 86400 }, "points": { + "description": "The points defined in this dictionary is the authoritative source indicating the representative points for the device (in both `telemetry` and `state` messages). Read more: ", "additionalProperties": false, "existingJavaType": "java.util.HashMap", "patternProperties": { diff --git a/schema/config_pointset_point.json b/schema/config_pointset_point.json index 93fc7aa74d..8bcb00486f 100644 --- a/schema/config_pointset_point.json +++ b/schema/config_pointset_point.json @@ -8,6 +8,8 @@ "type": "string" }, "set_value": { + "description": "Used for cloud writeback functionality, this field specifies the value for a given point in the device's current units.", + "examples": [22.4] } } } diff --git a/schema/config_system.json b/schema/config_system.json index 27d52a322b..a346a84c8a 100644 --- a/schema/config_system.json +++ b/schema/config_system.json @@ -5,6 +5,7 @@ "additionalProperties": false, "properties": { "min_loglevel": { + "description": "The minimum loglevel for reporting log messages below which log entries should not be sent.", "type": "integer", "minimum": 100, "maximum": 800 diff --git a/schema/envelope.json b/schema/envelope.json index a1e988d6e2..eee23bec14 100644 --- a/schema/envelope.json +++ b/schema/envelope.json @@ -1,5 +1,6 @@ { "title": "Envelope", + "description": "The UDMI `envelope` is not a message itself, per se, but the attributes and other information that is delivered along with a message. Read more: ", "additionalProperties": true, "properties": { "deviceId": { diff --git a/schema/event_discovery.json b/schema/event_discovery.json index 8dc3d513ab..0910006622 100644 --- a/schema/event_discovery.json +++ b/schema/event_discovery.json @@ -5,10 +5,13 @@ "additionalProperties": false, "properties": { "timestamp": { + "description": "RFC 3339 timestamp the discover telemetry event was generated", "type": "string", - "format": "date-time" + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] }, "version": { + "description": "Major version of the UDMI schema", "enum": [ 1 ] diff --git a/schema/event_pointset.json b/schema/event_pointset.json index eff0758d3e..9dfb1dd31b 100644 --- a/schema/event_pointset.json +++ b/schema/event_pointset.json @@ -5,10 +5,13 @@ "additionalProperties": false, "properties": { "timestamp": { + "description": " RFC 3339 timestamp the telemetry event was generated", "type": "string", - "format": "date-time" + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] }, "version": { + "description": "Major version of the UDMI schema", "type": "integer", "minimum": 1, "maximum": 1 diff --git a/schema/event_pointset_point.json b/schema/event_pointset_point.json index 94f7ac820c..9a1b304f70 100644 --- a/schema/event_pointset_point.json +++ b/schema/event_pointset_point.json @@ -5,6 +5,8 @@ "additionalProperties": false, "properties": { "present_value": { + "description": "The specific point data reading", + "examples": [24.1, true, 4] } }, "required": [ diff --git a/schema/event_system.json b/schema/event_system.json index 2622541ec0..a21617cba6 100644 --- a/schema/event_system.json +++ b/schema/event_system.json @@ -5,10 +5,13 @@ "additionalProperties": false, "properties": { "timestamp": { + "description": "RFC 3339 timestamp the event payload was generated", "type": "string", - "format": "date-time" + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] }, "version": { + "description": "Major version of the UDMI schema", "type": "integer", "minimum": 1, "maximum": 1 diff --git a/schema/metadata.json b/schema/metadata.json index 9aba14eb0f..630ee0c414 100644 --- a/schema/metadata.json +++ b/schema/metadata.json @@ -10,15 +10,19 @@ ], "properties": { "timestamp": { + "description": "RFC 3339 timestamp the metadata was generated", "type": "string", - "format": "date-time" + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] }, "version": { + "description": "Major version of the UDMI schema", "type": "integer", "minimum": 1, "maximum": 1 }, "hash": { + "description": "Automatically generated field that contains the hash of file contents.", "type": "string", "pattern": "^[0-9a-z]{8}$" }, diff --git a/schema/metadata_cloud.json b/schema/metadata_cloud.json index 5314d1ee5f..aa614aba30 100644 --- a/schema/metadata_cloud.json +++ b/schema/metadata_cloud.json @@ -1,10 +1,12 @@ { "title": "Cloud Metadata", + "description": "Information specific to how the device communicates with the cloud.", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, "properties": { "auth_type": { + "description": "The key type used for cloud communication.", "enum": [ "ES256", "ES256_X509", @@ -16,6 +18,7 @@ "type": "boolean" }, "is_gateway": { + "description": "If the device functions as an IoT Gateway, proxying for other devices using a single logical connection", "type": "boolean" } }, diff --git a/schema/metadata_gateway.json b/schema/metadata_gateway.json index 8858e26264..60cb3de7ff 100644 --- a/schema/metadata_gateway.json +++ b/schema/metadata_gateway.json @@ -5,19 +5,23 @@ "additionalProperties": false, "properties": { "gateway_id": { + "description": "Present in devices which are proxied by a gateway, this identifies the device ID of the gateway the device is bound to", "type": "string", - "pattern": "^[A-Z]{2,6}-[0-9]{1,6}$" + "pattern": "^[A-Z]{2,6}-[0-9]{1,6}$", + "examples": ["GAT-100"] }, "subsystem": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "proxy_ids": { + "description": "Present in devices which are IoT gateways, this is an array of all the device IDs which are bound to the device", "type": "array", "items": { "type": "string", "pattern": "^[A-Z]{2,6}-[0-9]{1,6}$" - } + }, + "examples": [["AHU-22"]] } }, "oneOf": [ diff --git a/schema/metadata_pointset.json b/schema/metadata_pointset.json index 5e656296f4..8bb364f899 100644 --- a/schema/metadata_pointset.json +++ b/schema/metadata_pointset.json @@ -1,10 +1,12 @@ { "title": "Pointset Metadata", + "description": "Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, "properties": { "points": { + "description": "Information about a specific point name of the device.", "additionalProperties": false, "maxProperties": 150, "existingJavaType": "java.util.HashMap", diff --git a/schema/metadata_pointset_point.json b/schema/metadata_pointset_point.json index d7a65f1c25..934f74ef6a 100644 --- a/schema/metadata_pointset_point.json +++ b/schema/metadata_pointset_point.json @@ -8,7 +8,9 @@ "$ref": "file:units.json#" }, "ref": { - "type": "string" + "description": "A local network reference for a point, e.g. BACnet address or Modbus register", + "type": "string", + "examples": ["AI3.Present_Value", "400070"] } } } diff --git a/schema/metadata_system.json b/schema/metadata_system.json index 1c4b5a8fa0..216747b322 100644 --- a/schema/metadata_system.json +++ b/schema/metadata_system.json @@ -1,16 +1,20 @@ { "title": "System Metadata", + "description": "High-level sytem informaiton about the device.", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, "properties": { "location": { + "description": "Properties the expected physical location of the device.", "type": "object", "additionalProperties": false, "properties": { "site": { + "description": "The site name according to the site model in which a device is installed in", "type": "string", - "pattern": "^[A-Z]{2}-[A-Z]{3}-[A-Z0-9]{2,9}$" + "pattern": "^[A-Z]{2}-[A-Z]{3}-[A-Z0-9]{2,9}$", + "examples": ["US-SFO-XYY"] }, "section": { "type": "string", @@ -38,6 +42,7 @@ ] }, "physical_tag": { + "description": "Information used to print a physical QR code label.", "type": "object", "additionalProperties": false, "properties": { diff --git a/schema/state.json b/schema/state.json index 4d9780488c..e2ff69c284 100644 --- a/schema/state.json +++ b/schema/state.json @@ -10,10 +10,13 @@ ], "properties": { "timestamp": { + "description": "RFC 3339 Timestamp the state payload was generated", "type": "string", - "format": "date-time" + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] }, "version": { + "description": "Major version of the UDMI schema", "type": "integer", "minimum": 1, "maximum": 1 diff --git a/schema/state_pointset.json b/schema/state_pointset.json index 955cf25cc4..b7a4fd6d84 100644 --- a/schema/state_pointset.json +++ b/schema/state_pointset.json @@ -1,18 +1,22 @@ { "title": "Pointset State", + "description": "A set of points reporting telemetry data.", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, "properties": { "state_etag": { + "description": "An identifier which uniquely represents the state, and used by a device avoid race conditions where the incoming config is based off an obsolete state. Additional information on implementation: ", "type": "string", "maxLength": 32 }, "points": { + "description": "Collection of point names, defining the representative point set for this device.", "additionalProperties": false, "existingJavaType": "java.util.HashMap", "patternProperties": { "^[a-z][a-z0-9]*(_[a-z0-9]+)*$": { + "description": "Object representation for for a single point", "$ref": "file:state_pointset_point.json#" } } diff --git a/schema/state_pointset_point.json b/schema/state_pointset_point.json index 78ff561f52..130a720951 100644 --- a/schema/state_pointset_point.json +++ b/schema/state_pointset_point.json @@ -1,10 +1,12 @@ { "title": "Point Pointset State", + "description": "Object representation for for a single point", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, "properties": { "value_state": { + "description": "Optional enumeration indicating the state of the points value. Valid `value_state` settings include:\n* __: No `set_value` _config_ has been specified, the source is device-native.\n* _applied_: The `set_value` _config_ has been successfully applied.\n* _overridden_: The _config_ setting is being overridden by another source.\n* _invalid_: A problem has been identified with the _config_ setting.\n* _failure_: The _config_ is fine, but a problem has been encountered applying the setting.\nWhen the value state indicates an error state, an assosciated status entry should be included", "enum": [ "applied", "updating", @@ -14,6 +16,7 @@ ] }, "status": { + "description": "Optional status information about this point, subject to log severity level", "$ref": "file:common.json#/definitions/entry" } } diff --git a/schema/state_system.json b/schema/state_system.json index b133873376..771b04d878 100644 --- a/schema/state_system.json +++ b/schema/state_system.json @@ -5,10 +5,14 @@ "additionalProperties": false, "properties": { "make_model": { - "type": "string" + "description": "The make and model of the physical device", + "type": "string", + "examples": ["Delta Controls O3-DIN-SRC", "Arup Gateway"] }, "serial_no": { - "type": "string" + "description": "The serial number of the physical device", + "type": "string", + "examples": ["A1B2C3D4", "00001"] }, "auth_key": { "type": "object", @@ -23,10 +27,12 @@ ] }, "firmware": { + "description": "Information about the physical device firmware", "type": "object", "additionalProperties": false, "properties": { "version": { + "description": "Version of the local firmware", "type": "string" } }, @@ -35,13 +41,17 @@ ] }, "last_config": { + "description": "Time from the `timestamp` field of the last successfully parsed `config` message (not the timestamp the message was received/processed).", "type": "string", - "format": "date-time" + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] }, "operational": { + "$comment": "whatis", "type": "boolean" }, "statuses": { + "description": "A map of 'sticky' conditions that are keyed on a value that can be used to manage updates by a particular (device dependent) subsystem.", "type": "object", "additionalProperties": false, "existingJavaType": "java.util.HashMap", From 54b4eaead7799d59fca4288ca705197c6013dc42 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Sep 2021 12:40:28 +0100 Subject: [PATCH 04/10] few more additions, add hashes and hash checking test adding github action A FIX TABS fix tabs but actually save remove java from doc checker test doc check check hashes restore --- .github/workflows/testing.yml | 8 ++++++++ bin/gendocs | 20 ++++++++++++++----- docs/schema/config.html | 4 ++-- docs/schema/envelope.html | 2 +- docs/schema/event.html | 1 + docs/schema/event_discovery.html | 4 ++-- docs/schema/event_pointset.html | 2 +- docs/schema/event_system.html | 2 +- docs/schema/metadata.html | 4 ++-- docs/schema/schema.hash | 34 ++++++++++++++++++++++++++++++++ docs/schema/state.html | 2 +- schema/common.json | 1 + schema/config.json | 3 ++- schema/event_discovery.json | 1 + schema/metadata_gateway.json | 1 + schema/state_gateway.json | 1 + validator_config.json | 7 +++++++ 17 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 docs/schema/event.html create mode 100644 docs/schema/schema.hash create mode 100644 validator_config.json diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 23475d118b..dbd4648c09 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -71,3 +71,11 @@ jobs: run: | echo Pubber output logs: cat pubber.out || true + + docs: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v2 + - name: schema docs + run: bin/gendocs check \ No newline at end of file diff --git a/bin/gendocs b/bin/gendocs index b584a89a98..9db49ae951 100755 --- a/bin/gendocs +++ b/bin/gendocs @@ -1,14 +1,25 @@ -#!/bin/bash +#!/bin/bash -e ROOT_DIR=$(realpath $(dirname $0)/..) cd $ROOT_DIR OUTPUT_DIR=docs/schema +SCHEMA_FILES=`ls schema/*.json` + +if [ "$1" == check ]; then + mkdir -p tmp/schema + sha1sum $SCHEMA_FILES > tmp/schema/schema.hash + diff tmp/schema/schema.hash $OUTPUT_DIR/schema.hash + echo Schema hashes in $OUTPUT_DIR/schema.hash are up-to-date. + git diff --exit-code $OUTPUT_DIR/schema.hash + exit 0 +fi -#Delete existing HTML files rm -rf OUTPUT_DIR -# Make a copy of the schema files into a tmp folder +sha1sum $SCHEMA_FILES > $OUTPUT_DIR/schema.hash + +# Make a copy of the schema files into a tmp folder for any fixes to work with generator rm -rf tmp/schema mkdir -p tmp/schema cp -r schema tmp @@ -24,13 +35,12 @@ done rm -rf tmp/schema -# Convert github doc links to relative links +# Convert github doc links to relative links for hosted/downloaded docs RELATIVE_LINK="..\/" ABSOLUTE_LINK="https:\/\/github.com\/faucetsdn\/udmi\/blob\/master\/docs\/" find $OUTPUT_DIR -type f -exec sed -i '' "s/$ABSOLUTE_LINK/$RELATIVE_LINK/" {} \; # Create index page with links to different schemas -rm $OUTPUT_DIR/index.html cp etc/schema_index_template.html $OUTPUT_DIR/index.html for schema in $schemas; do diff --git a/docs/schema/config.html b/docs/schema/config.html index 888b3bfedf..7879799f27 100644 --- a/docs/schema/config.html +++ b/docs/schema/config.html @@ -1,6 +1,6 @@ - Config

Config

Type: object
No Additional Properties

Type: string

Timestamp the configuration was generated in Zulu time


Example:

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

Config

Type: object

The config block controls a device's intended behavior. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/config.md

No Additional Properties

Type: string

RFC 3339 timestamp the configuration was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: object
No Additional Properties

Type: integer

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

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

Type: object
No Additional Properties

Type: string

Type: object
No Additional Properties

Type: array of string

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

Each item of this array must be:

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

Example:

[
     "AHU-22"
 ]
 

Type: object
No Additional Properties

Type: object

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

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

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

Must be at most 32 characters long

Type: string

An expiry for the the device reverts to its operational state, and sends a state update to notify the cloud of the state change. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Type: integer

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

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

Type: integer

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

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

Type: object

The points defined in this dictionary is the authoritative source indicating the representative points for the device (in both telemetry and state messages). Read more: https://github.com/faucetsdn/udmi/blob/master/docs/pointset.md

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

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


Example:

22.4
-
+
diff --git a/docs/schema/envelope.html b/docs/schema/envelope.html index 7f3499bd79..1424d7bfa9 100644 --- a/docs/schema/envelope.html +++ b/docs/schema/envelope.html @@ -1 +1 @@ - Envelope

Envelope

Type: object

The UDMI envelope is not a message itself, per se, but the attributes and other information that is delivered along with a message. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/envelope.md

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

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

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

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

Type: enum (of string)

Must be one of:

  • "config"
  • "discovery"
  • "system"
  • "metadata"
  • "pointset"
  • "state"

Additional Properties of any type are allowed.

Type: object
+ Envelope

Envelope

Type: object

The UDMI envelope is not a message itself, per se, but the attributes and other information that is delivered along with a message. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/envelope.md

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

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

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

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

Type: enum (of string)

Must be one of:

  • "config"
  • "discovery"
  • "system"
  • "metadata"
  • "pointset"
  • "state"

Additional Properties of any type are allowed.

Type: object
diff --git a/docs/schema/event.html b/docs/schema/event.html new file mode 100644 index 0000000000..f34013545a --- /dev/null +++ b/docs/schema/event.html @@ -0,0 +1 @@ + Event

Event

Type: object

Container object for all event schemas, not directly used.

No Additional Properties

Type: object
No Additional Properties

Type: string

Type: integer

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

Type: array

Each item of this array must be:

Type: object
No Additional Properties

Type: string

Type: string

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

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: integer

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

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

Type: enum (of integer)

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

Type: string
Must match regular expression: ^[-_.:/0-9a-zA-Z]+$
diff --git a/docs/schema/event_discovery.html b/docs/schema/event_discovery.html index b0ff6789a5..41a26acacf 100644 --- a/docs/schema/event_discovery.html +++ b/docs/schema/event_discovery.html @@ -1,2 +1,2 @@ - Discovery

Discovery

Type: object
No Additional Properties

Type: string

RFC 3339 timestamp the discover telemetry event was generated


Example:

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

Type: enum (of integer)

Major version of the UDMI schema

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

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

+ Discovery

Discovery

Type: object

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/discovery.md

No Additional Properties

Type: string

RFC 3339 timestamp the discover telemetry event was generated


Example:

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

Type: enum (of integer)

Major version of the UDMI schema

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

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

diff --git a/docs/schema/event_pointset.html b/docs/schema/event_pointset.html index 3c51a8cc2a..729938c1e2 100644 --- a/docs/schema/event_pointset.html +++ b/docs/schema/event_pointset.html @@ -2,4 +2,4 @@

Type: integer

Major version of the UDMI schema

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

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

The specific point data reading


Examples:

24.1
 
true
 
4
-
+ diff --git a/docs/schema/event_system.html b/docs/schema/event_system.html index 677dcc4b9a..830b81c353 100644 --- a/docs/schema/event_system.html +++ b/docs/schema/event_system.html @@ -3,4 +3,4 @@

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
 

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


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
-
+ diff --git a/docs/schema/metadata.html b/docs/schema/metadata.html index 9a8e266480..b80ad4b7ca 100644 --- a/docs/schema/metadata.html +++ b/docs/schema/metadata.html @@ -1,9 +1,9 @@ Metadata

Metadata

Type: object
No Additional Properties

Type: string

RFC 3339 timestamp the metadata was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: string

Automatically generated field that contains the hash of file contents.

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

Type: object

Information specific to how the device communicates with the cloud.

No Additional Properties

Type: enum (of string)

The key type used for cloud communication.

Must be one of:

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

Type: boolean

Type: boolean

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

Type: object

High-level sytem informaiton about the device.

No Additional Properties

Type: object

Properties the expected physical location of the device.

No Additional Properties

Type: string

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

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

"US-SFO-XYY"
-

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

Type: object
No Additional Properties

Type: number

Type: number

Type: object

Information used to print a physical QR code label.

No Additional Properties

Type: object
No Additional Properties

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

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

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

Type: object
No Additional Properties

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

Type: object
No Additional Properties

Type: object

The following properties are required:

  • gateway_id
Type: object

The following properties are required:

  • proxy_ids

Type: string

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

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

"GAT-100"
+

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

Type: object
No Additional Properties

Type: number

Type: number

Type: object

Information used to print a physical QR code label.

No Additional Properties

Type: object
No Additional Properties

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

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

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

Type: object
No Additional Properties

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

Type: object

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/gateway.md

No Additional Properties

Type: object

The following properties are required:

  • gateway_id
Type: object

The following properties are required:

  • proxy_ids

Type: string

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

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

"GAT-100"
 

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

Type: array of string

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

Each item of this array must be:

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

Example:

[
     "AHU-22"
 ]
 

Type: object
No Additional Properties

Type: object
No Additional Properties

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

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

Type: object

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

No Additional Properties

Type: object

Information about a specific point name of the device.

No Additional Properties

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

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

Type: enum (of string)

Taken from standard BACnet engineering units

Must be one of:

  • "Square-meters"
  • "Square-feet"
  • "Milliamperes"
  • "Amperes"
  • "Ohms"
  • "Volts"
  • "Kilo-volts"
  • "Mega-volts"
  • "Volt-amperes"
  • "Kilo-volt-amperes"
  • "Mega-volt-amperes"
  • "Volt-amperes-reactive"
  • "Kilo-volt-amperes-reactive"
  • "Mega-volt-amperes-reactive"
  • "Volt-amperes-reactive-hours"
  • "Degrees-phase"
  • "Power-factor"
  • "Joules"
  • "Kilojoules"
  • "Watt-hours"
  • "Kilowatt-hours"
  • "BTUs"
  • "Therms"
  • "Ton-hours"
  • "Joules-per-kilogram-dry-air"
  • "BTUs-per-pound-dry-air"
  • "Cycles-per-hour"
  • "Cycles-per-minute"
  • "Hertz"
  • "Grams-of-water-per-kilogram-dry-air"
  • "Percent-relative-humidity"
  • "Millimeters"
  • "Meters"
  • "Inches"
  • "Feet"
  • "Watts-per-square-foot"
  • "Watts-per-square-meter"
  • "Lumens"
  • "Luxes"
  • "Foot-candles"
  • "Kilograms"
  • "Pounds-mass"
  • "Tons"
  • "Kilograms-per-second"
  • "Kilograms-per-minute"
  • "Kilograms-per-hour"
  • "Pounds-mass-per-minute"
  • "Pounds-mass-per-hour"
  • "Watts"
  • "Kilowatts"
  • "Megawatts"
  • "BTUs-per-hour"
  • "Horsepower"
  • "Tons-refrigeration"
  • "Pascals"
  • "Kilopascals"
  • "Bars"
  • "Pounds-force-per-square-inch"
  • "Centimeters-of-water"
  • "Inches-of-water"
  • "Millimeters-of-mercury"
  • "Centimeters-of-mercury"
  • "Inches-of-mercury"
  • "Degrees-Celsius"
  • "Degrees-Kelvin"
  • "Degrees-Fahrenheit"
  • "Degree-days-Celsius"
  • "Degree-days-Fahrenheit"
  • "Years"
  • "Months"
  • "Weeks"
  • "Days"
  • "Hours"
  • "Minutes"
  • "Seconds"
  • "Meters-per-second"
  • "Kilometers-per-hour"
  • "Feet-per-second"
  • "Feet-per-minute"
  • "Miles-per-hour"
  • "Cubic-feet"
  • "Cubic-meters"
  • "Imperial-gallons"
  • "Liters"
  • "Us-gallons"
  • "Cubic-feet-per-minute"
  • "Cubic-meters-per-second"
  • "Imperial-gallons-per-minute"
  • "Liters-per-second"
  • "Liters-per-minute"
  • "Us-gallons-per-minute"
  • "Degrees-angular"
  • "Degrees-Celsius-per-hour"
  • "Degrees-Celsius-per-minute"
  • "Degrees-Fahrenheit-per-hour"
  • "Degrees-Fahrenheit-per-minute"
  • "No-units"
  • "Parts-per-million"
  • "Parts-per-billion"
  • "Percent"
  • "Percent-per-second"
  • "Per-minute"
  • "Per-second"
  • "Psi-per-Degree-Fahrenheit"
  • "Radians"
  • "Revolutions-per-minute"
  • "Currency1"
  • "Currency2"
  • "Currency3"
  • "Currency4"
  • "Currency5"
  • "Currency6"
  • "Currency7"
  • "Currency8"
  • "Currency9"
  • "Currency10"
  • "Square-inches"
  • "Square-centimeters"
  • "BTUs-per-pound"
  • "Centimeters"
  • "Pounds-mass-per-second"
  • "Delta-Degrees-Fahrenheit"
  • "Delta-Degrees-Kelvin"
  • "Kilohms"
  • "Megohms"
  • "Millivolts"
  • "Kilojoules-per-kilogram"
  • "Megajoules"
  • "Joules-per-degree-Kelvin"
  • "Joules-per-kilogram-degree-Kelvin"
  • "Kilohertz"
  • "Megahertz"
  • "Per-hour"
  • "Milliwatts"
  • "Hectopascals"
  • "Millibars"
  • "Cubic-meters-per-hour"
  • "Liters-per-hour"
  • "Kilowatt-hours-per-square-meter"
  • "Kilowatt-hours-per-square-foot"
  • "Megajoules-per-square-meter"
  • "Megajoules-per-square-foot"
  • "Watts-per-square-meter-Degree-Kelvin"
  • "Cubic-feet-per-second"
  • "Percent-obscuration-per-foot"
  • "Percent-obscuration-per-meter"
  • "Milliohms"
  • "Megawatt-hours"
  • "Kilo-BTUs"
  • "Mega-BTUs"
  • "Kilojoules-per-kilogram-dry-air"
  • "Megajoules-per-kilogram-dry-air"
  • "Kilojoules-per-degree-Kelvin"
  • "Megajoules-per-degree-Kelvin"
  • "Newton"
  • "Grams-per-second"
  • "Grams-per-minute"
  • "Tons-per-hour"
  • "Kilo-BTUs-per-hour"
  • "Hundredths-seconds"
  • "Milliseconds"
  • "Newton-meters"
  • "Millimeters-per-second"
  • "Millimeters-per-minute"
  • "Meters-per-minute"
  • "Meters-per-hour"
  • "Cubic-meters-per-minute"
  • "Meters-per-second-per-second"
  • "Amperes-per-meter"
  • "Amperes-per-square-meter"
  • "Ampere-square-meters"
  • "Farads"
  • "Henrys"
  • "Ohm-meters"
  • "Siemens"
  • "Siemens-per-meter"
  • "Teslas"
  • "Volts-per-degree-Kelvin"
  • "Volts-per-meter"
  • "Webers"
  • "Candelas"
  • "Candelas-per-square-meter"
  • "Degrees-Kelvin-per-hour"
  • "Degrees-Kelvin-per-minute"
  • "Joule-seconds"
  • "Square-meters-per-Newton"
  • "Kilograms-per-cubic-meter"
  • "Newton-seconds"
  • "Newtons-per-meter"
  • "Watts-per-meter-per-degree-Kelvin"

Type: string

A local network reference for a point, e.g. BACnet address or Modbus register


Examples:

"AI3.Present_Value"
 
"400070"
-
+ diff --git a/docs/schema/schema.hash b/docs/schema/schema.hash new file mode 100644 index 0000000000..b9a836c0cf --- /dev/null +++ b/docs/schema/schema.hash @@ -0,0 +1,34 @@ +ed19b2d7058efec986e878215f2f2d369e35dbb5 schema/common.json +d2e9be6a5719802cef01d40e5727ab1064502d31 schema/config.json +7d2d3a38be924b275198e45d69a16d3a955bbe60 schema/config_blobset.json +153365b72627741768008dd8d135eef052b5e08d schema/config_blobset_blob.json +d7a512113ebf00f88cc2c647d506ea8e39423b4f schema/config_gateway.json +0531e4b9eb9dc4285171136e7f994b8a31739961 schema/config_localnet.json +f1cd2657a716337c7b40b834a4578b8f934c6131 schema/config_pointset.json +24ceee92930b0d65d0ddbc56f2059664673437c1 schema/config_pointset_point.json +bfaf5ac4b7c53a6039a44140a88753bf13a829e1 schema/config_system.json +e725fac71ca69ee42362e215fef0e49ef081dd98 schema/envelope.json +69bae680e77ed287646519afc93be17e90d938a9 schema/event.json +5a452ec88cbc294b1c6acdc1bcd4c0b77a06a469 schema/event_audit.json +b6ab269ab1690e6b91fe06f224b649748a91d611 schema/event_discovery.json +193eddf2cf5f2326a504a51bbf4de3f1b67f75c8 schema/event_discovery_family.json +9c95aadf9c020bd2846facf1212ba6e3c8f0b69a schema/event_pointset.json +17d8d3c2fb54bee578c09724bb6ddca08651b839 schema/event_pointset_point.json +ca0a9e90980ff73e5f0a216f35b0cdd0f1259f1f schema/event_system.json +ce0a3f203d554bbd331f36471adf0ca05795012a schema/metadata.json +7bc39e17e91b908694e02f899d5251a1758f99ae schema/metadata_cloud.json +bf72ac1a0c7e11cbb139abd6192327a61c8cf213 schema/metadata_gateway.json +088ff40591c8b723497d8c6b741faf7b5f668acb schema/metadata_localnet.json +ac140607d59df5fa3db25ae0dd70d44b817489af schema/metadata_localnet_subsystem.json +31fc098b5ed1783b5dfa5b42af1f3ba489c86675 schema/metadata_pointset.json +0c38b158346fd63e44ac3940155a4fcca4265dfc schema/metadata_pointset_point.json +19880c00da95e6e4a4287614c7b55161c939b7ee schema/metadata_system.json +8575ab8f89f0a68872a3404721b525c2ee1a00b4 schema/properties.json +4873a7ef012223e820bc326d8cb918da4180adbc schema/state.json +2e370cd922a07f962278783c983bc05661e013ce schema/state_blobset.json +46fe9664853600711f4c7eb87244e448cae7d57f schema/state_blobset_blob.json +2ad70606d38b23d69909e1538040ef314ebdac67 schema/state_gateway.json +fd4e8237146f31f16017bd0aa72d2584666852a9 schema/state_pointset.json +1ead42929e14de55a48ce9ee7d3d13ce8dc9686d schema/state_pointset_point.json +1c95a14054e43334de4eea217a2e18db69c5f896 schema/state_system.json +d435fc6b94c3e19cd13535d3a1371af367aab355 schema/units.json diff --git a/docs/schema/state.html b/docs/schema/state.html index d0d0fc217d..9cad270b59 100644 --- a/docs/schema/state.html +++ b/docs/schema/state.html @@ -8,4 +8,4 @@

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
 

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


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
Must match regular expression: ^[A-Z]{3}-[1-9][0-9]{0,2}$

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: object

A set of points reporting telemetry data.

No Additional Properties

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: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Must be at most 32 characters long

Type: object

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

No Additional Properties

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

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

Object representation for for a single point

No Additional Properties

Type: enum (of string)

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

Must be one of:

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

Type: object

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

Same definition as entry
+

Type: object

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/gateway.md

No Additional Properties

Type: array of string

Each item of this array must be:

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

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: object

A set of points reporting telemetry data.

No Additional Properties

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: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Must be at most 32 characters long

Type: object

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

No Additional Properties

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

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

Object representation for for a single point

No Additional Properties

Type: enum (of string)

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

Must be one of:

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

Type: object

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

Same definition as entry
diff --git a/schema/common.json b/schema/common.json index 2b9bfa5458..05e8dd9536 100644 --- a/schema/common.json +++ b/schema/common.json @@ -1,5 +1,6 @@ { "title": "Common", + "$comment": "test hash", "$schema": "http://json-schema.org/draft-04/schema#", "definitions": { "entry": { diff --git a/schema/config.json b/schema/config.json index 9f5559424d..df9428daeb 100644 --- a/schema/config.json +++ b/schema/config.json @@ -1,5 +1,6 @@ { "title": "Config", + "description": "The config block controls a device's intended behavior. Read more: ", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, @@ -9,7 +10,7 @@ ], "properties": { "timestamp": { - "description": "Timestamp the configuration was generated in Zulu time", + "description": "RFC 3339 timestamp the configuration was generated", "type": "string", "format": "date-time", "examples": ["2019-01-17T14:02:29.364Z"] diff --git a/schema/event_discovery.json b/schema/event_discovery.json index 0910006622..b4af4ab6cd 100644 --- a/schema/event_discovery.json +++ b/schema/event_discovery.json @@ -1,5 +1,6 @@ { "title": "Discovery", + "description": "Read more: ", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, diff --git a/schema/metadata_gateway.json b/schema/metadata_gateway.json index 60cb3de7ff..16c457ed21 100644 --- a/schema/metadata_gateway.json +++ b/schema/metadata_gateway.json @@ -1,5 +1,6 @@ { "title": "Gateway Metadata", + "description": "Read more: ", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, diff --git a/schema/state_gateway.json b/schema/state_gateway.json index d402fb81e6..16d1d1d31a 100644 --- a/schema/state_gateway.json +++ b/schema/state_gateway.json @@ -1,5 +1,6 @@ { "title": "Gateway State", + "description": "Read more: ", "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "additionalProperties": false, diff --git a/validator_config.json b/validator_config.json new file mode 100644 index 0000000000..7b159e59b3 --- /dev/null +++ b/validator_config.json @@ -0,0 +1,7 @@ +{ + "project_id": "udmi-nes", + "site_model": "udmi_site_model", + "device_id": "AHU-1", + "serial_no": "sequencer-3861", + "key_file": "udmi_site_model/devices/AHU-1/rsa_private.pkcs8" +} From df5469fe7d0ad7109d1ea342560fe480163151ad Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Tue, 7 Sep 2021 13:00:54 +0100 Subject: [PATCH 05/10] change to draft 07 because we are using annotations --- schema/common.json | 3 +-- schema/config.json | 2 +- schema/config_blobset.json | 2 +- schema/config_blobset_blob.json | 2 +- schema/config_gateway.json | 2 +- schema/config_localnet.json | 2 +- schema/config_pointset.json | 2 +- schema/config_pointset_point.json | 2 +- schema/config_system.json | 2 +- schema/event.json | 2 +- schema/event_audit.json | 2 +- schema/event_discovery.json | 2 +- schema/event_discovery_family.json | 2 +- schema/event_pointset.json | 2 +- schema/event_pointset_point.json | 2 +- schema/event_system.json | 2 +- schema/metadata.json | 2 +- schema/metadata_cloud.json | 2 +- schema/metadata_gateway.json | 2 +- schema/metadata_localnet.json | 2 +- schema/metadata_localnet_subsystem.json | 2 +- schema/metadata_pointset.json | 2 +- schema/metadata_pointset_point.json | 2 +- schema/metadata_system.json | 2 +- schema/properties.json | 2 +- schema/state.json | 2 +- schema/state_blobset.json | 2 +- schema/state_blobset_blob.json | 2 +- schema/state_gateway.json | 2 +- schema/state_pointset.json | 2 +- schema/state_pointset_point.json | 2 +- schema/state_system.json | 2 +- 32 files changed, 32 insertions(+), 33 deletions(-) diff --git a/schema/common.json b/schema/common.json index 05e8dd9536..787de6d964 100644 --- a/schema/common.json +++ b/schema/common.json @@ -1,7 +1,6 @@ { "title": "Common", - "$comment": "test hash", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "entry": { "title": "Entry", diff --git a/schema/config.json b/schema/config.json index df9428daeb..f0bb87b6d5 100644 --- a/schema/config.json +++ b/schema/config.json @@ -2,7 +2,7 @@ "title": "Config", "description": "The config block controls a device's intended behavior. Read more: ", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "required": [ "timestamp", diff --git a/schema/config_blobset.json b/schema/config_blobset.json index 271c01c090..a45eb3aff5 100644 --- a/schema/config_blobset.json +++ b/schema/config_blobset.json @@ -1,7 +1,7 @@ { "title": "Blobset Config", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "blobs": { diff --git a/schema/config_blobset_blob.json b/schema/config_blobset_blob.json index 67d130483d..c2aecbfa8a 100644 --- a/schema/config_blobset_blob.json +++ b/schema/config_blobset_blob.json @@ -1,7 +1,7 @@ { "title": "Blob Blobset Config", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "stage": { diff --git a/schema/config_gateway.json b/schema/config_gateway.json index 1e55147fbe..5124c12b08 100644 --- a/schema/config_gateway.json +++ b/schema/config_gateway.json @@ -1,7 +1,7 @@ { "title": "Gateway Config", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "required": [ "proxy_ids" diff --git a/schema/config_localnet.json b/schema/config_localnet.json index 37f7f0fec7..43d91020e6 100644 --- a/schema/config_localnet.json +++ b/schema/config_localnet.json @@ -1,7 +1,7 @@ { "title": "Localnet Config", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "subsystem": { diff --git a/schema/config_pointset.json b/schema/config_pointset.json index 38f2676433..636938813c 100644 --- a/schema/config_pointset.json +++ b/schema/config_pointset.json @@ -1,7 +1,7 @@ { "title": "Pointset Config", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "state_etag": { diff --git a/schema/config_pointset_point.json b/schema/config_pointset_point.json index 8bcb00486f..96cef88c04 100644 --- a/schema/config_pointset_point.json +++ b/schema/config_pointset_point.json @@ -1,7 +1,7 @@ { "title": "Point Pointset Config", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "ref": { diff --git a/schema/config_system.json b/schema/config_system.json index a346a84c8a..5d007820b3 100644 --- a/schema/config_system.json +++ b/schema/config_system.json @@ -1,7 +1,7 @@ { "title": "System Config", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "min_loglevel": { diff --git a/schema/event.json b/schema/event.json index 94f03020bc..ccc54e6c38 100644 --- a/schema/event.json +++ b/schema/event.json @@ -2,7 +2,7 @@ "title": "Event", "description": "Container object for all event schemas, not directly used.", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "system": { diff --git a/schema/event_audit.json b/schema/event_audit.json index ed74ae53f9..42c3694984 100644 --- a/schema/event_audit.json +++ b/schema/event_audit.json @@ -1,7 +1,7 @@ { "title": "Audit", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "timestamp": { diff --git a/schema/event_discovery.json b/schema/event_discovery.json index b4af4ab6cd..f9d6647a6e 100644 --- a/schema/event_discovery.json +++ b/schema/event_discovery.json @@ -2,7 +2,7 @@ "title": "Discovery", "description": "Read more: ", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "timestamp": { diff --git a/schema/event_discovery_family.json b/schema/event_discovery_family.json index 725165db76..10d5d07d95 100644 --- a/schema/event_discovery_family.json +++ b/schema/event_discovery_family.json @@ -1,7 +1,7 @@ { "title": "Family Discovery Event", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "id": { diff --git a/schema/event_pointset.json b/schema/event_pointset.json index 9dfb1dd31b..0141a24baa 100644 --- a/schema/event_pointset.json +++ b/schema/event_pointset.json @@ -1,7 +1,7 @@ { "title": "Pointset Event", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "timestamp": { diff --git a/schema/event_pointset_point.json b/schema/event_pointset_point.json index 9a1b304f70..7aaeb2c013 100644 --- a/schema/event_pointset_point.json +++ b/schema/event_pointset_point.json @@ -1,7 +1,7 @@ { "title": "Point Pointset Event", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "present_value": { diff --git a/schema/event_system.json b/schema/event_system.json index a21617cba6..8b69538e78 100644 --- a/schema/event_system.json +++ b/schema/event_system.json @@ -1,7 +1,7 @@ { "title": "System Event", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "timestamp": { diff --git a/schema/metadata.json b/schema/metadata.json index 630ee0c414..4130ade88c 100644 --- a/schema/metadata.json +++ b/schema/metadata.json @@ -1,7 +1,7 @@ { "title": "Metadata", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "required": [ "timestamp", diff --git a/schema/metadata_cloud.json b/schema/metadata_cloud.json index aa614aba30..26b3940b67 100644 --- a/schema/metadata_cloud.json +++ b/schema/metadata_cloud.json @@ -2,7 +2,7 @@ "title": "Cloud Metadata", "description": "Information specific to how the device communicates with the cloud.", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "auth_type": { diff --git a/schema/metadata_gateway.json b/schema/metadata_gateway.json index 16c457ed21..940c042336 100644 --- a/schema/metadata_gateway.json +++ b/schema/metadata_gateway.json @@ -2,7 +2,7 @@ "title": "Gateway Metadata", "description": "Read more: ", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "gateway_id": { diff --git a/schema/metadata_localnet.json b/schema/metadata_localnet.json index c0f65eb321..f10244edb0 100644 --- a/schema/metadata_localnet.json +++ b/schema/metadata_localnet.json @@ -1,7 +1,7 @@ { "title": "Localnet Metadata", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "subsystem": { diff --git a/schema/metadata_localnet_subsystem.json b/schema/metadata_localnet_subsystem.json index b834a05aaf..c6b334fe80 100644 --- a/schema/metadata_localnet_subsystem.json +++ b/schema/metadata_localnet_subsystem.json @@ -1,7 +1,7 @@ { "title": "Subsystem Localnet Metadata", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "local_id": { diff --git a/schema/metadata_pointset.json b/schema/metadata_pointset.json index 8bb364f899..4c5c6dee73 100644 --- a/schema/metadata_pointset.json +++ b/schema/metadata_pointset.json @@ -2,7 +2,7 @@ "title": "Pointset Metadata", "description": "Pointset representing the abstract system expectation for what the device should be doing, and how it should be configured and operated. This block specifies the expected points that a device holds", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "points": { diff --git a/schema/metadata_pointset_point.json b/schema/metadata_pointset_point.json index 934f74ef6a..d87f83053c 100644 --- a/schema/metadata_pointset_point.json +++ b/schema/metadata_pointset_point.json @@ -1,7 +1,7 @@ { "title": "Point Pointset Metadata", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "units": { diff --git a/schema/metadata_system.json b/schema/metadata_system.json index 216747b322..ddd77f60c3 100644 --- a/schema/metadata_system.json +++ b/schema/metadata_system.json @@ -2,7 +2,7 @@ "title": "System Metadata", "description": "High-level sytem informaiton about the device.", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "location": { diff --git a/schema/properties.json b/schema/properties.json index 99e18356cd..e49a8c9faa 100644 --- a/schema/properties.json +++ b/schema/properties.json @@ -1,7 +1,7 @@ { "title": "Properties", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "required": [ "key_type", diff --git a/schema/state.json b/schema/state.json index e2ff69c284..b5093d46be 100644 --- a/schema/state.json +++ b/schema/state.json @@ -1,7 +1,7 @@ { "title": "State", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "required": [ "timestamp", diff --git a/schema/state_blobset.json b/schema/state_blobset.json index 692fa59d03..004747e689 100644 --- a/schema/state_blobset.json +++ b/schema/state_blobset.json @@ -1,7 +1,7 @@ { "title": "Blobset State", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "state_etag": { diff --git a/schema/state_blobset_blob.json b/schema/state_blobset_blob.json index e5aac3d59a..b8120ec07d 100644 --- a/schema/state_blobset_blob.json +++ b/schema/state_blobset_blob.json @@ -1,7 +1,7 @@ { "title": "Blob Blobset State", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "stage": { diff --git a/schema/state_gateway.json b/schema/state_gateway.json index 16d1d1d31a..79ace4551c 100644 --- a/schema/state_gateway.json +++ b/schema/state_gateway.json @@ -2,7 +2,7 @@ "title": "Gateway State", "description": "Read more: ", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "required": [ "error_ids" diff --git a/schema/state_pointset.json b/schema/state_pointset.json index b7a4fd6d84..c6e40cba45 100644 --- a/schema/state_pointset.json +++ b/schema/state_pointset.json @@ -2,7 +2,7 @@ "title": "Pointset State", "description": "A set of points reporting telemetry data.", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "state_etag": { diff --git a/schema/state_pointset_point.json b/schema/state_pointset_point.json index 130a720951..702e8514f3 100644 --- a/schema/state_pointset_point.json +++ b/schema/state_pointset_point.json @@ -2,7 +2,7 @@ "title": "Point Pointset State", "description": "Object representation for for a single point", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "value_state": { diff --git a/schema/state_system.json b/schema/state_system.json index 771b04d878..4702ca372b 100644 --- a/schema/state_system.json +++ b/schema/state_system.json @@ -1,7 +1,7 @@ { "title": "System State", "type": "object", - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "make_model": { From 53e39100ba08ee1476a10298f6a5c1015bcde155 Mon Sep 17 00:00:00 2001 From: Noureddine Date: Tue, 7 Sep 2021 13:13:57 +0100 Subject: [PATCH 06/10] Delete event.html --- docs/schema/event.html | 1 - 1 file changed, 1 deletion(-) delete mode 100644 docs/schema/event.html diff --git a/docs/schema/event.html b/docs/schema/event.html deleted file mode 100644 index f34013545a..0000000000 --- a/docs/schema/event.html +++ /dev/null @@ -1 +0,0 @@ - Event

Event

Type: object

Container object for all event schemas, not directly used.

No Additional Properties

Type: object
No Additional Properties

Type: string

Type: integer

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

Type: array

Each item of this array must be:

Type: object
No Additional Properties

Type: string

Type: string

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

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: integer

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

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

Type: enum (of integer)

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

Type: string
Must match regular expression: ^[-_.:/0-9a-zA-Z]+$
From 58a9a92c9f6306cc3eee9115637a912233935a83 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Wed, 8 Sep 2021 22:46:02 +0100 Subject: [PATCH 07/10] small fixes --- bin/gendocs | 37 ++++++++++--------- bin/gendocs.py | 11 +++--- docs/schema/envelope.html | 1 - docs/schema/event.html | 1 - docs/schema/event_pointset.html | 5 --- docs/schema/schema.hash | 34 ----------------- docs/schema/state.html | 11 ------ {docs/schema => gencode/docs}/config.html | 6 +-- gencode/docs/envelope.html | 1 + .../docs}/event_discovery.html | 4 +- gencode/docs/event_pointset.html | 5 +++ .../schema => gencode/docs}/event_system.html | 2 +- {docs/schema => gencode/docs}/index.html | 0 {docs/schema => gencode/docs}/metadata.html | 6 +-- gencode/docs/schema.hash | 34 +++++++++++++++++ {docs/schema => gencode/docs}/schema_doc.css | 2 +- .../schema => gencode/docs}/schema_doc.min.js | 2 +- gencode/docs/state.html | 19 ++++++++++ schema/event_pointset.json | 2 + schema/event_pointset_point.json | 1 + schema/metadata_pointset_point.json | 2 + validator_config.json | 7 ---- 22 files changed, 101 insertions(+), 92 deletions(-) delete mode 100644 docs/schema/envelope.html delete mode 100644 docs/schema/event.html delete mode 100644 docs/schema/event_pointset.html delete mode 100644 docs/schema/schema.hash delete mode 100644 docs/schema/state.html rename {docs/schema => gencode/docs}/config.html (70%) create mode 100644 gencode/docs/envelope.html rename {docs/schema => gencode/docs}/event_discovery.html (85%) create mode 100644 gencode/docs/event_pointset.html rename {docs/schema => gencode/docs}/event_system.html (99%) rename {docs/schema => gencode/docs}/index.html (100%) rename {docs/schema => gencode/docs}/metadata.html (73%) create mode 100644 gencode/docs/schema.hash rename {docs/schema => gencode/docs}/schema_doc.css (99%) rename {docs/schema => gencode/docs}/schema_doc.min.js (97%) create mode 100644 gencode/docs/state.html delete mode 100644 validator_config.json diff --git a/bin/gendocs b/bin/gendocs index 9db49ae951..7295eae777 100755 --- a/bin/gendocs +++ b/bin/gendocs @@ -3,42 +3,45 @@ ROOT_DIR=$(realpath $(dirname $0)/..) cd $ROOT_DIR -OUTPUT_DIR=docs/schema -SCHEMA_FILES=`ls schema/*.json` +OUTPUT_DIR=$ROOT_DIR/gencode/docs +TMP_DIR=$ROOT_DIR/tmp/schema + +schema_files=`ls schema/*.json` if [ "$1" == check ]; then - mkdir -p tmp/schema - sha1sum $SCHEMA_FILES > tmp/schema/schema.hash - diff tmp/schema/schema.hash $OUTPUT_DIR/schema.hash + mkdir -p $TMP_DIR + sha1sum $schema_files > $TMP_DIR/schema.hash + diff $TMP_DIR/schema.hash $OUTPUT_DIR/schema.hash echo Schema hashes in $OUTPUT_DIR/schema.hash are up-to-date. git diff --exit-code $OUTPUT_DIR/schema.hash exit 0 fi -rm -rf OUTPUT_DIR +rm -rf $OUTPUT_DIR +mkdir -p $OUTPUT_DIR -sha1sum $SCHEMA_FILES > $OUTPUT_DIR/schema.hash +sha1sum $schema_files > $OUTPUT_DIR/schema.hash -# Make a copy of the schema files into a tmp folder for any fixes to work with generator -rm -rf tmp/schema -mkdir -p tmp/schema -cp -r schema tmp +# Make a copy of the schema files into a tmp folder for any pre generator fixes +rm -rf $TMP_DIR +mkdir -p $TMP_DIR +cp -r schema/. $TMP_DIR # Remove file: prefix from references so document generator works -find tmp/schema -type f -exec sed -i '' 's/file://' {} \; +find $TMP_DIR -type f -exec sed -i '' 's/file://' {} \; schemas="state event_system event_pointset event_discovery config metadata envelope" for schema in $schemas; do - python3 bin/gendocs.py $schema $ROOT_DIR $OUTPUT_DIR + python3 bin/gendocs.py $schema $TMP_DIR $OUTPUT_DIR done -rm -rf tmp/schema +rm -rf $TMP_DIR # Convert github doc links to relative links for hosted/downloaded docs -RELATIVE_LINK="..\/" -ABSOLUTE_LINK="https:\/\/github.com\/faucetsdn\/udmi\/blob\/master\/docs\/" -find $OUTPUT_DIR -type f -exec sed -i '' "s/$ABSOLUTE_LINK/$RELATIVE_LINK/" {} \; +#RELATIVE_LINK="..\/" +#find $OUTPUT_DIR -type f -exec sed -i '' "s/$ABSOLUTE_LINK/$RELATIVE_LINK/" {} \; +#ABSOLUTE_LINK="https:\/\/github.com\/faucetsdn\/udmi\/blob\/master\/docs\/" # Create index page with links to different schemas cp etc/schema_index_template.html $OUTPUT_DIR/index.html diff --git a/bin/gendocs.py b/bin/gendocs.py index 06424b97fd..7401a73e7c 100644 --- a/bin/gendocs.py +++ b/bin/gendocs.py @@ -5,13 +5,14 @@ config = GenerationConfiguration(copy_css=True, expand_buttons=True, - minify=False) + minify=False, + link_to_reused_ref=False) schema = sys.argv[1] -root_dir = sys.argv[2] +source_dir = sys.argv[2] output_dir = sys.argv[3] -file_name = root_dir + "/tmp/schema/" + schema + ".json" -output_file = root_dir + "/" + output_dir + "/" + schema + ".html" +schema_path = source_dir + "/" + schema + ".json" +output_path = output_dir + "/" + schema + ".html" -generate_from_filename(file_name, output_file, config=config) \ No newline at end of file +generate_from_filename(schema_path, output_path, config=config) diff --git a/docs/schema/envelope.html b/docs/schema/envelope.html deleted file mode 100644 index 1424d7bfa9..0000000000 --- a/docs/schema/envelope.html +++ /dev/null @@ -1 +0,0 @@ - Envelope

Envelope

Type: object

The UDMI envelope is not a message itself, per se, but the attributes and other information that is delivered along with a message. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/envelope.md

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

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

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

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

Type: enum (of string)

Must be one of:

  • "config"
  • "discovery"
  • "system"
  • "metadata"
  • "pointset"
  • "state"

Additional Properties of any type are allowed.

Type: object
diff --git a/docs/schema/event.html b/docs/schema/event.html deleted file mode 100644 index f34013545a..0000000000 --- a/docs/schema/event.html +++ /dev/null @@ -1 +0,0 @@ - Event

Event

Type: object

Container object for all event schemas, not directly used.

No Additional Properties

Type: object
No Additional Properties

Type: string

Type: integer

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

Type: array

Each item of this array must be:

Type: object
No Additional Properties

Type: string

Type: string

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

Type: string

Type: integer

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

Type: object
No Additional Properties

Type: string

Type: integer

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

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

Type: enum (of integer)

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

Type: string
Must match regular expression: ^[-_.:/0-9a-zA-Z]+$
diff --git a/docs/schema/event_pointset.html b/docs/schema/event_pointset.html deleted file mode 100644 index 729938c1e2..0000000000 --- a/docs/schema/event_pointset.html +++ /dev/null @@ -1,5 +0,0 @@ - Pointset Event

Pointset Event

Type: object
No Additional Properties

Type: string

RFC 3339 timestamp the telemetry event was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

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

The specific point data reading


Examples:

24.1
-
true
-
4
-
diff --git a/docs/schema/schema.hash b/docs/schema/schema.hash deleted file mode 100644 index b9a836c0cf..0000000000 --- a/docs/schema/schema.hash +++ /dev/null @@ -1,34 +0,0 @@ -ed19b2d7058efec986e878215f2f2d369e35dbb5 schema/common.json -d2e9be6a5719802cef01d40e5727ab1064502d31 schema/config.json -7d2d3a38be924b275198e45d69a16d3a955bbe60 schema/config_blobset.json -153365b72627741768008dd8d135eef052b5e08d schema/config_blobset_blob.json -d7a512113ebf00f88cc2c647d506ea8e39423b4f schema/config_gateway.json -0531e4b9eb9dc4285171136e7f994b8a31739961 schema/config_localnet.json -f1cd2657a716337c7b40b834a4578b8f934c6131 schema/config_pointset.json -24ceee92930b0d65d0ddbc56f2059664673437c1 schema/config_pointset_point.json -bfaf5ac4b7c53a6039a44140a88753bf13a829e1 schema/config_system.json -e725fac71ca69ee42362e215fef0e49ef081dd98 schema/envelope.json -69bae680e77ed287646519afc93be17e90d938a9 schema/event.json -5a452ec88cbc294b1c6acdc1bcd4c0b77a06a469 schema/event_audit.json -b6ab269ab1690e6b91fe06f224b649748a91d611 schema/event_discovery.json -193eddf2cf5f2326a504a51bbf4de3f1b67f75c8 schema/event_discovery_family.json -9c95aadf9c020bd2846facf1212ba6e3c8f0b69a schema/event_pointset.json -17d8d3c2fb54bee578c09724bb6ddca08651b839 schema/event_pointset_point.json -ca0a9e90980ff73e5f0a216f35b0cdd0f1259f1f schema/event_system.json -ce0a3f203d554bbd331f36471adf0ca05795012a schema/metadata.json -7bc39e17e91b908694e02f899d5251a1758f99ae schema/metadata_cloud.json -bf72ac1a0c7e11cbb139abd6192327a61c8cf213 schema/metadata_gateway.json -088ff40591c8b723497d8c6b741faf7b5f668acb schema/metadata_localnet.json -ac140607d59df5fa3db25ae0dd70d44b817489af schema/metadata_localnet_subsystem.json -31fc098b5ed1783b5dfa5b42af1f3ba489c86675 schema/metadata_pointset.json -0c38b158346fd63e44ac3940155a4fcca4265dfc schema/metadata_pointset_point.json -19880c00da95e6e4a4287614c7b55161c939b7ee schema/metadata_system.json -8575ab8f89f0a68872a3404721b525c2ee1a00b4 schema/properties.json -4873a7ef012223e820bc326d8cb918da4180adbc schema/state.json -2e370cd922a07f962278783c983bc05661e013ce schema/state_blobset.json -46fe9664853600711f4c7eb87244e448cae7d57f schema/state_blobset_blob.json -2ad70606d38b23d69909e1538040ef314ebdac67 schema/state_gateway.json -fd4e8237146f31f16017bd0aa72d2584666852a9 schema/state_pointset.json -1ead42929e14de55a48ce9ee7d3d13ce8dc9686d schema/state_pointset_point.json -1c95a14054e43334de4eea217a2e18db69c5f896 schema/state_system.json -d435fc6b94c3e19cd13535d3a1371af367aab355 schema/units.json diff --git a/docs/schema/state.html b/docs/schema/state.html deleted file mode 100644 index 9cad270b59..0000000000 --- a/docs/schema/state.html +++ /dev/null @@ -1,11 +0,0 @@ - State

State

Type: object
No Additional Properties

Type: string

RFC 3339 Timestamp the state payload was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: object
No Additional Properties

Type: string

The make and model of the physical device


Examples:

"Delta Controls O3-DIN-SRC"
-
"Arup Gateway"
-

Type: string

The serial number of the physical device


Examples:

"A1B2C3D4"
-
"00001"
-

Type: object
No Additional Properties

Type: string

Type: object

Information about the physical device firmware

No Additional Properties

Type: string

Version of the local firmware

Type: string

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


Example:

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

Type: boolean

Type: object

A map of 'sticky' conditions that are keyed on a value that can be used to manage updates by a particular (device dependent) subsystem.

No Additional Properties

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

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

Type: string

A one-line representation of the triggering condition.


Example:

"Point is not writable"
-

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
-

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


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

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/gateway.md

No Additional Properties

Type: array of string

Each item of this array must be:

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

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: object

A set of points reporting telemetry data.

No Additional Properties

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: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Must be at most 32 characters long

Type: object

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

No Additional Properties

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

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

Object representation for for a single point

No Additional Properties

Type: enum (of string)

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

Must be one of:

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

Type: object

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

Same definition as entry
diff --git a/docs/schema/config.html b/gencode/docs/config.html similarity index 70% rename from docs/schema/config.html rename to gencode/docs/config.html index 7879799f27..b4a4491a57 100644 --- a/docs/schema/config.html +++ b/gencode/docs/config.html @@ -1,6 +1,6 @@ - Config

Config

Type: object

The config block controls a device's intended behavior. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/config.md

No Additional Properties

Type: string

RFC 3339 timestamp the configuration was generated


Example:

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

Config

Type: object

The config block controls a device's intended behavior. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/config.md

No Additional Properties

Type: string

RFC 3339 timestamp the configuration was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: object
No Additional Properties

Type: integer

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

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

Type: object
No Additional Properties

Type: string

Type: object
No Additional Properties

Type: array of string

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

Each item of this array must be:

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

Example:

[
     "AHU-22"
 ]
-

Type: object
No Additional Properties

Type: object

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

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

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

Must be at most 32 characters long

Type: string

An expiry for the the device reverts to its operational state, and sends a state update to notify the cloud of the state change. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Type: integer

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

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

Type: integer

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

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

Type: object

The points defined in this dictionary is the authoritative source indicating the representative points for the device (in both telemetry and state messages). Read more: https://github.com/faucetsdn/udmi/blob/master/docs/pointset.md

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

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


Example:

22.4
-
+

Type: object
No Additional Properties

Type: object

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

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

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

Must be at most 32 characters long

Type: string

An expiry for the the device reverts to its operational state, and sends a state update to notify the cloud of the state change. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Type: integer

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

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

Type: integer

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

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

Type: object

The points defined in this dictionary is the authoritative source indicating the representative points for the device (in both telemetry and state messages). Read more: https://github.com/faucetsdn/udmi/blob/master/docs/pointset.md

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

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


Example:

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

Envelope

Type: object

The UDMI envelope is not a message itself, per se, but the attributes and other information that is delivered along with a message. Read more: https://github.com/faucetsdn/udmi/blob/master/docs/envelope.md

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

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

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

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

Type: enum (of string)

Must be one of:

  • "config"
  • "discovery"
  • "system"
  • "metadata"
  • "pointset"
  • "state"

Additional Properties of any type are allowed.

Type: object
\ No newline at end of file diff --git a/docs/schema/event_discovery.html b/gencode/docs/event_discovery.html similarity index 85% rename from docs/schema/event_discovery.html rename to gencode/docs/event_discovery.html index 41a26acacf..4dd8c31cac 100644 --- a/docs/schema/event_discovery.html +++ b/gencode/docs/event_discovery.html @@ -1,2 +1,2 @@ - Discovery

Discovery

Type: object

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/discovery.md

No Additional Properties

Type: string

RFC 3339 timestamp the discover telemetry event was generated


Example:

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

Type: enum (of integer)

Major version of the UDMI schema

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

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

+ Discovery

Discovery

Type: object

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/discovery.md

No Additional Properties

Type: string

RFC 3339 timestamp the discover telemetry event was generated


Example:

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

Type: enum (of integer)

Major version of the UDMI schema

Must be one of:

  • 1

Type: object
No Additional Properties

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

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

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

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

Pointset Event

Type: object

A set of points reporting telemetry data

No Additional Properties

Type: string

RFC 3339 timestamp the telemetry event was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: object

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

No Additional Properties

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

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

Object representation for for a single point

No Additional Properties

Type: object

The specific point data reading


Examples:

24.1
+
true
+
4
+
\ No newline at end of file diff --git a/docs/schema/event_system.html b/gencode/docs/event_system.html similarity index 99% rename from docs/schema/event_system.html rename to gencode/docs/event_system.html index 830b81c353..248cd0afba 100644 --- a/docs/schema/event_system.html +++ b/gencode/docs/event_system.html @@ -3,4 +3,4 @@

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
 

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


Example:

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

Type: integer

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

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


Example:

600
-
+ \ No newline at end of file diff --git a/docs/schema/index.html b/gencode/docs/index.html similarity index 100% rename from docs/schema/index.html rename to gencode/docs/index.html diff --git a/docs/schema/metadata.html b/gencode/docs/metadata.html similarity index 73% rename from docs/schema/metadata.html rename to gencode/docs/metadata.html index b80ad4b7ca..61740614ce 100644 --- a/docs/schema/metadata.html +++ b/gencode/docs/metadata.html @@ -1,9 +1,9 @@ Metadata

Metadata

Type: object
No Additional Properties

Type: string

RFC 3339 timestamp the metadata was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: string

Automatically generated field that contains the hash of file contents.

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

Type: object

Information specific to how the device communicates with the cloud.

No Additional Properties

Type: enum (of string)

The key type used for cloud communication.

Must be one of:

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

Type: boolean

Type: boolean

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

Type: object

High-level sytem informaiton about the device.

No Additional Properties

Type: object

Properties the expected physical location of the device.

No Additional Properties

Type: string

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

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

"US-SFO-XYY"
-

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

Type: object
No Additional Properties

Type: number

Type: number

Type: object

Information used to print a physical QR code label.

No Additional Properties

Type: object
No Additional Properties

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

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

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

Type: object
No Additional Properties

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

Type: object

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/gateway.md

No Additional Properties

Type: object

The following properties are required:

  • gateway_id
Type: object

The following properties are required:

  • proxy_ids

Type: string

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

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

"GAT-100"
+

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

Type: object
No Additional Properties

Type: number

Type: number

Type: object

Information used to print a physical QR code label.

No Additional Properties

Type: object
No Additional Properties

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

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

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

Type: object
No Additional Properties

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

Type: object

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/gateway.md

No Additional Properties

Type: object

The following properties are required:

  • gateway_id
Type: object

The following properties are required:

  • proxy_ids

Type: string

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

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

"GAT-100"
 

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

Type: array of string

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

Each item of this array must be:

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

Example:

[
     "AHU-22"
 ]
-

Type: object
No Additional Properties

Type: object
No Additional Properties

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

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

Type: object

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

No Additional Properties

Type: object

Information about a specific point name of the device.

No Additional Properties

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

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

Type: enum (of string)

Taken from standard BACnet engineering units

Must be one of:

  • "Square-meters"
  • "Square-feet"
  • "Milliamperes"
  • "Amperes"
  • "Ohms"
  • "Volts"
  • "Kilo-volts"
  • "Mega-volts"
  • "Volt-amperes"
  • "Kilo-volt-amperes"
  • "Mega-volt-amperes"
  • "Volt-amperes-reactive"
  • "Kilo-volt-amperes-reactive"
  • "Mega-volt-amperes-reactive"
  • "Volt-amperes-reactive-hours"
  • "Degrees-phase"
  • "Power-factor"
  • "Joules"
  • "Kilojoules"
  • "Watt-hours"
  • "Kilowatt-hours"
  • "BTUs"
  • "Therms"
  • "Ton-hours"
  • "Joules-per-kilogram-dry-air"
  • "BTUs-per-pound-dry-air"
  • "Cycles-per-hour"
  • "Cycles-per-minute"
  • "Hertz"
  • "Grams-of-water-per-kilogram-dry-air"
  • "Percent-relative-humidity"
  • "Millimeters"
  • "Meters"
  • "Inches"
  • "Feet"
  • "Watts-per-square-foot"
  • "Watts-per-square-meter"
  • "Lumens"
  • "Luxes"
  • "Foot-candles"
  • "Kilograms"
  • "Pounds-mass"
  • "Tons"
  • "Kilograms-per-second"
  • "Kilograms-per-minute"
  • "Kilograms-per-hour"
  • "Pounds-mass-per-minute"
  • "Pounds-mass-per-hour"
  • "Watts"
  • "Kilowatts"
  • "Megawatts"
  • "BTUs-per-hour"
  • "Horsepower"
  • "Tons-refrigeration"
  • "Pascals"
  • "Kilopascals"
  • "Bars"
  • "Pounds-force-per-square-inch"
  • "Centimeters-of-water"
  • "Inches-of-water"
  • "Millimeters-of-mercury"
  • "Centimeters-of-mercury"
  • "Inches-of-mercury"
  • "Degrees-Celsius"
  • "Degrees-Kelvin"
  • "Degrees-Fahrenheit"
  • "Degree-days-Celsius"
  • "Degree-days-Fahrenheit"
  • "Years"
  • "Months"
  • "Weeks"
  • "Days"
  • "Hours"
  • "Minutes"
  • "Seconds"
  • "Meters-per-second"
  • "Kilometers-per-hour"
  • "Feet-per-second"
  • "Feet-per-minute"
  • "Miles-per-hour"
  • "Cubic-feet"
  • "Cubic-meters"
  • "Imperial-gallons"
  • "Liters"
  • "Us-gallons"
  • "Cubic-feet-per-minute"
  • "Cubic-meters-per-second"
  • "Imperial-gallons-per-minute"
  • "Liters-per-second"
  • "Liters-per-minute"
  • "Us-gallons-per-minute"
  • "Degrees-angular"
  • "Degrees-Celsius-per-hour"
  • "Degrees-Celsius-per-minute"
  • "Degrees-Fahrenheit-per-hour"
  • "Degrees-Fahrenheit-per-minute"
  • "No-units"
  • "Parts-per-million"
  • "Parts-per-billion"
  • "Percent"
  • "Percent-per-second"
  • "Per-minute"
  • "Per-second"
  • "Psi-per-Degree-Fahrenheit"
  • "Radians"
  • "Revolutions-per-minute"
  • "Currency1"
  • "Currency2"
  • "Currency3"
  • "Currency4"
  • "Currency5"
  • "Currency6"
  • "Currency7"
  • "Currency8"
  • "Currency9"
  • "Currency10"
  • "Square-inches"
  • "Square-centimeters"
  • "BTUs-per-pound"
  • "Centimeters"
  • "Pounds-mass-per-second"
  • "Delta-Degrees-Fahrenheit"
  • "Delta-Degrees-Kelvin"
  • "Kilohms"
  • "Megohms"
  • "Millivolts"
  • "Kilojoules-per-kilogram"
  • "Megajoules"
  • "Joules-per-degree-Kelvin"
  • "Joules-per-kilogram-degree-Kelvin"
  • "Kilohertz"
  • "Megahertz"
  • "Per-hour"
  • "Milliwatts"
  • "Hectopascals"
  • "Millibars"
  • "Cubic-meters-per-hour"
  • "Liters-per-hour"
  • "Kilowatt-hours-per-square-meter"
  • "Kilowatt-hours-per-square-foot"
  • "Megajoules-per-square-meter"
  • "Megajoules-per-square-foot"
  • "Watts-per-square-meter-Degree-Kelvin"
  • "Cubic-feet-per-second"
  • "Percent-obscuration-per-foot"
  • "Percent-obscuration-per-meter"
  • "Milliohms"
  • "Megawatt-hours"
  • "Kilo-BTUs"
  • "Mega-BTUs"
  • "Kilojoules-per-kilogram-dry-air"
  • "Megajoules-per-kilogram-dry-air"
  • "Kilojoules-per-degree-Kelvin"
  • "Megajoules-per-degree-Kelvin"
  • "Newton"
  • "Grams-per-second"
  • "Grams-per-minute"
  • "Tons-per-hour"
  • "Kilo-BTUs-per-hour"
  • "Hundredths-seconds"
  • "Milliseconds"
  • "Newton-meters"
  • "Millimeters-per-second"
  • "Millimeters-per-minute"
  • "Meters-per-minute"
  • "Meters-per-hour"
  • "Cubic-meters-per-minute"
  • "Meters-per-second-per-second"
  • "Amperes-per-meter"
  • "Amperes-per-square-meter"
  • "Ampere-square-meters"
  • "Farads"
  • "Henrys"
  • "Ohm-meters"
  • "Siemens"
  • "Siemens-per-meter"
  • "Teslas"
  • "Volts-per-degree-Kelvin"
  • "Volts-per-meter"
  • "Webers"
  • "Candelas"
  • "Candelas-per-square-meter"
  • "Degrees-Kelvin-per-hour"
  • "Degrees-Kelvin-per-minute"
  • "Joule-seconds"
  • "Square-meters-per-Newton"
  • "Kilograms-per-cubic-meter"
  • "Newton-seconds"
  • "Newtons-per-meter"
  • "Watts-per-meter-per-degree-Kelvin"

Type: string

A local network reference for a point, e.g. BACnet address or Modbus register


Examples:

"AI3.Present_Value"
+

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-z0-9-]+$
Type: object
No Additional Properties

Type: object

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

No Additional Properties

Type: object

Information about a specific point name of the device.

No Additional Properties

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

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

Information about a specific point name of the device.

No Additional Properties

Type: enum (of string)

Expected unit configuration for the point.

Must be one of:

  • "Square-meters"
  • "Square-feet"
  • "Milliamperes"
  • "Amperes"
  • "Ohms"
  • "Volts"
  • "Kilo-volts"
  • "Mega-volts"
  • "Volt-amperes"
  • "Kilo-volt-amperes"
  • "Mega-volt-amperes"
  • "Volt-amperes-reactive"
  • "Kilo-volt-amperes-reactive"
  • "Mega-volt-amperes-reactive"
  • "Volt-amperes-reactive-hours"
  • "Degrees-phase"
  • "Power-factor"
  • "Joules"
  • "Kilojoules"
  • "Watt-hours"
  • "Kilowatt-hours"
  • "BTUs"
  • "Therms"
  • "Ton-hours"
  • "Joules-per-kilogram-dry-air"
  • "BTUs-per-pound-dry-air"
  • "Cycles-per-hour"
  • "Cycles-per-minute"
  • "Hertz"
  • "Grams-of-water-per-kilogram-dry-air"
  • "Percent-relative-humidity"
  • "Millimeters"
  • "Meters"
  • "Inches"
  • "Feet"
  • "Watts-per-square-foot"
  • "Watts-per-square-meter"
  • "Lumens"
  • "Luxes"
  • "Foot-candles"
  • "Kilograms"
  • "Pounds-mass"
  • "Tons"
  • "Kilograms-per-second"
  • "Kilograms-per-minute"
  • "Kilograms-per-hour"
  • "Pounds-mass-per-minute"
  • "Pounds-mass-per-hour"
  • "Watts"
  • "Kilowatts"
  • "Megawatts"
  • "BTUs-per-hour"
  • "Horsepower"
  • "Tons-refrigeration"
  • "Pascals"
  • "Kilopascals"
  • "Bars"
  • "Pounds-force-per-square-inch"
  • "Centimeters-of-water"
  • "Inches-of-water"
  • "Millimeters-of-mercury"
  • "Centimeters-of-mercury"
  • "Inches-of-mercury"
  • "Degrees-Celsius"
  • "Degrees-Kelvin"
  • "Degrees-Fahrenheit"
  • "Degree-days-Celsius"
  • "Degree-days-Fahrenheit"
  • "Years"
  • "Months"
  • "Weeks"
  • "Days"
  • "Hours"
  • "Minutes"
  • "Seconds"
  • "Meters-per-second"
  • "Kilometers-per-hour"
  • "Feet-per-second"
  • "Feet-per-minute"
  • "Miles-per-hour"
  • "Cubic-feet"
  • "Cubic-meters"
  • "Imperial-gallons"
  • "Liters"
  • "Us-gallons"
  • "Cubic-feet-per-minute"
  • "Cubic-meters-per-second"
  • "Imperial-gallons-per-minute"
  • "Liters-per-second"
  • "Liters-per-minute"
  • "Us-gallons-per-minute"
  • "Degrees-angular"
  • "Degrees-Celsius-per-hour"
  • "Degrees-Celsius-per-minute"
  • "Degrees-Fahrenheit-per-hour"
  • "Degrees-Fahrenheit-per-minute"
  • "No-units"
  • "Parts-per-million"
  • "Parts-per-billion"
  • "Percent"
  • "Percent-per-second"
  • "Per-minute"
  • "Per-second"
  • "Psi-per-Degree-Fahrenheit"
  • "Radians"
  • "Revolutions-per-minute"
  • "Currency1"
  • "Currency2"
  • "Currency3"
  • "Currency4"
  • "Currency5"
  • "Currency6"
  • "Currency7"
  • "Currency8"
  • "Currency9"
  • "Currency10"
  • "Square-inches"
  • "Square-centimeters"
  • "BTUs-per-pound"
  • "Centimeters"
  • "Pounds-mass-per-second"
  • "Delta-Degrees-Fahrenheit"
  • "Delta-Degrees-Kelvin"
  • "Kilohms"
  • "Megohms"
  • "Millivolts"
  • "Kilojoules-per-kilogram"
  • "Megajoules"
  • "Joules-per-degree-Kelvin"
  • "Joules-per-kilogram-degree-Kelvin"
  • "Kilohertz"
  • "Megahertz"
  • "Per-hour"
  • "Milliwatts"
  • "Hectopascals"
  • "Millibars"
  • "Cubic-meters-per-hour"
  • "Liters-per-hour"
  • "Kilowatt-hours-per-square-meter"
  • "Kilowatt-hours-per-square-foot"
  • "Megajoules-per-square-meter"
  • "Megajoules-per-square-foot"
  • "Watts-per-square-meter-Degree-Kelvin"
  • "Cubic-feet-per-second"
  • "Percent-obscuration-per-foot"
  • "Percent-obscuration-per-meter"
  • "Milliohms"
  • "Megawatt-hours"
  • "Kilo-BTUs"
  • "Mega-BTUs"
  • "Kilojoules-per-kilogram-dry-air"
  • "Megajoules-per-kilogram-dry-air"
  • "Kilojoules-per-degree-Kelvin"
  • "Megajoules-per-degree-Kelvin"
  • "Newton"
  • "Grams-per-second"
  • "Grams-per-minute"
  • "Tons-per-hour"
  • "Kilo-BTUs-per-hour"
  • "Hundredths-seconds"
  • "Milliseconds"
  • "Newton-meters"
  • "Millimeters-per-second"
  • "Millimeters-per-minute"
  • "Meters-per-minute"
  • "Meters-per-hour"
  • "Cubic-meters-per-minute"
  • "Meters-per-second-per-second"
  • "Amperes-per-meter"
  • "Amperes-per-square-meter"
  • "Ampere-square-meters"
  • "Farads"
  • "Henrys"
  • "Ohm-meters"
  • "Siemens"
  • "Siemens-per-meter"
  • "Teslas"
  • "Volts-per-degree-Kelvin"
  • "Volts-per-meter"
  • "Webers"
  • "Candelas"
  • "Candelas-per-square-meter"
  • "Degrees-Kelvin-per-hour"
  • "Degrees-Kelvin-per-minute"
  • "Joule-seconds"
  • "Square-meters-per-Newton"
  • "Kilograms-per-cubic-meter"
  • "Newton-seconds"
  • "Newtons-per-meter"
  • "Watts-per-meter-per-degree-Kelvin"

Type: string

A local network reference for a point, e.g. BACnet address or Modbus register


Examples:

"AI3.Present_Value"
 
"400070"
-
+
\ No newline at end of file diff --git a/gencode/docs/schema.hash b/gencode/docs/schema.hash new file mode 100644 index 0000000000..3faae209b9 --- /dev/null +++ b/gencode/docs/schema.hash @@ -0,0 +1,34 @@ +77dcb0fef471c7418306353a2cbb802b72679255 schema/common.json +d3ce94976a6c3f23fee2c41e2347101cf7e36c01 schema/config.json +2af1ef06afc81e2e6d0286afceb66a5dcbea999a schema/config_blobset.json +e9151e7c87ac1e880a1312cc7e49b435be6cbd0a schema/config_blobset_blob.json +4e316a61bf169d000474c8787a40b40ebee17eee schema/config_gateway.json +2701c5a05dd612d32b60d185948c80edaf7318b6 schema/config_localnet.json +7a8bf6da800d28f9acc3e2e10e6d6a9694b2da24 schema/config_pointset.json +5df53504219c90a3cc89c9e2129afe6d6c91ab58 schema/config_pointset_point.json +ac6e9424c5d367dbb7101a4160c7847321968457 schema/config_system.json +e725fac71ca69ee42362e215fef0e49ef081dd98 schema/envelope.json +c8c82c16099231d81bda86e0cb6a47bc0e607d1e schema/event.json +86d2445f4be9256b10f1053ce1f440ffe83f4706 schema/event_audit.json +6ce954ba12235ce4ea1e342045c9f6a64211375b schema/event_discovery.json +90ba67e6f487cdb47b2b92cf663186a200a0a829 schema/event_discovery_family.json +b00bb8e5305001df21c8c4f7d24ec42e23580d96 schema/event_pointset.json +daaa5b31ad385c27024cc915412e0f27d5102306 schema/event_pointset_point.json +5586b408ff7a59210c2c6a3a1f883583b30dae4e schema/event_system.json +dc1d3c4896ed03f645db0942dd47095188e5adf6 schema/metadata.json +ec5e11c52c11edc9d3398859cfa89f4e740fe6fb schema/metadata_cloud.json +7ade1337df6951cc645421512d3664b7e5adeced schema/metadata_gateway.json +e11e038b06c5778a5050c6a1bcf4f8b6e6fd8b89 schema/metadata_localnet.json +8aab0be292001048f19c79ec1b0a0726db297fab schema/metadata_localnet_subsystem.json +76f0a73a81c19a913125ba8113383b94730aabf1 schema/metadata_pointset.json +320bb8d21a21537c94b09acd974f4d8079490144 schema/metadata_pointset_point.json +28e5fb6ebe6e4824934161d5b5e20ca7881133c0 schema/metadata_system.json +5b497358a2253e8d72cf3ca5d8af2740e86149e0 schema/properties.json +0514d620dd98474fc42a2e19f08b2bc985285a99 schema/state.json +68e22a220aa6e2a8d30e68f0155134a000344e24 schema/state_blobset.json +e5ab83b6e18a5dc0673e43e9f5acd1d5b13636a7 schema/state_blobset_blob.json +f7b02ad613c0c3816728ad2d3237158ac9a6472e schema/state_gateway.json +920d82f3da7788f45ba6cf018beecd4076666b91 schema/state_pointset.json +22d16398260a743c3feea1d41d2fff924ed4c8d3 schema/state_pointset_point.json +b9542e4aecd1e21943702993612bba35b5ce7efe schema/state_system.json +d435fc6b94c3e19cd13535d3a1371af367aab355 schema/units.json diff --git a/docs/schema/schema_doc.css b/gencode/docs/schema_doc.css similarity index 99% rename from docs/schema/schema_doc.css rename to gencode/docs/schema_doc.css index cd1fcd3580..83897d896b 100644 --- a/docs/schema/schema_doc.css +++ b/gencode/docs/schema_doc.css @@ -177,4 +177,4 @@ body { .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ -.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ +.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/schema/schema_doc.min.js b/gencode/docs/schema_doc.min.js similarity index 97% rename from docs/schema/schema_doc.min.js rename to gencode/docs/schema_doc.min.js index 58eb600407..0d9c7882d8 100644 --- a/docs/schema/schema_doc.min.js +++ b/gencode/docs/schema_doc.min.js @@ -1 +1 @@ -function flashElement(t){myElement=document.getElementById(t),myElement.classList.add("jsfh-animated-property"),setTimeout(function(){myElement.classList.remove("jsfh-animated-property")},1e3)}function setAnchor(t){history.pushState({},"",t)}function anchorOnLoad(){let t=window.location.hash.split("?")[0].split("&")[0];"#"===t[0]&&(t=t.substr(1)),t.length>0&&anchorLink(t)}function anchorLink(t){$("#"+t).parents().addBack().filter(".collapse:not(.show), .tab-pane, [role='tab']").each(function(t){if($(this).hasClass("collapse"))$(this).collapse("show");else if($(this).hasClass("tab-pane")){const t=$("a[href='#"+$(this).attr("id")+"']");t&&t.tab("show")}else"tab"===$(this).attr("role")&&$(this).tab("show")}),setTimeout(function(){let e=document.getElementById(t);e&&(e.scrollIntoView({block:"center",behavior:"smooth"}),setTimeout(function(){flashElement(t)},500))},1e3)}$(document).on("click",'a[href^="#"]',function(t){t.preventDefault(),history.pushState({},"",this.href)}); +function flashElement(t){myElement=document.getElementById(t),myElement.classList.add("jsfh-animated-property"),setTimeout(function(){myElement.classList.remove("jsfh-animated-property")},1e3)}function setAnchor(t){history.pushState({},"",t)}function anchorOnLoad(){let t=window.location.hash.split("?")[0].split("&")[0];"#"===t[0]&&(t=t.substr(1)),t.length>0&&anchorLink(t)}function anchorLink(t){$("#"+t).parents().addBack().filter(".collapse:not(.show), .tab-pane, [role='tab']").each(function(t){if($(this).hasClass("collapse"))$(this).collapse("show");else if($(this).hasClass("tab-pane")){const t=$("a[href='#"+$(this).attr("id")+"']");t&&t.tab("show")}else"tab"===$(this).attr("role")&&$(this).tab("show")}),setTimeout(function(){let e=document.getElementById(t);e&&(e.scrollIntoView({block:"center",behavior:"smooth"}),setTimeout(function(){flashElement(t)},500))},1e3)}$(document).on("click",'a[href^="#"]',function(t){t.preventDefault(),history.pushState({},"",this.href)}); \ No newline at end of file diff --git a/gencode/docs/state.html b/gencode/docs/state.html new file mode 100644 index 0000000000..7c24b13483 --- /dev/null +++ b/gencode/docs/state.html @@ -0,0 +1,19 @@ + State

State

Type: object
No Additional Properties

Type: string

RFC 3339 Timestamp the state payload was generated


Example:

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

Type: integer

Major version of the UDMI schema

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

Type: object
No Additional Properties

Type: string

The make and model of the physical device


Examples:

"Delta Controls O3-DIN-SRC"
+
"Arup Gateway"
+

Type: string

The serial number of the physical device


Examples:

"A1B2C3D4"
+
"00001"
+

Type: object
No Additional Properties

Type: string

Type: object

Information about the physical device firmware

No Additional Properties

Type: string

Version of the local firmware

Type: string

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


Example:

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

Type: boolean

Type: object

A map of 'sticky' conditions that are keyed on a value that can be used to manage updates by a particular (device dependent) subsystem.

No Additional Properties

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

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

Type: string

A one-line representation of the triggering condition.


Example:

"Point is not writable"
+

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
+

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


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

Read more: https://github.com/faucetsdn/udmi/blob/master/docs/gateway.md

No Additional Properties

Type: array of string

Each item of this array must be:

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

Type: object
No Additional Properties

Type: string

Must be at most 32 characters long

Type: object
No Additional Properties

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

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

Type: object
No Additional Properties

Type: string

A one-line representation of the triggering condition.


Example:

"Point is not writable"
+

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
+

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


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

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: https://github.com/faucetsdn/udmi/blob/master/docs/writeback.md

Must be at most 32 characters long

Type: object

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

No Additional Properties

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

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

Object representation for for a single point

No Additional Properties

Type: enum (of string)

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

Must be one of:

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

Type: object

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

No Additional Properties

Type: string

A one-line representation of the triggering condition.


Example:

"Point is not writable"
+

Type: string

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

Type: string

A device-specific representation of which sub-system the message comes from. In a Java environment, for example, it would be the fully qualified path name of the Class triggering the message.

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

"state.pointset.points.config.invalid"
+

Type: string

Ttimestamp the condition was triggered, or most recently updated. It might be different than the top-level message timestamp if the condition is not checked often or is sticky until it's cleared.


Example:

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

Type: integer

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

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


Example:

600
+
\ No newline at end of file diff --git a/schema/event_pointset.json b/schema/event_pointset.json index 0141a24baa..b64d834ba0 100644 --- a/schema/event_pointset.json +++ b/schema/event_pointset.json @@ -1,5 +1,6 @@ { "title": "Pointset Event", + "description": "A set of points reporting telemetry data", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, @@ -17,6 +18,7 @@ "maximum": 1 }, "points": { + "description": "Collection of point names, defining the representative point set for this device.", "additionalProperties": false, "existingJavaType": "java.util.HashMap", "patternProperties": { diff --git a/schema/event_pointset_point.json b/schema/event_pointset_point.json index 7aaeb2c013..dd976cd521 100644 --- a/schema/event_pointset_point.json +++ b/schema/event_pointset_point.json @@ -1,5 +1,6 @@ { "title": "Point Pointset Event", + "description": "Object representation for for a single point", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, diff --git a/schema/metadata_pointset_point.json b/schema/metadata_pointset_point.json index d87f83053c..7b03893f2b 100644 --- a/schema/metadata_pointset_point.json +++ b/schema/metadata_pointset_point.json @@ -1,10 +1,12 @@ { "title": "Point Pointset Metadata", + "description": "Information about a specific point name of the device.", "type": "object", "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "units": { + "description": "Expected unit configuration for the point.", "$ref": "file:units.json#" }, "ref": { diff --git a/validator_config.json b/validator_config.json deleted file mode 100644 index 7b159e59b3..0000000000 --- a/validator_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "project_id": "udmi-nes", - "site_model": "udmi_site_model", - "device_id": "AHU-1", - "serial_no": "sequencer-3861", - "key_file": "udmi_site_model/devices/AHU-1/rsa_private.pkcs8" -} From a94fe10af843d9f6c0d670eff4599346d8ece6c6 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Wed, 8 Sep 2021 22:49:01 +0100 Subject: [PATCH 08/10] empty commit From 743420a52cb70bbc9e1f69a954774d00b3788ff9 Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Wed, 8 Sep 2021 22:50:38 +0100 Subject: [PATCH 09/10] new line at end of testing.yaml --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index dbd4648c09..6fa1b2469a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -78,4 +78,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: schema docs - run: bin/gendocs check \ No newline at end of file + run: bin/gendocs check From 9fde3bc0cf9d8371973aa43501dea26e1e86d92f Mon Sep 17 00:00:00 2001 From: Noureddine El Saidi Date: Thu, 9 Sep 2021 12:39:25 +0100 Subject: [PATCH 10/10] fix indent --- bin/gendocs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/gendocs b/bin/gendocs index 7295eae777..e9fc9152c2 100755 --- a/bin/gendocs +++ b/bin/gendocs @@ -48,6 +48,6 @@ cp etc/schema_index_template.html $OUTPUT_DIR/index.html for schema in $schemas; do sed -i '' "s//\ -