Skip to content

Commit fa77be6

Browse files
authored
Merge 37c33aa into 9db03b5
2 parents 9db03b5 + 37c33aa commit fa77be6

File tree

6 files changed

+151
-25
lines changed

6 files changed

+151
-25
lines changed

specs/ingestion/common/parameters.yml

+8
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,11 @@ orderKeys:
8383
description: Ascending or descending sort order.
8484
default: desc
8585
enum: [asc, desc]
86+
87+
watch:
88+
name: watch
89+
in: query
90+
description: When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
91+
required: false
92+
schema:
93+
type: boolean

specs/ingestion/common/schemas/task.yml

+21
Original file line numberDiff line numberDiff line change
@@ -606,3 +606,24 @@ Policies:
606606
type: integer
607607
minimum: 1
608608
maximum: 10
609+
610+
PushTaskPayload:
611+
title: pushTaskPayload
612+
type: object
613+
properties:
614+
action:
615+
$ref: '../../../common/schemas/Batch.yml#/action'
616+
records:
617+
type: array
618+
items:
619+
title: pushTaskRecords
620+
type: object
621+
additionalProperties: true
622+
required:
623+
- objectID
624+
properties:
625+
objectID:
626+
$ref: '../../../common/parameters.yml#/objectID'
627+
required:
628+
- action
629+
- records

specs/ingestion/paths/push.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
post:
2+
summary: Push a `batch` request payload through the Pipeline
3+
description: Push a `batch` request payload through the Pipeline. You can check the status of your request with the observability endpoints.
4+
operationId: push
5+
x-acl:
6+
- addObject
7+
- deleteIndex
8+
- editSettings
9+
x-timeouts:
10+
connect: 180000
11+
read: 180000
12+
write: 180000
13+
parameters:
14+
- $ref: '../../common/parameters.yml#/IndexName'
15+
- $ref: '../common/parameters.yml#/watch'
16+
requestBody:
17+
description: Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
18+
content:
19+
application/json:
20+
schema:
21+
$ref: '../common/schemas/task.yml#/PushTaskPayload'
22+
required: true
23+
responses:
24+
'200':
25+
description: OK
26+
content:
27+
application/json:
28+
schema:
29+
$ref: '../common/schemas/common.yml#/WatchResponse'
30+
'400':
31+
$ref: '../../common/responses/BadRequest.yml'

specs/ingestion/paths/tasks/v2/pushTask.yml

+2-25
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,13 @@ post:
1414
write: 180000
1515
parameters:
1616
- $ref: '../../../common/parameters.yml#/pathTaskID'
17-
- name: watch
18-
in: query
19-
description: When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
20-
required: false
21-
schema:
22-
type: boolean
17+
- $ref: '../../../common/parameters.yml#/watch'
2318
requestBody:
2419
description: Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
2520
content:
2621
application/json:
2722
schema:
28-
title: pushTaskPayload
29-
type: object
30-
properties:
31-
action:
32-
$ref: '../../../../common/schemas/Batch.yml#/action'
33-
records:
34-
type: array
35-
items:
36-
title: pushTaskRecords
37-
type: object
38-
additionalProperties: true
39-
required:
40-
- objectID
41-
properties:
42-
objectID:
43-
$ref: '../../../../common/parameters.yml#/objectID'
44-
required:
45-
- action
46-
- records
23+
$ref: '../../../common/schemas/task.yml#/PushTaskPayload'
4724
required: true
4825
responses:
4926
'200':

specs/ingestion/spec.yml

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ paths:
112112
/{path}:
113113
$ref: '../common/paths/customRequest.yml'
114114

115+
/1/push/{indexName}:
116+
$ref: 'paths/push.yml'
117+
115118
# authentications API.
116119
/1/authentications:
117120
$ref: 'paths/authentications/authentications.yml'
+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
[
2+
{
3+
"testName": "global push",
4+
"parameters": {
5+
"indexName": "foo",
6+
"pushTaskPayload": {
7+
"action": "addObject",
8+
"records": [
9+
{
10+
"key": "bar",
11+
"foo": "1",
12+
"objectID": "o"
13+
},
14+
{
15+
"key": "baz",
16+
"foo": "2",
17+
"objectID": "k"
18+
}
19+
]
20+
}
21+
},
22+
"request": {
23+
"path": "/1/push/foo",
24+
"method": "POST",
25+
"body": {
26+
"action": "addObject",
27+
"records": [
28+
{
29+
"key": "bar",
30+
"foo": "1",
31+
"objectID": "o"
32+
},
33+
{
34+
"key": "baz",
35+
"foo": "2",
36+
"objectID": "k"
37+
}
38+
]
39+
}
40+
}
41+
},
42+
{
43+
"testName": "global push with watch mode",
44+
"parameters": {
45+
"indexName": "bar",
46+
"pushTaskPayload": {
47+
"action": "addObject",
48+
"records": [
49+
{
50+
"key": "bar",
51+
"foo": "1",
52+
"objectID": "o"
53+
},
54+
{
55+
"key": "baz",
56+
"foo": "2",
57+
"objectID": "k"
58+
}
59+
]
60+
},
61+
"watch": true
62+
},
63+
"request": {
64+
"path": "/1/push/bar",
65+
"method": "POST",
66+
"queryParameters": {
67+
"watch": "true"
68+
},
69+
"body": {
70+
"action": "addObject",
71+
"records": [
72+
{
73+
"key": "bar",
74+
"foo": "1",
75+
"objectID": "o"
76+
},
77+
{
78+
"key": "baz",
79+
"foo": "2",
80+
"objectID": "k"
81+
}
82+
]
83+
}
84+
}
85+
}
86+
]

0 commit comments

Comments
 (0)