aboutsummaryrefslogtreecommitdiffstats
path: root/openapi/client-history/src/api.yaml
blob: 22c6ae5c0f4888cf87c916ed3aca9b22d02b360e (plain)
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
openapi: 3.0.2
info:
  title: Config API
  version: '1.0'
  description: API to provide actions for history
  contact:
    name: TNAP Team Tesla
    url: 'https://www.telekom.de'
    email: info@telekom.de
servers:
  - url: 'http://localhost:9002'
tags:
  - name: actions
paths:
  '/v1/actions/{userId}':
    parameters:
      - $ref: '#/components/parameters/userIdPathParam'
      - $ref: '#/components/parameters/xRequestIdHeader'
    get:
      summary: Retrieve all actions for a specific user
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionsListResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
      operationId: getActions
      parameters:
        - $ref: '#/components/parameters/pageQueryParam'
        - $ref: '#/components/parameters/pageSizeQueryParam'
        - schema:
            type: integer
            format: int32
          in: query
          name: showLastHours
          description: Get all actions within the last X hours.
      description: Get actions for the given userId
      tags:
        - actions
    post:
      summary: Create an action for a given user
      operationId: createAction
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateActionRequest'
        description: Only one action in each POST request
      description: Create a user action
      tags:
        - actions
    delete:
      summary: Delete user actions after given time
      operationId: deleteActions
      parameters:
        - schema:
            type: integer
            format: int32
          in: query
          name: deleteAfterHours
          description: If parameter is given actions older than value will be deleted for the user
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
      tags:
        - actions
      description: Delete user actions after given time
  '/v1/actions':
    get:
      summary: Retrieve all actions from the portal with an optional timeframe
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionsListResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
      operationId: listActions
      parameters:
        - $ref: '#/components/parameters/xRequestIdHeader'
        - $ref: '#/components/parameters/pageQueryParam'
        - $ref: '#/components/parameters/pageSizeQueryParam'
        - schema:
            type: integer
            format: int32
          in: query
          name: showLastHours
          description: Get all actions within the last X hours.
      description: Get portal actions from all users
      tags:
        - actions
  '/actuator/info':
    get:
      tags:
        - actions
      summary: Retrieve actuator information
      description: Proxy for actuator info endpoint
      operationId: getActuatorInfo
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActuatorInfoResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'

components:
  parameters:
    xRequestIdHeader:
      name: X-Request-Id
      in: header
      description: The unique identifier of the request
      required: true
      schema:
        type: string
    pageQueryParam:
      name: page
      in: query
      description: Page index (1..N)
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
        default: 1
    pageSizeQueryParam:
      name: pageSize
      in: query
      description: The size of the page to be returned
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 5000
        default: 10
    userIdPathParam:
      name: userId
      in: path
      description: User ID
      required: true
      schema:
        $ref: '#/components/schemas/ValidString'
  schemas:
    ActionResponse:
      title: ActionResponse
      type: object
      properties:
        actionCreatedAt:
          type: string
          format: date-time
        action:
          type: object
        saveInterval:
          type: integer
          format: int32
      required:
        - action
        - actionCreatedAt
    CreateActionRequest:
      title: CreateActionRequest
      type: object
      properties:
        userId:
          type: string
        actionCreatedAt:
          type: string
          format: date-time
        action:
          type: object
      required:
        - userId
        - actionCreatedAt
        - action
    ActionsListResponse:
      title: ActionsListResponse
      type: object
      properties:
        actionsList:
          type: array
          items:
            $ref: '#/components/schemas/ActionResponse'
        totalCount:
          type: integer
          format: int32
          description: Total number of items matching criteria
      required:
        - actionsList
        - totalCount
    ActuatorInfoResponse:
      title: ActuatorInfoResponse
      type: object
      properties:
        git:
          $ref: '#/components/schemas/ActuatorGitInfo'
        build:
          $ref: '#/components/schemas/ActuatorBuildInfo'
        java:
          $ref: '#/components/schemas/ActuatorJavaInfo'
    ActuatorGitInfo:
      title: ActuatorGitInfo
      type: object
      properties:
        branch:
          type: string
        commit:
          $ref: '#/components/schemas/GitCommitInfo'
    ActuatorBuildInfo:
      title: ActuatorBuildInfo
      type: object
      properties:
        artifact:
          type: string
        name:
          type: string
        time:
          type: string
        version:
          type: string
        group:
          type: string
    GitCommitInfo:
      title: GitCommitInfo
      type: object
      properties:
        id:
          type: string
        time:
          type: string
    ActuatorJavaInfo:
      title: ActuatorJavaInfo
      type: object
      properties:
        version:
          type: string
        vendor:
          $ref: '#/components/schemas/JavaVendorInfo'
        runtime:
          $ref: '#/components/schemas/JavaRuntimeInfo'
        jvm:
          $ref: '#/components/schemas/JavaJvmInfo'
    JavaVendorInfo:
      title: JavaVendorInfo
      type: object
      properties:
        name:
          type: string
        version:
          type: string
    JavaRuntimeInfo:
      title: JavaRuntimeInfo
      type: object
      properties:
        name:
          type: string
        version:
          type: string
    JavaJvmInfo:
      title: JavaJvmInfo
      type: object
      properties:
        name:
          type: string
        vendor:
          type: string
        version:
          type: string
    Problem:
      type: object
      properties:
        type:
          type: string
          format: uri-reference
          description: |
            A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type.
          default: 'about:blank'
          example: /problem/connection-error
        title:
          type: string
          description: |
            A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
          example: Service Unavailable
        status:
          type: integer
          format: int32
          description: |
            The HTTP status code generated by the origin server for this occurrence of the problem.
          minimum: 100
          maximum: 600
          exclusiveMaximum: true
          example: 503
        detail:
          type: string
          description: |
            A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
          example: Connection to database timed out
        instance:
          type: string
          format: uri-reference
          description: |
            A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code.
          example: /problem/connection-error#token-info-read-timed-out
    ValidString:
      type: string
      pattern: '[\w,/!=§#@€:µ.*+?'' \-\u00C0-\u017F]*'
  responses:
    BadRequest:
      description: '400: Bad Request'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      headers:
        X-Request-Id:
          schema:
            type: string
          description: A <uuid4> in each response
    Unauthorized:
      description: '401: Unauthorized'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      headers:
        X-Request-Id:
          schema:
            type: string
          description: A <uuid4> in each response
    Forbidden:
      description: '403: Forbidden'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      headers:
        X-Request-Id:
          schema:
            type: string
          description: A <uuid4> in each response
    NotFound:
      description: '404: Not Found'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      headers:
        X-Request-Id:
          schema:
            type: string
          description: A <uuid4> in each response
    NotAllowed:
      description: '405: Method Not Allowed'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      headers:
        X-Request-Id:
          schema:
            type: string
          description: A <uuid4> in each response
    Conflict:
      description: '409: Conflict'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      headers:
        X-Request-Id:
          schema:
            type: string
          description: A <uuid4> in each response
    InternalServerError:
      description: Internal Server Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      headers:
        X-Request-Id:
          schema:
            type: string
          description: A <uuid4> in each response
    BadGateway:
      description: Bad Gateway
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
      headers:
        X-Request-Id:
          schema:
            type: string
          description: A <uuid4> in each response