Fixed URL for data job result 49/138649/6
authorleventecsanyi <levente.csanyi@est.tech>
Mon, 5 Aug 2024 13:46:59 +0000 (15:46 +0200)
committerleventecsanyi <levente.csanyi@est.tech>
Mon, 26 Aug 2024 10:39:09 +0000 (12:39 +0200)
- fixed opeanapi and stub
- updated pnp simulator image

Issue-ID: CPS-2296
Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
Change-Id: I6654762256097f9deb8ce40cfc8014bed67cb269

csit/plans/dmi/pnfsim/docker-compose.yml
dmi-service/openapi/openapi-datajob.yml
dmi-service/src/main/java/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestController.java
dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy
dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
docs/api/swagger/openapi-datajob.yaml

index d8610b4..99befa7 100644 (file)
@@ -16,7 +16,7 @@
 
 services:
   netconf-pnp-simulator:
-    image: nexus3.onap.org:10001/onap/integration/simulators/netconf-pnp-simulator:2.8.6
+    image: blueonap/netconf-pnp-simulator:v2.8.6
     container_name: netconf-simulator
     restart: always
     ports:
index 09e23a9..569fa19 100644 (file)
@@ -73,14 +73,13 @@ paths:
       responses:
         "501":
           $ref: '#/components/responses/NotImplemented'
-  /v1/dataJob/{requestId}/dataProducerJob/{dataProducerJobId}/result:
+  /v1/cmwriteJob/dataProducer/{dataProducerId}/dataProducerJob/{dataProducerJobId}/result:
     get:
       description: Retrieve the result of a data job.
       operationId: getDataJobResult
       parameters:
-        - $ref: '#/components/parameters/requestIdInPath'
+        - $ref: '#/components/parameters/dataProducerIdInPath'
         - $ref: '#/components/parameters/dataProducerJobIdInPath'
-        - $ref: '#/components/parameters/dataProducerIdInQuery'
         - $ref: '#/components/parameters/destinationInQuery'
       tags:
         - dmi-datajob
index 6ab56f5..8376e4a 100644 (file)
@@ -70,15 +70,14 @@ public class DmiDatajobsRestController implements DmiDatajobApi {
     /**
      * This method is not implemented for ONAP DMI plugin.
      *
-     * @param dataProducerJobId     Identifier for the data producer job (required)
      * @param dataProducerId        Identifier for the data producer as a query parameter (required)
+     * @param dataProducerJobId     Identifier for the data producer job (required)
      * @param destination           The destination of the results, Kafka topic name or s3 bucket name (required)
      * @return ResponseEntity       Response entity indicating the method is not implemented
      */
     @Override
-    public ResponseEntity<Void> getDataJobResult(final String requestId,
+    public ResponseEntity<Void> getDataJobResult(final String dataProducerId,
                                                  final String dataProducerJobId,
-                                                 final String dataProducerId,
                                                  final String destination) {
         return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
     }
index 17354e6..e2669c4 100644 (file)
@@ -82,7 +82,7 @@ class DmiDatajobsRestControllerSpec extends Specification{
 
     def 'get result request should return 501 HTTP Status' () {
         given: 'URL to get the result of a data job'
-            def getStatus = "${basePathV1}/dataJob/some-identifier/dataProducerJob/some-producer-job-identifier/result?dataProducerId=some-data-producer-identifier&destination=some-destination"
+            def getStatus = "${basePathV1}/cmwriteJob/dataProducer/some-identifier/dataProducerJob/some-producer-job-identifier/result?destination=some-destination"
         when: 'the request is performed'
             def response = mvc.perform(
                     get(getStatus)
index 5218db4..2f026f9 100644 (file)
@@ -298,21 +298,19 @@ public class DmiRestStubController {
     /**
      * Retrieves the result of a given data job identified by {@code requestId} and {@code dataProducerJobId}.
      *
-     * @param requestId             Identifier for the overall Datajob (required)
-     * @param dataProducerJobId     Identifier for the data producer job (required)
      * @param dataProducerId        Identifier for the data producer as a query parameter (required)
+     * @param dataProducerJobId     Identifier for the data producer job (required)
      * @param destination           The destination of the results, Kafka topic name or s3 bucket name (required)
      * @return A ResponseEntity with HTTP status 200 (OK) and the data job's result as an Object.
      */
-    @GetMapping("/v1/dataJob/{requestId}/dataProducerJob/{dataProducerJobId}/result")
+    @GetMapping("/v1/cmwriteJob/dataProducer/{dataProducerId}/dataProducerJob/{dataProducerJobId}/result")
     public ResponseEntity<Object> retrieveDataJobResult(
-            @PathVariable("requestId") final String requestId,
+            @PathVariable("dataProducerId") final String dataProducerId,
             @PathVariable("dataProducerJobId") final String dataProducerJobId,
-            @RequestParam(name = "dataProducerId") String dataProducerId,
             @RequestParam(name = "destination") String destination) {
-        log.debug("Received request to retrieve data job result. Request ID: {}, Data Producer Job ID: {}, " +
-                        "Data Producer ID: {}, Destination: {}",
-                requestId, dataProducerJobId, dataProducerId, destination);
+        log.debug("Received request to retrieve data job result. Data Producer ID: {}, " +
+                        "Data Producer Job ID: {}, Destination: {}",
+                dataProducerId, dataProducerJobId, destination);
         return ResponseEntity.ok(Map.of("result", "some status"));
     }
 
index ea2c3a9..54ce066 100644 (file)
@@ -97,6 +97,14 @@ paths:
             example: some-producer-job-identifier
             type: string
           style: simple
+        - description: Identifier for the data producer
+          in: query
+          name: dataProducerId
+          required: true
+          schema:
+            example: some-data-producer-identifier
+            type: string
+          style: form
       responses:
         "501":
           content:
@@ -110,17 +118,17 @@ paths:
           description: Not Implemented
       tags:
         - dmi-datajob
-  /v1/dataJob/{requestId}/dataProducerJob/{dataProducerJobId}/result:
+  /v1/cmwriteJob/dataProducer/{dataProducerId}/dataProducerJob/{dataProducerJobId}/result:
     get:
       description: Retrieve the result of a data job.
       operationId: getDataJobResult
       parameters:
-        - description: Identifier for the overall Datajob
+        - description: Identifier for the data producer
           in: path
-          name: requestId
+          name: dataProducerId
           required: true
           schema:
-            example: some-identifier
+            example: some-data-producer-identifier
             type: string
           style: simple
         - description: Identifier for the data producer job
@@ -277,7 +285,7 @@ components:
           type: string
         dataJobId:
           description: Identifier for the overall Data Job
-          example: my-data-producer-identifier
+          example: my-data-job-identifier
           type: string
         data:
           example: