From 77f2b06c3b0da8c0337a1f1ec0940881cdaf0274 Mon Sep 17 00:00:00 2001 From: Thomas Raffray Date: Fri, 13 Jan 2023 16:56:39 +0100 Subject: [PATCH 1/3] feat(tasks): add query params to task lists endpoint --- specs/ingestion/common/parameters.yml | 54 +++++++++++++++++++++++++++ specs/ingestion/paths/tasks/tasks.yml | 4 ++ 2 files changed, 58 insertions(+) diff --git a/specs/ingestion/common/parameters.yml b/specs/ingestion/common/parameters.yml index cd072cfdaa..781f0e6493 100644 --- a/specs/ingestion/common/parameters.yml +++ b/specs/ingestion/common/parameters.yml @@ -67,3 +67,57 @@ page: required: false schema: type: integer + +enabled: + name: enabled + in: query + description: If the return element should have is 'enabled' property set to true. + required: false + schema: + type: boolean + +action: + name: action + in: query + description: Which action the return element should have. Can be a list of string separated with commas. + required: false + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - save + - replace + - delete + example: save,replace + +destinationIDQueryParam: + name: destinationID + in: query + description: Which destinationID the return element should have. Can be a list of string separated with commas. + required: false + style: form + explode: false + schema: + type: array + items: + type: string + +triggerType: + name: triggerType + in: query + description: Which trigger type the return element should have. Can be a list of string separated with commas. + required: false + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - on_demand + - schedule + - subscription + example: on_demand,schedule diff --git a/specs/ingestion/paths/tasks/tasks.yml b/specs/ingestion/paths/tasks/tasks.yml index 0662006b62..4b3676c1ad 100644 --- a/specs/ingestion/paths/tasks/tasks.yml +++ b/specs/ingestion/paths/tasks/tasks.yml @@ -7,6 +7,10 @@ get: parameters: - $ref: '../../common/parameters.yml#/itemsPerPage' - $ref: '../../common/parameters.yml#/page' + - $ref: '../../common/parameters.yml#/action' + - $ref: '../../common/parameters.yml#/enabled' + - $ref: '../../common/parameters.yml#/destinationIDQueryParam' + - $ref: '../../common/parameters.yml#/triggerType' responses: '200': description: OK From e01d660483d62bac1b98350a3f5e238aad32b4a3 Mon Sep 17 00:00:00 2001 From: Thomas Raffray Date: Fri, 13 Jan 2023 17:17:13 +0100 Subject: [PATCH 2/3] feat(tasks): fix spec errors --- specs/ingestion/common/parameters.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/specs/ingestion/common/parameters.yml b/specs/ingestion/common/parameters.yml index 781f0e6493..d617008ebf 100644 --- a/specs/ingestion/common/parameters.yml +++ b/specs/ingestion/common/parameters.yml @@ -86,11 +86,7 @@ action: schema: type: array items: - type: string - enum: - - save - - replace - - delete + $ref: './schemas/task.yml#/ActionType' example: save,replace destinationIDQueryParam: @@ -115,9 +111,5 @@ triggerType: schema: type: array items: - type: string - enum: - - on_demand - - schedule - - subscription + $ref: './schemas/task.yml#/TriggerType' example: on_demand,schedule From 46fa26092451f16054e48e2af8f496086e9a0004 Mon Sep 17 00:00:00 2001 From: Thomas Raffray Date: Mon, 16 Jan 2023 11:14:47 +0100 Subject: [PATCH 3/3] feat(tasks): put task parameters in their own file --- specs/ingestion/common/parameters.yml | 46 ----------------------- specs/ingestion/common/taskParameters.yml | 45 ++++++++++++++++++++++ specs/ingestion/paths/tasks/tasks.yml | 8 ++-- 3 files changed, 49 insertions(+), 50 deletions(-) create mode 100644 specs/ingestion/common/taskParameters.yml diff --git a/specs/ingestion/common/parameters.yml b/specs/ingestion/common/parameters.yml index d617008ebf..cd072cfdaa 100644 --- a/specs/ingestion/common/parameters.yml +++ b/specs/ingestion/common/parameters.yml @@ -67,49 +67,3 @@ page: required: false schema: type: integer - -enabled: - name: enabled - in: query - description: If the return element should have is 'enabled' property set to true. - required: false - schema: - type: boolean - -action: - name: action - in: query - description: Which action the return element should have. Can be a list of string separated with commas. - required: false - style: form - explode: false - schema: - type: array - items: - $ref: './schemas/task.yml#/ActionType' - example: save,replace - -destinationIDQueryParam: - name: destinationID - in: query - description: Which destinationID the return element should have. Can be a list of string separated with commas. - required: false - style: form - explode: false - schema: - type: array - items: - type: string - -triggerType: - name: triggerType - in: query - description: Which trigger type the return element should have. Can be a list of string separated with commas. - required: false - style: form - explode: false - schema: - type: array - items: - $ref: './schemas/task.yml#/TriggerType' - example: on_demand,schedule diff --git a/specs/ingestion/common/taskParameters.yml b/specs/ingestion/common/taskParameters.yml new file mode 100644 index 0000000000..68f6317595 --- /dev/null +++ b/specs/ingestion/common/taskParameters.yml @@ -0,0 +1,45 @@ +enabled: + name: enabled + in: query + description: If the returned task should have its 'enabled' property set to true. + required: false + schema: + type: boolean + +action: + name: action + in: query + description: Which action the returned task should have. Can be a list of string separated with commas. + required: false + style: form + explode: false + schema: + type: array + items: + $ref: './schemas/task.yml#/ActionType' + example: save,replace + +destinationID: + name: destinationID + in: query + description: Which destinationID the returned task should have. Can be a list of string separated with commas. + required: false + style: form + explode: false + schema: + type: array + items: + type: string + +triggerType: + name: triggerType + in: query + description: Which trigger type the returned task should have. Can be a list of string separated with commas. + required: false + style: form + explode: false + schema: + type: array + items: + $ref: './schemas/task.yml#/TriggerType' + example: on_demand,schedule diff --git a/specs/ingestion/paths/tasks/tasks.yml b/specs/ingestion/paths/tasks/tasks.yml index 4b3676c1ad..8547420a65 100644 --- a/specs/ingestion/paths/tasks/tasks.yml +++ b/specs/ingestion/paths/tasks/tasks.yml @@ -7,10 +7,10 @@ get: parameters: - $ref: '../../common/parameters.yml#/itemsPerPage' - $ref: '../../common/parameters.yml#/page' - - $ref: '../../common/parameters.yml#/action' - - $ref: '../../common/parameters.yml#/enabled' - - $ref: '../../common/parameters.yml#/destinationIDQueryParam' - - $ref: '../../common/parameters.yml#/triggerType' + - $ref: '../../common/taskParameters.yml#/action' + - $ref: '../../common/taskParameters.yml#/enabled' + - $ref: '../../common/taskParameters.yml#/destinationID' + - $ref: '../../common/taskParameters.yml#/triggerType' responses: '200': description: OK