Skip to content

RFC7895 yang module library implementation - #15

Merged
renukamanavalan merged 5 commits into
sonic-net:masterfrom
sachinholla:yanglib
Jul 30, 2020
Merged

renukamanavalan merged 5 commits into
sonic-net:masterfrom
sachinholla:yanglib

Conversation

@sachinholla

Copy link
Copy Markdown
Contributor

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.

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. Only GET is supported.

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.

"yang-library-change" notification is not supported.
Comment thread go.sum
Comment thread translib/path_utils.go Outdated
Comment thread translib/path_utils_test.go Outdated
@renukamanavalan
renukamanavalan merged commit 1d730df into sonic-net:master Jul 30, 2020
@sachinholla
sachinholla deleted the yanglib branch October 1, 2020 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants