forked from Sphereon-SDK/storage-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.json
476 lines (476 loc) · 14.6 KB
/
swagger.json
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
{
"basePath": "/",
"paths": {
"/bucket-storage/0.6.0/containers/{containerId}": {
"post": {
"summary": "Update a container",
"security": [{"oauth2schema": ["global"]}],
"produces": ["application/json;charset=UTF-8"],
"description": "Update an existing container with new container settings",
"operationId": "updateContainer",
"responses": {
"200": {
"schema": {"$ref": "#/definitions/ContainerResponse"},
"description": "Container updated"
},
"400": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Invalid Container request"
},
"404": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Backend was not found"
}
},
"parameters": [
{
"in": "path",
"name": "containerId",
"description": "containerId",
"type": "string",
"required": true
},
{
"schema": {"$ref": "#/definitions/ContainerRequest"},
"in": "body",
"name": "containerRequest",
"description": "containerRequest",
"required": true
}
],
"tags": ["Storage"],
"consumes": ["application/json;charset=UTF-8"]
},
"delete": {
"summary": "Delete an existing container",
"security": [{"oauth2schema": ["global"]}],
"produces": ["application/json;charset=UTF-8"],
"description": "Delete an existing container including the stored objects if indicated.",
"operationId": "deleteContainer",
"responses": {
"200": {
"schema": {"$ref": "#/definitions/ContainerResponse"},
"description": "Container deleted"
},
"400": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Invalid container name or container was not empty and recursion was not set"
},
"404": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Container was not found"
}
},
"parameters": [
{
"in": "path",
"name": "containerId",
"description": "containerId",
"type": "string",
"required": true
},
{
"in": "query",
"name": "delete",
"description": "delete",
"type": "string",
"required": false,
"enum": [
"RECURSIVE",
"EMPTY_ONLY"
]
}
],
"tags": ["Storage"],
"consumes": ["application/json"]
}
},
"/bucket-storage/0.6.0/containers": {"post": {
"summary": "Create a new container",
"security": [{"oauth2schema": ["global"]}],
"produces": ["application/json;charset=UTF-8"],
"description": "Create a new container",
"operationId": "createContainer",
"responses": {
"201": {
"schema": {"$ref": "#/definitions/ContainerResponse"},
"description": "Container created"
},
"400": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Invalid Container request"
},
"404": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Backend was not found"
}
},
"parameters": [{
"schema": {"$ref": "#/definitions/ContainerRequest"},
"in": "body",
"name": "containerRequest",
"description": "containerRequest",
"required": true
}],
"tags": ["Storage"],
"consumes": ["application/json;charset=UTF-8"]
}},
"/bucket-storage/0.6.0/backends": {"post": {
"summary": "Create a new backend",
"security": [{"oauth2schema": ["global"]}],
"produces": ["application/json;charset=UTF-8"],
"description": "Create a new backend",
"operationId": "createBackend",
"responses": {
"201": {
"schema": {"$ref": "#/definitions/BackendResponse"},
"description": "Backend created"
},
"400": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Invalid backend request"
}
},
"parameters": [{
"schema": {"$ref": "#/definitions/BackendRequest"},
"in": "body",
"name": "backendRequest",
"description": "backendRequest",
"required": true
}],
"tags": ["Storage"],
"consumes": ["application/json;charset=UTF-8"]
}},
"/bucket-storage/0.6.0/containers/{containerId}/objects/{objectPath}": {
"post": {
"summary": "Create a new object within a container",
"security": [{"oauth2schema": ["global"]}],
"produces": ["*/*"],
"description": "Create a new object within a container. If the container did not exist yet, it will be created on the fly with a default policy, hence no 404 http status will be returned",
"operationId": "createObject",
"responses": {
"201": {"description": "Object created"},
"400": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Invalid container or object request"
},
"404": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Container was not found"
}
},
"parameters": [
{
"in": "path",
"name": "containerId",
"description": "containerId",
"type": "string",
"required": true
},
{
"in": "path",
"name": "objectPath",
"description": "objectPath",
"type": "string",
"required": true
},
{
"in": "formData",
"name": "stream",
"description": "stream",
"type": "file",
"required": true
}
],
"tags": ["Storage"],
"consumes": ["multipart/form-data"]
},
"get": {
"summary": "Get an existing object from a container",
"security": [{"oauth2schema": ["global"]}],
"produces": [
"application/octet-stream",
"application/json;charset=UTF-8"
],
"description": "Get an existing object from a container",
"operationId": "getObject",
"responses": {
"200": {"description": "Object retrieved"},
"400": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Invalid container or object name"
},
"404": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Object or container did not exist"
}
},
"parameters": [
{
"in": "path",
"name": "containerId",
"description": "containerId",
"type": "string",
"required": true
},
{
"in": "path",
"name": "objectPath",
"description": "objectPath",
"type": "string",
"required": true
}
],
"tags": ["Storage"],
"consumes": ["application/json"]
},
"delete": {
"summary": "Delete an existing object from a container.",
"security": [{"oauth2schema": ["global"]}],
"produces": ["*/*"],
"description": "Delete an existing object from a container. There is no request nor response body for a delete request.",
"operationId": "deleteObject",
"responses": {
"200": {"description": "Object deleted"},
"400": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Invalid container or object name"
},
"404": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Container or object was not found"
}
},
"parameters": [
{
"in": "path",
"name": "containerId",
"description": "containerId",
"type": "string",
"required": true
},
{
"in": "path",
"name": "objectPath",
"description": "objectPath",
"type": "string",
"required": true
}
],
"tags": ["Storage"],
"consumes": ["application/json"]
}
},
"/bucket-storage/0.6.0/backends/{backendId}": {
"post": {
"summary": "Update a backend",
"security": [{"oauth2schema": ["global"]}],
"produces": ["application/json;charset=UTF-8"],
"description": "Update a backend",
"operationId": "updateBackend",
"responses": {
"200": {
"schema": {"$ref": "#/definitions/BackendResponse"},
"description": "Backend updated"
},
"400": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Invalid backend request"
},
"404": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Backend was not found"
}
},
"parameters": [
{
"in": "path",
"name": "backendId",
"description": "backendId",
"type": "string",
"required": true
},
{
"schema": {"$ref": "#/definitions/BackendRequest"},
"in": "body",
"name": "backendRequest",
"description": "backendRequest",
"required": true
}
],
"tags": ["Storage"],
"consumes": ["application/json;charset=UTF-8"]
},
"delete": {
"summary": "Delete a backend",
"security": [{"oauth2schema": ["global"]}],
"produces": ["application/json;charset=UTF-8"],
"description": "Delete a backend",
"operationId": "deleteBackend",
"responses": {
"200": {
"schema": {"$ref": "#/definitions/BackendResponse"},
"description": "Backend deleted"
},
"404": {
"schema": {"$ref": "#/definitions/ErrorResponse"},
"description": "Backend was already deleted or unknown backend"
}
},
"parameters": [{
"in": "path",
"name": "backendId",
"description": "backendId",
"type": "string",
"required": true
}],
"tags": ["Storage"],
"consumes": ["application/json"]
}
}
},
"host": "gw.api.cloud.sphereon.com",
"schemes": ["https"],
"securityDefinitions": {"oauth2schema": {
"tokenUrl": "https://gw.api.cloud.sphereon.com/token",
"scopes": {"global": "accessEverything"},
"type": "oauth2",
"flow": "application"
}},
"definitions": {
"BackendRequest": {
"type": "object",
"properties": {
"authenticationProvider": {
"description": "The provider of the credentials",
"type": "string",
"enum": [
"API_SUPPLIER",
"END_USER"
]
},
"backendType": {
"description": "The type of backend that is created. This field allows users to create a local backend or with supported 3rd parties.",
"type": "string",
"enum": [
"FILESYSTEM",
"AMAZON_S3",
"MS_AZURE_BLOB_STORAGE",
"GOOGLE_CLOUD_STORAGE"
]
},
"backendSecret": {
"description": "The API secret for 3rd party backends.",
"type": "string"
},
"name": {"type": "string"},
"description": {"type": "string"},
"backendKey": {
"description": "The API key for 3rd party backends.",
"type": "string"
},
"parentId": {
"description": "The backend that is used for when properties are not set. This allows credentials to be set at one backend and used by multiple backends.",
"type": "string"
}
}
},
"ContainerResponse": {
"type": "object",
"properties": {
"name": {"type": "string"},
"backendId": {
"description": "The backend in which the container will be stored or is stored.",
"type": "string"
},
"id": {"type": "string"},
"state": {
"type": "string",
"enum": [
"REQUEST",
"CREATED",
"UPDATED",
"DELETED"
]
}
}
},
"BackendResponse": {
"type": "object",
"properties": {
"name": {"type": "string"},
"id": {"type": "string"},
"state": {
"type": "string",
"enum": [
"REQUEST",
"CREATED",
"UPDATED",
"DELETED"
]
},
"parentId": {"type": "string"}
}
},
"Error": {
"description": "An error",
"type": "object",
"required": [
"code",
"level",
"message"
],
"properties": {
"code": {"type": "string"},
"level": {
"type": "string",
"enum": [
"INFO",
"WARNING",
"FATAL"
]
},
"cause": {"$ref": "#/definitions/Error"},
"message": {"type": "string"}
}
},
"ContainerRequest": {
"type": "object",
"properties": {
"name": {"type": "string"},
"backendId": {
"description": "The backend in which the container will be stored or is stored.",
"type": "string"
}
}
},
"ErrorResponse": {
"description": "The error response",
"type": "object",
"properties": {"errors": {
"type": "array",
"items": {"$ref": "#/definitions/Error"}
}}
}
},
"swagger": "2.0",
"info": {
"license": {
"name": "Apache License Version 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
},
"contact": {
"name": "Sphereon DevOps Team",
"url": "https://sphereon.com",
"email": "dev@sphereon.com"
},
"description": "Sphereon Storage APIs provide an abstraction layer for storage of containers (folders) and objects (files), using a filesystem backend or AWS-s3, Azure blobstorage or Google cloud storage backend.",
"termsOfService": "https://sphereon.com",
"title": "Storage",
"version": "0.6.0"
},
"tags": [{
"name": "Storage",
"description": "Storage related API"
}]
}