Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.

Latest commit

 

History

History
136 lines (119 loc) · 4.51 KB

schema-tables.md

File metadata and controls

136 lines (119 loc) · 4.51 KB

Schema Tables

Overview

The device agent and its capabilities (handlers) communicate with the cloud through a pre-defined json schema.

The high-level description of this schema is as follows:

{
    "desired":{
        "configuration-group-id": {
            [sub-group-0-start][n/a|optional|required]
            "sub_group_0_prop_0": "value" [n/a|optional|required],
            "sub_group_0_prop_1": "value" [n/a|optional|required],
            [sub-group-0-end]
            [sub-group-1-start][n/a|optional|required]
            "sub_group_1_prop_0": "value" [n/a|optional|required],
            "sub_group_1_prop_1": "value" [n/a|optional|required]
            [sub-group-1-end]
        }
    },
    "reported":{
        "configuration-group-id": {
            [sub-group-0-start][yes|no]
            "sub_group_0_prop_0": "value" [yes|no],
            "sub_group_0_prop_1": "value" [yes|no],
            [sub-group-0-end]
            [sub-group-1-start][yes|no]
            "sub_group_1_prop_0": "value" [yes|no],
            "sub_group_1_prop_1": "value" [yes|no]
            [sub-group-1-end]
        }
    }
}

Notes

  • Anything between square brackets is an annotation describing the intention and is not an actual attribute in the json.
  • Sub-groups are the logical children of a group. Properties are the logical children of a sub-group. For more on groups and sub-groups, see the Configuration Granularity page.

Desired Schema

  • When a desired property is marked 'required', it is required in relative to its sub-group. However, the sub-group as a whole can be optional.
  • When a desired sub-group is marked n/a, consequently all its properties are n/a.

Reported Schema

  • A sub-group marked to be reported ('yes') does not necessarily mean all its properties will be reported. That's why each individual property can indicate whether it is reported or not.
  • On the other hand, if a sub-group is marked to be not reported ('no'), all its properties will be marked 'no' too.

The Schema Table Format

To represent the above relationships, each handler fills out a table in the following format:

Sub-Group Properties
Sub-Group-0 Title

Desired: n/a|optiona|required
Reported: Yes|No

Sub-Group-0 description.
`sub_group_0_prop_0` Typedata_type
Desiredn/a|optiona|required
ReportedYes|No
Descriptionsub_group_0_prop_0 description and values.
`sub_group_0_prop_1` Typedata_type
Desiredn/a|optiona|required
ReportedYes|No
Descriptionsub_group_0_prop_1 description and values.
Sub-Group-1 Title

Desired: n/a|optiona|required
Reported: Yes|No

Sub-Group-1 description.
`sub_group_0_prop_0` Typedata_type
Desiredn/a|optiona|required
ReportedYes|No
Descriptionsub_group_0_prop_0 description and values.
`sub_group_0_prop_1` Typedata_type
Desiredn/a|optiona|required
ReportedYes|No
Descriptionsub_group_0_prop_1 description and values.

Related Topics:


Home | Device Agent | Reference