RFC7895 yang module library implementation #15
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added new yang ietf-yang-library.yang, which defines data models for
RFC7895 yang library discovery feature.
New app module yanglib_app.go to handle ietf-yang-library.yang APIs.
REST and gNMI requests for '/ietf-yang-library:modules-state' and its
child paths will be serviced by this app module.
Parses all NB yangs using goyang parser and builds the module info data
tree as per ietf-yang-library.yang. Yangs are parsed upon first request
and cached thereafter.
Uses translib.GetModel() API to identify the yang modules that are
implemented by apps. Other modules are marked as 'import' in yang
library response data. Transformer annotation files (*_annot.yang) are
ignored -- they do not define any data model.
Uses hardcoded module-set-id value for now. Should be changed to use
"yang bundle version" number when yang versioning feature is in.
Yang schema URL is included in the response only if main program set the
root URL through translib.SetSchemaRootURL() API. Schema URL is prepared
by appending the yang file name to the root URL.