From e1f73e264e2dca1f10c273620653f541c2f25d69 Mon Sep 17 00:00:00 2001 From: emaclee Date: Fri, 17 Jun 2022 17:42:56 +0100 Subject: Add method to get YANG module sources for CM handle - part of this commit includes renaming the enum SyncState to DataStoreSyncState Issue-ID: CPS-1064 Signed-off-by: emaclee Change-Id: I6bf419141a1b33f09871946445cdfff422c8c354 --- cps-ncmp-rest/docs/openapi/components.yaml | 24 ++++++++++++++++++++++++ cps-ncmp-rest/docs/openapi/ncmp.yml | 25 +++++++++++++++++++++++++ cps-ncmp-rest/docs/openapi/openapi.yml | 3 +++ 3 files changed, 52 insertions(+) (limited to 'cps-ncmp-rest/docs') diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml index cf254e511..8249a7a3d 100644 --- a/cps-ncmp-rest/docs/openapi/components.yaml +++ b/cps-ncmp-rest/docs/openapi/components.yaml @@ -145,6 +145,30 @@ components: type: string example: my-module-revision + RestModuleDefinition: + type: object + title: Module definitions + properties: + moduleName: + type: string + example: my-module-name + revision: + type: string + example: 2020-09-15 + content: + type: string + example: | + module stores { + yang-version 1.1; + namespace "org:onap:ccsdk:sample"; + prefix book-store; + revision "2020-09-15" { + description + "Sample Model"; + } + } + + CmHandleQueryParameters: type: object title: Cm Handle query parameters for executing cm handle search diff --git a/cps-ncmp-rest/docs/openapi/ncmp.yml b/cps-ncmp-rest/docs/openapi/ncmp.yml index 8bdaa82d8..aaf0d6a1a 100755 --- a/cps-ncmp-rest/docs/openapi/ncmp.yml +++ b/cps-ncmp-rest/docs/openapi/ncmp.yml @@ -246,6 +246,31 @@ fetchModuleReferencesByCmHandle: 500: $ref: 'components.yaml#/components/responses/InternalServerError' +fetchModuleDefinitionsByCmHandle: + 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 + parameters: + - $ref: 'components.yaml#/components/parameters/cmHandleInPath' + responses: + 200: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: 'components.yaml#/components/schemas/RestModuleDefinition' + 401: + $ref: 'components.yaml#/components/responses/Unauthorized' + 403: + $ref: 'components.yaml#/components/responses/Forbidden' + 500: + $ref: 'components.yaml#/components/responses/InternalServerError' + searchCmHandles: post: description: Execute cm handle query search, to be included in the result a cm-handle must fulfill ALL the conditions listed here, if one of the given module names does not exists, return with an empty collection. diff --git a/cps-ncmp-rest/docs/openapi/openapi.yml b/cps-ncmp-rest/docs/openapi/openapi.yml index ad7dd1d4f..35be59a38 100755 --- a/cps-ncmp-rest/docs/openapi/openapi.yml +++ b/cps-ncmp-rest/docs/openapi/openapi.yml @@ -35,6 +35,9 @@ paths: /v1/ch/{cm-handle}/modules: $ref: 'ncmp.yml#/fetchModuleReferencesByCmHandle' + /v1/ch/{cm-handle}/modules/definitions: + $ref: 'ncmp.yml#/fetchModuleDefinitionsByCmHandle' + /v1/ch/searches: $ref: 'ncmp.yml#/searchCmHandles' -- cgit 1.2.3-korg