Facade over the database storing jobs and rules. Allows basic CRUD operations. Should be used always, when accessing jobs database.
Data types used here are stored in db-entries repository.
./gradlew build run
or /.gradlew build
and java -jar build\libs\jobs-db-service-0.0.1-SNAPSHOT.jar
This sections demonstrates endpoints and requests.
Data types used here are stored in db-entries repository.
url: ../db/jobs/get?id=ID_OF_JOB
, method: GET
case | response | code |
---|---|---|
success | json of Job |
200 OK |
fail | empty | 204 No Content |
url: ../db/jobs/all
, method: GET
case | response | code |
---|---|---|
found rules | json array of Job |
200 OK |
no rules in db | [] |
204 No Content |
url: ../db/jobs/new/first
, method: GET
case | response | code |
---|---|---|
found rules | json Job |
200 OK |
no rules in db | empty | 204 No Content |
url: ../db/jobs/new/all
, method: GET
case | response | code |
---|---|---|
found rules | json array of Job |
200 OK |
no rules in db | [] |
204 No Content |
url: ../db/jobs/add
, method: POST
, body: json of Job
(without id
, created
and updated
)
case | response | code |
---|---|---|
success | location header with added job id |
200 OK |
fail | error json | 400 Bad request |
url: ../db/jobs/update/conclusions
, method: PUT
, body:
{
"id": "idOfJobToUpdate",
"conclusions": [/*array of conclusions*/]
}
case | response | code |
---|---|---|
success | empty | 200 OK |
fail | error json | 500 Internal Server Error |
url: ../db/jobs/update/status
, method: PUT
, body:
{
"id": "idOfJobToUpdate",
"status": "new JobStatus"
}
case | response | code |
---|---|---|
success | empty | 200 OK |
fail | error json | 500 Internal Server Error |
url: ../db/rules/get?id=ID_OF_RULE
, method: GET
case | response | code |
---|---|---|
success | json of Rule |
200 OK |
fail | empty | 204 No Content |
url: ../db/rules/all
, method: GET
case | response | code |
---|---|---|
found rules | json array of Rule |
200 OK |
no rules in db | [] |
204 No Content |
url: ../db/rules/add
, method: POST
, body: json of Rule
case | response | code |
---|---|---|
success | location header with added rule id |
200 OK |
fail | error json | 400 Bad request |