-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yml
More file actions
342 lines (335 loc) · 9.22 KB
/
openapi.yml
File metadata and controls
342 lines (335 loc) · 9.22 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
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
openapi: 3.0.0
info:
version: "1.1.0"
title: aeriOS LLO API
contact:
email: info@aerios-project.eu
license:
name: Apache 2.0
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
servers:
- description: LLO API
url: "{protocol}://{hostname}:{port}"
variables:
protocol:
enum:
- http
- https
default: http
hostname:
default: localhost
port:
default: "8090"
tags:
- name: Common
- name: LLO API
description: REST API to list, update, delete and create K8s Custom Resources managed by aeriOS LLO Operators.
paths:
/version:
get:
tags:
- Common
summary: Returns the API version
operationId: version
description: |
Returns the API version along with the supported K8s CRs
responses:
"200":
description: API version
/health:
get:
tags:
- Common
summary: Returns the health status
operationId: health
description: |
Returns the health status of the API: HEALTHY or UNHEALTHY
responses:
"200":
description: Healthy status
"500":
description: Unhealthy status
/v1/service-components:
get:
tags:
- LLO API
summary: Retrieves all the deployed Service Components
operationId: getServiceComponents
description: Retrieves all the deployed Service Components
parameters:
- name: type
in: query
description: Type of the LLO
required: true
schema:
type: string
enum:
- docker
- k8s
- name: onlyNames
in: query
description: Return only the Service Component names
required: false
schema:
type: boolean
responses:
"200":
description: List of deployed Service Components
"400":
description: Invalid LLO type
"500":
description: Internal error
post:
tags:
- LLO API
summary: Deploys a Service Component
operationId: deployServiceComponent
description: |
Deploys a Service Component in the K8s cluster
requestBody:
description: ServiceComponent K8s Custom Resource
content:
application/yaml:
schema:
$ref: "#/components/schemas/ServiceComponentCR"
responses:
"201":
description: Service Component deployed
"400":
description: Bad request
"409":
description: This Service Component already exists
put:
tags:
- LLO API
summary: Replace a Service Component
operationId: replaceServiceComponent
description: |
Replaces a Service Component in the K8s cluster
requestBody:
description: ServiceComponent K8s Custom Resource
content:
application/yaml:
schema:
$ref: "#/components/schemas/ServiceComponentCR"
responses:
"200":
description: Service Component replaced
"400":
description: Bad request
"/v1/service-components/{scName}":
get:
tags:
- LLO API
summary: Retrieves a deployed Service Component
operationId: getServiceComponentByName
description: Retrieves a deployed Service Component
parameters:
- name: scName
in: path
description: Name of the Service Component
required: true
schema:
type: string
- name: type
in: query
description: Type of the LLO
required: true
schema:
type: string
enum:
- docker
- k8s
responses:
"200":
description: List of deployed Service Components
"400":
description: Invalid LLO type
"404":
description: Service Component not found
"500":
description: Internal error
patch:
tags:
- LLO API
summary: Updates a Service Component
operationId: updateServiceComponent
description: |
Updates a Service Component in the K8s cluster
parameters:
- name: scName
in: path
description: Name of the Service Component
required: true
schema:
type: string
- name: type
in: query
description: Type of the LLO
required: true
schema:
type: string
enum:
- docker
- k8s
requestBody:
description: Part of a ServiceComponent K8s Custom Resource
content:
application/yaml:
schema:
$ref: "#/components/schemas/ServiceComponentSpec"
responses:
"200":
description: Service Component updated
"400":
description: Bad request
delete:
tags:
- LLO API
summary: Deletes a deployed Service Component
operationId: deleteServiceComponentByName
description: Deletes a deployed Service Component
parameters:
- name: scName
in: path
description: Name of the Service Component
required: true
schema:
type: string
- name: type
in: query
description: Type of the LLO
required: true
schema:
type: string
enum:
- docker
- k8s
responses:
"200":
description: Service Component deleted
"400":
description: Invalid LLO type
"404":
description: Service Component not found
"500":
description: Internal error
components:
schemas:
ServiceComponentSpec:
description: "Spec of a Service Component K8s Custom Resource"
type: object
properties:
cliArgs:
description: CLI arguments
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
envVars:
description: Environment variables
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
exposePorts:
description: Expose the network ports outside the node
type: boolean
image:
description: Container image of the service component
type: string
imageRegistry:
description: Configuration to use a private container image registry
properties:
password:
type: string
url:
description: Full url of the OCI image registry
type: string
username:
description: User credentials
type: string
type: object
networkOverlay:
description: aeriOS service network overlay configuration
properties:
allowedIps:
type: string
dns:
type: string
endpoint:
type: string
internalIp:
type: string
mtu:
type: integer
persistentKeepalive:
type: integer
privateKey:
type: string
publicKey:
type: string
type: object
ports:
description: Ports to expose
items:
properties:
number:
description: Expose the network port outside the node
format: int32
type: integer
protocol:
type: string
type: object
type: array
privileged:
description: Privileged opt
type: boolean
selectedIE:
description: Selected IE by the HLO
properties:
hostname:
description: hostname attribute of the Infrastructure Element
NGSI-LD entity
type: string
id:
description: ID of the Infrastructure Element NGSI-LD entity
type: string
type: object
ServiceComponentCR:
description: "Service Component K8s Custom Resource"
type: object
properties:
apiVersion:
type: string
example: llo.aeros-project.eu/v1alpha1
kind:
type: string
enum:
- ServiceComponentDocker
- ServiceComponentK8s
metadata:
type: object
properties:
labels:
type: array
items:
type: object
example:
app.kubernetes.io/name: component-1-of-the-service-1
app.kubernetes.io/instance: Service_1_Component_1
app.kubernetes.io/part-of: Service_1
app.kubernetes.io/managed-by: aeros-project.eu
app.kubernetes.io/created-by: LowLevelOrchestrator_2
name:
type: string
spec:
$ref: "#/components/schemas/ServiceComponentSpec"