Config Meta
Note
config_data
, config_meta
and config_tree
objects must always be
compatible with each other and most of the time should be treated as one unit.
config_meta
holds information needed to ensure that config_data
can be
displayed and edited (i.e. enum options) and that correct config_data
can be
produced (i.e. validators).
Model
All Config Meta are divided into several groups defined by Config Top-Level Meta
model (e.g. main
).
Each of these groups contains specific values that are represented with Config
Directive Meta model. (e.g. device_name
).
Config Directive Meta model represents either scalar or tabular values. If
the value is tabular (type=table
), the Config Directive Meta for the individual
columns are represented with Column model in the columns
attribute.
Config Directives can reference each other via an identifier seid
.
Attributes disabled
, permission_edit
and permission_view
support
inheritance across all three layers defined above,
Config Top-Level Meta
attribute | description |
---|---|
children* Config Directive Meta |
The meta information for the individual configuration directives. |
disabledConfig Disabler |
Disabler for all nested fields. |
permission_editunsigned integer |
The maximum permission level the user must have to be granted edit permission. |
permission_viewunsigned integer |
The maximum permission level the user must have to be granted view permission. |
Config Directive Meta
attribute | description |
---|---|
label* i18n |
The user facing label of the directive. |
type* Type |
Defines the data type. |
options[Option] | [Option Group] |
The options to be offered when type=enum |
option_sort'asc'|'desc' |
The direction how to sort entries in the options by translated label. If not provided, options are presented in the order as send by the API. |
columns[Column] |
Column definitions when type=table . |
precisionunsigned integer |
Indicates number of digits after the decimal point when type=number . |
defaultbool|string|number |
The default value for this directive. |
validConfig Validator |
Validator for this directive. |
disabledConfig Disabler |
Disabler for this directive and all its children. |
permission_editunsigned integer |
The maximum permission level the user must have to be granted edit permission. |
permission_viewunsigned integer |
The maximum permission level the user must have to be granted view permission. |
docs_linkstring |
Link to the relevant place in documentation. |
Data type
type | description |
---|---|
bool | Can be represented either by true /false and 1 /0 |
number | Distinction between integer and float is done by the precision attribute |
hex | Sequence of hexadecimal numbers |
string | A string of characters |
password | String that must be handled as secure |
ipv4 | String in the form "x.x.x.x" where x must be an unsigned integer between 0-255 |
ipv6 | String in the form "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx", where x must be a hexadecimal number |
mac6 | String in the form "xx:xx:xx:xx:xx:xx", where x must be a hexadecimal number |
enum | Value from a predefined set |
table | Value is array of objects |
Option Group
type | description |
---|---|
options* [Option] |
The options belonging to this Option Group |
option_sort'asc'|'desc' |
The direction how to sort entries in the options by translated label. If not provided, options are presented in the order as send by the API. |
label* i18n |
The user facing label of this Option Group. |
disabledConfig Disabler |
Disabler for this Option Group. |
Option
type | description |
---|---|
value* integer |
The data value of this Option. |
label* i18n |
The user facing label of this Option. |
disabledConfig Disabler |
Disabler for this Option. |
Column
type | description |
---|---|
label* i18n |
The user facing label of the column. |
type* Type |
Defines the data type. |
precisionunsigned integer |
Indicates the number of digits after the decimal point when type=number . |
optionsOption |
The options to be offered when type=enum |
defaultbool|string|number |
The default value for this directive. |
validConfig Validator |
Validator for this directive. |
disabledConfig Disabler |
Disabler for this directive and all its children. |
permission_editunsigned integer |
The maximum permission level the user must have to be granted edit permission. |
permission_viewunsigned integer |
The maximum permission level the user must have to be granted view permission. |
docs_linkstring |
Link to the relevant place in documentation. |
Example
{
"main": {
"disabled": "TODO!",
"permission_edit": 500,
"permission_view": 500,
"children": {
"device_name": {
"label": "device-name-translation-key",
"type": "string",
"default": "My Station",
"disabled": "TODO!",
"valid": "TODO!",
"permission_edit": 400,
"permission_view": 400,
"docs_link": "/help/device#device_name"
},
"admins":{
"label": "admins-translation-key",
"type": "table",
"columns": {
"name": {
"label": "name-translation-key",
"type": "string"
},
"age": {
"label": "age-translation-key",
"type": "number",
"precision": 0
},
"department_id": {
"label": "department-translation-key",
"type": "enum",
"options": [
{
"value": 3,
"label": "sales-translation-key",
"disabled": "TODO!"
}
]
}
}
}
}
}
}