-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
191 lines (190 loc) · 5.11 KB
/
Copy pathopenapi.yaml
File metadata and controls
191 lines (190 loc) · 5.11 KB
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
openapi: 3.0.3
info:
title: Analysis Service
description: |-
The analysis service is in charge of running ML models and algorithms to extract insights from patient images.
version: 0.0.1
tags:
- name: Analysis
description: The results of running a certain algorithm/model.
- name: Models
description: The available models and algorithms.
servers:
- url: https://prod.bric-lungs.com/api/
description: Production server
- url: https://beta.bric-lungs.com/api/
description: Staging server
- url: https://<devId>.dev.bric-lungs.com/api/
description: Development server
security:
- ApiKey: []
paths:
/models:
get:
tags:
- Models
summary: Get all available models/algorithms.
description: Retrieves a list of models which can be run as part of this service.
operationId: getModels
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/Models'
/analysis:
post:
tags:
- Analysis
summary: Request a new AI analysis
description: Trigger the execution of an algorithm with some inputs.
operationId: postAnalysis
requestBody:
description: Send the algorithm you want to run, as well as its inputs.
content:
application/json:
schema:
$ref: '#/components/schemas/PostAnalysisBody'
required: true
responses:
'202':
description: Accepted
content:
application/json:
schema:
$ref: '#/components/schemas/Analysis'
'400':
description: Invalid schema, model does not exist.
'401':
description: Missing or invalid Authorization header.
'403':
description: Analysis is not owned by your center or imaging test does not belong to your center.
'429':
description: Quota limit exceeded.
/analysis/{id}:
delete:
tags:
- Analysis
summary: Cancels or removes an AI analysis
description: If the AI analysis was still pending, it cancels it. If the AI analysis had completed, it removes it.
operationId: deleteAnalysis
parameters:
- name: id
in: path
description: 'id of the Analysis'
required: true
schema:
type: string
responses:
'200':
description: Cancelled or removed.
'404':
description: Invalid id.
'401':
description: Missing or invalid Authorization header.
'403':
description: Analysis is not owned by your center.
get:
tags:
- Analysis
summary: Get the results of an AI analysis
description: Retrieves the result or progress of an AI analysis.
operationId: getAnalysis
parameters:
- name: id
in: path
description: 'id of the Analysis'
required: true
schema:
type: string
responses:
'200':
description: Exists.
content:
application/json:
schema:
$ref: '#/components/schemas/Analysis'
'404':
description: Invalid id.
'403':
description: Analysis is not owned by your center.
components:
schemas:
Model:
required:
- id
- description
type: object
properties:
id:
type: string
example: bric-core
description:
type: string
example: Lung nodule detection.
Models:
required:
- models
type: object
properties:
models:
type: array
items:
$ref: '#/components/schemas/Model'
PostAnalysisBody:
required:
- modelId
type: object
properties:
modelId:
type: string
example: 31bd5132-c683-4e66-ac7c-62c8f2dd5bc6
parameters:
type: object
example: {}
imagingTests:
type: array
items:
$ref: '#/components/schemas/ImagingTest'
ImagingTest:
required:
- id
type: object
properties:
id:
type: string
example: 024cedd9-06bd-40c1-a6f6-ed1f7078da01
Analysis:
required:
- id
- modelId
- status
type: object
properties:
id:
type: string
example: 39b30df5-2b40-4396-8452-9b456aaadd48
modelId:
type: string
example: 31bd5132-c683-4e66-ac7c-62c8f2dd5bc6
status:
type: string
example: done
enum: [done, enqueued, analysis-error, internal-error, invalid-parameters]
parameters:
type: object
example: {}
results:
type: object
example: {}
imagingTests:
type: array
items:
$ref: '#/components/schemas/ImagingTest'
securitySchemes:
ApiKey:
type: apiKey
name: Authorization
in: header
description: 'Cognito ID token.'