A simple task-reporting service to keep track of generic backend tasks metrics
Two resources are available tot the API consumer:
/task-execution-reports
to operate on thetaskExecutionReports
/task-step-execution-reports
to operate on thetaskStepExecutionReports
The swagger is available at http://localhost:8080/swagger-ui/index.html.
GET
/task-execution-reports
The method returns all the taskExecutionReports
present on the persistence layer
GET
/task-execution-reports/status/{status}
The method returns all the taskExecutionReports
with status equal to the path variable value status
present on the
persistence layer
GET
/task-execution-reports/execution-time
The method returns all the taskExecutionReports
present on the persistence layer ordered by
ascending executionTimeSeconds
GET
/task-execution-reports/{id}
The method returns the taskExecutionReport
present on the persistence layer with id equal to the path variable
value id
POST
/task-execution-reports
The method allows the creation and the update of the taskExecutionReport
following the request json model:
TaskExecutionReportRequest:
{
"id": number,
"taskId": non-null number,
"taskStepExecutionReports": List<TaskStepExecutionReportRequest>,
"startDateTime": non-null "yyyy-MM-ddThh:mm:ss",
"endDateTime": "yyyy-MM-ddThh:mm:ss",
"errorMessage": string
}
TaskStepExecutionReportRequest:
{
"id": number,
"taskExecutionId": non-null number,
"stepName": non-null string,
"status": status
"startDateTime": non-null "yyyy-MM-ddThh:mm:ss",
"endDateTime": "yyyy-MM-ddThh:mm:ss",
"errorMessage": string
}
To create a new entity on the persistence layer the id
field must be left unspecified. A request with a specific id
will overwrite the pre-existing one forcing an UPDATE
of the resource. The field status
must have a value between
the following allowed:
{
"SUCCESS",
"FAILURE",
"RUNNING"
}
DELETE
/task-execution-reports/{id}
The method deletes the taskExecutionReport
and all the associated taskStepExecutionReports
present on the
persistence layer respectively with id and taskExecutionId equal to the path variable value id
GET
/task-step-execution-reports
The method returns all the taskStepExecutionReports
present on the persistence layer
GET
/task-step-execution-reports/{id}
The method returns the taskStepExecutionReport
present on the persistence layer with id equal to the path variable
value id
POST
/task-step-execution-reports
The method allows the creation and the update of the taskStepExecutionReport
following the request json model:
TaskStepExecutionReportRequest:
{
"id": number,
"taskExecutionId": non-null number,
"stepName": non-null string,
"status": status
"startDateTime": non-null "yyyy-MM-ddThh:mm:ss",
"endDateTime": "yyyy-MM-ddThh:mm:ss",
"errorMessage": string
}
To create a new entity on the persistence layer the id
field must be left unspecified. A request with a specific id
will overwrite the pre-existing one forcing an UPDATE
of the resource. The field status
must have a value between
the following allowed:
{
"SUCCESS",
"FAILURE",
"RUNNING"
}
DELETE
/task-step-execution-reports/{id}
The method deletes the taskStepExecutionReport
present on the persistence layer respectively with taskExecutionId
equal to the path variable value id
GET
/task-step-execution-reports/task-execution-id/{task_execution_id}
The method returns the taskStepExecutionReports
present on the persistence layer with taskExecutionId equal to the
path variable value task_execution_id
. It is possible to sort the resulting list accordingly to the following request
params:
direction
with possible valuesASC,DESC
columnName
with possible valuesid,taskExecutionId,stepName,status,startDateTime,endDateTime,executionTimeSeconds,errorMessage,insertDate,updateDate
On all methods positive responses always return HttpStatus 200 OK
. Some methods output a response body using the following json
response models.
TaskExecutionReportResponse:
{
"id": number,
"taskId": number,
"taskStepExecutionReports": List<TaskStepExecutionReportRequest>,
"startDateTime": "yyyy-MM-ddThh:mm:ss",
"endDateTime": "yyyy-MM-ddThh:mm:ss",
"executionTimeSeconds": number,
"errorMessage": string,
"status": status
}
TaskStepExecutionReportResponse:
{
"id": number,
"taskExecutionId": number,
"stepName": string,
"status": status
"startDateTime": "yyyy-MM-ddThh:mm:ss",
"endDateTime": "yyyy-MM-ddThh:mm:ss",
"executionTimeSeconds": number,
"errorMessage": string
}
On some methods a thrown validation failed exception returns HttpStatus 400 BAD REQUEST
. In this case the produced
response body uses the following json response models.
{
"message": "Field error",
"code": "field_error",
"detailErrorList": [
{
"field": "{field_name}",
"message": "{field_name} should not be null"
}
],
"dateTime": "yyyy-MM-dd hh:mm:ss+hh:mm"
}
On search methods the absence of the searched resource will result in a HttpStatus 404 NOT FOUND
.
The body will be a simple string following one of the two patterns:
- "TaskExecutionReport for id [
id
] not found" - "TaskStepExecutionReport for id [
id
] not found"