-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.yaml
240 lines (238 loc) · 7.79 KB
/
settings.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
openapi: 3.0.0
info:
title: Settings
version: v1
paths:
/settings/entries:
parameters:
- $ref: headers/okapi-permissions.yaml
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: headers/okapi-user.yaml
- $ref: parameters/limit.yaml
- $ref: parameters/offset.yaml
- $ref: parameters/query.yaml
get:
description: >
Get settings with optional CQL query.
If X-Okapi-Permissions includes settings.global.read then settings
without a userId are returned.
If X-Okapi-Permissions includes settings.users.read then settings
with a userId are returned.
If X-Okapi-Permissions includes settings.owner.read then settings
with userId = current-user are returned.
operationId: getSettings
responses:
"200":
description: Setting entries
content:
application/json:
schema:
$ref: schemas/entries.json
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
post:
description: >
Create setting entry.
If X-Okapi-Permissions includes settings.global.write, then a setting without
a userId may be created.
If X-Okapi-Permissions includes settings.users.write, then a setting with a
userId may be created.
If X-Okapi-Permissions includes settings.owner.write, then a setting with
userId = current-user may be created.
operationId: postSetting
requestBody:
content:
application/json:
schema:
$ref: schemas/entry.json
responses:
"204":
description: Setting created
"400":
$ref: "#/components/responses/trait_400"
"403":
$ref: "#/components/responses/trait_403"
"413":
$ref: "#/components/responses/trait_413"
"500":
$ref: "#/components/responses/trait_500"
/settings/entries/{id}:
parameters:
- $ref: headers/okapi-permissions.yaml
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: headers/okapi-user.yaml
- in: path
name: id
required: true
description: Settings entry identifier
schema:
type: string
format: uuid
get:
description: >
Get setting.
If X-Okapi-Permissions includes settings.global.read, then a setting without
a userId may be retrieved.
If X-Okapi-Permissions includes settings.users.read, then a setting with a
userId may be retrieved.
If X-Okapi-Permissions includes settings.owner.read, then a setting with
userId = current-user may be retrieved.
operationId: getSetting
responses:
"200":
description: Configuration entry
content:
application/json:
schema:
$ref: schemas/entry.json
"400":
$ref: "#/components/responses/trait_400"
"403":
$ref: "#/components/responses/trait_403"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
put:
description: >
Update setting.
If X-Okapi-Permissions includes settings.global.write, then a setting without
a userId may be updated.
If X-Okapi-Permissions includes settings.users.write, then a setting with a
userId may be updated.
If X-Okapi-Permissions includes settings.owner.write, then a setting with
userId = current-user may be updated.
operationId: putSetting
requestBody:
content:
application/json:
schema:
$ref: schemas/entry.json
responses:
"204":
description: Setting updated
"400":
$ref: "#/components/responses/trait_400"
"403":
$ref: "#/components/responses/trait_403"
"404":
$ref: "#/components/responses/trait_404"
"413":
$ref: "#/components/responses/trait_413"
"500":
$ref: "#/components/responses/trait_500"
delete:
description: >
Delete setting.
If X-Okapi-Permissions includes settings.global.write, then a setting without
a userId may be deleted.
If X-Okapi-Permissions includes settings.users.write, then a setting with a
userId may be deleted.
If X-Okapi-Permissions includes settings.owner.write, then a setting with
userId = current-user may be deleted.
operationId: deleteSetting
responses:
"204":
description: Setting deleted
"400":
$ref: "#/components/responses/trait_400"
"404":
$ref: "#/components/responses/trait_404"
"500":
$ref: "#/components/responses/trait_500"
/settings/upload:
parameters:
- $ref: headers/okapi-permissions.yaml
- $ref: headers/okapi-tenant.yaml
- $ref: headers/okapi-token.yaml
- $ref: headers/okapi-url.yaml
- $ref: headers/okapi-user.yaml
put:
description: >
Upload settings. The entries are inserted or updated depending on whether
key, scope, userId already. Each entry gets a unique identifier assigned
if it's a new setting. The id must not be supplied.
If X-Okapi-Permissions includes settings.global.write, then a setting without
a userId may be created/updated.
If X-Okapi-Permissions includes settings.users.write, then a setting with a
userId may be created/updated.
If X-Okapi-Permissions includes settings.owner.write, then a setting with
userId = current-user may be created/updated.
operationId: uploadSettings
requestBody:
content:
application/json:
schema:
$ref: schemas/uploadRequest.json
responses:
"200":
description: Settings uploaded
content:
application/json:
schema:
$ref: schemas/uploadResponse.json
"400":
$ref: "#/components/responses/trait_400"
"403":
$ref: "#/components/responses/trait_403"
"500":
$ref: "#/components/responses/trait_500"
components:
responses:
trait_400:
description: Bad request
content:
text/plain:
schema:
type: string
example: Invalid JSON in request
application/json:
schema:
type: object
example: {"error":"Invalid JSON in request"}
trait_403:
description: Forbidden
content:
text/plain:
schema:
type: string
example: Insufficient permissions to access resource
application/json:
schema:
type: object
example: {"error":"Insufficient permissions to access resource"}
trait_404:
description: Not Found
content:
text/plain:
schema:
type: string
example: Identifier 596d9f60-cda3-44d2-a4a1-2f48b7d4d23c not found
application/json:
schema:
type: object
example: {"error":"Identifier 596d9f60-cda3-44d2-a4a1-2f48b7d4d23c not found"}
trait_413:
description: Payload Too Large
content:
text/plain:
schema:
type: string
trait_500:
description: Internal error
content:
text/plain:
schema:
type: string
example: Internal server error, contact administrator
schemas:
errors:
$ref: schemas/errors.json