CPS-1064 Support retrieval of YANG module sources for CM handle on the NCMP interface

CPS-1064 Support retrieval of YANG module sources for CM handle on the NCMP interface

Implementation Proposal

 

cps-ncmp-rest

open API

  • Agreed endpoint →  /v1/ch/{cm-handle}/modules/definitions/

  • Method reference

    1. fetchModuleDefinitionsByCmHandle

    2. fetchYangResourcesByCmHandle

  • Response Schema

    1. 'RestModuleDefinition'

    2. 'YangResourceDefinition'

RestModuleDefinition: type: object title: Yang properties: moduleName: type: string example: my-module-name revision: type: string example: my-module-revision content: type: string example:

 

rest controller

  • Operation id

    1. ResponseEntity<List<?>> getYangResourcesByCmHandle(String cmhandle)

    2. ResponseEntity<List<?>> getModuleDefinitionsByCmHandle(String cmhandle)

  • Return type

 

cps-ncmp-service  — cpsModuleService

NetworkCmProxyDataService

NetworkCmProxyDataServiceImpl

CpsModuleServiceImpl

  • Method

           **existing → Collection<ModuleReference> getYangResourcesModuleReferences(final String cmHandleId)

  1. getYangResourcesDefinition

 

  • Response type

          **existing → ModuleReference [moduleName, revision, namespace]

  1. Extend module reference

  2. Create new class 

    1. YangResourceDefinition

    2. ModuleDefinition

cps-ri

CpsModulePersistenceServiceImpl

 

YangResourceRepository