/
yumaworks-extensions.yang
576 lines (466 loc) · 17.7 KB
/
yumaworks-extensions.yang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
module yumaworks-extensions {
namespace "http://yumaworks.com/ns/yumaworks-extensions";
prefix "ywx";
organization "YumaWorks, Inc.";
contact
"Support <support@yumaworks.com>";
description
"This module contains definitions for YumaWorks YANG extensions.
Copyright (c) 2012 - 2024 YumaWorks, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the BSD 3-Clause License
http://opensource.org/licenses/BSD-3-Clause";
revision 2024-03-16 {
description
"23.10-7:
- Add hidden-from-cli extension.";
}
revision 2024-03-04 {
description
"23.10-6:
- Add sort-type extension.";
}
revision 2023-04-19 {
description
"Add sil-xpath-function extension.";
}
revision 2021-12-14 {
description
"Update sil-aio-get2 extension. Remove reference to default values.";
}
revision 2020-03-31 {
description
"Update sil-aio-get2 extension. Add argument parameter to it";
}
revision 2019-12-06 {
description
"Add xpath-operational-ok extension.
Add sil-aio-get2 extension.";
}
revision 2019-01-04 {
description
"Add sil-test-get-when extension.";
}
revision 2018-03-24 {
description
"Add errmsg and sub-statement extensions.";
}
revision 2018-01-08 {
description
"Add no-sil-delete-children-first extension.";
}
revision 2017-12-26 {
description
"Add no-nvstore extension.";
}
revision 2015-05-08 {
description
"Add sil-priority extension.";
}
revision 2014-08-10 {
description
"Add sil-force-replace-replay extension.";
}
revision 2014-06-05 {
description
"Add sil-force-replay extension.";
}
revision 2014-04-08 {
description
"Add datapath extension.";
}
revision 2013-11-23 {
description
"Add exclusive-rpc extension.";
}
revision 2013-05-30 {
description
"Fix some missing argument clauses in the documentation.
Comment out notif-root and rpc-hook extensions for now because
they are not used in YANG-API.";
}
revision 2013-01-27 {
description
"Add help string extension.";
}
revision 2012-06-28 {
description
"Initial version";
}
extension alt-name {
argument name {
yin-element false;
}
description
"Used within a data node definition to specify an alternate
name for the node. The --alt-names parameter must
be enabled for these names to be used. The argument is the
alternate name to use. It must be a valid YANG identifier.";
}
extension rpc-root {
description
"Used within a container definition to indicate it is
really a root container for a conceptual NETCONF
operations, instead of just a container. The container
is expected to be empty. Any top-level rpc-stmt can
be specified using a QName value with the same module
and local name as the RPC operation definition.
This extension is reserved and only used by the server.";
}
extension urlpath {
description
"Used within a leaf or leaf-list definition to indicate it is
really a REST URI path string, not a plain string.";
}
extension cli-text-block {
description
"If this extension is present in an empty container
or list, it will be treated in unit-test parsing as a
container or list of ordered text commands, 1 per line.
Line extension is needed to wrap a command into
many lines.
Example YANG:
container setup {
ywx:cli-text-block;
}
Example test script or conf file usage:
setup {
run test1-script
get-config source=running
lock target=candidate
}
";
}
extension help {
description
"Used within a rpc or data definition statement to
provide a short help text string for CLI
and other applications to use in addition to
the description statement.
The 'helptext' argument is the help text string,
which should be 60 characters or less in length.";
argument helptext {
yin-element true;
}
}
extension exclusive-rpc {
description
"Used within an rpc definition statement to
indicate that the RPC is not allowed to be called
concurrently by different sessions. The server will
return an in-use error if another session is currently
invoking the RPC operation and this extension is present
in the rpc-stmt.";
}
extension datapath {
description
"Used within a container or anyxml definition to indicate
that the object path for the data node should be sent
in the value as an attribute. The SIL-SA parser will use
the datapath attribute to select the object template
to use for parsing, instead of generic anyxml.
anyxml newval {
ywx:datapath;
}
anyxml curval {
ywx:datapath;
}
If /foo/bar/leaf2 is edited, the <edit> message
will be generated with the datapath attribute
from the yumaworks-attrs module.
<newval ywattrs:datapath='/foo/bar/leaf2'>42</newval>
<curval ywattrs:datapath='/foo/bar/leaf2'>67</curval>
";
}
extension sil-force-replay {
description
"Used within a configuration data node definition statement
to indicate that the SIL (or SIL-SA) callback should be
invoked even for nodes that are not changing. At least
one descendant-or-self node must be changing in order
for any of the SIL callbacks for unchanged sibling nodes
to be invoked.";
}
extension sil-force-replace-replay {
description
"Used within a configuration data node definition statement
to indicate that the SIL (or SIL-SA) callback should be
invoked even for nodes that are not changing, during a
replace operation. All SIL callbacks for child nodes
in the replace request (where the parent node contains
this extension) will be invoked during edit processing.
If this extension is used within a list statement, then
SIL callbacks for all instances of the list that are
provided in the replace operation will be invoked.";
}
extension sil-priority {
description
"Used to control the order that SIL or SIL-SA callbacks
are invoked for specific objects.
If this extension is used within a configuration database
object then the SIL priority for the object will be assigned
the value of the 'prio' argument.
Only the order of the 'apply', 'commit' and 'rollback'
callback phases will be affected by this parameter.
The 'validate' phase callbacks are invoked in the
order they appear in the edit request.
The 'prio' argument must be a number between 1 and 255.
If two objects are edited in the same edit request, the
the one with the lowest SIL priority number will be
executed first.
If no sil-priority is set for an object, then the value
of its nearest ancestor with the sil-priority extension
set will be used. If there is none, the the default
value of '255' will be used.
If the SIL priority is the same for two objects in the
same edit request, then the server will pick an order
in an implementation-specific manner.";
argument prio;
}
extension no-nvstore {
description
"Used within a configuration data node definition statement
to indicate that configuration changes made to the object
will not be stored in non-volatile storage. The configuration
node will be handled in an implementation-specific manner.
There is no argument defined for this extension.
The extension applies to the specified node and all
its descendants.";
}
extension no-sil-delete-children-first {
description
"Used within a configuration data node definition statement
to indicate that the --sil-delete-children-first parameter
should be ignored for this subtree, if it is set to 'true'.
Faster server performance can be achieved by deleting
an entire subtree at once, and this extension allows
the developer to force this behavior for the selected
SIL libraries that can support such deletion.
This is the opposite of the sil-delete-children-first
extension. Note that this extension applies to the
entire subtree, not just the node that contains this
extension. There are no parameters defined.";
}
extension errmsg {
description
"Used within a data node statement to define
a custom error-message filed within an 'rpc-error'
or 'error' structure for some or all error conditions.
The string format is restricted to plain text with
the exception of the 2 character sequence '%s'.
This special sequence will be replaced in the
dynamic error message generation if an errmsg-parm
statement is found to match the escape sequence.
If this extension statement has no sub-statements,
then it matches all errors for the object.
If 'errmsg-tag' sub-statements are found, then
this entry will match only those error-tag values.
If 'errmsg-apptag' sub-statements are found, then
this entry will match only those error-app-tag values.
The 'basestr' argument must be formatted string.
If any parameters are specified, then the corresponding
'errmsg-parm' extension statements must be encoded within
this errmsg statement.
Multiple errmsg statements can be present in the same
data node statement. They will be processed in order
and the first matching statement will be used to
generate the error-message value.
Example:
leaf my-network-id {
type int32;
ywx:errmsg 'Not a valid network ID for interface %s' {
ywx:errmsg-parm '../../if:name';
ywx:errmsg-apptag 'network-error';
}
}
";
argument basestr;
}
extension errmsg-parm {
description
"Used within an errmsg statement to define
a parameter for expansion within the errmsg basestr.
There should be the correct number of expected parameters
for the corresponding 'basestr' format string.
The 'parmstr' argument must be an XPath path expression.
The context node will be the data node containing the
errmsg statement.
";
argument parmstr;
}
extension errmsg-tag {
description
"Used within an errmsg statement to define an
error-tag value that will filter this errmsg.
Multiple errmsg-tag and/or errmsg-apptag values
form a conceptual OR expression.
The 'tagstr' argument must be the error-tag value
that will be matched.
";
argument tagstr;
}
extension errmsg-apptag {
description
"Used within an errmsg statement to define an
error-app-tag value that will filter this errmsg.
Multiple errmsg-tag and/or errmsg-apptag values
form a conceptual OR expression.
The 'apptagstr' argument must be the error-app-tag
value that will be matched.
";
argument apptagstr;
}
extension errmsg-lang {
description
"Used within an errmsg statement to define the
language code value that will filter this errmsg.
Only one errmsg-lang statement may appear within
an errmsg statement. The 'langstr' value will
be compared to the 'errmsg-lang' CLI variable setting.
If the strings are the same, the entry is used.
If this statement is not present, then the errmsg entry
will be used regardless of the 'errmsg-lang' CLI variable
setting.
The 'langstr' argument must be the language code
value that will be matched.
";
argument langstr;
}
extension sil-test-get-when {
description
"Used within a data definition statement to define
the --sil-get-test-when CLI parameter behavior for
a single object. This extension does not affect the
descendant data nodes.
The 'boolval' argument must be the string 'true'
or 'false'; If 'true' the object will be tested
for when-stmts if any need to be evaluated during
retrieval operations. If 'false' then any when-stmts
will be ignored during retrieval operations.
This extension will override the --sil-test-get-when
global CLI parameter. This extension will have no affect
unless the value is different than this CLI parameter.
";
argument boolval;
}
extension sil-aio-get2 {
description
"Used within a data definition statement to define
the GET2 retrieval mechanism.
This extension affects the descendant data nodes.
This extension can be used in a container or list
to force the server to treat that data subtree as
a terminal node for GET2.
The entire subtree would be expected in one retrieval
in one callback invocation.
The entire subtree can be specified in the JSON
or XML buffer that will be used for return values.
The server will parse and handle the buffer and process
retrieval based on the provide JSON or XML encoded buffer.
The 'parmstr' argument can specify the encoding that will
be used in the callback. Available options are:
- xml: XML element in a buffer is expected in return value
- json: JSON object in a buffer is expected in return value
- val: val_value_t tree is expected in return value
";
argument parmstr;
}
extension xpath-operational-ok {
description
"Used within a data-definition statement for a configuration
data node to alter the must-stmt and when-stmt found within
the data node. This allows an XPath expression in such a node
to reference config=false data nodes.
This property does not apply to any child nodes, just the data
node containing this external statement.
This violates the standard in RFC 7950, sec 6.4.1 so use with
caution since the YANG module will not be valid according to
YANG 1.1 rules.
There is no parameter for this extension.
";
}
extension sil-xpath-function {
description
"Used within a configuration data node definition
statement to define the YANG XPath Callback function
for the object.
It can also be added to a node using an annotation.
This extension affects only the node containing the
extension. The following data nodes are supported:
- container
- list
- leaf
- leaf-list
- anydata
- anyxml
Other data definition statements are allowed to have
must or when statements but the context node will
be one of the types listed above. The callback function
is invoked any time the data node containing this extension
is used as the context node for a must/when XPath evaluation.
This callback can be used to replace real must/when
XPath expression evaluation, in case the constraint
is enforced by the SIL code or can be checked internally
by the SIL code. It is intended to speed up or prune XPath
evaluation for a data node object.
The 'parmstr' argument must be present, and contain the
callback function name to be used in the SIL code generation
by yangdump-pro. This function is expected to exist
and be present in the H files included by the SIL code module.
If the 'parmstr' argument contains the special value 'default',
then an XPath callback function will be generated using the
identifier assigned to that data node. This stub function will
return 'ERR_NCX_SKIPPED' by default. It must be completed
by a programmer in order to have any affect.
The callback function must conform to the
'xpath_bool_eval_fn_t' typedef defined in ncx/xpath.h.
Example:
leaf foo {
ywx:sil-xpath-function 'foo_xpath_callback';
type string;
must 'some expr';
}
";
argument parmstr;
}
extension sort-type {
description
"Used within a configuration data node definition
statement to define the System Ordered Sort Type
for the object.
It can also be added to a node using an annotation.
This extension affects only the node containing the
extension. The following data nodes are supported:
- list
- leaf-list
This extension only applies to ordered-by 'system'
data nodes.
This extension is ignored if the 'system-sorted'
CLI parameter is set to 'false'. Otherwise this extension
will override the 'system-sort-type' CLI parameter
value.
The 'parmstr' argument is a string with the same values
as the 'system-sort-type' parameter:
- off
- ascending
- descending
Example:
list foo {
ywx:sort-type 'descending';
// ...
}
";
argument parmstr;
}
extension hidden-from-cli {
description
"Used within a configuration data node definition
statement to indicate that the data node and all its
descendants should be hidden from the yp-shell
and yangcli-pro clients.
This is similar to the 'ncx:hidden' extension except
only the CLI clients are effected. If the 'ncx:hidden'
extension is present then this extension is ignored.";
}
}