Skip to content

Commit 3b46357

Browse files
authored
Update documentation for application interface (#904)
1 parent ecec1c6 commit 3b46357

File tree

4 files changed

+55
-93
lines changed

4 files changed

+55
-93
lines changed

.wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ http
6767
https
6868
IAM
6969
idToken
70+
integrations
7071
invoker
7172
io
7273
iot

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ The Universal Device Management Interface (UDMI) provides a high-level specifica
66
management and operation of physical IoT systems. This data is typically exchanged
77
with a cloud entity that can maintain a "digital twin" or "shadow device" in the cloud.
88

9-
* [Core UDMI documentation](http://faucetsdn.github.io/udmi/docs/) for tools and specifications
10-
* [Message schema definition](https://github.com/faucetsdn/udmi/tree/master/schema) with ([_🧬Interactive Viewer_](http://faucetsdn.github.io/udmi/gencode/docs/))
9+
* [Core UDMI documentation](docs/) for tools and specifications
10+
* [Message schema definition](https://github.com/faucetsdn/udmi/tree/master/schema) with ([_🧬Interactive Viewer_](gencode/docs/))
1111
* [[email protected]](https://groups.google.com/forum/#!forum/udmi-discuss) email discussion list
1212
* Bi-weekly _UDMI Discuss_ video meeting open to all (join the mailing list to get an invite)
1313

@@ -19,14 +19,14 @@ By design, this schema is intended to be:
1919
* **M**anagement: Focus on device _management_, rather than command & control.
2020
* **I**nterface: Define an interface specification, rather than a client-library or RPC mechanism.
2121

22-
See the associated [UDMI Tech Stack](http://faucetsdn.github.io/udmi/docs/specs/tech_stack) for details about transport mechanism
22+
See the associated [UDMI Tech Stack](docs/specs/tech_stack.md) for details about transport mechanism
2323
outside of the core schema definition. Nominally meant for use with
2424
[Google's Cloud IoT Core](https://cloud.google.com/iot/docs/), it can be applied to any set
2525
of data or hosting setup.
2626

2727
## Recommended Workflow
2828

29-
The [recommended workflow](http://faucetsdn.github.io/udmi/docs/guides) for UDMI covers using the _registrar_ and
29+
The [recommended workflow](docs/guides) for UDMI covers using the _registrar_ and
3030
_validator_ tools to configure and test a cloud project. Additionally, the _pubber_ tool
3131
is instrumental in setting up and testing the system independent of actual device setup.
3232

@@ -40,7 +40,7 @@ manual operation (aren't automated), and increase the security exposure of the s
4040

4141
UDMI is intended to support a few primary use-cases:
4242
* _Telemetry Ingestion_: Ingest device data points in a standardized format.
43-
* [_Gateway Proxy_](http://faucetsdn.github.io/udmi/docs/specs/gateway): Proxy data/connection for non-UDMI devices,
43+
* [_Gateway Proxy_](docs/specs/gateway.md): Proxy data/connection for non-UDMI devices,
4444
allowing adaptation to legacy systems.
4545
* _On-Prem Actuation_: Ability to effect on-prem device behavior.
4646
* _Device Testability_: e.g. Trigger a fake alarm to test reporting mechanisms.
@@ -83,10 +83,10 @@ very large structures or high-bandwidth streams.
8383
UDMI provides a means to multiplex multiple functional subsystems through the same shared
8484
communication channel. There are a number of subsystems that make up the core UDMI spec:
8585

86-
* Core [_system_](http://faucetsdn.github.io/udmi/docs/messages/system) messages about the base device itself.
87-
* Device [_pointset_](http://faucetsdn.github.io/udmi/docs/messages/pointset) for device telemetry organized by points.
88-
* Optional [_gateway_](http://faucetsdn.github.io/udmi/docs/specs/gateway) functionality for proxying device/MQTT connections.
89-
* Local [_discover_](http://faucetsdn.github.io/udmi/docs/specs/discovery) for discovering device and network capabilities.
86+
* Core [_system_](docs/messages/system.md) messages about the base device itself.
87+
* Device [_pointset_](docs/messages/pointset.md) for device telemetry organized by points.
88+
* Optional [_gateway_](docs/specs/gateway.md) functionality for proxying device/MQTT connections.
89+
* Local [_discover_](docs/specs/discovery.md) for discovering device and network capabilities.
9090

9191
## Schema Structure
9292

@@ -115,11 +115,11 @@ A device client implementation will typically only be aware of the _state_, _con
115115
one or more _telemetry_ messages (e.g. _pointset_), while all others are meant for the supporting
116116
infrastructure.
117117

118-
An interactive view of the schema is available on [https://faucetsdn.github.io/udmi/gencode/docs/](https://faucetsdn.github.io/udmi/gencode/docs/).
118+
An interactive view of the schema is available at [gencode/docs/](gencode/docs/).
119119

120120
### Metadata Registration and Validation
121121

122122
Using UDMI on a project entails not only the base device and server implementations, but also
123-
properly registering and validating device configuration. The [registrar](https://faucetsdn.github.io/udmi/docs/tools/registrar)
124-
tool and [validator](https://faucetsdn.github.io/udmi/docs/tools/validator) tool provide a means to configure and check site
123+
properly registering and validating device configuration. The [registrar](docs/tools/registrar.md)
124+
tool and [validator](docs/tools/validator.md) tool provide a means to configure and check site
125125
installations, respectively.

docs/messages/pointset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Specific `point_names` within a `pointset` should be specified in _snake_case_ a
1010
data ontology for the device (stipulated and verified outside of UDMI, e.g. [Digital Buildings Ontology](https://github.com/google/digitalbuildings/tree/master/ontology)).
1111

1212

13-
Pointset is represented in four locations
13+
Pointset is represented in four locations:
1414
- [Metadata](#metadata)
1515
- [Event](#event)
1616
- [State](#state)

docs/specs/subblocks.md

Lines changed: 41 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -10,89 +10,50 @@ device _state_/_config_, and only expose the relevant pieces.
1010

1111
The basic mode of this interface is a "read only" subscription to a PubSub topic (normally
1212
`udmi_target`) that then provides a complete view of updates as they flow through the system.
13-
For example, a cloud-to-device _config_ update would be published on this topic as a "update
14-
to device config." This level of visibility should be sufficient to completely mirror the
13+
This level of visibility should be sufficient to completely mirror the
1514
visible state of the system (barring issues like loss-of-message etc...).
1615

17-
The various _subblocks_ are detailed below. Each _subblock_ (or _subFolder_ if you're looking
18-
at the PubSub _message envelope_), has several basic _subTypes_ that manifest themselves from
19-
different sources:
16+
Messages are typed by their _subType_ and _subFolder_ (named so because of legacy integrations).
17+
The _subType_ field specifies generic message semantics, while the _subFolder_ specifies the
18+
semantic interpretation.
2019

21-
* **Model**: Model-based description of this device. Unlike the other messages, this exists
22-
independent of any actual physical device, and will be injected by the system through something
23-
like the `registrar` tool. The _model_ is typically also reflected in a _site\_model_ as a
24-
static set of files somewhere.
25-
* **Event**: Streaming telemetry. This is essentially a raw feed from the device itself,
26-
and will always be segmented by subblock (e.g. for a
27-
[pointset event](../../tests/schemas/events_pointset/example.json)). Streaming telemetry
28-
is sent from the device, so will be _received by_ a client app.
29-
* **State**: Device state for this subblock. Unlike a
20+
## _subType_ attribute values
21+
22+
Several main _subType_ values cover normal system operations. Other values not specified here should
23+
be ignored if received. If the _subType_ field is missing then it should default to `event`.
24+
25+
* `event`: Streaming telemetry from the device, representing changes to metrics or other values
26+
that change frequently.
27+
(See [pointset event](../../tests/schemas/events_pointset/example.json) as an example.) Messages
28+
with a defaulted `event` type represent raw telemetry from the device, while an explicit `event`
29+
type means the messages has been processed by the intermediate pipeline in some form.
30+
* `state`: Device state for this subblock. Unlike a
3031
[comprehensive device state message](../../tests/schemas/state/example.json)
3132
this message contains information _only_ for a single subblock. Used for reporting any 'sticky'
32-
state from a device, so will be _received by_ a client app.
33-
* **Config**: Device config for this subblock. Unlike a
33+
state from a device that has been processed and separated out by the UDMIS pipeline. A special
34+
_subFolder_ of `update` indicates a complete state message and should generally be ignored by
35+
consuming applications.
36+
* `config`: A confirmed device config update for this subblock. Unlike a
3437
[comprehensive device config message](../../tests/schemas/config/example.json)
35-
this message contains information _only_ for a single subblock. Used for writing configuration
36-
changes to a device, so will be _sent from_ a client app.
37-
* **Commands**: Streaming commands from cloud to the device. Generally not used because a model-based
38-
approach using device state is preferred.
39-
40-
In all cases, the _Subblock API_ messages encode the relevant subblock ID { pointset, discovery, ... }
41-
in the [message envelope's](../../tests/schemas/envelope/example.json) _subFolder_ field.
42-
The _subType_ field encodes the relevant type { _events_, _config_, _state_, _model_ }.
43-
44-
## System
45-
46-
* **Model**
47-
* **Event**
48-
* **State**
49-
* **Config**
50-
51-
## [Pointset](../messages/pointset.md)
52-
53-
A _pointset_ covers the structures necessary to model a device _point_ with associated data readings.
54-
This is typically what is thought of as 'device telemetry' and represents the expected end value of
55-
the device-to-cloud connection.
56-
57-
* [**Model**](../../tests/schemas/model_pointset/example.json): Expected model for what the device should
58-
be reporting.
59-
* [**Event**](../../tests/schemas/events_pointset/example.json): Streaming telemetry events from the device
60-
containing the actual data points.
61-
* [**State**](../../tests/schemas/state_pointset/example.json): State of the device points, indicating any
62-
sticky errors or status of any cloud-to-device config.
63-
* [**Config**](../../tests/schemas/config_pointset/example.json): Configuration of the device points,
64-
indicating the expected points, cloud-to-device control, etc...
65-
66-
## Discovery
67-
68-
_Discovery_ covers systems that are actively searching for systems on a network (of some kind), and
69-
returning results about what was discovered and what their capabilities are. This provides a mechanism
70-
for doing things like a BACnet discovery sequence.
71-
72-
* **Model**
73-
* **Event**
74-
* **State**
75-
* **Config**
76-
77-
## Audit
78-
79-
_Audit_ covers an external "black box" audit of a system for vulnerabilities or other characteristics.
80-
E.g., doing a port-scan of a device to see what network ports are open would be part of a network
81-
exposure audit.
82-
83-
* **Model**
84-
* **Event**
85-
* **State**
86-
* **Config**
87-
88-
## Mapping
89-
90-
The _mapping_ process covers the determination of a translation from a set of identifiers or points to
91-
a canonical or other set of identifiers or points. E.g., there's a mapping process that goes on to
92-
correlate a BACnet MAC address (such as `9832C2`) with an associated IoT ID (such as `FCU-323`).
93-
94-
* **Model**
95-
* **Event**
96-
* **State**
97-
* **Config**
98-
38+
this message contains information _only_ for a single subblock. This message is injected after
39+
the config update has been applied to the device as an effective confirmation of an applied
40+
config change.
41+
* `model`: Model-based description of this device(so does not correspond to any to/from device
42+
message). This message is generated by various tools (such as `registrar`) that manipulate the
43+
cloud-based provisioning and setup of the device. Generally, this is a live reflection of the
44+
device's `site_model` contents.
45+
46+
## _subFolder_ attribute values
47+
48+
The _subFolder_ attribute describes the semantic category for the message. There's many potential
49+
values for this field (and it can be easily extended), but there are some primary values commonly
50+
of interest (and values not relevant to any given application should be ignored).
51+
52+
* [`system`](../messages/system.md): High level information about a device as an overall entity,
53+
independent of specific functional blocks.
54+
* [`pointset`](../messages/pointset.md): Relating to point (value reading) telemetry and values.
55+
* [`gateway`](gateway.md): How devices are connected together in a logical structure to proxy information from
56+
legacy (non-UDMI) fieldbus protocols.
57+
* [`discovery`](discovery.md): Raw information from on-prem discovery about on-prem configuration and setup.
58+
* `cloud`: How a device is represented or connects to cloud infrastructure (e.g. the authentication
59+
key type).

0 commit comments

Comments
 (0)