Skip to content

Commit

Permalink
rest: pass parameters in set_workflow_status
Browse files Browse the repository at this point in the history
Signed-off-by: Dinos Kousidis <dinos.kousidis@cern.ch>
  • Loading branch information
dinosk committed Aug 8, 2018
1 parent 03eb929 commit 5f34e20
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
16 changes: 11 additions & 5 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,20 +585,26 @@
},
{
"description": "Required. New workflow status.",
"in": "body",
"in": "query",
"name": "status",
"required": true,
"schema": {
"description": "Required. New status.",
"type": "string"
}
"type": "string"
},
{
"description": "Required. The API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
},
{
"description": "Optional. Extra parameters for workflow status.",
"in": "body",
"name": "parameters",
"required": false,
"schema": {
"type": "object"
}
}
],
"produces": [
Expand Down
12 changes: 9 additions & 3 deletions reana_server/openapi_connections/reana_workflow_controller.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,18 @@
},
{
"description": "Required. New status.",
"in": "body",
"in": "query",
"name": "status",
"required": true,
"type": "string"
},
{
"description": "Optional. Extra parameters for workflow status.",
"in": "body",
"name": "parameters",
"required": false,
"schema": {
"description": "Required. New status.",
"type": "string"
"type": "object"
}
}
],
Expand Down
19 changes: 12 additions & 7 deletions reana_server/rest/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,21 @@ def set_workflow_status(workflow_id_or_name): # noqa
required: true
type: string
- name: status
in: body
in: query
description: Required. New workflow status.
required: true
schema:
type: string
description: Required. New status.
type: string
- name: access_token
in: query
description: Required. The API access_token of workflow owner.
required: true
type: string
- name: parameters
in: body
description: Optional. Extra parameters for workflow status.
required: false
schema:
type: object
responses:
200:
description: >-
Expand Down Expand Up @@ -613,13 +617,14 @@ def set_workflow_status(workflow_id_or_name): # noqa

if not workflow_id_or_name:
raise KeyError("workflow_id_or_name is not supplied")

status = request.json
status = request.args.get('status')
parameters = request.json

response, http_response = rwc_api_client.api.set_workflow_status(
user=user_id,
workflow_id_or_name=workflow_id_or_name,
status=status).result()
status=status,
parameters=parameters).result()

return jsonify(response), http_response.status_code
except HTTPError as e:
Expand Down

0 comments on commit 5f34e20

Please sign in to comment.