Added UVL values minlength, maxlength, minimum, maximum
[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 # $Id$
4
5 package schema
6
7 #-------------------------------------------------------------------------------
8 # Central package definition
9 #
10 #       config package
11 #               option ...
12 #-------------------------------------------------------------------------------
13
14 # Section definition (schema.@package)
15 config section
16         option name             'package'
17         option title    'Definition of uci package'
18         option package  'schema'
19         option required false
20         option named    false
21         option unique   true
22         option dynamic  false
23
24 # Section title (schema.@package.title)
25 config variable
26         option name             'title'
27         option title    'Title of the defined package'
28         option section  'schema.package'
29         option type             'variable'
30         option datatype 'string'
31         option required false
32
33 # Section description (schema.@package.description)
34 config variable
35         option name             'description'
36         option title    'Description of the defined package'
37         option section  'schema.package'
38         option type             'lazylist'
39         option datatype 'string'
40         option required false
41
42
43 #-------------------------------------------------------------------------------
44 # Central section definition
45 #
46 #       config section
47 #               option ...
48 #-------------------------------------------------------------------------------
49
50 # Section definition (schema.@section)
51 config section
52         option name             'section'
53         option title    'Definition of uci section'
54         option package  'schema'
55         option required false
56         option named    false
57         option unique   false
58         option dynamic  false
59
60 # Section name (schema.@section.name)
61 config variable
62         option name             'name'
63         option title    'Name of the defined section'
64         option section  'schema.section'
65         option type             'variable'
66         option datatype 'string'
67         option required true
68
69 # Section package (schema.@section.package)
70 config variable
71         option name             'package'
72         option title    'Parent package of the defined section'
73         option section  'schema.section'
74         option type             'variable'
75         option datatype 'string'
76         option required true
77
78 # Section title (schema.@section.title)
79 config variable
80         option name             'title'
81         option title    'Title of the defined section'
82         option section  'schema.section'
83         option type             'variable'
84         option datatype 'string'
85         option required false
86
87 # Section description (schema.@section.description)
88 config variable
89         option name             'description'
90         option title    'Description of the defined section'
91         option section  'schema.section'
92         option type             'lazylist'
93         option datatype 'string'
94         option required false
95
96 # Section dependencies (schema.@section.depends)
97 config variable
98         option name             'depends'
99         option title    'List of dependencies within and between defined sections'
100         option section  'schema.section'
101         option type             'lazylist'
102         option datatype 'string'
103         option required false
104
105 # Section required flag (schema.@section.required)
106 config variable
107         option name             'required'
108         option title    'Specify whether at least one instance of this section type must be defined in config'
109         option section  'schema.section'
110         option type             'variable'
111         option datatype 'boolean'
112         option required false
113
114 # Section unique flag (schema.@section.unique)
115 config variable
116         option name             'unique'
117         option title    'Specify whether only one instance of this section type is allowed in config'
118         option section  'schema.section'
119         option type             'variable'
120         option datatype 'boolean'
121         option required false
122
123 # Section named flag (schema.@section.named)
124 config variable
125         option name             'named'
126         option title    'Specify whether sections of this type must have a name set (are not anonymous)'
127         option section  'schema.section'
128         option type             'variable'
129         option datatype 'boolean'
130         option required false
131
132 # Section dynamic flag (schema.@section.dynamic)
133 config variable
134         option name             'dynamic'
135         option title    'Specify whether sections of this type may contain arbitary, not specified options'
136         option section  'schema.section'
137         option type             'variable'
138         option datatype 'boolean'
139         option required false
140
141
142 #-------------------------------------------------------------------------------
143 # Central variable definition
144 #
145 #       config variable
146 #               option ...
147 #-------------------------------------------------------------------------------
148
149 # Variable definition (schema.@variable)
150 config section
151         option name             'variable'
152         option title    'Definition of uci variable'
153         option package  'schema'
154         option required false
155         option named    false
156         option unique   false
157         option dynamic  false
158
159 # Variable name (schema.@variable.name)
160 config variable
161         option name             'name'
162         option title    'Name of the defined variable'
163         option section  'schema.variable'
164         option type             'variable'
165         option datatype 'string'
166         option required true
167
168 # Variable section (schema.@variable.section)
169 config variable
170         option name             'section'
171         option title    'Parent section of the defined variable'
172         option section  'schema.variable'
173         option type             'variable'
174         option datatype 'string'
175         option required true
176
177 # Variable title (schema.@variable.title)
178 config variable
179         option name             'title'
180         option title    'Title of the defined variable'
181         option section  'schema.variable'
182         option type             'variable'
183         option datatype 'string'
184         option required false
185
186 # Variable description (schema.@variable.description)
187 config variable
188         option name             'description'
189         option title    'Description of the defined variable'
190         option section  'schema.variable'
191         option type             'lazylist'
192         option datatype 'string'
193         option required false
194
195 # Variable dependencies (schema.@variable.depends)
196 config variable
197         option name             'depends'
198         option title    'List of dependencies between defined variables'
199         option section  'schema.variable'
200         option type             'lazylist'
201         option datatype 'string'
202         option required false
203
204 # Variable required flag (schema.@variable.required)
205 config variable
206         option name             'required'
207         option title    'Specify whether this variable must be set in config'
208         option section  'schema.variable'
209         option type             'variable'
210         option datatype 'boolean'
211         option required false
212
213 # Variable multiple values flag (schema.@variable.multival)
214 config variable
215         option name             'multival'
216         option title    'Specify whether this variable may contain multiple values separated by space'
217         option section  'schema.variable'
218         option type             'variable'
219         option datatype 'boolean'
220         option required false
221
222 # Variable type (schema.@variable.type)
223 config variable
224         option name             'type'
225         option title    'Type of this variable'
226         option section  'schema.variable'
227         option type             'enum'
228         option datatype 'string'
229         option required false
230
231 # Plain variable type (schema.@variable.type=variable)
232 config enum
233         option value    'variable'
234         option title    'This is a plain variable'
235         option variable 'schema.variable.type'
236
237 # Enum variable type (schema.@variable.type=enum)
238 config enum
239         option value    'enum'
240         option title    'This is a enum variable'
241         option variable 'schema.variable.type'
242
243 # List variable type (schema.@variable.type=list)
244 config enum
245         option value    'list'
246         option title    'This is a list variable'
247         option variable 'schema.variable.type'
248
249 # List-or-Option variable type (schema.@variable.type=lazylist)
250 config enum
251         option value    'lazylist'
252         option title    'This is a list or option variable'
253         option variable 'schema.variable.type'
254
255 # Reference variable type (schema.@variable.type=reference)
256 config enum
257         option value    'reference'
258         option title    'This is a reference (valueof) variable'
259         option variable 'schema.variable.type'
260
261 # Variable datatype (schema.@variable.datatype)
262 config variable
263         option name             'datatype'
264         option title    'Datatype of this variable'
265         option section  'schema.variable'
266         option type             'variable'
267         option datatype 'string'
268         option required false
269
270 # Variable default value (schema.@variable.default)
271 config variable
272         option name             'default'
273         option title    'Default value of this variable'
274         option section  'schema.variable'
275         option type             'variable'
276         option datatype 'string'
277         option required false
278         
279 # Variable minimum length (schema.@variable.minlength)
280 config variable
281         option name             'minlength'
282         option title    'Minimum length of this variable'
283         option section  'schema.variable'
284         option type             'variable'
285         option datatype 'uint'
286         option required false
287         
288 # Variable maximum length (schema.@variable.minlength)
289 config variable
290         option name             'maxlength'
291         option title    'Maximum length of this variable'
292         option section  'schema.variable'
293         option type             'variable'
294         option datatype 'uint'
295         option required false
296         
297 # Variable minimum value (schema.@variable.minlength)
298 config variable
299         option name             'minimum'
300         option title    'Minimum value of this variable'
301         option section  'schema.variable'
302         option type             'variable'
303         option datatype 'integer'
304         option required false
305         
306 # Variable maximum value (schema.@variable.minlength)
307 config variable
308         option name             'maximum'
309         option title    'Maximum value of this variable'
310         option section  'schema.variable'
311         option type             'variable'
312         option datatype 'integer'
313         option required false
314
315 # Variable validators (schema.@variable.validator)
316 config variable
317         option name             'validator'
318         option title    'Datatype of this variable'
319         option section  'schema.variable'
320         option type             'lazylist'
321         option datatype 'string'
322         option required false
323
324 # Variable value references (schema.@variable.valueof)
325 config variable
326         option name             'valueof'
327         option title    'Reference to section or option to read values from'
328         option section  'schema.variable'
329         option type             'lazylist'
330         option datatype 'string'
331         option required false
332
333
334 #-------------------------------------------------------------------------------
335 # Central enum definition
336 #
337 #       config enum
338 #               option ...
339 #-------------------------------------------------------------------------------
340
341 # Enum definition (schema.@enum)
342 config section
343         option name             'enum'
344         option title    'Definition of uci enum value'
345         option package  'schema'
346         option required false
347         option named    false
348         option unique   false
349         option dynamic  false
350
351 # Enum value (schema.@enum.value)
352 config variable
353         option name             'value'
354         option title    'Value of the defined enum value'
355         option section  'schema.enum'
356         option type             'variable'
357         option datatype 'string'
358         option required true
359
360 # Enum variable (schema.@enum.variable)
361 config variable
362         option name             'variable'
363         option title    'Parent variable of the defined enum value'
364         option section  'schema.enum'
365         option type             'variable'
366         option datatype 'string'
367         option required true
368
369 # Enum value title (schema.@enum.title)
370 config variable
371         option name             'title'
372         option title    'Title of the defined enum value'
373         option section  'schema.enum'
374         option type             'variable'
375         option datatype 'string'
376         option required false
377
378 # Enum value description (schema.@enum.description)
379 config variable
380         option name             'description'
381         option title    'Description of the defined enum value'
382         option section  'schema.enum'
383         option type             'lazylist'
384         option datatype 'string'
385         option required false
386
387 # Enum value dependencies (schema.@enum.depends)
388 config variable
389         option name             'depends'
390         option title    'List of dependencies on defined variables'
391         option section  'schema.enum'
392         option type             'lazylist'
393         option datatype 'string'
394         option required false
395
396 # Enum value default flag (schema.@enum.default)
397 config variable
398         option name             'default'
399         option title    'Specify whether this value is the default value of the parent enum'
400         option section  'schema.enum'
401         option type             'variable'
402         option datatype 'boolean'
403         option required false