From ee7e1bdd2ca4378a90cdfafff0beab3055fbdb27 Mon Sep 17 00:00:00 2001 From: Suyash Gupta Date: Mon, 27 Jun 2022 21:03:31 +0530 Subject: [PATCH 1/2] added callback specs --- openapi/task_execution_service.openapi.yaml | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/openapi/task_execution_service.openapi.yaml b/openapi/task_execution_service.openapi.yaml index 8d57d8f..e0dde70 100644 --- a/openapi/task_execution_service.openapi.yaml +++ b/openapi/task_execution_service.openapi.yaml @@ -146,6 +146,23 @@ paths: application/json: schema: $ref: '#/components/schemas/tesCreateTaskResponse' + callbacks: + statusChange: + '{$request.body#/callback_url}': + post: + description: |- + The API will send notifications to the callback URL, if provided, + when the task status changes. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/tesCallbackStatus' + responses: + 204: + description: |- + Listener should return this HTTP status code if + the payload was received successfully. x-codegen-request-body-name: body /tasks/{id}: get: @@ -654,6 +671,14 @@ components: type: string description: |- Optional user-provided description of task for documentation purposes. + callback_url: + type: string + format: uri + description: |- + Optional user-provided callback URL. Note that the URL can be + provided while creating a new task, but it MUST NOT be displayed when + a task or a list of tasks is returned by the TES server. + example: https://myserver.com/send/callback/here inputs: type: array description: |- @@ -741,6 +766,19 @@ components: example: 2020-10-02T10:00:00-05:00 readOnly: true description: Task describes an instance of a task. + tesCallbackStatus: + type: object + required: + - task_id + - state + properties: + task_id: + type: string + description: Task identifier assigned by the server. + example: job-0012345 + state: + $ref: '#/components/schemas/tesState' + description: Notification that a task has changed state. tesTaskLog: required: - logs From b0f59642c323e02d4b4b7315aeede0de4f3874aa Mon Sep 17 00:00:00 2001 From: Suyash Gupta Date: Sat, 10 Sep 2022 12:39:24 +0530 Subject: [PATCH 2/2] added callback specs --- openapi/task_execution_service.openapi.yaml | 34 ++++++++++----------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/openapi/task_execution_service.openapi.yaml b/openapi/task_execution_service.openapi.yaml index e0dde70..21ebc18 100644 --- a/openapi/task_execution_service.openapi.yaml +++ b/openapi/task_execution_service.openapi.yaml @@ -151,7 +151,7 @@ paths: '{$request.body#/callback_url}': post: description: |- - The API will send notifications to the callback URL, if provided, + The TES server will send notifications to the callback URL, if provided, when the task status changes. requestBody: content: @@ -236,6 +236,19 @@ components: - FULL schemas: + tesCallbackStatus: + type: object + required: + - id + - state + properties: + id: + type: string + description: Task identifier assigned by the server. + example: job-0012345 + state: + $ref: '#/components/schemas/tesState' + description: Notification that a task has changed state. tesCancelTaskResponse: type: object description: CancelTaskResponse describes a response from the CancelTask endpoint. @@ -675,9 +688,7 @@ components: type: string format: uri description: |- - Optional user-provided callback URL. Note that the URL can be - provided while creating a new task, but it MUST NOT be displayed when - a task or a list of tasks is returned by the TES server. + Optional user-provided callback URL. example: https://myserver.com/send/callback/here inputs: type: array @@ -765,20 +776,7 @@ components: This is set by the system, not the client. example: 2020-10-02T10:00:00-05:00 readOnly: true - description: Task describes an instance of a task. - tesCallbackStatus: - type: object - required: - - task_id - - state - properties: - task_id: - type: string - description: Task identifier assigned by the server. - example: job-0012345 - state: - $ref: '#/components/schemas/tesState' - description: Notification that a task has changed state. + description: Task describes an instance of a task. tesTaskLog: required: - logs