DMI-Plugin : Replacing the word 'Batch' as 'DataOperation'. 78/134978/2
authorraviteja.karumuri <raviteja.karumuri@est.tech>
Mon, 19 Jun 2023 15:43:32 +0000 (16:43 +0100)
committerraviteja.karumuri <raviteja.karumuri@est.tech>
Tue, 20 Jun 2023 08:47:05 +0000 (09:47 +0100)
Issue-ID: CPS-1754
Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech>
Change-Id: I8a1d6e329bb79d3762da17e9740854048b2aeace

openapi/components.yml
openapi/openapi.yml
src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java
src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy

index b32130b..a339134 100644 (file)
@@ -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
index 4bca410..6dbc19f 100644 (file)
@@ -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
index 6a404c6..b0ee4cf 100644 (file)
@@ -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);
     }
 
index 8499ae2..5caef07 100644 (file)
@@ -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