UDMI / Docs / Specs / Site Model
A project “site model” contains information necessary to specify the configuration for a particular site. This is a logical representation of the underlying information, and can be applied against different cloud projects or device configurations to ensure that things are configured appropriately. It’s fundamentally the building model that describes the on-prem devices and how they communicate with the cloud.
Typically, each site has its own git repo, with the site model files (cloud_iot_config.json,
devices/, reflector/, etc.) located either at the repository root or inside a udmi/
subdirectory (<repo>/udmi/) when the repository also stores non-UDMI site artifacts.
For test and development, this only needs to be an on-disk directory.
The udmi_site_model repo
provides an up-to-date example of what a site model might look like (actively used by some
of the integration tests).
At a high-level, the various constructs relevant to UDMI are (described in more detail below):
cloud_iot_config.jsondevices/reflector/The primary use of the site_model will be through the registrar and
validator tools. Primarily, they look for the existence of metadata
device/{device_id}/metadata.json files in the site model and process the information found there.
cloud_iot_config.jsonThe cloud_iot_config.json schema specifies some cloud-centric configuration parameters (example).
devices/The devices directory contains a set of descriptions for individual devices in the system. Each
device directory name corresponds to the Cloud IoT Core device entry and represents the canonical
name for the device. Inside of this directory will be various bits and pieces of information used
by different tools for managing the devices.
metadata.json: Metadata description of the device.out/metadata_norm.json: Generated normalized version of the metadata.json file (generated by the registrar tool from the metadata file)out/generated_config.json: Generated default config block (generated by the registrar tool from the metadata).rsa_private.pem: Private device key.rsa_private.pkcs8: Private device key (binary format).rsa_public.pem: Public device key (for registering with the cloud registry).reflector/The reflector directory contains the key pair (rsa_private.pem, rsa_private.pkcs8, and rsa_public.pem) used by reflector tools (registrar, validator, sequencer) to authenticate as this site (projects/<PROJECT_ID>/locations/<REGION>/registries/UDMI-REFLECT/devices/<SITE_ID>) when connecting via //gbos/<PROJECT_ID>. The corresponding rsa_public.pem must be registered under devices/<SITE_ID>/ in the target project’s UDMI-REFLECT registry.