Test repo to validate device-models
Перейти к файлу
Ricardo Minguez (Rido) cff9bffeae
Add Thermostat 4 inline (#23)
* add base 2

* add base2 and if1 (#9)

* undo extends

* fix thermostat casing (#19)

* fix thermostat
* fix lowercase

* Adding microchip (#20)

* Adding MeshSystem New models (#21)

* Adding microchip

* Adding Mesh new modelds

* therm 4

* fix ctx

Co-authored-by: SathishKumar Eswaran <seswar@microsoft.com>
2020-10-22 10:28:23 -07:00
.github Move back to dmr client (#18) 2020-10-14 15:31:00 -07:00
dtmi Add Thermostat 4 inline (#23) 2020-10-22 10:28:23 -07:00
test add files from fix/94 (#11) 2020-10-13 09:21:12 -07:00
tools add files from fix/94 (#11) 2020-10-13 09:21:12 -07:00
.gitignore Initial commit 2020-10-07 21:52:54 +00:00
BugBash.json Adding Nishitha/BugBash.json 2020-10-12 08:45:43 -07:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-10-07 14:53:02 -07:00
LICENSE Initial LICENSE commit 2020-10-07 14:53:00 -07:00
README.md Fix link to pq-reqs.md 2020-10-10 23:59:16 -07:00
SECURITY.md Initial SECURITY.md commit 2020-10-07 14:53:04 -07:00
SUPPORT.md Initial SUPPORT.md commit 2020-10-07 14:53:05 -07:00
package-lock.json WIP 2020-10-07 15:54:52 -07:00
package.json WIP 2020-10-07 15:54:52 -07:00
repo-convention.js add files from fix/94 (#11) 2020-10-13 09:21:12 -07:00

README.md

Azure/iot-plugandplay-models-test repository

WARNING: This is a test environment, do not use for production.

This repository includes DTDL models that are made publicly available on https://devicemodeltest.azureedge.net/. These models can be used to create Azure IoT Plug and Play solutions.

Related tools, samples, and specs can be found in the Azure/iot-plugandplay-models-tools repo. The current repo only stores test DTDL models.

Submit a model

  1. Fork the public GitHub repo: https://github.com/Azure/iot-plugandplay-models-test.
  2. Clone the forked repo. Optionally create a new branch to keep your changes isolated from the main branch.
  3. Add the new interfaces to the dtmi folder using the folder/filename convention. See the add-model tool below.
  4. Validate the models locally using the scripts to validate changes section.
  5. Commit the changes locally and push to your fork.
  6. From your fork, create a PR that targets the main branch.
  7. Review the PR requirements

The PR triggers a series of GitHub actions that will validate the new submitted interfaces, and make sure your PR satisfies all the checks.

Microsoft will respond to a PR with all checks in 3 business days.

Tools

The repo contains scripts to help managing the repo, with tools to add and valdidate files locally.

Note: These scripts require NodeJs. Don't forget to initialize the dependencies with:

npm install

add-models

If you have your model already stored in json files, you can use the add-model script to add those to the dtmi/ folder with the right file name.

npm run add-model <full-path-to-dtd.json>

Watch the console output for any error messages.

validate-files

Checks the folder and file names are expected from the root @id

npm run validate-files <list of files to validate>

validate-ids

Checks if all @id are nested under the root id.

npm run validate-ids <list of files to validate>

validate-deps

Checks if all the external dependencies in extends and @Component exists in the dtmi/ folder.

npm run validate-deps <list of files to validate>

validate-models

Checks if the models can be successfully validated by the .NET DTDL parser.

You can run the DTDL Validation Sample to validate your models locally

Consuming

Any HTTP client can consume the models by just applying the convention to translate DTMI ids to relative paths:

Eg, the interface:

dtmi:azure:DeviceManagement:DeviceInformation;1

can be retrieved from here:

https://devicemodeltest.azureedge.net/dtmi/azure/devicemanagement/deviceinformation-1.json

There are samples for .NET and Node in the iot-plugandplay-models-tools with code you can use to acquire models from your custom IoT solution.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.