2454a188c6efad42f2dd10d1472f25c18a32a8a1
[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             'variable'
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             'variable'
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             'list'
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             'variable'
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             'list'
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 # Reference variable type (schema.@variable.type=reference)
244 config enum
245         option value    'reference'
246         option title    'This is a reference (valueof) variable'
247         option variable 'schema.variable.type'
248
249 # Variable datatype (schema.@variable.datatype)
250 config variable
251         option name             'datatype'
252         option title    'Datatype of this variable'
253         option section  'schema.variable'
254         option type             'variable'
255         option datatype 'string'
256         option required false
257
258 # Variable validators (schema.@variable.validator)
259 config variable
260         option name             'validator'
261         option title    'Datatype of this variable'
262         option section  'schema.variable'
263         option type             'list'
264         option datatype 'string'
265         option required false
266
267 # Variable value references (schema.@variable.valueof)
268 config variable
269         option name             'valueof'
270         option title    'Reference to section or option to read values from'
271         option section  'schema.variable'
272         option type             'list'
273         option datatype 'string'
274         option required false
275
276
277 #-------------------------------------------------------------------------------
278 # Central enum definition
279 #
280 #       config enum
281 #               option ...
282 #-------------------------------------------------------------------------------
283
284 # Enum definition (schema.@enum)
285 config section
286         option name             'enum'
287         option title    'Definition of uci enum value'
288         option package  'schema'
289         option required false
290         option named    false
291         option unique   false
292         option dynamic  false
293
294 # Enum value (schema.@enum.value)
295 config variable
296         option name             'name'
297         option title    'Name of the defined variable'
298         option section  'schema.enum'
299         option type             'variable'
300         option datatype 'string'
301         option required true
302
303 # Enum variable (schema.@enum.variable)
304 config variable
305         option name             'variable'
306         option title    'Parent variable of the defined enum value'
307         option section  'schema.enum'
308         option type             'variable'
309         option datatype 'string'
310         option required true
311
312 # Enum value title (schema.@enum.title)
313 config variable
314         option name             'title'
315         option title    'Title of the defined enum value'
316         option section  'schema.enum'
317         option type             'variable'
318         option datatype 'string'
319         option required false
320
321 # Enum value description (schema.@enum.description)
322 config variable
323         option name             'description'
324         option title    'Description of the defined enum value'
325         option section  'schema.enum'
326         option type             'variable'
327         option datatype 'string'
328         option required false
329
330 # Enum value dependencies (schema.@enum.depends)
331 config variable
332         option name             'depends'
333         option title    'List of dependencies on defined variables'
334         option section  'schema.enum'
335         option type             'list'
336         option datatype 'string'
337         option required false
338
339 # Enum value default flag (schema.@enum.default)
340 config variable
341         option name             'default'
342         option title    'Specify whether this value is the default value of the parent enum'
343         option section  'schema.enum'
344         option type             'variable'
345         option datatype 'boolean'
346         option required false