Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagejava
themeMidnight
titleMethod added to CpsModuleService.java
    /**
     * 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
languagejava
themeMidnight
titleMethod added to CpsModulePersistenceService.java
    /**
     * Returns all YANG resources
     *
     * @return List of all YANG resources in the database
     */
    List<YangResource> getAllYangResources();