Skip to content

Commit

Permalink
feat(rest): add sharing parameters to get_workflows (reanahub#658)
Browse files Browse the repository at this point in the history
Adds new `shared`, `shared_with` and `shared_by` parameters to the
`get_workflows` endpoint to retrieve workflows along with their sharing
information.

Closes reanahub/reana-client#687
  • Loading branch information
DaanRosendal committed Mar 20, 2024
1 parent 4f6ed5e commit 8a59850
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,27 @@
"name": "workflow_id_or_name",
"required": false,
"type": "string"
},
{
"description": "Optional flag to list all shared (owned and unowned) workflows.",
"in": "query",
"name": "shared",
"required": false,
"type": "boolean"
},
{
"description": "Optional argument to list workflows shared by the specified user(s).",
"in": "query",
"name": "shared_by",
"required": false,
"type": "string"
},
{
"description": "Optional argument to list workflows shared with the specified user(s).",
"in": "query",
"name": "shared_with",
"required": false,
"type": "string"
}
],
"produces": [
Expand Down Expand Up @@ -1398,6 +1419,9 @@
"name": {
"type": "string"
},
"owner_email": {
"type": "string"
},
"progress": {
"properties": {
"current_command": {
Expand Down Expand Up @@ -1488,6 +1512,9 @@
"session_uri": {
"type": "string"
},
"shared_with": {
"type": "string"
},
"size": {
"properties": {
"human_readable": {
Expand Down
22 changes: 22 additions & 0 deletions reana_server/rest/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
"include_progress": fields.Bool(location="query"),
"include_workspace_size": fields.Bool(location="query"),
"workflow_id_or_name": fields.Str(),
"shared": fields.Bool(location="query"),
"shared_by": fields.Str(location="query"),
"shared_with": fields.Str(location="query"),
}
)
@signin_required(token_required=False)
Expand Down Expand Up @@ -135,6 +138,21 @@ def get_workflows(user, **kwargs): # noqa
description: Optional analysis UUID or name to filter.
required: false
type: string
- name: shared
in: query
description: Optional flag to list all shared (owned and unowned) workflows.
required: false
type: boolean
- name: shared_by
in: query
description: Optional argument to list workflows shared by the specified user(s).
required: false
type: string
- name: shared_with
in: query
description: Optional argument to list workflows shared with the specified user(s).
required: false
type: string
responses:
200:
description: >-
Expand Down Expand Up @@ -167,6 +185,10 @@ def get_workflows(user, **kwargs): # noqa
launcher_url:
type: string
x-nullable: true
owner_email:
type: string
shared_with:
type: string
created:
type: string
session_status:
Expand Down

0 comments on commit 8a59850

Please sign in to comment.