Skip to content

Commit

Permalink
feat(openapi): add get_workflow_share_status endpoint
Browse files Browse the repository at this point in the history
Adds `reana-server` and `reana-workflow-controller` OpenAPI
specifications for retrieving whom a workflow is shared with.

Closes reanahub/reana-client#686
  • Loading branch information
DaanRosendal committed Mar 13, 2024
1 parent e73b958 commit dcf23bb
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 0 deletions.
133 changes: 133 additions & 0 deletions reana_commons/openapi_specifications/reana_server.json
Original file line number Diff line number Diff line change
Expand Up @@ -3163,6 +3163,139 @@
"summary": "Share a workflow with another user."
}
},
"/api/workflows/{workflow_id_or_name}/share-status": {
"get": {
"description": "This resource returns the share status of a given workflow.",
"operationId": "get_workflow_share_status",
"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"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Request succeeded. The response contains the share status of the workflow.",
"examples": {
"application/json": {
"shared_with": [
{
"user_email": "bob@example.org",
"valid_until": "2022-11-24T23:59:59"
}
],
"workflow_id": "256b25f4-4cfb-4684-b7a8-73872ef455a1",
"workflow_name": "mytest.1"
}
},
"schema": {
"properties": {
"shared_with": {
"items": {
"properties": {
"user_email": {
"type": "string"
},
"valid_until": {
"type": "string",
"x-nullable": true
}
},
"type": "object"
},
"type": "array"
},
"workflow_id": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
},
"type": "object"
}
},
"401": {
"description": "Request failed. User not signed in.",
"examples": {
"application/json": {
"message": "User not signed in."
}
},
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
},
"403": {
"description": "Request failed. Credentials are invalid or revoked.",
"examples": {
"application/json": {
"message": "Token not valid."
}
},
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
},
"404": {
"description": "Request failed. Workflow does not exist.",
"examples": {
"application/json": {
"message": "Workflow mytest.1 does not exist."
}
},
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
},
"500": {
"description": "Request failed. Internal server error.",
"examples": {
"application/json": {
"message": "Something went wrong."
}
},
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Get the share status of a workflow."
}
},
"/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.",
Expand Down
133 changes: 133 additions & 0 deletions reana_commons/openapi_specifications/reana_workflow_controller.json
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,139 @@
"summary": "Share a workflow with other users."
}
},
"/api/workflows/{workflow_id_or_name}/share-status": {
"get": {
"description": "This resource returns the share status of a given workflow.",
"operationId": "get_workflow_share_status",
"parameters": [
{
"description": "Required. UUID of workflow owner.",
"in": "query",
"name": "user_id",
"required": true,
"type": "string"
},
{
"description": "Required. Workflow UUID or name.",
"in": "path",
"name": "workflow_id_or_name",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Request succeeded. The response contains the share status of the workflow.",
"examples": {
"application/json": {
"shared_with": [
{
"user_email": "bob@example.org",
"valid_until": "2022-11-24T23:59:59"
}
],
"workflow_id": "256b25f4-4cfb-4684-b7a8-73872ef455a1",
"workflow_name": "mytest.1"
}
},
"schema": {
"properties": {
"shared_with": {
"items": {
"properties": {
"user_email": {
"type": "string"
},
"valid_until": {
"type": "string",
"x-nullable": true
}
},
"type": "object"
},
"type": "array"
},
"workflow_id": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
},
"type": "object"
}
},
"401": {
"description": "Request failed. User not signed in.",
"examples": {
"application/json": {
"message": "User not signed in."
}
},
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
},
"403": {
"description": "Request failed. Credentials are invalid or revoked.",
"examples": {
"application/json": {
"message": "Token not valid."
}
},
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
},
"404": {
"description": "Request failed. Workflow does not exist.",
"examples": {
"application/json": {
"message": "Workflow mytest.1 does not exist."
}
},
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
},
"500": {
"description": "Request failed. Internal server error.",
"examples": {
"application/json": {
"message": "Something went wrong."
}
},
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Get the share status of a workflow."
}
},
"/api/workflows/{workflow_id_or_name}/status": {
"get": {
"description": "This resource reports the status of workflow.",
Expand Down

0 comments on commit dcf23bb

Please sign in to comment.