summaryrefslogtreecommitdiffstats
path: root/dmi-service
diff options
context:
space:
mode:
Diffstat (limited to 'dmi-service')
-rw-r--r--dmi-service/openapi/openapi-datajob.yml29
-rw-r--r--dmi-service/src/main/java/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestController.java19
-rw-r--r--dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy13
3 files changed, 59 insertions, 2 deletions
diff --git a/dmi-service/openapi/openapi-datajob.yml b/dmi-service/openapi/openapi-datajob.yml
index 31a76bbd..68ee3ecc 100644
--- a/dmi-service/openapi/openapi-datajob.yml
+++ b/dmi-service/openapi/openapi-datajob.yml
@@ -61,6 +61,19 @@ paths:
responses:
"501":
$ref: '#/components/responses/NotImplemented'
+ /v1/dataJob/{requestId}/dataProducerJob/{dataProducerJobId}/status:
+ get:
+ description: Retrieve the status of a specific data job.
+ operationId: getDataJobStatus
+ parameters:
+ - $ref: '#/components/parameters/requestIdInPath'
+ - $ref: '#/components/parameters/dataProducerJobIdInPath'
+ - $ref: '#/components/parameters/dataProducerIdInQuery'
+ tags:
+ - dmi-datajob
+ responses:
+ "501":
+ $ref: '#/components/responses/NotImplemented'
components:
parameters:
@@ -72,6 +85,22 @@ components:
schema:
example: some-identifier
type: string
+ dataProducerJobIdInPath:
+ description: Identifier for the data producer job
+ in: path
+ name: dataProducerJobId
+ required: true
+ schema:
+ example: some-producer-job-identifier
+ type: string
+ dataProducerIdInQuery:
+ name: dataProducerId
+ in: query
+ description: Identifier for the data producer
+ required: true
+ schema:
+ type: string
+ example: some-data-producer-identifier
schemas:
ErrorMessage:
type: object
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 bbc1c20d..8cf9f1fb 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
@@ -32,7 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class DmiDatajobsRestController implements DmiDatajobApi {
/**
- * * This method is not implemented for ONAP DMI plugin.
+ * This method is not implemented for ONAP DMI plugin.
*
* @param requestId Identifier for the overall Datajob (required)
* @param subjobReadRequest Operation body (optional)
@@ -46,7 +46,7 @@ public class DmiDatajobsRestController implements DmiDatajobApi {
}
/**
- * * This method is not implemented for ONAP DMI plugin.
+ * This method is not implemented for ONAP DMI plugin.
*
* @param requestId Identifier for the overall Datajob (required)
* @param subjobWriteRequest Operation body (optional)
@@ -57,4 +57,19 @@ public class DmiDatajobsRestController implements DmiDatajobApi {
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)
+ * @return ResponseEntity(Void) response entity indicating the method is not implemented
+ */
+ @Override
+ public ResponseEntity<Void> getDataJobStatus(final String requestId,
+ final String dataProducerJobId,
+ final String dataProducerId) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
}
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 c55f53c1..69d2ebd2 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
@@ -30,6 +30,7 @@ import org.springframework.security.test.context.support.WithMockUser
import org.springframework.test.web.servlet.MockMvc
import spock.lang.Specification
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post
@Import(WebSecurityConfig)
@@ -66,4 +67,16 @@ class DmiDatajobsRestControllerSpec extends Specification{
then: 'response value is Not Implemented'
response.status == HttpStatus.NOT_IMPLEMENTED.value()
}
+
+ 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"
+ when: 'the request is performed'
+ def response = mvc.perform(
+ get(getStatus)
+ .contentType('application/json')
+ ).andReturn().response
+ then: 'response value is Not Implemented'
+ response.status == HttpStatus.NOT_IMPLEMENTED.value()
+ }
}