Skip to content

Commit

Permalink
Added task_log changes to openapi spec and removed flag to hide task …
Browse files Browse the repository at this point in the history
…from RunLog
  • Loading branch information
patmagee committed Aug 26, 2022
1 parent 2227c97 commit c65adf6
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 6 deletions.
10 changes: 9 additions & 1 deletion openapi/components/schemas/RunLog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ properties:
$ref: './State.yaml'
run_log:
$ref: './Log.yaml'
task_logs_url:
type: string
description: A reference to the complete url which may be used to obtain a paginated list of task logs for this workflow
task_logs:
type: array
deprecated: true
required: false
items:
$ref: './Log.yaml'
description: The logs, and other key info like timing and exit code, for each step in the workflow run.
description: >-
The logs, and other key info like timing and exit code, for each step in the workflow run.
This field is deprecated and the `task_logs_url` should be used to retrieve a paginated list
of steps from the workflow run
outputs:
type: object
description: The outputs from the workflow run.
14 changes: 14 additions & 0 deletions openapi/components/schemas/TaskListResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: TaskListResponse
type: object
properties:
task_logs:
type: array
items:
$ref: './Log.yaml'
description: The logs, and other key info like timing and exit code, for each step in the workflow run.
next_page_token:
type: string
description: >-
A token which may be supplied as `page_token` in workflow run task list request to get the next page
of results. An empty string indicates there are no more items to return.
description: The service will return a TaskListResponse when receiving a successful TaskListRequest.
9 changes: 9 additions & 0 deletions openapi/paths/runs@{run_id}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ get:
style: simple
schema:
type: string
- name: exclude_task_logs
description: >-
A flag that toggles whether the workflow run's `task_logs` are returned as part of the response body.
If set to true, the `task_logs` key must be set to `null` and and the `task_logs_url` must specify
the complete url to retrieve `task_logs` from. If set to false, or left undefined,
then the `task_logs` MUST be returned as part of the response body, `task_logs_url` may also be set.
in: query
type: boolean
required: false
responses:
200:
description: ''
Expand Down
77 changes: 77 additions & 0 deletions openapi/paths/runs@{run_id}@tasks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
post:
tags:
- Workflow Runs
summary: ListTasks
description: >-
This endpoint provides a paginated list of tasks that were executed as part of a given
workflow run. Task ordering should be the same as what would be returned in a
`RunLog` response body.
operationId: ListTasks
parameters:
- name: run_id
in: path
description: ''
required: true
style: simple
schema:
type: string
- name: page_size
in: query
description: >-
OPTIONAL
The preferred number of task logs to return in a page.
If not provided, the implementation should use a default page size.
The implementation must not return more items
than `page_size`, but it may return fewer. Clients should
not assume that if fewer than `page_size` items are
returned that all items have been returned. The
availability of additional pages is indicated by the value
of `next_page_token` in the response.
style: form
explode: true
schema:
type: integer
format: int64
- name: page_token
in: query
description: >-
OPTIONAL
Token to use to indicate where to start getting results. If unspecified, return the first
page of results.
style: form
explode: true
schema:
type: string
responses:
200:
description: ''
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/TaskListResponse'
401:
description: The request is unauthorized.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
403:
description: The requester is not authorized to perform this action.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
404:
description: The requested workflow run wasn't found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: An unexpected error occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
deprecated: false
2 changes: 2 additions & 0 deletions openapi/workflow_execution_service.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ paths:
$ref: ./paths/runs.yaml
'/runs/{run_id}':
$ref: ./paths/runs@{run_id}.yaml
'/runs/{run_id}/tasks':
$ref: ./paths/runs@{run_id}@tasks.yaml
'/runs/{run_id}/status':
$ref: ./paths/runs@{run_id}@status.yaml
'/runs/{run_id}/cancel':
Expand Down
10 changes: 5 additions & 5 deletions openapi/workflow_execution_service.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ paths:
description: >-
A flag that toggles whether the workflow run's `task_logs` are returned as part of the response body.
If set to true, the `task_logs` key must be set to `null` and and the `task_logs_url` must specify
the complete url to retrieve `task_logs` from if there are any. If set to false, or left undefined,
the complete url to retrieve `task_logs` from. If set to false, or left undefined,
then the `task_logs` MUST be returned as part of the response body, `task_logs_url` may also be set.
in: query
type: boolean
Expand Down Expand Up @@ -646,14 +646,14 @@ definitions:
run_log:
$ref: '#/definitions/Log'
description: The logs, and other key info like timing and exit code, for the overall run of this workflow.
task_logs_url:
type: string
description: A reference to the complete url which may be used to obtain a paginated list of task logs of this workflow
task_logs:
type: array
items:
$ref: '#/definitions/Log'
description: The logs, and other key info like timing and exit code, for each step in the workflow run.
description: >-
The logs, and other key info like timing and exit code, for each step in the workflow run.
This field is deprecated and the `task_logs_url` should be used to retrieve a paginated list
of steps from the workflow run
outputs:
type: object
description: The outputs from the workflow run.
Expand Down

0 comments on commit c65adf6

Please sign in to comment.