Newer
Older
openapi: 3.0.0
info:
title: AURA Engine API
description: This is the AURA Engine API. Read more at https://gitlab.servus.at/aura/engine.
contact:
email: david.trattnig@subsquare.at
license:
name: AGPL 3.0
url: https://www.gnu.org/licenses/agpl-3.0.en.html
version: 1.0.0
servers:
- url: '{protocol}://{api-host}:{port}/api/{version}'
description: Engine API
variables:
protocol:
default: http
enum:
- http
- https
api-host:
description: Hostname or IP for API Host
default: localhost
port:
default: "8008"
version:
default: v1
- url: https://virtserver.swaggerhub.com/AURA-Engine/engine-api/1.0.0
description: SwaggerHub API Auto Mocking
tags:
- name: public
description: Operations available to the public
- name: internal
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
paths:
/trackservice:
get:
tags:
- public
summary: List recent tracks in the play-log
description: |
Lists the most recent track-service entries.
operationId: list_tracks
parameters:
- name: offset
in: query
description: The number of items to skip before starting to collect the result
set
required: false
style: form
explode: true
schema:
type: integer
- name: limit
in: query
description: The numbers of items to return
required: false
style: form
explode: true
schema:
maximum: 50
minimum: 1
type: integer
default: 20
responses:
"200":
description: search results matching criteria
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PlayLogEntry'
x-content-type: application/json
"400":
description: bad input parameter
x-openapi-router-controller: src.controllers.public_controller
/trackservice/{trackId}:
get:
tags:
- public
summary: Get a single track by ID
description: |
Retrieves a single track by its ID.
operationId: get_track
parameters:
- name: trackId
in: path
description: ID of the track-service entry
required: true
style: simple
explode: false
schema:
type: integer
responses:
"200":
description: Track matching the given ID
content:
application/json:
schema:
$ref: '#/components/schemas/PlayLogEntry'
"400":
description: bad input parameter
x-openapi-router-controller: src.controllers.public_controller
/trackservice/current:
get:
tags:
- public
summary: Get current track
description: |
Retrieves the currently playing track.
operationId: current_track
responses:
"200":
description: Track currently playing
content:
application/json:
schema:
$ref: '#/components/schemas/PlayLogEntry'
"400":
description: bad input parameter
x-openapi-router-controller: src.controllers.public_controller
/report/{year_month}:
get:
tags:
- internal
summary: Report for one month
description: |
Returns a report for the given month
operationId: get_report
parameters:
- name: year_month
in: path
description: Month to create the report for in the format "yyyy_mm"
required: true
style: simple
explode: false
schema:
type: string
responses:
"200":
description: report matching criteria
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PlayLogEntry'
x-content-type: application/json
"400":
description: bad input parameter
x-openapi-router-controller: src.controllers.internal_controller
get:
tags:
- internal
summary: Get active engine
description: |
Retrieves the status entry of the currently active engine
operationId: get_active_engine
responses:
"200":
description: report matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/StatusEntry'
"400":
description: bad input parameter
x-openapi-router-controller: src.controllers.internal_controller
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
/engine/{engineNumber}/health:
get:
tags:
- internal
summary: Get most recent health info
description: |
Retrieves the most recent health info of the requested engine
operationId: get_engine_health
parameters:
- name: engineNumber
in: path
description: Number of the engine
required: true
style: simple
explode: false
schema:
maximum: 2
minimum: 1
type: integer
responses:
"200":
description: report matching criteria
content:
application/json:
schema:
$ref: '#/components/schemas/HealthInfo'
"400":
description: bad input parameter
x-openapi-router-controller: src.controllers.internal_controller
post:
tags:
- internal
summary: Log health info
description: |
Logs another health entry for the given engine
operationId: log_engine_health
parameters:
- name: engineNumber
in: path
description: Number of the engine
required: true
style: simple
explode: false
schema:
maximum: 2
minimum: 1
type: integer
responses:
"200":
description: health info logged
"400":
description: bad input parameter
x-openapi-router-controller: src.controllers.internal_controller
/engine/{engineNumber}/activate:
put:
tags:
- internal
summary: Set active engine
description: |
Activates one engine and deactivates the other
operationId: activate_engine
parameters:
- name: engineNumber
in: path
description: Number of the engine
required: true
style: simple
explode: false
schema:
maximum: 2
minimum: 1
type: integer
responses:
"200":
description: status updated
"400":
description: bad input parameter
x-openapi-router-controller: src.controllers.internal_controller
components:
schemas:
PlayLogEntry:
required:
- track_start
type: object
properties:
track_start:
type: string
format: date-time
example: 2020-08-29T09:12:33.001Z
track_artist:
type: string
example: Amon Tobin
track_album:
type: string
example: Bricolage
track_title:
type: string
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
track_duration:
type: integer
example: 234
track_type:
type: string
example: Live
schedule_id:
type: integer
example: 1
schedule_start:
type: string
format: date-time
example: 2020-08-29T09:12:33.001Z
schedule_end:
type: string
format: date-time
example: 2020-08-29T09:12:33.001Z
schedule_repetition:
type: boolean
example: false
schedule_playlist_id:
type: integer
example: 1
schedule_fallback_type:
type: integer
example: 0
show_id:
type: integer
example: 1
show_name:
type: string
example: Special Music Show
show_funding_category:
type: string
example: Standard
show_type:
type: string
example: Feature
show_category:
type: string
show_topic:
type: string
example: Music
example:
track_album: Bricolage
show_funding_category: Standard
show_id: 1
schedule_fallback_type: 0
show_name: Special Music Show
track_artist: Amon Tobin
show_topic: Music
track_type: Live
schedule_playlist_id: 1
show_type: Feature
track_start: 2020-08-29T09:12:33.001Z
schedule_repetition: false
schedule_end: 2020-08-29T09:12:33.001Z
track_duration: 234
schedule_id: 1
schedule_start: 2020-08-29T09:12:33.001Z
StatusEntry:
required:
- engine_host
- is_active
- is_healthy
- log_time
type: object
properties:
log_time:
type: string
format: date-time
example: 2020-08-29T09:12:33.001Z
engine_number:
maximum: 2
minimum: 1
type: integer
engine_host:
type: string
example: engine1.local
is_healthy:
type: boolean
example: true
is_active:
type: boolean
example: true
example:
is_healthy: true
is_active: true
engine_host: engine1.local
log_time: 2020-08-29T09:12:33.001Z
required:
- details
- log_time
type: object
properties:
log_time:
type: string
format: date-time
example: 2020-08-29T09:12:33.001Z
details:
type: string
example: Stringified JSON Object
example:
details: Stringified JSON Object
log_time: 2020-08-29T09:12:33.001Z