summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraviteja.karumuri <raviteja.karumuri@est.tech>2023-06-19 16:43:32 +0100
committerraviteja.karumuri <raviteja.karumuri@est.tech>2023-06-20 09:47:05 +0100
commit9784384be364246ae07efbf0383661d6d32adec4 (patch)
tree49313c17051fabe6b3c29238b5555baa7f5db0b5
parent7272f11fa4a3876cf61451a21916a7244c2d045b (diff)
DMI-Plugin : Replacing the word 'Batch' as 'DataOperation'.
Issue-ID: CPS-1754 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: I8a1d6e329bb79d3762da17e9740854048b2aeace
-rw-r--r--openapi/components.yml4
-rw-r--r--openapi/openapi.yml8
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java12
-rw-r--r--src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy12
4 files changed, 18 insertions, 18 deletions
diff --git a/openapi/components.yml b/openapi/components.yml
index b32130b9..a339134e 100644
--- a/openapi/components.yml
+++ b/openapi/components.yml
@@ -49,11 +49,11 @@ components:
cmHandleProperties:
$ref: '#/components/schemas/cmHandleProperties'
- ResourceBatchDataRequest:
+ ResourceDataOperationRequests:
type: array
items:
type: object
- title: 'ResourceBatchRequest'
+ title: 'DataOperationRequest'
properties:
operation:
type: string
diff --git a/openapi/openapi.yml b/openapi/openapi.yml
index 4bca4108..6dbc19f3 100644
--- a/openapi/openapi.yml
+++ b/openapi/openapi.yml
@@ -154,9 +154,9 @@ paths:
post:
tags:
- dmi-plugin
- summary: Get resource data for batch of cm handle ids.
- description: Get resource data for batch of cm handle ids by supplied operation details
- operationId: getResourceDataForCmHandleBatch
+ summary: Execute a data operation for group of cm handle ids.
+ description: Execute a data operation for group of cm handle ids by supplied operation details
+ operationId: getResourceDataForCmHandleDataOperation
parameters:
- $ref: 'components.yml#/components/parameters/requiredTopicParamInQuery'
- $ref: 'components.yml#/components/parameters/requiredRequestIdParamInQuery'
@@ -165,7 +165,7 @@ paths:
content:
application/json:
schema:
- $ref: 'components.yml#/components/schemas/ResourceBatchDataRequest'
+ $ref: 'components.yml#/components/schemas/ResourceDataOperationRequests'
responses:
'202':
description: Accepted
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 6a404c6a..b0ee4cf0 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
@@ -32,10 +32,10 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.ncmp.dmi.model.CmHandles;
import org.onap.cps.ncmp.dmi.model.DataAccessRequest;
+import org.onap.cps.ncmp.dmi.model.DataOperationRequest;
import org.onap.cps.ncmp.dmi.model.ModuleReferencesRequest;
import org.onap.cps.ncmp.dmi.model.ModuleResourcesReadRequest;
import org.onap.cps.ncmp.dmi.model.ModuleSet;
-import org.onap.cps.ncmp.dmi.model.ResourceBatchRequest;
import org.onap.cps.ncmp.dmi.model.YangResources;
import org.onap.cps.ncmp.dmi.notifications.async.AsyncTaskExecutor;
import org.onap.cps.ncmp.dmi.rest.api.DmiPluginApi;
@@ -107,14 +107,14 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi {
/**
* This method is not implemented for ONAP DMI plugin.
*
- * @param requestId requestId generated by NCMP as an ack for client
- * @param topic client given topic name
- * @param resourceDataBatchRequest list of operation details
+ * @param requestId requestId generated by NCMP as an ack for client
+ * @param topic client given topic name
+ * @param dataOperationRequests list of operation details
* @return (@ code ResponseEntity) response entity
*/
@Override
- public ResponseEntity<Void> getResourceDataForCmHandleBatch(final String requestId, final String topic,
- final List<ResourceBatchRequest> resourceDataBatchRequest) {
+ public ResponseEntity<Void> getResourceDataForCmHandleDataOperation(final String requestId, final String topic,
+ final List<DataOperationRequest> dataOperationRequests) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
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 8499ae25..5caef07f 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
@@ -312,17 +312,17 @@ class DmiRestControllerSpec extends Specification {
}
- def 'Get resource data for a list of operations.'() {
- given: 'an endpoint for a batch data request with list of cmhandles in request body'
+ def 'Execute a data operation for a list of operations.'() {
+ given: 'an endpoint for a data operation request with list of cmhandles in request body'
def resourceDataUrl = "$basePathV1/data?topic=client-topic-name&requestId=some-requestId"
and: 'list of operation details are received into request body'
- def batchDataRequestBody = '[{"operation": "read", "operationId": "14", "datastore": "ncmp-datastore:passthrough-operational", "options": "some options", "resourceIdentifier": "some resourceIdentifier",' +
+ def dataOperationRequestBody = '[{"operation": "read", "operationId": "14", "datastore": "ncmp-datastore:passthrough-operational", "options": "some options", "resourceIdentifier": "some resourceIdentifier",' +
' "cmhandles": [ {"id": "cmHanlde123", "cmHandleProperties": { "myProp`": "some value", "otherProp": "other value"}}]}]'
- when: 'the dmi resource data for batch operation api is called.'
+ when: 'the dmi resource data for dataOperation api is called.'
def response = mvc.perform(
- post(resourceDataUrl).contentType(MediaType.APPLICATION_JSON).content(batchDataRequestBody)
+ post(resourceDataUrl).contentType(MediaType.APPLICATION_JSON).content(dataOperationRequestBody)
).andReturn().response
- then: 'the batch data endpoint returns the not implemented response'
+ then: 'the resource data operation endpoint returns the not implemented response'
assert response.status == 501
}
} \ No newline at end of file