streaming.openapi.yaml 12.9 KB
Newer Older
1
2
3
openapi: 3.0.0
info:
  version: 1.0.0
4
  title: OSDU Streaming Services
5
6
7
8
  license:
    name: Apache 2.0
    url: "http://www.apache.org/licenses/LICENSE-2.0"
servers:
9
10
  - url: "http://localhost:8080/api/streaming/v1"
    description: "Local development server"
11
tags:
12
13
  - name: stream-admin-api
    description: Stream Admin API
14
paths:
15
  /streams:
16
    get:
17
      summary: "List all registered streams"
18
19
      operationId: listAllStreams
      tags:
20
        - stream-admin-api
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
      parameters:
        - name: data-partition-id
          in: header
          description: "tenant"
          required: true
          example: "opendes"
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/StreamRecord"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
48
  /stream:
49
    post:
50
      summary: "Register a new stream"
51
52
      operationId: createNewStream
      tags:
53
        - stream-admin-api
54
55
56
57
58
59
60
61
62
63
64
65
      parameters:
        - name: data-partition-id
          in: header
          description: "tenant"
          required: true
          example: "opendes"
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
66
              $ref: "#/components/schemas/StreamRecord"
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                type: string
                description: "ID of the stream created"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
85
  /stream/{id}:
86
87
88
89
    get:
      summary: "Get stream definition by Id"
      operationId: getStreamById
      tags:
90
        - stream-admin-api
91
92
93
94
95
96
97
98
99
100
101
102
      parameters:
        - name: data-partition-id
          in: header
          description: "tenant"
          required: true
          example: "opendes"
          schema:
            type: string
        - name: id
          in: path
          description: "Stream ID"
          required: true
103
          example: "opendes:dataset--Stream.Generic:4dc4e8ec354e4953b6968fcb1d9d9f38"
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
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StreamRecord"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not found
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    delete:
      summary: "Delete stream definition by Id and decommision all associated compute resources"
      operationId: deleteStreamById
      tags:
129
        - stream-admin-api
130
131
132
133
134
135
136
137
138
139
140
141
      parameters:
        - name: data-partition-id
          in: header
          description: "tenant"
          required: true
          example: "opendes"
          schema:
            type: string
        - name: id
          in: path
          description: "Stream ID"
          required: true
142
          example: "opendes:dataset--Stream.Generic:4dc4e8ec354e4953b6968fcb1d9d9f38"
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
          schema:
            type: string
      responses:
        "204":
          description: Stream deleted
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not found
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
160
  /stream/{id}/start:
161
162
163
164
    get:
      summary: "Start live streaming for the specified stream Id"
      operationId: startStreamById
      tags:
165
        - stream-admin-api
166
167
168
169
170
171
172
173
174
175
176
177
      parameters:
        - name: data-partition-id
          in: header
          description: "tenant"
          required: true
          example: "opendes"
          schema:
            type: string
        - name: id
          in: path
          description: "Stream ID"
          required: true
178
          example: "opendes:dataset--Stream.Generic:4dc4e8ec354e4953b6968fcb1d9d9f38"
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
          schema:
            type: string
      responses:
        "200":
          description: Start command performed successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StreamStatus"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not found
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
200
  /stream/{id}/stop:
201
202
203
204
    get:
      summary: "Stop live streaming for the specified stream Id"
      operationId: stopStreamById
      tags:
205
        - stream-admin-api
206
207
208
209
210
211
212
213
214
215
216
217
      parameters:
        - name: data-partition-id
          in: header
          description: "tenant"
          required: true
          example: "opendes"
          schema:
            type: string
        - name: id
          in: path
          description: "Stream ID"
          required: true
218
          example: "opendes:dataset--Stream.Generic:4dc4e8ec354e4953b6968fcb1d9d9f38"
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
          schema:
            type: string
      responses:
        "200":
          description: Stop command performed successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StreamStatus"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not found
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
240
  /stream/{id}/info:
241
242
243
244
    get:
      summary: "Get the current status of the stream by Id"
      operationId: getStreamStatusById
      tags:
245
        - stream-admin-api
246
247
248
249
250
251
252
253
254
255
256
257
      parameters:
        - name: data-partition-id
          in: header
          description: "tenant"
          required: true
          example: "opendes"
          schema:
            type: string
        - name: id
          in: path
          description: "Stream ID"
          required: true
258
          example: "opendes:dataset--Stream.Generic:4dc4e8ec354e4953b6968fcb1d9d9f38"
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
          schema:
            type: string
      responses:
        "200":
          description: Info command performed successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StreamStatus"
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not found
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    StreamRecord:
      type: object
      required:
        - id
        - kind
        - data
        - acl
        - legal
        - type
        - namespace
      properties:
        id:
          type: string
