Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(specs): add task input for bigquery #1549

Merged
merged 3 commits into from
May 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions specs/ingestion/common/schemas/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Task:
trigger:
$ref: '#/Trigger'
input:
description: The input that holds information specific to the task.
type: object
$ref: '#/TaskInput'
enabled:
type: boolean
default: true
Expand Down Expand Up @@ -57,6 +56,8 @@ TaskCreate:
enabled:
type: boolean
description: Whether the task is enabled or not.
input:
$ref: '#/TaskInput'
# lastCursorValue:
# type: integer
# format: int64
Expand Down Expand Up @@ -94,6 +95,8 @@ TaskUpdate:
$ref: './common.yml#/destinationID'
trigger:
$ref: '#/TriggerInput'
input:
$ref: '#/TaskInput'
enabled:
type: boolean
description: Whether the task is enabled or not.
Expand Down Expand Up @@ -127,6 +130,11 @@ ActionType:
description: The action to perform on the Algolia index.
enum: ['replace', 'save']

TaskInput:
oneOf:
- $ref: '#/OnDemandDateUtilsInput'
- $ref: '#/ScheduleDateUtilsInput'

TriggerInput:
type: object
additionalProperties: false
Expand Down Expand Up @@ -239,3 +247,33 @@ SubscriptionTrigger:
$ref: '#/SubscriptionTriggerType'
required:
- type

# Task input

OnDemandDateUtilsInput:
type: object
additionalProperties: false
description: The input for an `onDemand` task whose source is of type `bigquery` and for which extracted data spans a given time range.
properties:
startDate:
description: The start date of the extraction (RFC3339 format).
type: string
endDate:
description: The end date of the extraction (RFC3339 format).
type: string
required:
- startDate
- endDate

ScheduleDateUtilsInput:
type: object
additionalProperties: false
description: The input for a `schedule` task whose source is of type `bigquery` and for which extracted data spans a fixed number of days.
properties:
timeframe:
description: The timeframe of the extraction, in number of days from today.
type: integer
minimum: 1
maximum: 30
required:
- timeframe