...
Finally, we need to add a method to cps-service/src/main/java/org/onap/cps/api/CpsModuleService.java to retrieve all modules and version known by CPS.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
/**
* Retrieve all modules and revisions known by CPS
* @return a list of YangResources
*/
List<YangResource> getAllYangResources(); |
For this we need to create a new model called YangResource in the cps-service/src/main/java/org/onap/cps/spi/model/YangResource.java. This model will have the following attributes.
- name
- moduleName
- revision
- content
- checksum
Another method getAllYangResources will also need to be added in the cps-service/src/main/java/org/onap/cps/spi/CpsModulePersistenceService.java
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
/**
* Returns all YANG resources
*
* @return List of all YANG resources in the database
*/
List<YangResource> getAllYangResources(); |