-
Story
-
Resolution: Done
-
Medium
-
None
Get the model set for the given CMHandle
Preliminary code already created here: https://gerrit.onap.org/r/c/cps/+/122877
Implementation
- Convert this to json and put it in the response and return it to the client
- New join query to extract only the yang modules that match the cm handles
- Return a json array containing the module_Name, revision, and namespace
- Create a new object ModuleNameRevision that contains moduleName and revision
A/C
- Implement a GET request to the given URI
{ncmp-root}/ncmp/v1/ch/<cmHandle>/modules
in yaml and define the output structure
- Overload the method getAllYangResourcesModuleReferences in cps java API CpsModuleServiceImpl to fetch a set of modules that will contain name, revision for a given cm-handle.
- For an example of the response see https://wiki.onap.org/display/DW/CPS-391Spike%3A+Define+and+Agree+NCMP+REST+Interface (no.3)
- if the anchor exists by there is no schema set associated with it then we will return an empty array
- If you provide an anchor that doesn't exist that an exception will be thrown
- a 404 response will be returned when a module is not found
- See an example of response below
- Agree on the format with stakeholders
Response
[ { "moduleName": "nc-notifications", "revision": "2008-07-14", }, { "moduleName": "ietf-tls-server", "revision": "2016-11-02", }, { "moduleName": "ietf-ssh-server", "revision": "2016-11-02", } ]
Out of scope
- no equvialant method on cps-core API