-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAWB-RestAPI.yaml
More file actions
636 lines (596 loc) · 16.8 KB
/
AWB-RestAPI.yaml
File metadata and controls
636 lines (596 loc) · 16.8 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
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
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
---
openapi: 3.0.0
# General Information
info:
title: Agent.Workbench REST - API
description: This is the REST-API for Agent.Workbench in an embbedded system mode.
contact:
name: EnFlex.IT
url: https://www.enflex.it
email: admin@enflex.it
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
# Servers
servers:
- url: http://localhost:8080/api
description: AWB-Embedded System
- url: http://localhost:8085/api
description: AWB-Embedded System
# Security
security:
- bearerAuth: []
# Tags to classifiy / organize paths
tags:
- name: admins
description: Secured Admin-only calls
- name: user
description: User related calls like authentication or changing user preferences
- name: info
description: Calls that expose some kind of Information about the AWB
- name: doAction
description: Some form of Action that takes place inside of awb. e.g. restart, update
# The paths of a REST-API
paths:
/alive:
get:
tags:
- info
responses:
"200":
description: server system is allive
content:
"application/json":
schema:
type: string
/user/login:
get:
tags:
- user
summary: Logs user into the system
description: "Does NOT use Bearer Auth like whole other application. Only Endpoint that uses Basic Authentication. Expects previously configured Credentials and returns appropriate Bearer Token"
operationId: loginUser
security:
- basicAuth: []
responses:
"200":
description: successfully logged-in
content:
"application/json":
schema:
$ref: "#/components/schemas/Jwt"
default:
description: Invalid username/password supplied
/user/pswd-change:
post:
tags:
- user
summary: Changes the user password
description: ""
operationId: changePassword
requestBody:
description: The credentials to login.
content:
"application/json":
schema:
$ref: "#/components/schemas/PasswordChange"
examples:
PasswordChange:
summary: Login credentials example
value:
password_old: testpass-old
password_new: testpass-new
responses:
"200":
description: successfully change password
content:
"application/json":
example:
token: "{aa83349f-72e7-4b32-aa4d-e7c9b9353e8e}"
default:
description: invalid parameters supplied
/user/logout:
get:
tags:
- user
summary: Logs out the user from the system
description: |
Effectively logs-out the user from the System
operationId: logout
responses:
"200":
description: successfully logged the user out
/app/settings/get:
get:
tags:
- info
summary: Returns required base configuration settings for the curren web application
description: Returns required base configuration settings for the curren web application
operationId: getAppSettings
parameters:
- in: header
name: X-Performative
schema:
type: string
responses:
"200":
description: Current application settings
content:
application/json:
schema:
$ref: "#/components/schemas/Properties"
/app/settings/set:
put:
tags:
- info
summary: Enables to update or set the required base configuration settings for the curren web application
description: Enables to update or set the required base configuration settings for the curren web application
operationId: setAppSettings
requestBody:
description: The new settings
content:
"application/json":
schema:
$ref: "#/components/schemas/Properties"
responses:
"200":
description: Successfully subbmited settings
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
/info:
get:
tags:
- admins
summary: Returns system information
description: |
Returns Hardware and system information.
externalDocs:
description: See description on GitBook
url: https://www.gitbook.io
responses:
"200":
description: AWB-State
content:
application/json:
schema:
$ref: "#/components/schemas/SystemInformation"
/executionState:
get:
tags:
- admins
summary: Returns the current AWB state
description: |
Returns the current state of Agent.Workbench consisiting information about the execution mode, the currently open project and other.
externalDocs:
description: See description on GitBook
url: https://www.gitbook.io
responses:
"200":
description: AWB-State
content:
application/json:
schema:
$ref: "#/components/schemas/ExecutionState"
/load:
get:
tags:
- admins
summary: Returns the current System load
description: |
Returns the current system load measured by Agent.Workbench that includes CPU-, memory- and Java Heap - load. Further, the number of threads and agents will be returnes
responses:
"200":
description: System Load
content:
application/json:
schema:
$ref: "#/components/schemas/SystemLoad"
/version:
get:
tags:
- info
summary: Return the current version number of Agent.Workbench
parameters:
- in: query
name: type
schema:
$ref: "#/components/schemas/SoftwareComponentType"
required: false
- in: query
name: filter
schema:
type: string
required: false
- in: query
name: isShowSource
schema:
type: boolean
required: false
responses:
"200":
description: Request was successful and user receives versionNumber
content:
application/json:
schema:
$ref: "#/components/schemas/SoftwareComponentList"
/isUpdateAvailable:
get:
tags:
- info
summary: Checks wether an update for the AWB is available or not
responses:
"200":
description: request successful. boolean in response indicates wether update is available or not
content:
application/json:
schema:
$ref: "#/components/schemas/isUpdateAvailable"
/eventLog:
get:
summary: get logs of specific type
tags:
- info
parameters:
- in: query
name: amount
schema:
type: integer
default: 10
minimum: 1
maximum: 100
description: the maximum number of logs to retrieve. If no number is specified the default is 10
required: false
- in: query
name: type
schema:
$ref: "#/components/schemas/EventLogTypes"
description: The type which is retrieved by awb
required: true
responses:
"200":
description: Return Logs of specified type
content:
application/json:
schema:
description: holds as many logs as specified to the call
type: array
minItems: 1
maxItems: 100
items:
$ref: "#/components/schemas/Event"
/doUpdate:
post:
description: tries to initiate update of awb
tags:
- doAction
responses:
"423": #Locked
description: AWB cant currently be updated due to unknown circumstances
"200":
description: AWB Update was sheduled. The state of the update can be received by calling /eventLog
/doRestart:
post:
description: tries to shedule restart
tags:
- doAction
responses:
"423":
description: Restart could not be initiated
"200":
description: Restart will happen. History can be accessed via eventLog
# Component definition such as schemas, securitySchemes and so on
components:
schemas:
# Definition of general properties
Properties:
type: object
required:
- propertyEntries
properties:
performative:
type: String
propertyEntries:
type: array
items:
$ref: '#/components/schemas/PropertyEntry'
PropertyEntry:
properties:
key:
type: string
value:
type: string
valueType:
$ref: '#/components/schemas/ValueType'
valueOptions:
type: array
items:
type: string
valueOptionsOnly:
type: boolean
required:
- key
- value
- valueType
ValueType:
type: string
enum:
- INTEGER
- BOOLEAN
- STRING
- LONG
- DOUBLE
# Message-Handling
Message:
properties:
dateTime:
type: string
messageType:
$ref: '#/components/schemas/MessageType'
message:
type: string
required:
- dateTime
- messageType
- message
MessageType:
type: string
enum:
- INFO
- WARNING
- ERROR
# Type Jwt
Jwt:
type: string
description: Mandatory for every auth call that uses bearer auth
example:
token: "{aa83349f-72e7-4b32-aa4d-e7c9b9353e8e}"
# Type PasswordChange
PasswordChange:
type: object
required:
- password_old
- password_new
properties:
password_old:
type: string
format: password
password_new:
type: string
format: password
# Type SystemInformation
SystemInformation:
type: object
properties:
osDescription:
type: string
osManufacturer:
type: string
osFamilly:
type: string
osVersion:
type: string
processorName:
type: string
processorFrequenceInMhz:
type: number
format: double
processorNoPhysical:
type: integer
format: int32
processorNoLogical:
type: integer
format: int32
memoryTotalInGB:
type: number
format: double
swapMemoryTotalInGB:
type: number
format: double
heapMemoryMaxInGB:
type: number
format: double
networkConnections:
type: array
items:
$ref: "#/components/schemas/NetworkConnection"
description: The system information consisting of Hardware and OS information
required:
- "osDescription"
- "osManufacturer"
- "osFamilly"
- "osVersion"
- "processorName"
- "processorFrequenceInMhz"
- "processorNoPhysical"
- "processorNoLogical"
- "memoryTotalInGB"
- "swapMemoryTotalInGB"
- "heapMemoryMaxInGB"
- "networkConnections"
# NetworkConnection
NetworkConnection:
type: object
description: Describes a single network connection.
properties:
name:
type: string
displayName:
type: string
macAddress:
type: string
ip4Addresses:
type: string
ip6Addresses:
type: string
trafficSendInMB:
type: number
format: double
trafficReceivedInMB:
type: number
format: double
required:
[
name,
displayName,
macAddress,
ip4Addresses,
ip6Addresses,
trafficSendInMB,
trafficReceivedInMB,
]
# Type ExecutionState
ExecutionState:
type: object
properties:
executionMode:
type: string
description: |
* 'APPLICATION' - Runs as end user application in an desktop environment * 'SERVER' - Runs as Background server-system * 'SERVER_MASTER' - Runs as central 'server. master' system and manages all 'server.slave' systems * 'SERVER_SLAVE' - Runs as central 'server. slave' system and wait for start order from the 'server.master' * 'DEVICE_SYSTEM' - Runs as system that directly executes single agents or projects
enum:
- APPLICATION
- SERVER
- SERVER_MASTER
- SERVER_SLAVE
- DEVICE_SYSTEM
deviceSystemExecutionMode:
type: string
description: |
* 'SETUP' - Runs the selected setup of an AWB projekt * 'AGENT' - Runs one or more agents from an AWB project
enum:
- SETUP
- AGENT
project:
type: string
description: The currently open project
setup:
type: string
description: The currently open project-setup
description: The Agent.Workbench execution state with its open project and the selected setup
# Type SystemLoad
SystemLoad:
type: object
properties:
cpuUsage:
type: number
format: float
description: The CPU usage in percent
memUsage:
type: number
format: float
description: The memory usage in percent
heapUsage:
type: number
format: float
description: The Heap usage in percen
description: The systems current load, includung CPU, memoryand HEAP usage. Further, the number of Java threads are returned.
required:
- "cpuUsage"
- "memUsage"
- "heapUsage"
# Software Components (e.g. WebApp, Bundle or Feature information)
SoftwareComponentList:
type: object
properties:
SoftwareComponentList:
type: array
items:
$ref: '#/components/schemas/SoftwareComponent'
SoftwareComponent:
type: object
properties:
ID:
type: string
description: ID of the software component as for example symbolic bundle name or feature ID
name:
type: string
description: human readable bundle or feature name
componentType:
$ref: "#/components/schemas/SoftwareComponentType"
version:
$ref: "#/components/schemas/Version"
SoftwareComponentType:
type: string
description: the type of software component that is either webApp, feature or bundle
enum:
- WEBAPP
- FEATURE
- BUNDLE
- BUNDLE_OF_FEATURE
- null
# Version
Version:
type: object
properties:
major:
type: integer
format: int32
description: the major version number
minor:
type: integer
format: int32
description: the minor version number
micro:
type: integer
format: int32
description: the micro version number
qualifier:
type: string
description: the version qualifier
description: Object that holds Version Information.
required:
- "major"
- "minor"
- "micro"
- "qualifier"
isUpdateAvailable:
type: boolean
description: checks if an update for the AWB is available
EventLogTypes:
description: The different types of EventLogs
type: string
enum:
- AWB
- Project
- Setup
- Agent
Event:
description: An Event that occured and can be logged
type: object
properties:
time:
description: The time at which the event happened
type: string
typeOfEvent:
description: the type of event that occured
$ref: "#/components/schemas/EventLogTypes"
event:
description: the event that has happened
type: string
enum:
- "Running"
- "Starting"
- "Open Project"
- "Starting Agent System"
- "Update Sheduled"
- "Update Executed"
- "Update Failure"
- "Update in Progess"
- "Restart Sheduled"
- "Restart Executed"
- "Restart Failure"
- "Restart in Progess"
required:
- "time"
- "type"
- "event"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
basicAuth:
type: http
scheme: basic