From: Toine Siebelink Date: Mon, 26 Jun 2023 09:29:58 +0000 (+0000) Subject: Merge "#2 NCMP : Replacing the word 'Batch' as 'DataOperation'." X-Git-Tag: 3.3.3~18 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=7cd5edbfd38ec8a500cbaf74618178955f7a6dd2;hp=7090a07b05517e0a748cb82ffac8840de82c7fa5;p=cps.git Merge "#2 NCMP : Replacing the word 'Batch' as 'DataOperation'." --- diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml index 8003d30a4..3eb2110c4 100755 --- a/cps-dependencies/pom.xml +++ b/cps-dependencies/pom.xml @@ -34,7 +34,7 @@ This artifact contains dependencyManagement declarations of upstream versions. - 3.0.8 + 3.0.9 https://nexus.onap.org /content/repositories/releases/ /content/repositories/snapshots/ @@ -99,7 +99,7 @@ io.swagger.core.v3 swagger-annotations - 2.1.4 + 2.2.10 io.springfox diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml index d45b8da28..818b2daee 100644 --- a/cps-ncmp-rest/docs/openapi/components.yaml +++ b/cps-ncmp-rest/docs/openapi/components.yaml @@ -38,7 +38,7 @@ components: properties: message: type: string - example: "Bad Gateway Error Message NCMP" + example: 'Bad Gateway Error Message NCMP' dmi-response: type: object properties: @@ -160,11 +160,11 @@ components: example: | module stores { yang-version 1.1; - namespace "org:onap:ccsdk:sample"; + namespace 'org:onap:ccsdk:sample'; prefix book-store; - revision "2020-09-15" { + revision '2020-09-15' { description - "Sample Model"; + 'Sample Model'; } } @@ -175,13 +175,11 @@ components: cmHandleQueryParameters: type: array items: - type: object $ref: '#/components/schemas/ConditionProperties' conditions: deprecated: true type: array items: - type: object $ref: '#/components/schemas/OldConditionProperties' description: not necessary, it is just for backward compatibility @@ -203,7 +201,6 @@ components: conditionParameters: type: array items: - type: object $ref: '#/components/schemas/ModuleNameAsJsonObject' ModuleNameAsJsonObject: properties: @@ -293,7 +290,6 @@ components: operations: type: array items: - type: object $ref: '#/components/schemas/DataOperationDefinition' description: contains group of data operation requests DataOperationDefinition: @@ -321,7 +317,7 @@ components: type: array items: type: string - example: [ "da310eecdb8d44c2acc0ddaae01174b1","c748c58f8e0b438f9fd1f28370b17d47" ] + example: [ "da310eecdb8d44c2acc0ddaae01174b1","c748c58f8e0b438f9fd1f28370b17d47" ] examples: dataSampleRequest: diff --git a/cps-ncmp-rest/docs/openapi/openapi-inventory.yml b/cps-ncmp-rest/docs/openapi/openapi-inventory.yml index bd83dbf25..b79408287 100755 --- a/cps-ncmp-rest/docs/openapi/openapi-inventory.yml +++ b/cps-ncmp-rest/docs/openapi/openapi-inventory.yml @@ -1,6 +1,6 @@ # ============LICENSE_START======================================================= # Copyright (C) 2021 Bell Canada -# Modifications Copyright (C) 2022 Nordix Foundation +# Modifications Copyright (C) 2022-2023 Nordix Foundation # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= -openapi: 3.0.1 +openapi: 3.0.3 info: title: NCMP Inventory API description: NCMP Inventory API diff --git a/cps-ncmp-rest/docs/openapi/openapi.yml b/cps-ncmp-rest/docs/openapi/openapi.yml index 84d86fffb..7ceb4fe70 100755 --- a/cps-ncmp-rest/docs/openapi/openapi.yml +++ b/cps-ncmp-rest/docs/openapi/openapi.yml @@ -18,7 +18,7 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= -openapi: 3.0.1 +openapi: 3.0.3 info: title: NCMP to CPS Proxy API description: NCMP to CPS Proxy API diff --git a/cps-ncmp-rest/pom.xml b/cps-ncmp-rest/pom.xml index 8c84546b2..6679932db 100644 --- a/cps-ncmp-rest/pom.xml +++ b/cps-ncmp-rest/pom.xml @@ -116,8 +116,9 @@ - io.swagger.codegen.v3 - swagger-codegen-maven-plugin + org.openapitools + openapi-generator-maven-plugin + 6.6.0 ncmp-code-gen @@ -129,13 +130,16 @@ org.onap.cps.ncmp.rest.controller org.onap.cps.ncmp.rest.model org.onap.cps.ncmp.rest.api - spring + spring false + true src/gen/java java11 true true + false + true @@ -149,13 +153,15 @@ org.onap.cps.ncmp.rest.controller org.onap.cps.ncmp.rest.model org.onap.cps.ncmp.rest.api - spring + spring false src/gen/java java11 true true + false + true @@ -167,7 +173,7 @@ compile ${project.basedir}/docs/openapi/openapi-inventory.yml - openapi-yaml + openapi-yaml openapi-inventory.yaml diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index 3c22b81ef..b81378dd2 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -138,18 +138,18 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { /** * Patch resource data from passthrough-running. * - * @param resourceIdentifier resource identifier * @param datastoreName name of the datastore * @param cmHandle cm handle identifier + * @param resourceIdentifier resource identifier * @param requestBody the request body * @param contentType content type of body * @return {@code ResponseEntity} response from dmi plugin */ @Override - public ResponseEntity patchResourceDataRunningForCmHandle(final String resourceIdentifier, - final String datastoreName, + public ResponseEntity patchResourceDataRunningForCmHandle(final String datastoreName, final String cmHandle, + final String resourceIdentifier, final Object requestBody, final String contentType) { @@ -165,17 +165,17 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { /** * Create resource data in datastore pass-through running for given cm-handle. * - * @param resourceIdentifier resource identifier * @param datastoreName name of the datastore * @param cmHandle cm handle identifier + * @param resourceIdentifier resource identifier * @param requestBody the request body * @param contentType content type of body * @return {@code ResponseEntity} response from dmi plugin */ @Override - public ResponseEntity createResourceDataRunningForCmHandle(final String resourceIdentifier, - final String datastoreName, + public ResponseEntity createResourceDataRunningForCmHandle(final String datastoreName, final String cmHandle, + final String resourceIdentifier, final Object requestBody, final String contentType) { @@ -189,18 +189,18 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { /** * Update resource data in datastore pass-through running for given cm-handle. * - * @param resourceIdentifier resource identifier * @param datastoreName name of the datastore * @param cmHandle cm handle identifier + * @param resourceIdentifier resource identifier * @param requestBody the request body * @param contentType content type of the body * @return response entity */ @Override - public ResponseEntity updateResourceDataRunningForCmHandle(final String resourceIdentifier, - final String datastoreName, + public ResponseEntity updateResourceDataRunningForCmHandle(final String datastoreName, final String cmHandle, + final String resourceIdentifier, final Object requestBody, final String contentType) { validateDataStore(PASSTHROUGH_RUNNING, datastoreName); diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java index f459acec2..fac948912 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java @@ -1,7 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2021 Pantheon.tech - * Modifications Copyright (C) 2021-2022 Nordix Foundation + * Modifications Copyright (C) 2021-2023 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import org.onap.cps.ncmp.api.impl.exception.ServerNcmpException; import org.onap.cps.ncmp.rest.controller.NetworkCmProxyController; import org.onap.cps.ncmp.rest.controller.NetworkCmProxyInventoryController; import org.onap.cps.ncmp.rest.model.DmiErrorMessage; -import org.onap.cps.ncmp.rest.model.DmiErrorMessageDmiresponse; +import org.onap.cps.ncmp.rest.model.DmiErrorMessageDmiResponse; import org.onap.cps.ncmp.rest.model.ErrorMessage; import org.onap.cps.spi.exceptions.AlreadyDefinedException; import org.onap.cps.spi.exceptions.AlreadyDefinedExceptionBatch; @@ -116,7 +116,7 @@ public class NetworkCmProxyRestExceptionHandler { final HttpStatus httpStatus, final HttpClientRequestException httpClientRequestException) { final var dmiErrorMessage = new DmiErrorMessage(); - final var dmiErrorResponse = new DmiErrorMessageDmiresponse(); + final var dmiErrorResponse = new DmiErrorMessageDmiResponse(); dmiErrorResponse.setHttpCode(httpClientRequestException.getHttpStatus()); dmiErrorResponse.setBody(httpClientRequestException.getDetails()); dmiErrorMessage.setMessage(httpClientRequestException.getMessage()); diff --git a/cps-rest/docs/openapi/openapi.yml b/cps-rest/docs/openapi/openapi.yml index d5ba97aeb..4bbf9f0fb 100644 --- a/cps-rest/docs/openapi/openapi.yml +++ b/cps-rest/docs/openapi/openapi.yml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (C) 2021 Nordix Foundation +# Copyright (C) 2021-2023 Nordix Foundation # Modifications Copyright (C) 2021 Pantheon.tech # Modifications Copyright (C) 2021 Bell Canada. # Modifications Copyright (C) 2022-2023 TechMahindra Ltd. @@ -19,7 +19,7 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= -openapi: 3.0.1 +openapi: 3.0.3 info: title: ONAP Open API v3 Configuration Persistence Service description: Configuration Persistence Service is a Model Driven Generic Database diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml index f6f81006e..c581b061d 100755 --- a/cps-rest/pom.xml +++ b/cps-rest/pom.xml @@ -128,8 +128,9 @@ - io.swagger.codegen.v3 - swagger-codegen-maven-plugin + org.openapitools + openapi-generator-maven-plugin + 6.6.0 code-gen @@ -141,13 +142,15 @@ org.onap.cps.rest.controller org.onap.cps.rest.model org.onap.cps.rest.api - spring + spring false src/gen/java java11 true true + false + true diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java index 993c5a3b5..369c94d29 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java @@ -96,14 +96,15 @@ public class AdminRestController implements CpsAdminApi { /** * Create a {@link SchemaSet}. * - * @param multipartFile multipart file - * @param schemaSetName schemaset name * @param dataspaceName dataspace name + * @param schemaSetName schemaset name + * @param multipartFile multipart file * @return a {@Link ResponseEntity} of created schemaset name & {@link HttpStatus} CREATED */ @Override - public ResponseEntity createSchemaSet(@NotNull @Valid final String schemaSetName, - final String dataspaceName, @Valid final MultipartFile multipartFile) { + public ResponseEntity createSchemaSet(final String dataspaceName, + @NotNull @Valid final String schemaSetName, + final MultipartFile multipartFile) { cpsModuleService.createSchemaSet(dataspaceName, schemaSetName, extractYangResourcesMap(multipartFile)); return new ResponseEntity<>(schemaSetName, HttpStatus.CREATED); } @@ -111,16 +112,17 @@ public class AdminRestController implements CpsAdminApi { /** * Create a {@link SchemaSet}. * - * @param multipartFile multipart file - * @param schemaSetName schemaset name * @param dataspaceName dataspace name + * @param schemaSetName schemaset name + * @param multipartFile multipart file * @return a {@Link ResponseEntity} of created schema set without any response body & {@link HttpStatus} CREATED */ @Override @Timed(value = "cps.rest.admin.controller.schemaset.create", description = "Time taken to create schemaset from controller") - public ResponseEntity createSchemaSetV2(@NotNull @Valid final String schemaSetName, - final String dataspaceName, @Valid final MultipartFile multipartFile) { + public ResponseEntity createSchemaSetV2(final String dataspaceName, + @NotNull @Valid final String schemaSetName, + final MultipartFile multipartFile) { cpsModuleService.createSchemaSet(dataspaceName, schemaSetName, extractYangResourcesMap(multipartFile)); return new ResponseEntity<>(HttpStatus.CREATED); } diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java index edfeab33e..62163327f 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2020-2022 Bell Canada. * Modifications Copyright (C) 2021 Pantheon.tech - * Modifications Copyright (C) 2021-2022 Nordix Foundation + * Modifications Copyright (C) 2021-2023 Nordix Foundation * Modifications Copyright (C) 2022-2023 TechMahindra Ltd. * Modifications Copyright (C) 2022 Deutsche Telekom AG * ================================================================================ @@ -63,9 +63,9 @@ public class DataRestController implements CpsDataApi { private final PrefixResolver prefixResolver; @Override - public ResponseEntity createNode(@RequestHeader(value = "Content-Type") final String contentTypeHeader, - final String apiVersion, + public ResponseEntity createNode(final String apiVersion, final String dataspaceName, final String anchorName, + @RequestHeader(value = "Content-Type") final String contentTypeHeader, final String nodeData, final String parentNodeXpath, final String observedTimestamp) { final ContentType contentType = contentTypeHeader.contains(MediaType.APPLICATION_XML_VALUE) ? ContentType.XML @@ -90,8 +90,9 @@ public class DataRestController implements CpsDataApi { } @Override - public ResponseEntity addListElements(final String parentNodeXpath, final String apiVersion, - final String dataspaceName, final String anchorName, final Object jsonData, final String observedTimestamp) { + public ResponseEntity addListElements(final String apiVersion, final String dataspaceName, + final String anchorName, final String parentNodeXpath, + final Object jsonData, final String observedTimestamp) { cpsDataService.saveListElements(dataspaceName, anchorName, parentNodeXpath, jsonObjectMapper.asJsonString(jsonData), toOffsetDateTime(observedTimestamp)); return new ResponseEntity<>(HttpStatus.CREATED); @@ -148,8 +149,9 @@ public class DataRestController implements CpsDataApi { } @Override - public ResponseEntity replaceListContent(final String parentNodeXpath, - final String apiVersion, final String dataspaceName, final String anchorName, final Object jsonData, + public ResponseEntity replaceListContent(final String apiVersion, + final String dataspaceName, final String anchorName, + final String parentNodeXpath, final Object jsonData, final String observedTimestamp) { cpsDataService.replaceListContent(dataspaceName, anchorName, parentNodeXpath, jsonObjectMapper.asJsonString(jsonData), toOffsetDateTime(observedTimestamp));