[NETCONF-1093] Join yang resource providers from restconf-nb and yanglib into single service Created: 19/Jul/23 Updated: 19/Sep/23 |
|
| Status: | Open |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0 |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Ruslan Kashapov | Assignee: | Ivan Hrasko |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | pick-next, pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Currently there two web services with own endpoints providing yang sources by module/submodule name and revision: RestconfSchemaService(Impl) of restconf-nb
YangLibService(YangLibProvider) of yanglib
In order to make URLs and produced content-types consistent, and to simplify the maintenance it makes sense to join these services into single one. Due to restconf-nb service also serves yang resources of mounted devices it seems reasonable to move functionality of yanglib to restconf-nb. In order to differentiate the sources it makes sense to use multiple schemas (and/or module-sets). It requires clarification either yang resources from a local folder (current yanglib functionality) need to be populated to yang-library data or it can be omitted as not a part of global context (similar to resources on mounted device) |
| Comments |
| Comment by Ivan Hrasko [ 20/Jul/23 ] |
|
IMO the restconf-nb is providing controller modules and yanglib is providing what is in cache/schema (YANG models downloaded from mounted devices). |
| Comment by Ruslan Kashapov [ 20/Jul/23 ] |
|
the mapped URI for restconf-nb service is /rests/modules/(identifier.+) the expected "identifier" is either (module_name/revision) or (path/to/mount/point/module_name/revision) the question to clarify how current service correlates to yang-library? if yang-library is just generate URL to existing service when constructing yang-library data |
| Comment by Ivan Hrasko [ 20/Jul/23 ] |
|
IMO I would remove yanglib as it is. It reads YANG files from cache/schema and we need to restart karaf to see new models. I expect we will not have this kind of issues with data-store approach - using device's schema context. |
| Comment by Ivan Hrasko [ 20/Jul/23 ] |
|
In fact, we should join this functionality in apps/yanglib-mdsal-writer as proposed by |
| Comment by Ivan Hrasko [ 19/Sep/23 ] |
|
Please verify that we can read both controller's and device's models by restconf-nb's modules/module{yang-ext:mount} and remove yanglib. |
| Comment by Ivan Hrasko [ 19/Sep/23 ] |
|
If its not possible to get device's modules then design solution to use mount-point's DOMSchemaService to retrieve devices modules on path: ../modules/modules/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/{module-name}/{module-revision} |
| Comment by Ivan Hrasko [ 19/Sep/23 ] |
|
restconf-nb works for both controller's and device's modules, thus:
|
| Comment by Ruslan Kashapov [ 19/Sep/23 ] |
|
yanglib serves as remote repository, it provides yang resources from configured local folder. accessing device models should not be treated as the only purpose of the service. so if yanglib is removed the remote repository functionality will be lost. |