generated from VEuPathDB/example-jaxrs-container-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.raml
562 lines (528 loc) · 15.8 KB
/
api.raml
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
#%RAML 1.0 Extension
extends: https://raw.githubusercontent.com/VEuPathDB/docs-api-schema/v2.0.2/libraries/base-service.raml
title: Organism Specific ID Service
version: v1.0.0
mediaType: application/json
uses:
error: https://raw.githubusercontent.com/VEuPathDB/docs-api-schema/v2.0.2/libraries/errors.raml
# lib: schema/library.raml
securitySchemes:
basic:
description: HTTP Basic Authentication
type: Basic Authentication
securedBy: basic
/organisms:
displayName: Organisms
get:
displayName: Get Organisms
description: |
Returns an array of the organisms currently registered with the OSID
service.
The results may be optionally filtered to a single result by use of the
`organismName` query parameter.
queryParameters:
organismName?:
type: string
description: |
Name of the organism to look up.
This field supports wildcards using the asterisk (`*`) character.
createdAfter?:
type: ZeroBasedLong
description: |
Unix timestamp of the earliest records this query should match.
No records created before this timestamp will be returned.
createdBefore?:
type: ZeroBasedLong
description: |
Unix timestamp of the latest records this query should match.
No records created after this timestamp will be returned.
createdBy?:
type: string
description: |
Filter results on the ID or name of the user that created the records.
responses:
200:
body:
type: OrganismResponse[]
example:
- organismId: 24
organismName: Plasmodium falciparum 3D7
template: "PF3D7_%07d"
geneIntStart: 1500000
geneIntCurrent: 1501203
transcriptIntStart: 1
transcriptIntCurrent: 57
createdOn: 2020-08-25T11:43:16Z
createdBy: 26
401:
body: error.UnauthorizedError
403:
body: error.ForbiddenError
422:
body: error.UnprocessableEntityError
500:
body: error.ServerError
post:
description: |
Registers a new organism with the OSID service, returning the ID of the
newly registered organism record on success.
body:
type: OrganismPostRequest
responses:
200:
body:
description: Primary key value for the newly created organism record.
type: OneBasedLong
400:
body: error.BadRequestError
401:
body: error.UnauthorizedError
403:
body: error.ForbiddenError
422:
body: error.UnprocessableEntityError
500:
body: error.ServerError
/{organism-id}:
uriParameters:
organism-id:
description: |
May be either the primary key value for the specific organism or the
organism name.
type: string
get:
description: |
Looks up and returns the details of a single organism record by record
id.
responses:
200:
body: OrganismResponse
401:
body: error.UnauthorizedError
404:
body: error.NotFoundError
500:
body: error.ServerError
put:
description: |
Updates a specific organism record by replacing specific fields with the
new values in the request body.
Put requests will be rejected if they violate the following rules:
1. The new `startingInt` value must not be lower than the organism
record's `currentInt` value.
2. The `template` value must not be null or empty.
3. The `template` value must contain a single printf integer
placeholder. (See [the Java string formatting cheatsheet](https://dzone.com/articles/how-to-format-a-string-clarified))
4. The `organismName` value must not be null or empty.
body: OrganismPutRequest
responses:
204:
400:
body: error.BadRequestError
401:
body: error.UnauthorizedError
403:
body: error.ForbiddenError
404:
body: error.NotFoundError
422:
body: error.UnprocessableEntityError
500:
body: error.ServerError
/idSets:
get:
queryParameters:
createdAfter?: ZeroBasedLong
createdBefore?: ZeroBasedLong
createdBy?:
responses:
200:
body:
type: IdSetResponse[]
example:
- idSetId: 48
organismId: 1
template: PF3D7_%07d
geneIntStart: 150000
generatedGeneCount: 2
generatedIds:
- geneId: PF3D7_0145842
transcripts:
- PF3D7_0145842.R57
- PF3D7_0145842.R58
- PF3D7_0145842.R59
- PF3D7_0145842.R78
proteins:
- PF3D7_0145842.P57
- PF3D7_0145842.P58
- PF3D7_0145842.P59
- PF3D7_0145842.P78
- geneId: PF3D7_150001
transcripts: []
proteins: []
- geneId: PF3D7_150002
transcripts:
- PF3D7_150002.R79
proteins:
- PF3D7_150002.P79
createdOn: 2020-08-25T11:43:16Z
createdBy: 215
401:
body: error.UnauthorizedError
403:
body: error.ForbiddenError
500:
body: error.ServerError
post:
body: IdSetPostRequest
responses:
200:
body:
type: IdSetResponse
example:
idSetId: 48
organismId: 1
template: PF3D7_%07d
geneIntStart: 150000
generatedGeneCount: 2
generatedIds:
- geneId: PF3D7_150001
transcripts: []
proteins: []
- geneId: PF3D7_150002
transcripts: []
proteins: []
createdOn: 2020-08-25T11:43:16Z
createdBy: 123
400:
body: error.BadRequestError
401:
body: error.UnauthorizedError
403:
body: error.ForbiddenError
422:
body: error.UnprocessableEntityError
500:
body: error.ServerError
/{id-set-id}:
uriParameters:
id-set-id: OneBasedLong
get:
responses:
200:
body:
type: IdSetResponse
example:
idSetId: 48
organismId: 1
template: PF3D7_%07d
geneIntStart: 150000
generatedGeneCount: 2
generatedIds:
- geneId: PF3D7_0145842
transcripts:
- PF3D7_0145842.R57
- PF3D7_0145842.R58
- PF3D7_0145842.R59
- PF3D7_0145842.R78
proteins:
- PF3D7_0145842.P57
- PF3D7_0145842.P58
- PF3D7_0145842.P59
- PF3D7_0145842.P78
- geneId: PF3D7_150001
transcripts: []
proteins: []
- geneId: PF3D7_150002
transcripts:
- PF3D7_150002.R79
proteins:
- PF3D7_150002.P79
createdOn: 2020-08-25T11:43:16Z
createdBy: 546
401:
body: error.UnauthorizedError
403:
body: error.ForbiddenError
404:
body: error.NotFoundError
500:
body: error.ServerError
patch:
body:
type: IdSetPatchEntry[]
example:
- geneId: PF3D7_0145842
transcripts: 4
- geneId: PF3D7_0120354
transcripts: 18
responses:
200:
body: IdSetResponse
400:
body: error.BadRequestError
401:
body: error.UnauthorizedError
403:
body: error.ForbiddenError
404:
body: error.NotFoundError
500:
body: error.ServerError
/auth:
displayName: User Management
post:
displayName: Create User
description: |
Register a new user/application and issue an API key for that user to
access this service.
This endpoint may only be used by a user or application with access to the
admin credentials.
body:
type: UserPostRequest
example:
username: someApplicationName
responses:
200:
body: NewUserResponse
400:
body: error.BadRequestError
401:
body: error.UnauthorizedError
403:
body: error.ForbiddenError
422:
body: error.UnprocessableEntityError
500:
body: error.ServerError
/{user-identifier}:
uriParameters:
user-identifier:
type: string
description: |
Either the primary key id or the exact username of the user to lookup.
get:
displayName: Lookup User
description: |
Look up a user by name or ID.
This endpoint may only be used by a user or application with access to
the admin credentials.
responses:
200:
body: NewUserResponse
401:
body: error.UnauthorizedError
500:
body: error.ServerError
types:
TemplatePattern:
displayName: Gene ID Template String
description: |
Gene ID template string. Must include at least 1 integer format parameter
for injecting the id counter value into the template.
The template string will be expanded using Java's String.format method
which will expect a Java format parameter.
See [the Java string formatting cheatsheet](https://dzone.com/articles/how-to-format-a-string-clarified)
for possible parameters and modifiers.
The example parameter for this field is `%07d` which breaks down to:
* `%` = parameter start marker
* `07` = left pad the number with zeros for a total length of 7 digits
* `d` = format as an int
**NOTE**: When used, this template string will be passed exactly one int64
value and nothing else. Templates should only include `%d` based formats.
If the template needs more than one instance of the counter int64 value,
positional parameters may be used.
type: string
pattern: "^.*%[0-9,+\\- $.]*d.*$"
minLength: 5
example: PF3D7_%07d
ZeroBasedInt:
description: Int32 value with a valid value range of `[0..2147483647]`.
type: integer
format: int32
minimum: 0
maximum: 2147483647
ZeroBasedLong:
description: |
Int64 value with a valid value range of `[0..9223372036854775807]`.
type: integer
format: int64
minimum: 0
maximum: 9223372036854775807
OneBasedLong:
description: |
Int64 value with a valid value range of `[1..9223372036854775807]`.
type: integer
format: int64
minimum: 1
maximum: 9223372036854775807
IdSetPostRequest:
type: object
properties:
organismId:
description: |
Internal storage primary key for an organism registered with the OSID
service.
type: OneBasedLong
generateGenes:
description: |
Number of gene IDs generated by the OSID service for the current
organism.
type: ZeroBasedInt
additionalProperties: false
IdSetResponse:
type: object
properties:
idSetId:
description: |
Internal storage primary key for an ID set. Used to make requests
that operate on or retrieve one specific ID set.
type: OneBasedLong
organismId: OneBasedLong
template: TemplatePattern
geneIntStart: OneBasedLong
generatedGeneCount: ZeroBasedInt
generatedIds: GeneratedTranscriptEntry[]
createdOn: datetime
createdBy: OneBasedLong
additionalProperties: false
GeneratedTranscriptEntry:
type: object
properties:
geneId:
type: string
minLength: 3
transcripts: string[]
proteins: string[]
additionalProperties: false
example:
geneId: PF3D7_0145842
transcripts:
- PF3D7_0145842.R57
- PF3D7_0145842.R58
- PF3D7_0145842.R59
- PF3D7_0145842.R78
proteins:
- PF3D7_0145842.P57
- PF3D7_0145842.P58
- PF3D7_0145842.P59
- PF3D7_0145842.P78
IdSetPatchEntry:
type: object
properties:
geneId:
type: string
minLength: 3
transcripts: ZeroBasedInt
additionalProperties: false
example:
geneId: PF3D7_0145842
transcripts: 4
OrganismPostRequest:
displayName: Organism Record Create/Update Request Body
type: object
properties:
organismName:
type: string
minLength: 3
template: TemplatePattern
geneIntStart:
description: Starting point for the gene ID integer counter.
type: OneBasedLong
transcriptIntStart:
description: Starting point for the transcript ID integer counter.
type: OneBasedLong
required: false
default: 1
additionalProperties: false
example:
organismName: Plasmodium falciparum 3D7
template: "PF3D7_%07d"
geneIntStart: 1500000
transcriptIntStart: 1
OrganismPutRequest:
displayName: Organism Record Create/Update Request Body
type: object
properties:
template: TemplatePattern
geneIntStart?:
description: |
Starting point for the gene ID integer counter.
**NOTE** This field may only be changed if no gene ids have yet been
issued for this organism.
type: OneBasedLong
transcriptIntStart?:
description: |
Starting point for the transcript ID integer counter.
**NOTE** This field may only be changed if no transcript ids have yet
been issued for this organism.
type: OneBasedLong
additionalProperties: false
example:
template: "PF3D7_%07d"
geneIntStart: 1500000
transcriptIntStart: 1
OrganismResponse:
type: object
properties:
organismId:
description: |
Internal primary key value assigned to this organism record.
type: OneBasedLong
organismName:
type: string
minLength: 3
template:
description: Currently assigned gene ID template string.
type: TemplatePattern
geneIntStart:
description: Starting point for the gene ID integer counter.
type: OneBasedLong
transcriptIntStart:
description: Starting point for the transcript ID integer counter.
type: OneBasedLong
geneIntCurrent:
description: Current value for the gene ID integer counter.
type: OneBasedLong
transcriptIntCurrent:
description: Current value for the transcript ID integer counter.
type: OneBasedLong
createdOn:
description: Timestamp of when this record was created.
type: datetime
createdBy:
description: User ID of the user/app that created this record.
type: OneBasedLong
additionalProperties: false
example:
organismId: 24
organismName: Plasmodium falciparum 3D7
template: "PF3D7_%07d"
geneIntStart: 1500000
geneIntCurrent: 1501203
transcriptIntStart: 1
transcriptIntCurrent: 57
createdOn: 2020-08-25T11:43:16Z
createdBy: 26
NewUserResponse:
type: object
properties:
userId: OneBasedLong
username:
apiKey:
issued: datetime
additionalProperties: false
example:
userId: 123456
username: "some user name"
apiKey: "d831d10e47de4154912ea7a8f1c633c3"
issued: "2020-05-25T13:18:26Z"
UserPostRequest:
type: object
properties:
username:
type: string
minLength: 3
additionalProperties: false
example:
username: "some user name"