-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
268 lines (259 loc) · 7.05 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
openapi: 3.0.2
info:
title: Lucinda server
version: "3.2.1"
servers:
- url: http://localhost:9997/lucinda/3.0
paths:
/:
get:
description: Test if the server is working
responses:
200:
description: The server is alive
content:
text/plain:
schema:
type: string
/get/{id}:
get:
description: retrieve the document with the given id
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
description: The requested document in binary form
content:
application/octet-stream:
schema:
type: string
format: byte
404:
description: The requested document was not found
/getmeta/{id}:
get:
description: retrieve the metadata of the document with the given id
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
description: Ok, body contains the metadata
content:
application/json:
schema:
type: object
404:
description: The document with theb given id was not found
/query/{expression}:
get:
description: Query the database with a lucene query expression as path parameter
parameters:
- name: querystring
in: path
required: true
schema:
type: string
responses:
200:
description: ok, body contains a list (wich might be empty)
content:
application/json:
schema:
type: array
400:
description: Bad query expression
post:
description: Query the database with a Solr JSON expression
requestBody:
content:
application/json:
schema:
$ref: "#components/schemas/jsonQuery"
responses:
200:
description: ok. Result is in the body
content:
application/json:
schema:
$ref: "#components/schemas/solrResponse"
400:
description: Bad query object
/addfile:
post:
description: Indexes and immports a new document
requestBody:
content:
application/json:
schema:
$ref: "#components/schemas/newFile"
responses:
202:
description: The new entry has been accepted and is scheduled for storage and indexing
400:
description: There was an error in the request
401:
description: This client is not allowed to create content
/addindex:
post:
description: Indexes a JSON document. If a field 'contents' is provided, this field will only be indexed but not stored.
requestBody:
content:
application/json:
schema:
$ref: "#components/schemas/newDocument"
responses:
201:
description: The document was imported.
400:
description: There was an error with the request
401:
description: This client is not allowed to create content
/listfiles:
post:
description: list contents of a subdirectory of the filebase
requestBody:
content:
application/json:
schema:
type: object
required:
- subdir
properties:
subdir:
type: string
options:
type: object
properties:
withSubdirs:
type: boolean
withPattern:
type: string
responses:
200:
description: ok
/removeindex/{id}:
get:
description: remove the document with the given ID from the index (not from the file system!)
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
204:
description: The document was removed from the index or the document didn't exist.
403:
description: Removal not allowed
404:
description: No document with that index was found
/rescan:
get:
description: initiate a rescan of the document base
responses:
200:
description: Ok
/parse:
post:
summary: Parse a binary file and extract its text contents.
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'200':
description: OK
content:
text/plain:
schema:
type: string
'400':
description: Bad Request
'500':
description: Internal Server Error
components:
schemas:
newDocument:
type: object
required:
- filename
properties:
id:
description:
If you provide an id, that will be used. If not, an id is created automnatically.
If you send an existing id, the previous entry with that id will be overwritten with the new document.
type: string
title:
type: string
pattern: /[\w][\w\d \-_\.]*\-_\.]*/
concern:
type: string
filename:
description: Only for /addfile
type: string
filepath:
description: Only for /addfile
type: string
contents:
description: Only for /addindex
type: string
format: base64
newFile:
type: object
required:
- metadata
- payload
properties:
metadata:
type: object
$ref: "#/components/schemas/newDocument"
payload:
type: string
format: base64
jsonQuery:
description: For more informations on json Queries, see Solr documentation
type: object
required:
- query
properties:
query:
description: A Lucene conformant query expression, e.g. "title:someTitle&author:johndoe" (aka q)
type: string
limit:
description: Number of results per call (aka rows)
type: number
offset:
description: offset of first result (aka start)
type: number
filter:
description: filter expressen (aka fl)
type: string
sort:
description: A sort expression, such as "title asc"
type: string
facet:
type: object
solrResponse:
description: Result of a successful query to Lucinda
type: object
properties:
numFound:
type: number
start:
type: number
docs:
type: array
items:
description: application specific document objects
type: object