blob: 673fe950b240ae4fc5011494237fa75e7499b9f2 [file] [log] [blame]
Thomas Vachuska6655bee2017-08-24 16:12:59 -07001module openconfig-module-catalog {
2
3 yang-version "1";
4
5 // namespace
6 namespace "http://openconfig.net/yang/module-catalog";
7
8 prefix "oc-cat";
9
10 // import some basic types
11 import openconfig-inet-types { prefix oc-inet; }
12 import openconfig-catalog-types { prefix oc-cat-types; }
13 import openconfig-extensions { prefix oc-ext; }
14
15
16 // meta
17 organization "OpenConfig working group";
18
19 contact
20 "OpenConfig working group
21 www.openconfig.net";
22
23 description
24 "This module provides a schema for cataloging and descrbing
25 YANG models published across various organizations. The catalog
26 contains several categories of data:
27
28 * organizations -- entities that publish and/or maintain
29 individual YANG modules or groups of modules
30
31 * modules -- information regarding individual YANG modules,
32 including their versions, dependencies, submodules, and how
33 to access them
34
35 * release bundles -- groups of modules that are compatible and
36 consistent with each other (as determined by the publisher of
37 of the bundle). The release bundle does not necessarily
38 correspond to a functional area, e.g., it could the entire
39 set of modules published by an organization
40
41 * feature bundles -- sets of schema paths across a
42 release bundle that provide a specific set of functionality
43
44 * implementations -- information about available module and/or
45 bundle implementations and their status";
46
47 oc-ext:openconfig-version "0.2.1";
48
49 revision "2017-05-01" {
50 description
51 "Fix to module dependency list";
52 reference "0.2.1";
53 }
54
55 revision "2017-03-08" {
56 description
57 "OpenConfig public release";
58 reference "0.2.0";
59 }
60
61 revision "2016-02-15" {
62 description
63 "Initial OpenConfig public release";
64 reference "0.1.0";
65 }
66
67
68
69 // grouping statements
70
71 grouping catalog-module-common-config {
72 description
73 "Data definitions common for both bundles and standalone
74 modules";
75
76 leaf name {
77 type string;
78 description
79 "The name of the module or bundle. For modules, this
80 should reflect the 'module' or 'submodule'
81 statement in the YANG module file.
82
83 For bundles, this is the canonical name for the overall
84 bundle of modules which is to be released together.
85 This name should be consistent over multiple
86 releases";
87 }
88
89 leaf version {
90 type oc-cat-types:module-version-type;
91 description
92 "For individual modules, this is the version number, e.g.,
93 a semantic version. The version may be the same as the date
94 indicated in the module revision statement.
95
96 For bundles, this is a semantic version number for the
97 overall bundle. This version is to be defined as per the
98 approach specified in the OpenConfig semantic version
99 guidance - and is of the form x.y.z, where x is the major
100 version, y is the minor version, and z is the patch level";
101 reference
102 "Semantic versioning for OpenConfig models";
103 }
104 }
105
106 grouping feature-bundle-included-reference {
107 description
108 "References to the included feature bundles";
109
110 leaf name {
111 type leafref {
112 path "../../../../../../../organizations/" +
113 "organization[name=current()/../publisher]/" +
114 "feature-bundles/feature-bundle/name";
115 }
116 description
117 "Name of the referenced feature bundle";
118 }
119
120 leaf publisher {
121 type leafref {
122 path "../../../../../../../organizations/organization/" +
123 "name";
124 }
125 description
126 "Publisher of the referenced feature bundle";
127 }
128
129 leaf version {
130 type oc-cat-types:module-version-type;
131 description
132 "Version of the referenced feature bundle";
133 }
134 }
135
136 grouping catalog-implementation-bundle-config {
137 description
138 "References to the feature bundles supported by an
139 implementation";
140
141 uses feature-bundle-included-reference;
142 }
143
144 grouping catalog-implementation-bundle-top {
145 description
146 "Top-level grouping for the list of feature bundles
147 supported by an implementation";
148
149 container feature-bundles {
150 description
151 "Enclosing container for the list of feature bundles";
152
153 list feature-bundle {
154 key "name version";
155 description
156 "List of feature bundles supported by the implementation";
157
158 uses catalog-implementation-bundle-config;
159 }
160 }
161 }
162
163 grouping catalog-implementation-config {
164 description
165 "Data describing any available implementations";
166
167 leaf id {
168 type string;
169 description
170 "An identifier for the implementation, provided by the
171 implementor. This id should uniquely identify a specific
172 implementation of the module, e.g., based on the vendor,
173 platform, and platform version.";
174 }
175
176 leaf description {
177 type string;
178 description
179 "A text summary of important information about the
180 implementation";
181 }
182
183 leaf reference {
184 type union {
185 type oc-inet:uri;
186 type string;
187 }
188 description
189 "A URI (preferred) or text reference to more detailed
190 information about the implementation.";
191 }
192
193
194 leaf platform {
195 type string;
196 description
197 "Name of the platform on which the implementation
198 is available -- this could be the model name of a network
199 device, a server OS, etc.";
200 }
201
202 leaf platform-version {
203 type string;
204 description
205 "Implementor-defined version name or number of the
206 module implementation, corresponding to the platform.
207 This could be the firmware version of a network device
208 such as a router, OS version, or other server platform
209 version.";
210 }
211
212 leaf status {
213 type identityref {
214 base oc-cat-types:IMPLEMENTATION_STATUS_TYPE;
215 }
216 description
217 "Indicates the status of the implementation, e.g.,
218 complete, partial, in-progress, etc. Implementors
219 may define additional values for the base identity";
220 }
221 }
222
223 grouping catalog-implementation-top {
224 description
225 "Top level grouping for information on model implementations";
226
227 container implementations {
228 description
229 "Container for module implementation information";
230
231 list implementation {
232 key "id";
233 description
234 "List of available implementations, keyed by an identifier
235 provided by either the implementor or the module
236 maintainer. Such a key avoids needing a complex composite
237 key to uniquely identify an implementation.";
238
239 uses catalog-implementation-config;
240 uses catalog-implementation-bundle-top;
241 }
242 }
243 }
244
245 grouping catalog-module-dependency-config {
246 description
247 "Information about module dependencies";
248
249
250 leaf-list required-module {
251 type string;
252 description
253 "List of names of modules that are imported by the
254 current module. This list should reflect all of the 'import'
255 statements in the module. Release bundles should be used to
256 indicate which versions of the imported module are used
257 (or are compatible) with the current module";
258 }
259 }
260
261 grouping catalog-module-dependency-top {
262 description
263 "Top-level grouping for module dependency data";
264
265 container dependencies {
266 description
267 "Data about dependencies of the module";
268
269 uses catalog-module-dependency-config;
270 }
271
272 }
273
274 grouping catalog-module-classification-config {
275 description
276 "Data describing the module's classification(s)";
277
278 leaf category {
279 type identityref {
280 base oc-cat-types:MODULE_CATEGORY_BASE;
281 }
282 description
283 "Categorization of the module based on identities defined
284 or used by the publishing organizations.";
285 }
286
287 leaf subcategory {
288 type identityref {
289 base oc-cat-types:MODULE_SUBCATEGORY_BASE;
290 }
291 description
292 "Sub-categorization of the module based on identities
293 defined or used by the publishing organizations.";
294 }
295
296 leaf deployment-status {
297 type identityref {
298 base oc-cat-types:MODULE_STATUS_TYPE;
299 }
300 description
301 "Deployment status of the module -- experimental,
302 standards-track, production, etc.";
303 }
304 }
305
306 grouping catalog-module-classification-top {
307 description
308 "Data definitions related to module classfications";
309
310 container classification {
311 description
312 "Container for data describing the module's classification";
313
314 uses catalog-module-classification-config;
315 }
316 }
317
318 grouping catalog-module-access-config {
319 description
320 "Data pertaining to retrieval and usage of the module";
321
322 leaf uri {
323 type oc-inet:uri;
324 description
325 "URI where module can be downloaded. Modules may be
326 made available from the catalog maintainer, or directly
327 from the publisher";
328 }
329
330 leaf md5-hash {
331 type string;
332 description
333 "Optional MD5 hash of the module file. If specified, the
334 hash may be used by users to validate data integrity";
335 }
336 }
337
338 grouping catalog-module-access-top {
339 description
340 "Top level groupig for data related to accessing a module
341 or submodule";
342
343 container access {
344 description
345 "Container for data pertaining to retrieval and usage of the
346 module";
347
348 uses catalog-module-access-config;
349 }
350 }
351
352 grouping catalog-module-submodule-config {
353 description
354 "Data definitions for submodules belonging to a
355 module";
356
357 leaf name {
358 type string;
359 description
360 "Name of the submodule as indicated by its top-level
361 'submodule' statement";
362 }
363
364 }
365
366 grouping catalog-module-submodule-top {
367 description
368 "Top-level grouping for submodule information";
369
370 container submodules {
371 description
372 "Data for the submodules belonging to a submodule. If the
373 module does not have any submodules, this container
374 should be empty.";
375
376 list submodule {
377 key "name";
378 description
379 "List of submodules included by a module. All submodules
380 specified by 'include' statements in the module should be
381 included in this list.";
382
383 uses catalog-module-submodule-config;
384 uses catalog-module-access-top;
385 }
386 }
387 }
388
389 grouping catalog-module-base-config {
390 description
391 "Basic information describing the module, e.g., the
392 YANG metadata in the module preface.";
393
394
395 leaf namespace {
396 type string;
397 description
398 "Published namespace of module, i.e., defined by the
399 'namespace' ";
400 }
401
402 leaf prefix {
403 type string;
404 description
405 "Published prefix of the module";
406 }
407
408 leaf revision {
409 type string;
410 description
411 "Date in the revision statement of the module";
412 }
413
414 leaf summary {
415 type string;
416 description
417 "Summary description of the module";
418 }
419 }
420
421 grouping release-bundle-member-config {
422 description
423 "Data for each member of a bundle";
424
425 leaf id {
426 type string;
427 description
428 "Identifier for the bundle member";
429 }
430
431 leaf type {
432 type identityref {
433 base oc-cat-types:CATALOG_MEMBER_TYPE;
434 }
435 description
436 "The type of member that is to be included within the
437 release bundle. Release bundles may include modules and
438 other release bundles. Both member modules and member
439 bundles should specify the list of compatible versions.";
440 }
441
442 leaf module {
443 when "../type = 'oc-cat-types:MODULE'" {
444 description
445 "The module name is specified for bundle membrs that are
446 modules";
447 }
448 type leafref {
449 path "../../../../../../../organizations/" +
450 "organization[name=current()/../publisher]/modules/" +
451 "module/name";
452 }
453 description
454 "Name of the module set which is included in this bundle -
455 for example, 'openconfig-bgp'";
456 }
457
458 leaf release-bundle {
459 when "../type = 'oc-cat-types:RELEASE_BUNDLE'" {
460 description
461 "The release bundle is specified for bundle members that
462 are release bundles";
463 }
464 type leafref {
465 path "../../../../../../../organizations/" +
466 "organization[name=current()/../publisher]/" +
467 "release-bundles/release-bundle/name";
468 }
469 description
470 "Name of the module set which is included in this bundle -
471 for example, 'openconfig-bgp'";
472 }
473
474 leaf publisher {
475 type leafref {
476 path "../../../../../../../organizations/organization/" +
477 "name";
478 }
479 description
480 "Reference to the name of the publishing organization";
481 }
482
483 leaf-list compatible-versions {
484 type oc-cat-types:module-version-type;
485 description
486 "A list of semantic version specification of the versions
487 of the specified module or release bundle which are
488 compatible when building this version of the bundle.
489
490 Version specifications may be added when changes are made
491 to a module within a bundle, and this does not affect the
492 interaction between it and other modules. It is expected
493 that backwards compatible changes to an individual module or
494 member bundle do not affect the compatibility of that
495 with other members, and hence wildcard matches are allowed
496 within this list.";
497 }
498 }
499
500 grouping release-bundle-member-top {
501
502 description
503 "Parameters relating to models within release bundles";
504
505 container members {
506 description
507 "List of bundle members which make up this release bundle. A
508 member is defined as an individual YANG module specified
509 in the YANG catalogue, or another release
510 bundle which can be used to group multiple YANG
511 models together.";
512
513 list member {
514 key "id";
515 description
516 "A set of modules or bundles which are part of the bundle
517 of models. For example, if 'ietf-yang-types' were to be
518 specified within the bundle, then this would refer to the
519 individual entry within the module catalogue. If the type
520 of the entry is set to bundle, then for example,
521 openconfig-bgp could be referenced - which itself consists
522 of separate modules.";
523
524 uses release-bundle-member-config;
525
526 }
527 }
528 }
529
530 grouping release-bundle-top {
531 description
532 "Top-level container for a release bundle";
533
534 container release-bundles {
535 description
536 "List of release bundles";
537
538 list release-bundle {
539 key "name version";
540
541 description
542 "List of release bundles - sets of modules and/or
543 bundles which are interoperable";
544
545 uses catalog-module-common-config;
546 uses release-bundle-member-top;
547 }
548 }
549 }
550
551 grouping feature-bundle-release-config {
552 description
553 "Data definitions to identify the release bundle that the
554 feature bundle is based on.";
555
556 leaf name {
557 type leafref {
558 path "../../../../release-bundles/release-bundle/name";
559 }
560 description
561 "Reference to the name of the release bundle used for the
562 feature paths.";
563 }
564
565 leaf version {
566 type leafref {
567 path "../../../../release-bundles/" +
568 "release-bundle[name=current()/../name]/version";
569 }
570 description
571 "Reference to the release bundle version used for the
572 feature paths";
573 }
574
575 leaf publisher {
576 type leafref {
577 path "../../../../release-bundles/" +
578 "release-bundle[name=current()/../name]/publisher";
579 }
580 description
581 "Reference to the publisher of the release bundle used for
582 the feature paths";
583 }
584 }
585
586 grouping feature-bundle-release-top {
587 description
588 "Top-level grouping for data about the release bundle used
589 to specify the feature bundle";
590
591 container release-bundle {
592 description
593 "Data to identify the release bundle from which the feature
594 paths should be specified. If the feature crosses
595 release bundles, a new release bundle should be
596 created to support the feature bundle.";
597
598 leaf name {
599 type leafref {
600 path "../../../../../../organizations/" +
601 "organization[name=current()/../publisher]/" +
602 "release-bundles/release-bundle/name";
603 }
604 description
605 "Name of the module set which is included in this bundle -
606 for example, 'openconfig-bgp'";
607 }
608
609 leaf publisher {
610 type leafref {
611 path "../../../../../../organizations/organization/" +
612 "name";
613 }
614 description
615 "Reference to the name of the publishing organization";
616 }
617
618 leaf version {
619 type oc-cat-types:module-version-type;
620 description
621 "Version of the referenced release bundle";
622 }
623 }
624 }
625
626
627 grouping feature-bundle-config {
628 description
629 "Data definitions for the feature bundle";
630
631 uses catalog-module-common-config;
632
633 leaf-list path {
634 type string;
635 description
636 "The list of schema paths included in the feature. The
637 paths specify subtrees, i.e., all data underneath the
638 specified path are included in the feature.";
639 }
640 }
641
642 grouping feature-bundle-feature-config {
643 description
644 "Data definitions for included feature bundles";
645
646 uses feature-bundle-included-reference;
647 }
648
649 grouping feature-bundle-feature-top {
650 description
651 "Top level grouping for the list of included feature
652 bundles";
653
654 container feature-bundles {
655 description
656 "Enclosing container for the list of included feature
657 bundles. Feature bundles may be composed from other
658 smaller feature units";
659
660 list feature-bundle {
661 key "name";
662 description
663 "The list of feature bundles included in the current
664 feature bundle.";
665
666 uses feature-bundle-feature-config;
667 }
668 }
669
670 }
671
672
673 grouping feature-bundle-top {
674 description
675 "Top-level grouping for OpenConfig feature bundles";
676
677 container feature-bundles {
678 description
679 "Enclosing container for the list of feature bundles";
680
681 list feature-bundle {
682 key "name version";
683 description
684 "List of feature bundles";
685
686 uses feature-bundle-config;
687 uses feature-bundle-release-top;
688 uses feature-bundle-feature-top;
689 }
690 }
691 }
692
693 grouping catalog-module-top {
694 description
695 "Top level structure of the module catalog";
696
697 container modules {
698 description
699 "Modules published by this organization";
700
701 list module {
702 key "name version";
703 description
704 "List of published modules from the organization";
705
706 uses catalog-module-common-config;
707 uses catalog-module-base-config;
708 uses catalog-module-classification-top;
709 uses catalog-module-dependency-top;
710 uses catalog-module-access-top;
711 uses catalog-module-submodule-top;
712 }
713 }
714 }
715
716 grouping catalog-organization-config {
717 description
718 "Top level grouping for data related to an organization that
719 publishes module, bundles, etc.";
720
721 leaf name {
722 type string;
723 description
724 "Name of the maintaining organization -- the name should be
725 supplied in the official format used by the organization.
726 Standards Body examples:
727 IETF, IEEE, MEF, ONF, etc.
728 Commercial entity examples:
729 AT&T, Facebook, <Vendor>
730 Name of industry forum examples:
731 OpenConfig, OpenDaylight, ON.Lab";
732 }
733
734 leaf type {
735 type identityref {
736 base oc-cat-types:ORGANIZATION_TYPE;
737 }
738 description
739 "Type of the publishing organization";
740 }
741
742 leaf contact {
743 type string;
744 description
745 "Contact information for the publishing organization (web
746 site, email address, etc.)";
747 }
748 }
749
750 grouping catalog-organization-top {
751 description
752 "Top level grouping for list of maintaining organizations";
753
754 container organizations {
755 description
756 "List of organizations owning modules";
757
758 list organization {
759 key "name";
760
761 description
762 "List of organizations publishing YANG modules or
763 module bundles";
764
765 uses catalog-organization-config;
766 uses catalog-module-top;
767 uses release-bundle-top;
768 uses feature-bundle-top;
769 uses catalog-implementation-top;
770 }
771 }
772 }
773
774
775 grouping catalog-top {
776 description
777 "Top-level grouping for the YANG model catalog";
778
779 uses catalog-organization-top;
780 }
781
782 // data definition statements
783
784 uses catalog-top;
785
786}