Skip to content

Commit

Permalink
feat(specs): add v2 endpoints for ingestion (#3410)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Jul 24, 2024
1 parent a317528 commit fe6f5ed
Show file tree
Hide file tree
Showing 46 changed files with 595 additions and 114 deletions.
95 changes: 93 additions & 2 deletions specs/ingestion/common/schemas/task.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,48 @@
Task:
type: object
additionalProperties: false
properties:
taskID:
$ref: './common.yml#/taskID'
sourceID:
$ref: './common.yml#/sourceID'
destinationID:
$ref: './common.yml#/destinationID'
cron:
$ref: '#/Cron'
lastRun:
$ref: '#/LastRun'
nextRun:
$ref: '#/NextRun'
input:
$ref: '#/TaskInput'
enabled:
type: boolean
default: true
description: Whether the task is enabled.
failureThreshold:
$ref: '#/failureThreshold'
action:
$ref: '#/ActionType'
cursor:
$ref: './common.yml#/cursor'
createdAt:
$ref: './common.yml#/createdAt'
updatedAt:
$ref: './common.yml#/updatedAt'
required:
- taskID
- sourceID
- destinationID
- enabled
- action
- createdAt

TaskV1:
type: object
additionalProperties: false
deprecated: true
description: The V1 task object, please use methods and types that don't contain the V1 suffix.
properties:
taskID:
$ref: './common.yml#/taskID'
Expand Down Expand Up @@ -47,6 +89,34 @@ TaskCreate:
type: object
additionalProperties: false
description: API request body for creating a task.
properties:
sourceID:
$ref: './common.yml#/sourceID'
destinationID:
$ref: './common.yml#/destinationID'
action:
$ref: '#/ActionType'
cron:
$ref: '#/Cron'
enabled:
type: boolean
description: Whether the task is enabled.
failureThreshold:
$ref: '#/failureThreshold'
input:
$ref: '#/TaskInput'
cursor:
$ref: './common.yml#/cursor'
required:
- sourceID
- destinationID
- action

TaskCreateV1:
type: object
additionalProperties: false
deprecated: true
description: API request body for creating a task using the V1 shape, please use methods and types that don't contain the V1 suffix.
properties:
sourceID:
$ref: './common.yml#/sourceID'
Expand Down Expand Up @@ -95,6 +165,24 @@ TaskUpdate:
type: object
additionalProperties: false
description: API request body for updating a task.
properties:
destinationID:
$ref: './common.yml#/destinationID'
cron:
$ref: '#/Cron'
input:
$ref: '#/TaskInput'
enabled:
type: boolean
description: Whether the task is enabled.
failureThreshold:
$ref: '#/failureThreshold'

TaskUpdateV1:
type: object
additionalProperties: false
deprecated: true
description: API request body for updating a task using the V1 shape, please use methods and types that don't contain the V1 suffix.
properties:
destinationID:
$ref: './common.yml#/destinationID'
Expand Down Expand Up @@ -188,6 +276,10 @@ LastRun:
description: The last time the scheduled task ran in RFC 3339 format.
type: string

NextRun:
description: The next scheduled run of the task in RFC 3339 format.
type: string

Cron:
type: string
description: Cron expression for the task's schedule.
Expand Down Expand Up @@ -224,8 +316,7 @@ ScheduleTrigger:
lastRun:
$ref: '#/LastRun'
nextRun:
description: The next scheduled run of the task in RFC 3339 format.
type: string
$ref: '#/NextRun'
required:
- type
- cron
Expand Down
2 changes: 1 addition & 1 deletion specs/ingestion/paths/authentications/authentications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ get:
- authentications
summary: List authentication resources
description: Retrieves a list of all authentication resources.
operationId: getAuthentications
operationId: listAuthentications
x-acl:
- addObject
- deleteIndex
Expand Down
2 changes: 1 addition & 1 deletion specs/ingestion/paths/destinations/destinations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ get:
- destinations
summary: List destinations
description: Retrieves a list of destinations.
operationId: getDestinations
operationId: listDestinations
x-acl:
- addObject
- deleteIndex
Expand Down
2 changes: 1 addition & 1 deletion specs/ingestion/paths/runs/events/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ get:
- observability
summary: List task run events
description: Retrieves a list of events for a task run, identified by it's ID.
operationId: getEvents
operationId: listEvents
x-acl:
- addObject
- deleteIndex
Expand Down
2 changes: 1 addition & 1 deletion specs/ingestion/paths/runs/runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ get:
- observability
summary: List task runs
description: Retrieve a list of task runs.
operationId: getRuns
operationId: listRuns
x-acl:
- addObject
- deleteIndex
Expand Down
2 changes: 1 addition & 1 deletion specs/ingestion/paths/sources/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ get:
- sources
summary: List sources
description: Retrieves a list of sources.
operationId: getSources
operationId: listSources
x-acl:
- addObject
- deleteIndex
Expand Down
22 changes: 22 additions & 0 deletions specs/ingestion/paths/tasks/v1/disableTask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
put:
tags:
- tasks
summary: Disable a task
description: Disables a task using the v1 endpoint, please use `disableTask` instead.
operationId: disableTaskV1
deprecated: true
x-acl:
- addObject
- deleteIndex
- editSettings
parameters:
- $ref: '../../../common/parameters.yml#/pathTaskID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '../../../common/schemas/task.yml#/TaskUpdateResponse'
'400':
$ref: '../../../../common/responses/BadRequest.yml'
21 changes: 21 additions & 0 deletions specs/ingestion/paths/tasks/v1/enableTask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
put:
tags:
- tasks
summary: Enable a task
description: Enables a task using the v1 endpoint, please use `enableTask` instead.
operationId: enableTaskV1
x-acl:
- addObject
- deleteIndex
- editSettings
parameters:
- $ref: '../../../common/parameters.yml#/pathTaskID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '../../../common/schemas/task.yml#/TaskUpdateResponse'
'400':
$ref: '../../../../common/responses/BadRequest.yml'
21 changes: 21 additions & 0 deletions specs/ingestion/paths/tasks/v1/runTask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
post:
tags:
- tasks
summary: Run a task
description: Runs a task using the v1 endpoint, please use `runTask` instead. You can check the status of task runs with the observability endpoints.
operationId: runTaskV1
x-acl:
- addObject
- deleteIndex
- editSettings
parameters:
- $ref: '../../../common/parameters.yml#/pathTaskID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '../../../common/schemas/run.yml#/RunResponse'
'400':
$ref: '../../../../common/responses/BadRequest.yml'
28 changes: 28 additions & 0 deletions specs/ingestion/paths/tasks/v1/searchTasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
post:
tags:
- tasks
summary: Search for tasks
description: Searches for tasks using the v1 endpoint, please use `searchTasks` instead.
operationId: searchTasksV1
x-acl:
- addObject
- deleteIndex
- editSettings
requestBody:
content:
application/json:
schema:
$ref: '../../../common/schemas/task.yml#/TaskSearch'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
title: searchTasksResponseV1
type: array
items:
$ref: '../../../common/schemas/task.yml#/TaskV1'
'400':
$ref: '../../../../common/responses/BadRequest.yml'
64 changes: 64 additions & 0 deletions specs/ingestion/paths/tasks/v1/taskID.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
get:
tags:
- tasks
summary: Retrieve a task
description: Retrieves a task by its ID using the v1 endpoint, please use `getTask` instead.
operationId: getTaskV1
x-acl:
- addObject
- deleteIndex
- editSettings
parameters:
- $ref: '../../../common/parameters.yml#/pathTaskID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '../../../common/schemas/task.yml#/TaskV1'
'400':
$ref: '../../../../common/responses/BadRequest.yml'

patch:
tags:
- tasks
summary: Update a task
description: Updates a task by its ID using the v1 endpoint, please use `updateTask` instead.
operationId: updateTaskV1
parameters:
- $ref: '../../../common/parameters.yml#/pathTaskID'
x-codegen-request-body-name: taskUpdate
requestBody:
content:
application/json:
schema:
$ref: '../../../common/schemas/task.yml#/TaskUpdateV1'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '../../../common/schemas/task.yml#/TaskUpdateResponse'
'400':
$ref: '../../../../common/responses/BadRequest.yml'

delete:
tags:
- tasks
summary: Delete a task
description: Deletes a task by its ID using the v1 endpoint, please use `deleteTask` instead.
operationId: deleteTaskV1
parameters:
- $ref: '../../../common/parameters.yml#/pathTaskID'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '../../../common/schemas/common.yml#/DeleteResponse'
'400':
$ref: '../../../../common/responses/BadRequest.yml'
Loading

0 comments on commit fe6f5ed

Please sign in to comment.