Merged in feature/jobsynced (pull request #72)

Job Status Get and DB tidy up

* initalquery

* tests

* shorttests

* testing queries

* job

* solvedthequery

* updatingdb

* fixingtests

* repotests

* shorttests

* docker

* testspassed
This commit is contained in:
Michael McGuinness
2025-02-20 19:02:44 +00:00
parent 0ea544926b
commit 3d434eedb8
74 changed files with 2395 additions and 1335 deletions
+76 -67
View File
@@ -32,15 +32,15 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ClientCreate'
$ref: "#/components/schemas/ClientCreate"
responses:
'201':
"201":
description: Client created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/IdMessage'
'400':
$ref: "#/components/schemas/IdMessage"
"400":
description: Invalid request body.
/client/{id}:
@@ -59,15 +59,15 @@ paths:
summary: Get a client by ID
description: Retrieves a specific client by its ID.
responses:
'200':
"200":
description: Client details.
content:
application/json:
schema:
$ref: '#/components/schemas/JobClient'
'400':
$ref: "#/components/schemas/JobClient"
"400":
description: Invalid request parameters.
'404':
"404":
description: Client not found.
patch:
operationId: updateClient
@@ -80,13 +80,13 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ClientUpdate'
$ref: "#/components/schemas/ClientUpdate"
responses:
'200':
"200":
description: Client updated successfully.
'400':
"400":
description: Invalid request body.
'404':
"404":
description: Client not found
/query:
@@ -97,15 +97,15 @@ paths:
summary: List queries
description: Retrieves a list of queries based on filter criteria.
responses:
'200':
"200":
description: A list of queries.
content:
application/json:
schema:
$ref: '#/components/schemas/ListQueries'
'400':
$ref: "#/components/schemas/ListQueries"
"400":
description: Invalid request parameters.
'404':
"404":
description: Query not found.
post:
operationId: createQuery
@@ -118,15 +118,15 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/QueryCreate'
$ref: "#/components/schemas/QueryCreate"
responses:
'201':
"201":
description: Query created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/IdMessage'
'400':
$ref: "#/components/schemas/IdMessage"
"400":
description: Invalid request body.
/query/{id}:
@@ -145,15 +145,15 @@ paths:
summary: Get a query by ID
description: Retrieves a specific query by its ID.
responses:
'200':
"200":
description: Query details.
content:
application/json:
schema:
$ref: '#/components/schemas/Query'
'400':
$ref: "#/components/schemas/Query"
"400":
description: Invalid request parameters.
'404':
"404":
description: Query not found.
patch:
operationId: updateQuery
@@ -166,13 +166,13 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/QueryUpdate'
$ref: "#/components/schemas/QueryUpdate"
responses:
'200':
"200":
description: Query updated successfully.
'400':
"400":
description: Invalid request body.
'404':
"404":
description: Query not found.
/query/{id}/test:
@@ -195,15 +195,15 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/QueryTestRequest'
$ref: "#/components/schemas/QueryTestRequest"
responses:
'200':
"200":
description: Test result.
content:
application/json:
schema:
$ref: '#/components/schemas/QueryTestResponse'
'400':
$ref: "#/components/schemas/QueryTestResponse"
"400":
description: Invalid request body.
/job:
@@ -218,15 +218,15 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/JobCreate'
$ref: "#/components/schemas/JobCreate"
responses:
'201':
"201":
description: Job created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/IdMessage'
'400':
$ref: "#/components/schemas/IdMessage"
"400":
description: Invalid request body.
/job/{id}:
@@ -245,15 +245,15 @@ paths:
summary: Get a job by ID
description: Retrieves a specific job by its ID.
responses:
'200':
"200":
description: Job details.
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'400':
$ref: "#/components/schemas/Job"
"400":
description: Invalid request parameters.
'404':
"404":
description: Job not found.
patch:
operationId: updateJob
@@ -266,13 +266,13 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/JobUpdate'
$ref: "#/components/schemas/JobUpdate"
responses:
'204':
"204":
description: Job updated successfully.
'400':
"400":
description: Invalid request body.
'404':
"404":
description: Job not found.
/job/{id}/collector:
@@ -291,13 +291,13 @@ paths:
summary: Get a job collector by ID
description: Retrieves a specific job collector by its ID.
responses:
'200':
"200":
description: Job collector details.
content:
application/json:
schema:
$ref: '#/components/schemas/JobCollector'
'404':
$ref: "#/components/schemas/JobCollector"
"404":
description: Job collector not found.
patch:
operationId: updateJobCollectorByJobId
@@ -310,13 +310,13 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/JobCollectorUpdate'
$ref: "#/components/schemas/JobCollectorUpdate"
responses:
'204':
"204":
description: Job collector updated successfully.
'400':
"400":
description: Invalid request body.
'404':
"404":
description: Job collector not found.
/job/export:
@@ -331,17 +331,17 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ExportTrigger'
$ref: "#/components/schemas/ExportTrigger"
responses:
'201':
"201":
description: Export triggered successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/IdMessage'
'400':
$ref: "#/components/schemas/IdMessage"
"400":
description: Invalid request body.
'404':
"404":
description: Job not found.
/job/{id}/export:
@@ -360,16 +360,15 @@ paths:
summary: Check export state.
description: Checks the current state of an export.
responses:
'200':
"200":
description: Export has been completed.
content:
application/json:
schema:
$ref: '#/components/schemas/ExportDetails'
'404':
$ref: "#/components/schemas/ExportDetails"
"404":
description: Export job not found.
components:
schemas:
QueryType:
@@ -387,7 +386,7 @@ components:
format: uuid
description: Unique identifier for the query.
type:
$ref: '#/components/schemas/QueryType'
$ref: "#/components/schemas/QueryType"
active_version:
type: integer
format: int32
@@ -417,7 +416,7 @@ components:
queries:
type: array
items:
$ref: '#/components/schemas/Query'
$ref: "#/components/schemas/Query"
description: List of queries.
required:
- queries
@@ -426,7 +425,7 @@ components:
type: object
properties:
type:
$ref: '#/components/schemas/QueryType'
$ref: "#/components/schemas/QueryType"
config:
type: string
description: Configuration for the new query.
@@ -498,6 +497,13 @@ components:
- name
- can_sync
JobStatus:
type: string
enum:
- IN_SYNC
- NOT_SYNCED
description: Specifies the status of a job.
Job:
type: object
properties:
@@ -512,10 +518,13 @@ components:
can_sync:
type: boolean
description: Specifies whether the job is actively syncing
status:
$ref: "#/components/schemas/JobStatus"
required:
- id
- client_id
- can_sync
- status
JobCreate:
type: object
@@ -590,7 +599,7 @@ components:
type: array
description: The fields in the job collector.
items:
$ref: '#/components/schemas/JobCollectorField'
$ref: "#/components/schemas/JobCollectorField"
description: JobCollector model.
required:
- job_id
@@ -619,7 +628,7 @@ components:
type: array
description: The fields in the job collector.
items:
$ref: '#/components/schemas/JobCollectorField'
$ref: "#/components/schemas/JobCollectorField"
description: Payload for updating a JobCollector.
JobCollectorField:
@@ -658,7 +667,7 @@ components:
type: array
description: Filter the scope based on field output values.
items:
$ref: '#/components/schemas/FieldFilter'
$ref: "#/components/schemas/FieldFilter"
description: Payload for triggering an export.
required:
- job_id
@@ -711,7 +720,7 @@ components:
format: uuid
description: The job id relative to the export.
status:
$ref: '#/components/schemas/ExportStatus'
$ref: "#/components/schemas/ExportStatus"
output_location:
type: string
description: The location in which the export zip file will be found.