-
Notifications
You must be signed in to change notification settings - Fork 18
Resolvers
Resolution is the process of getting all required interfaces associated to a given
dtmi
.
Models available in the Model Repo can be resolved by Model Resolver Client (s) using a signature similar like:
IDictionary<dtmi,dtdlJson> dtdlInterfaces = resolver('dtmi:com:example:TemperatureController;1')
The resolver is responsible for:
- Allow to configure different Model Repositories (federation)
- If none is configured , it will use the Public Device Model Repository by default
- Convert the DTMI to a relative path, as described in the Resolution-Convention
- All interface dependencies, from
extends
and@Component
will be retrieved from- A
.expanded.json
file with all the dependencies already flattened in an array - The first element in the array MUST be the root interface
- Calculating the dependencies using the
expand
algorithm in the client
- A
- Allow to acquire the interfaces ahead of time (before parsing)
- Allow to configure the DTDL parser to resolve on demand
DTDL v2 allows to reference external interfaces in extends
and @Component
:
- There is only one level of nested
@Component
-
extends
can have multiple levels and can contain components.
The DMR client can resolve dependencies with two options
- From the
extended.json
file (dependencies already pre-calculated) - From the client, making one call per interface and composing the resulting Array
The DMR client can work with a configurable registry, this value can point to a local folder
or a url
.
For the MVP release we dont need to resolve from multiple repos at the same time, the feature will be enabled in a feature release.
TBD. Handle repositories with authentication.
The client will throw exceptions in the next cases:
- The configured host (by FQDN) is not accessible
- The request path returns a 500 HTTP status code. (200, 300, and 400 ranges should be expected)
- Retrieved incorrect JSON document without the required DTDL fields:
@id
,extends
,contents
When the resolver can't find ALL the required interfaces, it will return an EMPTY array without raising any exception.
The DMR Client SDK will be available as a package (NuGet, NPM, Maven, PiP) with a library to be consumed by any application using the targeted language.
Internal versions are available in the ADO feed: https://dev.azure.com/azure-iot-pnp/azure-iot-pnp-libraries
Additionally, we will provide a CLI that makes use of the Parser - with the resolver configured - to enable CLI validation.
The Validation-Pipeline will use the CLI to validate the submitted models are DTDL compliant.
We will provide samples to showcase how to interact with the DMR
The libraries, namespaces and libraries will use the next prefixes:
- [TBD]
Azure.DeviceModelRepo.Client
- [TBD]
dmr-cli
The SDK, CLI and Samples will be released within the next schedule
Platform | Package | Milestone | Date |
---|---|---|---|
.NET | Samples | MVP GA | 10/14 |
.NET | SDK | Internal Preview | 10/14 |
.NET | CLI | Internal Preview | 10/14 |
.NET | SDK | Public Preview | TBD |
.NET | CLI | Public Preview | TBD |
.NET | SDK | v1.0.0 | TBD |
.NET | CLI | v1.0.0 | TBD |
.NET | Samples | v1.0.0 | TBD |
Node | SDK | Internal Preview | TBD |
Node | CLI | Internal Preview | TBD |
Node | SDK | Public Preview | TBD |
Node | CLI | Public Preview | TBD |
Node | SDK | v1.0.0 | TBD |
Node | CLI | v1.0.0 | TBD |
Node | Samples | v1.0.0 | TBD |