295
296
          pattern: '^[\\w\\-\\.]+:dataset\\-\\-Stream.Generic:[\\w\\-\\.\\:\\%]+'
          example: "opendes:dataset--Stream.Generic:4dc4e8ec354e4953b6968fcb1d9d9f38"
297
298
299
          description: "Unique identifier in whole Data Ecosystem. When not provided, Data Ecosystem will create and assign an id to the record."
        kind:
          type: string
Dmitry Kniazev's avatar
Dmitry Kniazev committed
300
          example: "osdu:wks:dataset--Stream.Generic:1.0.0"
301
302
303
304
305
306
307
308
309
310
311
312
313
314
          description: "Record kind for which the schema information is applied to."
        data:
          $ref: "#/components/schemas/StreamDataset"
        namespace:
          type: string
          example: "opendes:osdu"
        version:
          type: integer
          format: int64
          example: 1605804087572060
        acl:
          $ref: "#/components/schemas/Acl"
        legal:
          $ref: "#/components/schemas/Legal"
315
316
        tags:
          $ref: "#/components/schemas/Tags"
317
318
319
320
321
322
323
324
325
326
327
328
        meta:
          type: array
          items:
            $ref: "#/components/schemas/Map"
        ancestry:
          $ref: "#/components/schemas/RecordAncestry"
    StreamDataset:
      type: object
      properties:
        ResourceSecurityClassification:
          type: string
          example: "opendes:reference-data--ResourceSecurityClassification:RESTRICTED:"
329
        Source:
330
331
          type: string
          example: "Contoso Inc."
332
333
334
335
336
337
        Name:
          type: string
          example: "Example Well Log Kafka Stream"
        Description:
          type: string
          example: "This stream follows data for one Well Log and routes it from source to sink with no additional filtering"
338
339
340
341
342
        DatasetProperties:
          type: object
          properties:
            StreamType:
              type: string
343
344
345
346
              enum:
                - source
                - processor
                - sink
347
              description: 'Type of the stream. Enumeration: "source", "processor", "sink"'
348
              example: "processor"
349
350
            StreamDefinition:
              $ref: "#/components/schemas/StreamDefinition"
351
352
            ExtensionProperties:
              type: object
353
354
355
356
357
358
359
360
361
362
363
364
365
366
              properties:
                StreamDeployment:
                  type: object
                  properties:
                    Image:
                      type: string
                      example: "quay.io/org/image:tag"
                    Env:
                      type: object
                      additionalProperties:
                        type: string
                      example:
                        ENV1: "ENV VALUE 1"
                        ENV2: "ENV VALUE 2"
367
368
369
370
371
    StreamDefinition:
      type: object
      required:
        - SubscribeIDs
      properties:
372
        SourceBindings:
373
374
375
376
          type: array
          items:
            type: string
            example: "opendes_wks_work-product-component--WellLog_1.0.0"
377
        SinkBindings:
378
379
380
381
          type: array
          items:
            type: string
            example: "opendes_4dc4e8ec354e4953b6968fcb1d9d9f38_work-product-component--WellLog_1.0.0"
382
        SubscribeIds:
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
          type: array
          items:
            type: string
            example: "opendes:work-product-component--WellLog:be54a691c0384182944d71c6b2b6f699"
        Filter:
          type: string
          example: "TBD"
        Aggregate:
          type: string
          example: "TBD"
    StreamStatus:
      type: object
      properties:
        Command:
          type: string
          enum:
            - start
            - stop
            - info
        Workers:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              state:
                type: string
                enum:
                  - running
                  - stopped
                  - failed
    Acl:
      type: object
      properties:
        owners:
          type: array
          items:
            type: string
            example: "data.stream-4dc4e8ec354e4953b6968fcb1d9d9f38.producer@opendes.contoso.com"
        viewers:
          type: array
          items:
            type: string
            example: "data.stream-4dc4e8ec354e4953b6968fcb1d9d9f38.consumer@opendes.contoso.com"
    Legal:
      type: object
      properties:
        legaltags:
          type: array
          items:
            type: string
            example: "opendes-public-usa-dataset"
        otherRelevantDataCountries:
          type: array
          items:
            type: string
            example: "US"
        status:
          type: string
          enum:
            - compliant
            - incompliant
446
447
448
449
    Tags:
      type: object
      additionalProperties:
        type: object
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
    Map:
      type: object
      additionalProperties:
        type: object
    RecordAncestry:
      type: object
      properties:
        parents:
          type: array
          items:
            type: string
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
security:
  - JWT:
      - global