summaryrefslogtreecommitdiffstats
path: root/dmi-stub
diff options
context:
space:
mode:
authorleventecsanyi <levente.csanyi@est.tech>2024-08-15 13:52:21 +0200
committerleventecsanyi <levente.csanyi@est.tech>2024-08-15 13:56:31 +0200
commit636c228c5d646e7c919bc5ce135fa2967b3fef5a (patch)
tree26b71946894823dab64a0377060e6b278e7ed705 /dmi-stub
parent202fc696cdf0a2503b2d5f738f892b8cb5da7bd9 (diff)
Refactored dat job interfaces - result endpoint changed is a separate commit
-changed openapi and stub implementations Issue-ID: CPS-2360 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: Ib7d826f5909278309b7c16dc5caaabbe5f01732b
Diffstat (limited to 'dmi-stub')
-rw-r--r--dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
index e06c528d..5218db43 100644
--- a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
+++ b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
@@ -264,14 +264,15 @@ public class DmiRestStubController {
/**
* Consume sub-job write requests from NCMP.
*
- * @param requestId requestId generated by NCMP as an ack for client.
* @param subJobWriteRequest contains a collection of write requests and metadata.
+ * @param destination the destination of the results. ( e.g. S3 Bucket).
* @return (@ code ResponseEntity) response for the write request.
*/
- @PostMapping("/v1/writeJob/{requestId}")
- public ResponseEntity<SubjobWriteResponse> consumeWriteSubJobs(@PathVariable("requestId") final String requestId,
- @RequestBody final SubjobWriteRequest subJobWriteRequest) {
- log.debug("Request ID: {}", requestId);
+ @PostMapping("/v1/cmwriteJob")
+ public ResponseEntity<SubjobWriteResponse> consumeWriteSubJobs(
+ @RequestBody final SubjobWriteRequest subJobWriteRequest,
+ @RequestParam("destination") final String destination) {
+ log.debug("Destination: {}", destination);
log.debug("Request body: {}", subJobWriteRequest);
return ResponseEntity.ok(new SubjobWriteResponse(String.valueOf(subJobWriteRequestCounter.incrementAndGet()),
"some-dmi-service-name", "my-data-producer-id"));
@@ -280,17 +281,18 @@ public class DmiRestStubController {
/**
* Retrieves the status of a given data job identified by {@code requestId} and {@code dataProducerJobId}.
*
- * @param requestId Unique identifier for the outgoing request.
+ * @param dataProducerId ID of the producer registered by DMI for the alternateIDs
+ * in the operations in this request.
* @param dataProducerJobId Identifier of the data producer job.
* @return A ResponseEntity with HTTP status 200 (OK) and the data job's status as a string.
*/
- @GetMapping("/v1/dataJob/{requestId}/dataProducerJob/{dataProducerJobId}/status")
- public ResponseEntity<String> retrieveDataJobStatus(
- @PathVariable("requestId") final String requestId,
+ @GetMapping("/v1/cmwriteJob/dataProducer/{dataProducerId}/dataProducerJob/{dataProducerJobId}/status")
+ public ResponseEntity<Map<String, String>> retrieveDataJobStatus(
+ @PathVariable("dataProducerId") final String dataProducerId,
@PathVariable("dataProducerJobId") final String dataProducerJobId) {
log.info("Received request to retrieve data job status. Request ID: {}, Data Producer Job ID: {}",
- requestId, dataProducerJobId);
- return ResponseEntity.ok("FINISHED");
+ dataProducerId, dataProducerJobId);
+ return ResponseEntity.ok(Map.of("status", "FINISHED"));
}
/**