|
| 1 | +# YANG directory |
| 2 | + |
| 3 | +## Directory structure |
| 4 | + |
| 5 | + yang/ --> Standard YANGs |
| 6 | + |-- annotations/ --> Transformer annotations |
| 7 | + |-- common/ --> Dependencies for standard YANGs |
| 8 | + |-- extensions/ --> Extenstions for standard YANGs |
| 9 | + |-- sonic/ --> SONiC yangs |
| 10 | + |-- testdata/ --> Test YANGs - ignored |
| 11 | + `-- version.xml --> YANG bundle version configuration file |
| 12 | + |
| 13 | +All supported standard YANG files (OpenConfig and IETF) are kept in this **yang** directory. Usual practice is to keep only top level YANG module here and keep dependent YANGs, submodules in **yang/common** directory. |
| 14 | + |
| 15 | +Example: openconfig-platform.yang is kept in top **yang** directory and openconfig-platform-types.yang in **yang/common** directory. |
| 16 | + |
| 17 | +All extenstion YANGs **MUST** be kept in **yang/extensions** directory. |
| 18 | + |
| 19 | +## version.xml |
| 20 | + |
| 21 | +version.xml file maintains the yang bundle version number in **Major.Minor.Patch** format. |
| 22 | +It is the collective version number for all the YANG modules defined here. |
| 23 | +**UPDATE THIS VERSION NUMBER FOR EVERY YANG CHANGE.** |
| 24 | + |
| 25 | +**Major version** should be incremented if YANG model is changed in a non backward compatible manner. |
| 26 | +Such changes should be avoided. |
| 27 | + |
| 28 | +* Delete, rename or relocate data node |
| 29 | +* Change list key attributes |
| 30 | +* Change data type of a node to an incompatible type |
| 31 | +* Change leafref target |
| 32 | + |
| 33 | +**Minor version** should be incremented if the YANG change modifies the API in a backward |
| 34 | +compatible way. Patch version should be reset to 0. |
| 35 | +Candidate YANG changes for this category are: |
| 36 | + |
| 37 | +* Add new YANG module |
| 38 | +* Add new YANG data nodes |
| 39 | +* Mark a YANG data node as deprecated |
| 40 | +* Change data type of a node to a compatible type |
| 41 | +* Add new enum or identity |
| 42 | + |
| 43 | +**Patch version** should incremented for cosmetic fixes that do not change YANG API. |
| 44 | +Candidate YANG changes for this category are: |
| 45 | + |
| 46 | +* Change description, beautification. |
| 47 | +* Expand pattern or range of a node to wider set. |
| 48 | +* Change must expression to accept more cases. |
| 49 | +* Error message or error tag changes. |
| 50 | + |
| 51 | + |
0 commit comments