diff --git a/AUTHORS.md b/AUTHORS.md index 373cd589..b4f51d10 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -9,6 +9,7 @@ The list of contributors in alphabetical order: - [Burt Holzman](https://orcid.org/0000-0001-5235-6314) - [Camila Diaz](https://orcid.org/0000-0001-5543-797X) - [Clemens Lange](https://orcid.org/0000-0002-3632-3157) +- [Daan Rosendal](https://orcid.org/0000-0002-3447-9000) - [Daniel Prelipcean](https://orcid.org/0000-0002-4855-194X) - [Diego Rodriguez](https://orcid.org/0000-0003-0649-2002) - [Dinos Kousidis](https://orcid.org/0000-0002-4914-4289) diff --git a/reana_commons/openapi_specifications/reana_server.json b/reana_commons/openapi_specifications/reana_server.json index 3001071d..4db3989b 100644 --- a/reana_commons/openapi_specifications/reana_server.json +++ b/reana_commons/openapi_specifications/reana_server.json @@ -2972,6 +2972,197 @@ "summary": "Get the retention rules of a workflow." } }, + "/api/workflows/{workflow_id_or_name}/share": { + "post": { + "description": "This resource shares a workflow with another user. This resource is expecting a workflow UUID and some parameters.", + "operationId": "share_workflow", + "parameters": [ + { + "description": "The API access_token of workflow owner.", + "in": "query", + "name": "access_token", + "required": false, + "type": "string" + }, + { + "description": "Required. Workflow UUID or name.", + "in": "path", + "name": "workflow_id_or_name", + "required": true, + "type": "string" + }, + { + "description": "Required. User to share the workflow with.", + "in": "query", + "name": "user_email_to_share_with", + "required": true, + "type": "string" + }, + { + "description": "Optional. Message to include when sharing the workflow.", + "in": "query", + "name": "message", + "required": false, + "type": "string" + }, + { + "description": "Optional. Date when access to the workflow will expire (format YYYY-MM-DD).", + "in": "query", + "name": "valid_until", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Request succeeded. The workflow has been shared with the user.", + "examples": { + "application/json": { + "message": "The workflow has been shared with the user.", + "workflow_id": "cdcf48b1-c2f3-4693-8230-b066e088c6ac", + "workflow_name": "mytest.1" + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + } + }, + "type": "object" + } + }, + "400": { + "description": "Request failed. The incoming data specification seems malformed.", + "examples": { + "application/json": { + "errors": [ + "Missing data for required field." + ], + "message": "Malformed request." + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "403": { + "description": "Request failed. User is not allowed to share the workflow.", + "examples": { + "application/json": { + "errors": [ + "User is not allowed to share the workflow." + ] + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "404": { + "description": "Request failed. Workflow does not exist or user does not exist.", + "examples": { + "application/json": { + "errors": [ + "Workflow cdcf48b1-c2f3-4693-8230-b066e088c6ac does not exist" + ], + "message": "Workflow cdcf48b1-c2f3-4693-8230-b066e088c6ac does not exist" + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "409": { + "description": "Request failed. The workflow is already shared with the user.", + "examples": { + "application/json": { + "errors": [ + "The workflow is already shared with the user." + ], + "message": "The workflow is already shared with the user." + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "500": { + "description": "Request failed. Internal controller error.", + "examples": { + "application/json": { + "errors": [ + "Internal controller error." + ], + "message": "Internal controller error." + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "summary": "Share a workflow with another user." + } + }, "/api/workflows/{workflow_id_or_name}/specification": { "get": { "description": "This resource returns the REANA workflow specification used to start the workflow run. Resource is expecting a workflow UUID.", diff --git a/reana_commons/openapi_specifications/reana_workflow_controller.json b/reana_commons/openapi_specifications/reana_workflow_controller.json index 8fa267f5..ba596536 100644 --- a/reana_commons/openapi_specifications/reana_workflow_controller.json +++ b/reana_commons/openapi_specifications/reana_workflow_controller.json @@ -993,6 +993,197 @@ "summary": "Get the retention rules of a workflow." } }, + "/api/workflows/{workflow_id_or_name}/share": { + "post": { + "description": "This resource allows to share a workflow with other users.", + "operationId": "share_workflow", + "parameters": [ + { + "description": "Required. UUID of workflow owner.", + "in": "query", + "name": "user_id", + "required": true, + "type": "string" + }, + { + "description": "Required. Analysis UUID or name.", + "in": "path", + "name": "workflow_id_or_name", + "required": true, + "type": "string" + }, + { + "description": "Required. User to share the workflow with.", + "in": "query", + "name": "user_email_to_share_with", + "required": true, + "type": "string" + }, + { + "description": "Optional. Message to include when sharing the workflow.", + "in": "query", + "name": "message", + "required": false, + "type": "string" + }, + { + "description": "Optional. Date when access to the workflow will expire (format YYYY-MM-DD).", + "in": "query", + "name": "valid_until", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Request succeeded. The workflow has been shared with the user.", + "examples": { + "application/json": { + "message": "The workflow has been shared with the user.", + "workflow_id": "cdcf48b1-c2f3-4693-8230-b066e088c6ac", + "workflow_name": "mytest.1" + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "workflow_name": { + "type": "string" + } + }, + "type": "object" + } + }, + "400": { + "description": "Request failed. The incoming data specification seems malformed.", + "examples": { + "application/json": { + "errors": [ + "Missing data for required field." + ], + "message": "Malformed request." + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "403": { + "description": "Request failed. User is not allowed to share the workflow.", + "examples": { + "application/json": { + "errors": [ + "User is not allowed to share the workflow." + ] + } + }, + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "404": { + "description": "Request failed. Workflow does not exist or user does not exist.", + "examples": { + "application/json": { + "errors": [ + "Workflow cdcf48b1-c2f3-4693-8230-b066e088c6ac does not exist" + ], + "message": "Workflow cdcf48b1-c2f3-4693-8230-b066e088c6ac does not exist" + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "409": { + "description": "Request failed. The workflow is already shared with the user.", + "examples": { + "application/json": { + "errors": [ + "The workflow is already shared with the user." + ], + "message": "The workflow is already shared with the user." + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + }, + "500": { + "description": "Request failed. Internal controller error.", + "examples": { + "application/json": { + "errors": [ + "Internal controller error." + ], + "message": "Internal controller error." + } + }, + "schema": { + "properties": { + "errors": { + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "summary": "Share a workflow with other users." + } + }, "/api/workflows/{workflow_id_or_name}/status": { "get": { "description": "This resource reports the status of workflow.",