- 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:
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:
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:
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
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
/**
* 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);
}
/**
* 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);
}
/**
* 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)
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)
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)
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)
/**
* 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"));
/**
* 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"));
}
/**
- description: DMI plugin rest apis
name: dmi-datajob
paths:
- /v1/readJob/{requestId}:
+ /v1/cmreadJob:
post:
description: Create a read request
operationId: readDataJob
parameters:
- - description: Identifier for the overall Datajob
- explode: false
- in: path
- name: requestId
+ - description: The destination of the results (Kafka topic name or s3 bucket
+ name)
+ in: query
+ name: destination
required: true
schema:
- example: some-identifier
+ example: some-destination
type: string
- style: simple
+ style: form
requestBody:
content:
application/3gpp-json-patch+json:
description: Not Implemented
tags:
- dmi-datajob
- /v1/writeJob/{requestId}:
+ /v1/cmwriteJob:
post:
description: Create a write request
operationId: writeDataJob
parameters:
- - description: Identifier for the overall Datajob
- explode: false
- in: path
- name: requestId
+ - description: The destination of the results (Kafka topic name or s3 bucket
+ name)
+ in: query
+ name: destination
required: true
schema:
- example: some-identifier
+ example: some-destination
type: string
- style: simple
+ style: form
requestBody:
content:
application/3gpp-json-patch+json:
description: Not Implemented
tags:
- dmi-datajob
- /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:
- - description: Identifier for the overall Datajob
- explode: false
+ - 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
- explode: false
in: path
name: dataProducerJobId
required: true
example: some-producer-job-identifier
type: string
style: simple
- - description: Identifier for the data producer
- explode: true
- in: query
- name: dataProducerId
- required: true
- schema:
- example: some-data-producer-identifier
- type: string
- style: form
responses:
"501":
content:
operationId: getDataJobResult
parameters:
- description: Identifier for the overall Datajob
- explode: false
in: path
name: requestId
required: true
type: string
style: simple
- description: Identifier for the data producer job
- explode: false
in: path
name: dataProducerJobId
required: true
type: string
style: simple
- description: Identifier for the data producer
- explode: true
in: query
name: dataProducerId
required: true
example: some-data-producer-identifier
type: string
style: form
- - description: The destination of the results (Kafka topic name or s3 bucket name)
- explode: true
+ - description: The destination of the results (Kafka topic name or s3 bucket
+ name)
in: query
name: destination
required: true
parameters:
requestIdInPath:
description: Identifier for the overall Datajob
- explode: false
in: path
name: requestId
required: true
style: simple
dataProducerJobIdInPath:
description: Identifier for the data producer job
- explode: false
in: path
name: dataProducerJobId
required: true
example: some-producer-job-identifier
type: string
style: simple
+ dataProducerIdInPath:
+ description: Identifier for the data producer
+ in: path
+ name: dataProducerId
+ required: true
+ schema:
+ example: some-data-producer-identifier
+ type: string
+ style: simple
dataProducerIdInQuery:
description: Identifier for the data producer
- explode: true
in: query
name: dataProducerId
required: true
style: form
destinationInQuery:
description: The destination of the results (Kafka topic name or s3 bucket name)
- explode: true
in: query
name: destination
required: true
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