Extend API: Get Module Definitions
- add query parameters: module-name and revision to OpenAPI
- extend the controller method to hande the new parameters
- add the new method stack to the service layer
- extend the SQL query to support the new parameters
- add unit and integration testwares
Issue-ID: CPS-1135
Change-Id: I089ad2ad71effb58ac0ba809e9f441d6cdb59c4f
Signed-off-by: halil.cakal <halil.cakal@est.tech>
diff --git a/cps-ncmp-rest/docs/openapi/ncmp.yml b/cps-ncmp-rest/docs/openapi/ncmp.yml
index 95ca6cc..2f90155 100755
--- a/cps-ncmp-rest/docs/openapi/ncmp.yml
+++ b/cps-ncmp-rest/docs/openapi/ncmp.yml
@@ -1,5 +1,5 @@
# ============LICENSE_START=======================================================
-# Copyright (C) 2021-2023 Nordix Foundation
+# Copyright (C) 2021-2024 Nordix Foundation
# Modifications Copyright (C) 2021 Pantheon.tech
# Modifications Copyright (C) 2021-2022 Bell Canada
# ================================================================================
@@ -289,15 +289,17 @@
500:
$ref: 'components.yaml#/components/responses/InternalServerError'
-fetchModuleDefinitionsByCmHandle:
+getModuleDefinitions:
get:
- description: Fetch all module definitions (name, revision, yang resource) for a given cm handle
tags:
- network-cm-proxy
- summary: Fetch all module definitions (name, revision, yang resource) for a given cm handle
- operationId: getModuleDefinitionsByCmHandleId
+ summary: Get module definitions
+ description: Get module definitions (module name, revision, yang resource) with options to filter on module name and revision
+ operationId: getModuleDefinitions
parameters:
- $ref: 'components.yaml#/components/parameters/cmHandleInPath'
+ - $ref: 'components.yaml#/components/parameters/moduleNameInQuery'
+ - $ref: 'components.yaml#/components/parameters/revisionInQuery'
responses:
200:
description: OK