* luci/libs: uvl: add reference meta scheme
[project/luci.git] / libs / uvl / root / lib / uci / schema / meta / schema
1 # UVL - Reference-Spec
2 # This is a meta scheme defining the format of uci schemes.
3 # Note that this spec is overly strict, it requires that the "depends",
4 # "valueof" and "validator" fields are of type list but if only one value is
5 # given, the notation as "option" is allowed too.
6 # $Id$
7
8 package schema
9
10 #-------------------------------------------------------------------------------
11 # Central section definition
12 #
13 # config section
14 # option ...
15 #-------------------------------------------------------------------------------
16
17 # Section definition (schema.@section)
18 config section
19 option name 'section'
20 option title 'Definition of uci section'
21 option package 'schema'
22 option required false
23 option named false
24 option unique false
25 option dynamic false
26
27 # Section name (schema.@section.name)
28 config variable
29 option name 'name'
30 option title 'Name of the defined section'
31 option section 'schema.section'
32 option type 'variable'
33 option datatype 'string'
34 option required true
35
36 # Section package (schema.@section.package)
37 config variable
38 option name 'package'
39 option title 'Parent package of the defined section'
40 option section 'schema.section'
41 option type 'variable'
42 option datatype 'string'
43 option required true
44
45 # Section title (schema.@section.title)
46 config variable
47 option name 'title'
48 option title 'Title of the defined section'
49 option section 'schema.section'
50 option type 'variable'
51 option datatype 'string'
52 option required false
53
54 # Section description (schema.@section.description)
55 config variable
56 option name 'description'
57 option title 'Description of the defined section'
58 option section 'schema.section'
59 option type 'variable'
60 option datatype 'string'
61 option required false
62
63 # Section dependencies (schema.@section.depends)
64 config variable
65 option name 'depends'
66 option title 'List of dependencies within and between defined sections'
67 option section 'schema.section'
68 option type 'list'
69 option datatype 'string'
70 option required false
71
72 # Section required flag (schema.@section.required)
73 config variable
74 option name 'required'
75 option title 'Specify whether at least one instance of this section type must be defined in config'
76 option section 'schema.section'
77 option type 'variable'
78 option datatype 'boolean'
79 option required false
80
81 # Section unique flag (schema.@section.unique)
82 config variable
83 option name 'unique'
84 option title 'Specify whether only one instance of this section type is allowed in config'
85 option section 'schema.section'
86 option type 'variable'
87 option datatype 'boolean'
88 option required false
89
90 # Section named flag (schema.@section.named)
91 config variable
92 option name 'named'
93 option title 'Specify whether sections of this type must have a name set (are not anonymous)'
94 option section 'schema.section'
95 option type 'variable'
96 option datatype 'boolean'
97 option required false
98
99 # Section dynamic flag (schema.@section.dynamic)
100 config variable
101 option name 'dynamic'
102 option title 'Specify whether sections of this type may contain arbitary, not specified options'
103 option section 'schema.section'
104 option type 'variable'
105 option datatype 'boolean'
106 option required false
107
108
109 #-------------------------------------------------------------------------------
110 # Central variable definition
111 #
112 # config variable
113 # option ...
114 #-------------------------------------------------------------------------------
115
116 # Variable definition (schema.@variable)
117 config section
118 option name 'variable'
119 option title 'Definition of uci variable'
120 option package 'schema'
121 option required false
122 option named false
123 option unique false
124 option dynamic false
125
126 # Variable name (schema.@variable.name)
127 config variable
128 option name 'name'
129 option title 'Name of the defined variable'
130 option section 'schema.variable'
131 option type 'variable'
132 option datatype 'string'
133 option required true
134
135 # Variable section (schema.@variable.section)
136 config variable
137 option name 'section'
138 option title 'Parent section of the defined variable'
139 option section 'schema.variable'
140 option type 'variable'
141 option datatype 'string'
142 option required true
143
144 # Variable title (schema.@variable.title)
145 config variable
146 option name 'title'
147 option title 'Title of the defined variable'
148 option section 'schema.variable'
149 option type 'variable'
150 option datatype 'string'
151 option required false
152
153 # Variable description (schema.@variable.description)
154 config variable
155 option name 'description'
156 option title 'Description of the defined variable'
157 option section 'schema.variable'
158 option type 'variable'
159 option datatype 'string'
160 option required false
161
162 # Variable dependencies (schema.@variable.depends)
163 config variable
164 option name 'depends'
165 option title 'List of dependencies between defined variables'
166 option section 'schema.variable'
167 option type 'list'
168 option datatype 'string'
169 option required false
170
171 # Variable required flag (schema.@variable.required)
172 config variable
173 option name 'required'
174 option title 'Specify whether this variable must be set in config'
175 option section 'schema.variable'
176 option type 'variable'
177 option datatype 'boolean'
178 option required false
179
180 # Variable type (schema.@variable.type)
181 config variable
182 option name 'type'
183 option title 'Type of this variable'
184 option section 'schema.variable'
185 option type 'enum'
186 option datatype 'string'
187 option required false
188
189 # Plain variable type (schema.@variable.type=variable)
190 config enum
191 option value 'variable'
192 option title 'This is a plain variable'
193 option variable 'schema.variable.type'
194
195 # Enum variable type (schema.@variable.type=enum)
196 config enum
197 option value 'enum'
198 option title 'This is a enum variable'
199 option variable 'schema.variable.type'
200
201 # List variable type (schema.@variable.type=list)
202 config enum
203 option value 'list'
204 option title 'This is a list variable'
205 option variable 'schema.variable.type'
206
207 # Reference variable type (schema.@variable.type=reference)
208 config enum
209 option value 'reference'
210 option title 'This is a reference (valueof) variable'
211 option variable 'schema.variable.type'
212
213 # Variable datatype (schema.@variable.datatype)
214 config variable
215 option name 'datatype'
216 option title 'Datatype of this variable'
217 option section 'schema.variable'
218 option type 'variable'
219 option datatype 'string'
220 option required false
221
222 # Variable validators (schema.@variable.validator)
223 config variable
224 option name 'validator'
225 option title 'Datatype of this variable'
226 option section 'schema.variable'
227 option type 'list'
228 option datatype 'string'
229 option required false
230
231 # Variable value references (schema.@variable.valueof)
232 config variable
233 option name 'valueof'
234 option title 'Reference to section or option to read values from'
235 option section 'schema.variable'
236 option type 'list'
237 option datatype 'string'
238 option required false
239
240
241 #-------------------------------------------------------------------------------
242 # Central enum definition
243 #
244 # config enum
245 # option ...
246 #-------------------------------------------------------------------------------
247
248 # Enum definition (schema.@enum)
249 config section
250 option name 'enum'
251 option title 'Definition of uci enum value'
252 option package 'schema'
253 option required false
254 option named false
255 option unique false
256 option dynamic false
257
258 # Enum value (schema.@enum.value)
259 config variable
260 option name 'name'
261 option title 'Name of the defined variable'
262 option section 'schema.enum'
263 option type 'variable'
264 option datatype 'string'
265 option required true
266
267 # Enum variable (schema.@enum.variable)
268 config variable
269 option name 'variable'
270 option title 'Parent variable of the defined enum value'
271 option section 'schema.enum'
272 option type 'variable'
273 option datatype 'string'
274 option required true
275
276 # Enum value title (schema.@enum.title)
277 config variable
278 option name 'title'
279 option title 'Title of the defined enum value'
280 option section 'schema.enum'
281 option type 'variable'
282 option datatype 'string'
283 option required false
284
285 # Enum value description (schema.@enum.description)
286 config variable
287 option name 'description'
288 option title 'Description of the defined enum value'
289 option section 'schema.enum'
290 option type 'variable'
291 option datatype 'string'
292 option required false
293
294 # Enum value dependencies (schema.@enum.depends)
295 config variable
296 option name 'depends'
297 option title 'List of dependencies on defined variables'
298 option section 'schema.enum'
299 option type 'list'
300 option datatype 'string'
301 option required false
302
303 # Enum value default flag (schema.@enum.default)
304 config variable
305 option name 'default'
306 option title 'Specify whether this value is the default value of the parent enum'
307 option section 'schema.enum'
308 option type 'variable'
309 option datatype 'boolean'
310 option required false