diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2024-05-29 12:39:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-05-29 12:39:35 +0000 |
commit | 3adc1d6bc4400b37c1cb23c0204d7f09d4ff380b (patch) | |
tree | b5268f4001684794dc5e7c3e0a34b0faa356a4fc | |
parent | 8ec8bc27176da9c85d5d205d9c40dce2c1591036 (diff) | |
parent | efe96fa26c01a66c673be68d5ecc70f836963505 (diff) |
Merge "CPS-2187 - Move Module Set Tag into request body for data access passthrough"
-rw-r--r-- | docs/api/swagger/openapi.yaml | 23 | ||||
-rw-r--r-- | openapi/components.yml | 14 | ||||
-rw-r--r-- | openapi/openapi.yml | 1 | ||||
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java | 4 | ||||
-rw-r--r-- | src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy | 4 | ||||
-rw-r--r-- | src/test/resources/readData.json | 3 |
6 files changed, 12 insertions, 37 deletions
diff --git a/docs/api/swagger/openapi.yaml b/docs/api/swagger/openapi.yaml index ceb61913..14c721a3 100644 --- a/docs/api/swagger/openapi.yaml +++ b/docs/api/swagger/openapi.yaml @@ -206,15 +206,6 @@ paths: required: false schema: type: string - - description: Module set tag of the given cm handle. - examples: - sample1: - value: tag1 - in: query - name: moduleSetTag - required: false - schema: - type: string requestBody: content: application/json: @@ -380,16 +371,6 @@ components: required: false schema: type: string - moduleSetTagParamInQuery: - description: Module set tag of the given cm handle. - examples: - sample1: - value: tag1 - in: query - name: moduleSetTag - required: false - schema: - type: string requiredTopicParamInQuery: description: mandatory topic name passed from client(NCMP). examples: @@ -567,6 +548,7 @@ components: dataType: my-data-type cmHandleProperties: key: "{\"prop1\":\"value1\",\"prop2\":\"value2\"}" + moduleSetTag: module-set-tag1 operation: read properties: operation: @@ -593,6 +575,9 @@ components: requestId: example: 3a9ce55c-e365-4dc9-8da3-a06f07cbc6d7 type: string + moduleSetTag: + example: module-set-tag1 + type: string type: object ResourceDataOperationRequests: items: diff --git a/openapi/components.yml b/openapi/components.yml index 3142654d..4a6d1729 100644 --- a/openapi/components.yml +++ b/openapi/components.yml @@ -180,6 +180,9 @@ components: requestId: type: string example: 3a9ce55c-e365-4dc9-8da3-a06f07cbc6d7 + moduleSetTag: + type: string + example: module-set-tag1 cmHandleProperties: type: object @@ -297,17 +300,6 @@ components: value: topic: my-topic-name - moduleSetTagParamInQuery: - name: moduleSetTag - in: query - description: Module set tag of the given cm handle. - required: false - schema: - type: string - examples: - sample1: - value: tag1 - requiredRequestIdParamInQuery: name: requestId in: query diff --git a/openapi/openapi.yml b/openapi/openapi.yml index 38f21c15..6dbc19f3 100644 --- a/openapi/openapi.yml +++ b/openapi/openapi.yml @@ -128,7 +128,6 @@ paths: - $ref: 'components.yml#/components/parameters/resourceIdentifierInQuery' - $ref: 'components.yml#/components/parameters/optionsParamInQuery' - $ref: 'components.yml#/components/parameters/topicParamInQuery' - - $ref: 'components.yml#/components/parameters/moduleSetTagParamInQuery' requestBody: description: Contains collection of cm handles with it's private properties and requestId content: diff --git a/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java b/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java index ec56884c..cad5e726 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java @@ -149,10 +149,8 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { final String resourceIdentifier, final String optionsParamInQuery, final String topicParamInQuery, - final String moduleSetTagParamInQuery, final DataAccessRequest dataAccessRequest) { - - log.info("Module set tag received: {}", moduleSetTagParamInQuery); + log.info("Module set tag: {}", dataAccessRequest.getModuleSetTag()); if (DatastoreType.PASSTHROUGH_OPERATIONAL == DatastoreType.fromDatastoreName(datastoreName)) { return dataAccessPassthroughOperational(resourceIdentifier, cmHandle, dataAccessRequest, optionsParamInQuery, topicParamInQuery); diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy index 23b039bd..a519de7b 100644 --- a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy +++ b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy @@ -341,14 +341,14 @@ class DmiRestControllerSpec extends Specification { def 'PassThrough logs module set tag'(){ given: 'Passthrough read URL and request data with a module set tag (parameter)' def readPassThroughUrl ="${basePathV1}/ch/some-cmHandle/data/ds/ncmp-datastore:" + - 'passthrough-running?resourceIdentifier=some-resourceIdentifier&moduleSetTag=module-set-tag1' + 'passthrough-running?resourceIdentifier=some-resourceIdentifier' def jsonData = TestUtils.getResourceFileContent('readData.json') when: 'the request is posted' mvc.perform( post(readPassThroughUrl).contentType(MediaType.APPLICATION_JSON).content(jsonData)) then: 'response status is OK' def loggingMessage = getLoggingMessage(0) - assert loggingMessage.contains('module-set-tag1') + assert loggingMessage.contains('module-set-tag-example') } def 'Get resource data for pass-through running with #scenario value in resource identifier param.'() { diff --git a/src/test/resources/readData.json b/src/test/resources/readData.json index 9f2b154f..53f6d2ed 100644 --- a/src/test/resources/readData.json +++ b/src/test/resources/readData.json @@ -4,5 +4,6 @@ "data": "normal request body", "cmHandleProperties": { "some-property": "some-property-value" - } + }, + "moduleSetTag": "module-set-tag-example" }
\ No newline at end of file |