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