diff --git a/api/specs/webserver/components/schemas/task.yaml b/api/specs/common/schemas/task.yaml similarity index 100% rename from api/specs/webserver/components/schemas/task.yaml rename to api/specs/common/schemas/task.yaml diff --git a/api/specs/storage/openapi.yaml b/api/specs/storage/openapi.yaml index 0f4844f1fce3..19697fc6d5d3 100644 --- a/api/specs/storage/openapi.yaml +++ b/api/specs/storage/openapi.yaml @@ -28,6 +28,7 @@ tags: - name: location - name: dataset - name: file + - name: tasks paths: /: get: @@ -640,6 +641,68 @@ paths: $ref: "#/components/schemas/FileMetaEnvelope" default: $ref: "#/components/responses/DefaultErrorResponse" + + /tasks: + get: + operationId: list_tasks + tags: + - tasks + responses: + "200": + description: Returns the list of active tasks (running and/or done) + content: + application/json: + schema: + type: array + items: + $ref: "../common/schemas/task.yaml#/TaskEnveloped" + /tasks/{task_id}: + parameters: + - name: task_id + in: path + required: true + schema: + type: string + get: + operationId: get_task_status + tags: + - tasks + responses: + "200": + description: Returns the task status + content: + application/json: + schema: + $ref: "../common/schemas/task.yaml#/TaskStatusEnveloped" + default: + $ref: "#/components/responses/DefaultErrorResponse" + delete: + operationId: cancel_and_delete_task + description: Aborts and remove the task + tags: + - tasks + responses: + "204": + description: Task was successfully aborted + default: + $ref: "#/components/responses/DefaultErrorResponse" + + /tasks/{task_id}/result: + parameters: + - name: task_id + in: path + required: true + schema: + type: string + get: + operationId: get_task_result + tags: + - tasks + responses: + "2XX": + description: Retrieve the task result and returns directly its HTTP code + default: + $ref: "#/components/responses/DefaultErrorResponse" components: schemas: HealthCheckEnveloped: diff --git a/api/specs/webserver/openapi-projects.yaml b/api/specs/webserver/openapi-projects.yaml index 1202f6d7a990..f9061bf6db2f 100644 --- a/api/specs/webserver/openapi-projects.yaml +++ b/api/specs/webserver/openapi-projects.yaml @@ -85,7 +85,7 @@ paths: content: application/json: schema: - $ref: "./components/schemas/task.yaml#/TaskEnveloped" + $ref: "../common/schemas/task.yaml#/TaskEnveloped" links: CreationStatus: operationId: get_task_status diff --git a/api/specs/webserver/openapi-tasks.yaml b/api/specs/webserver/openapi-tasks.yaml index d80dc09d1546..e0c205899c3e 100644 --- a/api/specs/webserver/openapi-tasks.yaml +++ b/api/specs/webserver/openapi-tasks.yaml @@ -12,7 +12,7 @@ paths: schema: type: array items: - $ref: "./components/schemas/task.yaml#/TaskEnveloped" + $ref: "../common/schemas/task.yaml#/TaskEnveloped" /tasks/{task_id}: parameters: @@ -31,7 +31,7 @@ paths: content: application/json: schema: - $ref: "./components/schemas/task.yaml#/TaskStatusEnveloped" + $ref: "../common/schemas/task.yaml#/TaskStatusEnveloped" default: $ref: "#/components/responses/DefaultErrorResponse" delete: diff --git a/services/storage/src/simcore_service_storage/api/v0/openapi.yaml b/services/storage/src/simcore_service_storage/api/v0/openapi.yaml index c6dcc7288da8..409b1cc1c77d 100644 --- a/services/storage/src/simcore_service_storage/api/v0/openapi.yaml +++ b/services/storage/src/simcore_service_storage/api/v0/openapi.yaml @@ -23,11 +23,19 @@ servers: enum: - v0 default: v0 +tags: + - name: maintenance + - name: location + - name: dataset + - name: file + - name: tasks paths: /: get: summary: Service health-check endpoint description: Some general information on the API and state of the service behind + tags: + - maintenance operationId: health_check responses: '200': @@ -42,6 +50,8 @@ paths: get: summary: checks status of self and connected services operationId: get_status + tags: + - maintenance responses: '200': description: returns app status check @@ -49,6 +59,8 @@ paths: get: summary: Lists available storage locations operationId: get_storage_locations + tags: + - location parameters: - name: user_id in: query @@ -68,6 +80,8 @@ paths: post: summary: Manually triggers the synchronisation of the file meta data table in the database operationId: synchronise_meta_data_table + tags: + - location parameters: - name: location_id in: path @@ -99,6 +113,8 @@ paths: get: summary: Lists all dataset's metadata operationId: get_datasets_metadata + tags: + - dataset parameters: - name: location_id in: path @@ -123,6 +139,8 @@ paths: get: summary: Lists all file's metadata operationId: get_files_metadata + tags: + - file parameters: - name: location_id in: path @@ -152,6 +170,8 @@ paths: get: summary: Get dataset metadata operationId: get_files_metadata_dataset + tags: + - dataset parameters: - name: location_id in: path @@ -181,6 +201,8 @@ paths: get: summary: Get file metadata operationId: get_file_metadata + tags: + - file parameters: - name: file_id in: path @@ -210,6 +232,8 @@ paths: get: summary: Gets download link for file at location operationId: download_file + tags: + - file parameters: - name: file_id in: path @@ -247,6 +271,8 @@ paths: put: summary: Returns upload object operationId: upload_file + tags: + - file parameters: - name: file_id in: path @@ -307,6 +333,8 @@ paths: delete: summary: Deletes file operationId: delete_file + tags: + - file parameters: - name: file_id in: path @@ -332,6 +360,8 @@ paths: post: summary: Asks the server to abort the upload and revert to the last valid version if any operationId: abort_upload_file + tags: + - file parameters: - name: file_id in: path @@ -357,6 +387,8 @@ paths: post: summary: Asks the server to complete the upload operationId: complete_upload_file + tags: + - file parameters: - name: file_id in: path @@ -415,6 +447,8 @@ paths: post: summary: Check for upload completion operationId: is_completed_upload_file + tags: + - file parameters: - name: future_id in: path @@ -449,6 +483,8 @@ paths: post: summary: Returns the temporary access credentials for the user storage space operationId: get_or_create_temporary_s3_access + tags: + - file parameters: - name: user_id in: query @@ -468,6 +504,8 @@ paths: post: summary: Returns metadata for all files matching a pattern operationId: search_files_starting_with + tags: + - file parameters: - name: user_id in: query @@ -493,6 +531,8 @@ paths: post: summary: Deep copies of all data from source to destination project in s3 operationId: copy_folders_from_project + tags: + - file parameters: - name: user_id in: query @@ -527,6 +567,8 @@ paths: delete: summary: Deletes all objects within a node_id or within a project_id if node_id is omitted operationId: delete_folders_of_project + tags: + - file parameters: - name: folder_id in: path @@ -550,6 +592,8 @@ paths: post: summary: Copy as soft link operationId: copy_as_soft_link + tags: + - file parameters: - name: file_id in: path @@ -580,6 +624,108 @@ paths: $ref: '#/components/schemas/FileMetaEnvelope' default: $ref: '#/components/responses/DefaultErrorResponse' + /tasks: + get: + operationId: list_tasks + tags: + - tasks + responses: + '200': + description: Returns the list of active tasks (running and/or done) + content: + application/json: + schema: + type: array + items: + type: object + required: + - data + properties: + data: + type: object + properties: + task_id: + type: string + status_href: + type: string + result_href: + type: string + required: + - task_id + - status_href + - result_href + error: + nullable: true + default: null + '/tasks/{task_id}': + parameters: + - name: task_id + in: path + required: true + schema: + type: string + get: + operationId: get_task_status + tags: + - tasks + responses: + '200': + description: Returns the task status + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + required: + - task_progress + - done + - started + properties: + task_progress: + type: number + minimum: 0 + maximum: 1 + done: + type: boolean + started: + type: string + pattern: '\d{4}-(12|11|10|0?[1-9])-(31|30|[0-2]?\d)T(2[0-3]|1\d|0?[0-9])(:(\d|[0-5]\d)){2}(\.\d{3})?Z' + example: '2018-07-01T11:13:43Z' + error: + nullable: true + default: null + default: + $ref: '#/components/responses/DefaultErrorResponse' + delete: + operationId: cancel_and_delete_task + description: Aborts and remove the task + tags: + - tasks + responses: + '204': + description: Task was successfully aborted + default: + $ref: '#/components/responses/DefaultErrorResponse' + '/tasks/{task_id}/result': + parameters: + - name: task_id + in: path + required: true + schema: + type: string + get: + operationId: get_task_result + tags: + - tasks + responses: + 2XX: + description: Retrieve the task result and returns directly its HTTP code + default: + $ref: '#/components/responses/DefaultErrorResponse' components: schemas: HealthCheckEnveloped: diff --git a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml index b83aaaa25be1..da94d86eff12 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml +++ b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml @@ -203,7 +203,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' default: $ref: '#/components/responses/DefaultErrorResponse' /auth/verify-phone-number: @@ -235,7 +235,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' default: $ref: '#/components/responses/DefaultErrorResponse' /auth/validate-code-register: @@ -271,7 +271,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' default: $ref: '#/components/responses/DefaultErrorResponse' /auth/login: @@ -296,6 +296,12 @@ paths: responses: '200': description: Succesfully logged in + content: + application/json: + schema: + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' + '202': + description: 'Accepted, but 2 Factor Authentication required' content: application/json: schema: @@ -330,12 +336,6 @@ paths: error: nullable: true default: null - '202': - description: 'Accepted, but 2 Factor Authentication required' - content: - application/json: - schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' default: $ref: '#/components/responses/DefaultErrorResponse' /auth/validate-code-login: @@ -366,7 +366,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' default: $ref: '#/components/responses/DefaultErrorResponse' /auth/logout: @@ -389,7 +389,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' default: $ref: '#/components/responses/DefaultErrorResponse' /auth/reset-password: @@ -416,7 +416,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' '503': description: failed to send confirmation email content: @@ -457,7 +457,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' '401': description: unauthorized reset due to invalid token code content: @@ -490,7 +490,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' '401': description: unauthorized user. Login required content: @@ -537,7 +537,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1auth~1login/post/responses/200/content/application~1json/schema' + $ref: '#/paths/~1auth~1login/post/responses/202/content/application~1json/schema' '401': description: unauthorized user. Login required content: @@ -3003,7 +3003,15 @@ paths: content: application/json: schema: - $ref: '#/paths/~1projects~1%7Bproject_id%7D~1nodes~1%7Bnode_id%7D~1resources/put/responses/200/content/application~1json/schema' + type: object + required: + - data + properties: + data: + $ref: '#/paths/~1projects~1%7Bproject_id%7D~1nodes~1%7Bnode_id%7D~1resources/put/requestBody/content/application~1json/schema' + error: + nullable: true + default: null default: $ref: '#/components/responses/DefaultErrorResponse' put: @@ -3039,15 +3047,7 @@ paths: content: application/json: schema: - type: object - required: - - data - properties: - data: - $ref: '#/paths/~1projects~1%7Bproject_id%7D~1nodes~1%7Bnode_id%7D~1resources/put/requestBody/content/application~1json/schema' - error: - nullable: true - default: null + $ref: '#/paths/~1projects~1%7Bproject_id%7D~1nodes~1%7Bnode_id%7D~1resources/get/responses/200/content/application~1json/schema' default: $ref: '#/components/responses/DefaultErrorResponse' '/nodes/{nodeInstanceUUID}/outputUi/{outputKey}': @@ -4985,7 +4985,7 @@ paths: content: application/json: schema: - $ref: '#/paths/~1projects~1%7Bproject_id%7D~1nodes~1%7Bnode_id%7D~1resources/put/responses/200/content/application~1json/schema' + $ref: '#/paths/~1projects~1%7Bproject_id%7D~1nodes~1%7Bnode_id%7D~1resources/get/responses/200/content/application~1json/schema' default: $ref: '#/components/responses/DefaultErrorResponse' '/clusters:ping':