diff options
Diffstat (limited to 'dmi-service')
3 files changed, 25 insertions, 21 deletions
diff --git a/dmi-service/openapi/openapi-datajob.yml b/dmi-service/openapi/openapi-datajob.yml index aa93623c..09e23a9e 100644 --- a/dmi-service/openapi/openapi-datajob.yml +++ b/dmi-service/openapi/openapi-datajob.yml @@ -27,12 +27,12 @@ tags: - description: DMI plugin rest apis name: dmi-datajob paths: - /v1/readJob/{requestId}: + /v1/cmreadJob: post: description: Create a read request operationId: readDataJob parameters: - - $ref: '#/components/parameters/requestIdInPath' + - $ref: '#/components/parameters/destinationInQuery' requestBody: description: Operation body content: @@ -44,12 +44,12 @@ paths: responses: "501": $ref: '#/components/responses/NotImplemented' - /v1/writeJob/{requestId}: + /v1/cmwriteJob: post: description: Create a write request operationId: writeDataJob parameters: - - $ref: '#/components/parameters/requestIdInPath' + - $ref: '#/components/parameters/destinationInQuery' requestBody: description: Operation body content: @@ -61,14 +61,13 @@ paths: responses: "501": $ref: '#/components/responses/NotImplemented' - /v1/dataJob/{requestId}/dataProducerJob/{dataProducerJobId}/status: + /v1/cmwriteJob/dataProducer/{dataProducerId}/dataProducerJob/{dataProducerJobId}/status: get: description: Retrieve the status of a specific data job. operationId: getDataJobStatus parameters: - - $ref: '#/components/parameters/requestIdInPath' + - $ref: '#/components/parameters/dataProducerIdInPath' - $ref: '#/components/parameters/dataProducerJobIdInPath' - - $ref: '#/components/parameters/dataProducerIdInQuery' tags: - dmi-datajob responses: @@ -107,6 +106,14 @@ components: schema: example: some-producer-job-identifier type: string + dataProducerIdInPath: + name: dataProducerId + in: path + description: Identifier for the data producer + required: true + schema: + type: string + example: some-data-producer-identifier dataProducerIdInQuery: name: dataProducerId in: query @@ -227,6 +234,10 @@ components: description: ID of the producer registered by DMI for the paths in the operations in this request example: my-data-producer-identifier type: string + dataJobId: + description: Identifier for the overall Data Job + example: my-data-producer-identifier + type: string data: example: op: add diff --git a/dmi-service/src/main/java/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestController.java b/dmi-service/src/main/java/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestController.java index 928ec6b6..6ab56f57 100644 --- a/dmi-service/src/main/java/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestController.java +++ b/dmi-service/src/main/java/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestController.java @@ -34,13 +34,11 @@ public class DmiDatajobsRestController implements DmiDatajobApi { /** * This method is not implemented for ONAP DMI plugin. * - * @param requestId Identifier for the overall Datajob (required) * @param subjobReadRequest Operation body (optional) * @return (@ code ResponseEntity) Response entity */ @Override - public ResponseEntity<Void> readDataJob(final String requestId, - final SubjobReadRequest subjobReadRequest) { + public ResponseEntity<Void> readDataJob(final String destination, final SubjobReadRequest subjobReadRequest) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -48,27 +46,23 @@ public class DmiDatajobsRestController implements DmiDatajobApi { /** * This method is not implemented for ONAP DMI plugin. * - * @param requestId Identifier for the overall Datajob (required) * @param subjobWriteRequest Operation body (optional) * @return (@ code ResponseEntity) Response entity */ @Override - public ResponseEntity<Void> writeDataJob(final String requestId, - final SubjobWriteRequest subjobWriteRequest) { + public ResponseEntity<Void> writeDataJob(final String destination, final SubjobWriteRequest subjobWriteRequest) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * This method is not implemented for ONAP DMI plugin. * - * @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 dataProducerId Identifier for the data producer (required) * @return ResponseEntity Response entity indicating the method is not implemented */ @Override - public ResponseEntity<Void> getDataJobStatus(final String requestId, - final String dataProducerJobId, + public ResponseEntity<Void> getDataJobStatus(final String dataProducerJobId, final String dataProducerId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -76,7 +70,6 @@ public class DmiDatajobsRestController implements DmiDatajobApi { /** * This method is not implemented for ONAP DMI plugin. * - * @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 destination The destination of the results, Kafka topic name or s3 bucket name (required) diff --git a/dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy b/dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy index 6c05f6f3..17354e65 100644 --- a/dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy +++ b/dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy @@ -46,7 +46,7 @@ class DmiDatajobsRestControllerSpec extends Specification{ def 'write request should return 501 HTTP Status' () { given: 'URL to write a data job' - def getModuleUrl = "${basePathV1}/writeJob/001" + def getModuleUrl = "${basePathV1}/cmwriteJob?destination=001" when: 'the request is posted' def response = mvc.perform( post(getModuleUrl) @@ -58,7 +58,7 @@ class DmiDatajobsRestControllerSpec extends Specification{ def 'read request should return 501 HTTP Status' () { given: 'URL to write a data job' - def getModuleUrl = "${basePathV1}/readJob/001" + def getModuleUrl = "${basePathV1}/cmreadJob?destination=001" when: 'the request is posted' def response = mvc.perform( post(getModuleUrl) @@ -70,7 +70,7 @@ class DmiDatajobsRestControllerSpec extends Specification{ def 'get status request should return 501 HTTP Status' () { given: 'URL to get the status of a data job' - def getStatus = "${basePathV1}/dataJob/some-identifier/dataProducerJob/some-producer-job-identifier/status?dataProducerId=some-data-producer-identifier" + def getStatus = "${basePathV1}/cmwriteJob/dataProducer/data-producer-id/dataProducerJob/data-producerd-job-id}/status" when: 'the request is performed' def response = mvc.perform( get(getStatus) |