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 runSource endpoint #3453

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions specs/ingestion/common/schemas/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -492,3 +492,32 @@ SourceWatchResponse:
type: string
required:
- message

RunSourcePayload:
type: object
additionalProperties: false
properties:
indexToInclude:
type: array
description: List of index names to include in reidexing/update.
items:
type: string
indexToExclude:
type: array
description: List of index names to exclude in reidexing/update.
items:
type: string
entityIDs:
type: array
items:
type: string
description: List of entityID to update.
entityType:
$ref: '#/EntityType'

EntityType:
type: string
description: Type of entity to update.
enum:
- product
- collection
39 changes: 39 additions & 0 deletions specs/ingestion/paths/sources/runSource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
post:
tags:
- sources
summary: Run all tasks linked to a source
description: Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
operationId: runSource
x-acl:
- addObject
- deleteIndex
- editSettings
parameters:
- $ref: '../../common/parameters.yml#/pathSourceID'
requestBody:
description: ''
content:
application/json:
schema:
$ref: '../../common/schemas/source.yml#/RunSourcePayload'
responses:
'200':
description: OK
content:
application/json:
schema:
title: runSourceResponse
type: object
properties:
taskWithRunID:
type: object
description: Map of taskID sent for reindex with the corresponding runID.
additionalProperties:
type: string
createdAt:
$ref: '../../common/schemas/common.yml#/createdAt'
required:
- taskWithRunID
- createdAt
'400':
$ref: '../../../common/responses/BadRequest.yml'
2 changes: 2 additions & 0 deletions specs/ingestion/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ paths:
$ref: 'paths/sources/validateID.yml'
/1/sources/{sourceID}/discover:
$ref: 'paths/sources/discover.yml'
/1/sources/{sourceID}/run:
$ref: 'paths/sources/runSource.yml'

# tasks API.
/1/tasks:
Expand Down
33 changes: 33 additions & 0 deletions tests/CTS/requests/ingestion/runSource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"parameters": {
"sourceID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
"runSourcePayload": {
"indexToInclude": [
"products_us",
"products eu"
],
"entityIDs": [
"1234",
"5678"
],
"entityType": "product"
}
},
"request": {
"path": "/1/sources/6c02aeb1-775e-418e-870b-1faccd4b2c0f/run",
"method": "POST",
"body": {
"indexToInclude": [
"products_us",
"products eu"
],
"entityIDs": [
"1234",
"5678"
],
"entityType": "product"
}
}
}
]
Loading