UDMI / Docs / Specs / Metadata
A device's metadata.json
is a description about the device: a specification
about how the device should be configured and expectations about what the device
should be doing. It is used to provide the basic information for registering
devices in a IoT Core registry, generation of other template files (e.g.
config block) associated with the device, and as a means for runtime
validation of what the device is actually sending.
The metadata.json
files are stored in a devices/{device_id}
directory
with an expected 1:1 mapping between device directory and device entry
in a IoT Core registry.
There are three main sets of tools that rely on the metadata.json
file,
all found in the UDMI bin/
directory.
genkeys
: Generates public/private device key pairs (optional as needed).registrar
: Validates metadata files and can (optionally) register devices.validator
: Validates live data stream from devices.
The various tools will generate some output files in the same devices/
directory:
rsa_*
: Device public/private key files (genkeys
tool).metadata_norm.json
: Normalized version of themetadata.json
file (registrar
tool).generated_config.json
: Default device IoT Coreconfig
block (registrar
tool).errors.map
: Detailed error file (registrar
tool).
The structure of the metadata file is shown in the 🧬metadata schema
Using UDMI on a project entails not only the base device implementations, but also properly registering and validating device configuration. The registrar tool and validator tool provide a means to configure and check site installations, respectively.
This working example shows how a typical metadata
file
is constructed.