-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
382 lines (374 loc) · 11 KB
/
openapi.yaml
File metadata and controls
382 lines (374 loc) · 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
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
openapi: 3.0.0
info:
version: "0.0.2"
title: aeriOS Federator
contact:
email: info@aerios-project.eu
license:
name: Apache 2.0
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
servers:
- description: aeriOS Domain
url: "{protocol}://{hostname}:{port}"
variables:
protocol:
enum:
- http
- https
default: http
hostname:
default: localhost
port:
default: "8050"
tags:
- name: Common
- name: Federator API
description: REST API to manage aeriOS Domain Federation
paths:
/version:
get:
tags:
- Common
summary: Returns the API version
operationId: version
description: |
Returns the API version
responses:
"200":
description: API version
/health:
get:
tags:
- Common
summary: Returns the health status
operationId: health
description: |
Returns the health status of the Federator and of the domain federation
responses:
"200":
description: Healthy status
content:
application/json:
schema:
$ref: "#/components/schemas/FederatorHealth"
"500":
description: Unhealthy status
/v1/domains:
get:
tags:
- Federator API
summary: Retrieves all the federated domains of the continuum
operationId: getDomains
description: Retrieves all the domain entities from all the federated Context Brokers of the aeriOS continuum
responses:
"200":
description: List of federated domains
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Domain"
"500":
description: Internal error
post:
tags:
- Federator API
summary: Handles the notification of a new domain
operationId: newDomain
description: |
Handles the notification from another Federator that a new domain has been created and added to the continuum
parameters:
- name: spread
in: query
description: Spreads the new domain creation across the continuum
required: true
schema:
type: boolean
default: false
requestBody:
description: ServiceComponent K8s Custom Resource
content:
application/json:
schema:
$ref: "#/components/schemas/NewDomainNotification"
responses:
"201":
description: Domain registered
content:
application/json:
schema:
anyOf:
- $ref: "#/components/schemas/NewDomainSpreadingResponse"
- $ref: "#/components/schemas/NewDomainResponse"
"207":
description: Domain registered but the process failed in some domains
content:
application/json:
schema:
anyOf:
- $ref: "#/components/schemas/NewDomainSpreadingResponse"
"400":
description: Bad request
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorMessage"
"409":
description: Domain already registered in the Context Broker
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorMessage"
"500":
description: Internal error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorMessage"
/v1/domains/local:
get:
tags:
- Federator API
summary: Retrieves the local domain
operationId: getLocalDomain
description: Retrieves the local domain NGSI-LD entity from the local Context Broker of the aeriOS domain
responses:
"200":
description: Local domain
content:
application/json:
schema:
$ref: "#/components/schemas/Domain"
"500":
description: Internal error
delete:
tags:
- Federator API
summary: Handles the notification of a domain removal
operationId: deleteLocalDomain
description: Spreads the deletion of the local domain across the continuum
responses:
"200":
description: Domain removed
content:
application/json:
schema:
$ref: "#/components/schemas/DeleteLocalDomainResponse"
"207":
description: Domain removed but the process failed in some domains
content:
application/json:
schema:
anyOf:
- $ref: "#/components/schemas/DeleteLocalDomainResponse"
"400":
description: Domain has been previously removed
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorMessage"
"500":
description: Error removing the local domain
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorMessage"
"/v1/domains/{domainName}":
delete:
tags:
- Federator API
summary: Handles the notification of a domain removal
operationId: deleteDomain
description: Handles the notification from another Federator that a domain has been removed from the continuum
parameters:
- name: domainName
in: path
description: Name of the domain
required: true
schema:
type: string
responses:
"200":
description: Domain removed
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorMessage"
"404":
description: Domain not registered in the Context Broker
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorMessage"
"500":
description: Error deleting CSRs in the Context Broker
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorMessage"
"/v1/domains/{domainName}/spread":
delete:
tags:
- Federator API
summary: (Only enabled in the Entrypoint Domain) Starts the spreading process of a domain removal
operationId: spreadDomainDeletion
description: Starts the spreading process to notify all the Federators of the continuum about a domain removal
parameters:
- name: domainName
in: path
description: Name of the domain
required: true
schema:
type: string
responses:
"200":
description: Domain removed
"404":
description: Domain not registered
"500":
description: Error deleting CSRs in the Context Broker
components:
schemas:
FederatorHealth:
description: "Desciption of the health status of the Federator"
type: object
properties:
status:
type: string
example: HEALTHY
orionLdStatus:
type: string
example: HEALTHY
domain:
type: string
example: CloudFerro
domainStatus:
type: string
example: Functional
peerFederatorDomain:
type: string
example: UPV
peerFederatorStatus:
type: string
example: HEALTHY
isEntrypoint:
type: boolean
example: true
message:
type: string
example: "The peer federator is unhealty"
detailedErrorMessage:
type: string
example: "Get \"http://localhost:8050/health\": dial tcp [::1]:8050: connectex"
federatedDomains:
$ref: "#/components/schemas/FederatorHealthFederatedDomains"
FederatorHealthFederatedDomains:
type: object
properties:
total:
type: integer
example: 3
names:
type: string
example: Domain1, Domain2, Domain3
Domain:
description: "NGSI-LD entity of type Domain with simplified format"
type: object
properties:
id:
type: string
example: urn:ngsi-ld:Domain:CloudFerro
type:
type: string
example: Domain
description:
type: string
example: CloudFerro domain
publicUrl:
type: string
example: https://cloudferro-domain.aerios-project.eu
owner:
type: string
example: urn:ngsi-ld:Organization:CloudFerro
domainStatus:
type: string
example: urn:ngsi-ld:DomainStatus:Functional
isEntrypoint:
type: string
example: false
federatorUrl:
type: string
example: https://cloudferro-domain.aerios-project.eu/federator
publicKey:
type: string
example: qvZsatwi1NnKKoq7vAdHhwah2TNqaSxcoIICh8vZsRs=
NewDomainNotification:
description: "Notification of a new domain creation"
type: object
properties:
name:
type: string
example: CloudFerro
publicUrl:
type: string
example: https://cloudferro-domain.aerios-project.eu
isEntrypoint:
type: string
example: false
brokerId:
type: string
example: CloudFerro
NewDomainSpreadingResponse:
description: "Result of the domain registration"
type: object
properties:
newRegistrations:
type: string
example: llo.aerios-project.eu/v1alpha1
domains:
type: array
items:
$ref: "#/components/schemas/Domain"
newDomainRegistrations:
type: array
items:
type: object
example: Array of NGSI-LD Context Source Registrations
failedDomains:
type: array
items:
type: string
example: UPV, Edge
message:
type: string
example: Spreading operation completed
NewDomainResponse:
description: "Result of the domain registration"
type: object
properties:
newRegistrations:
items:
type: object
example: Array of NGSI-LD Context Source Registrations
message:
type: string
example: Spreading operation completed
ErrorMessage:
description: "Error message"
type: object
properties:
message:
type: string
example: Cannot retrieve continuum domains
DeleteLocalDomainResponse:
description: "Result of the local domain removal"
type: object
properties:
failedDomains:
items:
type: string
example: Domain1, Domain2
message:
type: string
example: Local domain successfully deleted