-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathopenapi.yaml
More file actions
568 lines (568 loc) · 15.3 KB
/
openapi.yaml
File metadata and controls
568 lines (568 loc) · 15.3 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
openapi: 3.0.1
info:
title: Batch Processing Gateway API
description: "Batch Processing Gateway API is a RESTful web service to submit, examine\
\ and delete Spark jobs."
version: "2.0"
tags:
- name: Submission
description: APIs to submit jobs
- name: Deletion
description: APIs to delete jobs
- name: Examination
description: APIs to examine jobs
- name: Storage
description: API to upload artifact to S3
- name: Admin
description: Admin related APIs
- name: Health Check
description: Service availability health check
paths:
/admin/version:
get:
tags:
- Admin
summary: Show the version
operationId: version
responses:
"200":
description: OK
content:
application/json:
schema:
type: string
/admin/submissions:
get:
tags:
- Admin
summary: List submissions from all users
operationId: listSubmissions
parameters:
- name: name
in: query
description: specify this to list only submissions under one application name
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: string
/log:
get:
tags:
- Examination
summary: Get driver/executor stdout logs from EKS
description: "By default driver logs will be returned, unless executor ID is\
\ specified."
operationId: getLog
parameters:
- name: subId
in: query
description: submission ID (mutual exclusive with application ID)
schema:
type: string
default: ""
- name: appId
in: query
description: application ID (mutual exclusive with submission ID)
schema:
type: string
default: ""
- name: execId
in: query
description: "If execId is specified, logs from specific executor will be\
\ returned. Otherwise driver log will be returned."
schema:
type: string
default: ""
example: 11
responses:
"200":
description: OK
content:
application/octet-stream:
schema:
type: string
"400":
description: "Bad request due to invalid submission ID, app ID or other\
\ issues"
"500":
description: Internal server error
/spark/{submissionId}/status:
get:
tags:
- Examination
summary: Get Spark application status by submission ID.
description: May return an empty object when the Spark application is not be
started yet.
operationId: getStatus
parameters:
- name: submissionId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetSubmissionStatusResponse'
"400":
description: Bad request due to wrong format or invalid values
"415":
description: Unsupported content type
"500":
description: Internal server error
"403":
description: Forbidden
/spark:
post:
tags:
- Submission
summary: Submit a Spark application
description: "To submit a job, prepare a job payload in the request body either\
\ in JSON or YAML format."
operationId: submitApplication
parameters:
- name: content-type
in: header
description: "options: application/json, text/yaml, or leave it empty for\
\ API to figure out"
schema:
type: string
requestBody:
description: "All the specification of the job, including necessary artifacts,\
\ versions, driver and executor specs"
content:
application/json:
schema:
$ref: '#/components/schemas/SubmitApplicationRequest'
text/yaml:
schema:
$ref: '#/components/schemas/SubmitApplicationRequest'
'*/*':
schema:
$ref: '#/components/schemas/SubmitApplicationRequest'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SubmitApplicationResponse'
"400":
description: Bad request due to wrong format or invalid values
"415":
description: Unsupported content type
"500":
description: Internal server error
/spark/{submissionId}:
delete:
tags:
- Deletion
summary: Delete Spark application by submission ID
description: "After a job is submitted, you can use the submission ID returned\
\ to delete the job."
operationId: deleteSubmission
parameters:
- name: submissionId
in: path
description: The submission ID returned by submission API
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteSubmissionResponse'
"400":
description: Bad request due to invalid submission ID or other issues
"500":
description: Internal server error
/spark/{submissionId}/spec:
get:
tags:
- Examination
summary: Get Spark application spec by submission ID.
description: Return the detailed spec of the Spark job.
operationId: getSparkSpec
parameters:
- name: submissionId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SparkApplicationSpec'
"400":
description: Bad request due to invalid submission ID or other issues
"500":
description: Internal server error
/spark/{submissionId}/driver:
get:
tags:
- Examination
summary: Get Spark application driver information.
description: May return an empty object when the Spark application has not started
yet.
operationId: getDriverInfo
parameters:
- name: submissionId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetDriverInfoResponse'
"400":
description: Bad request due to invalid submission ID or other issues
"500":
description: Internal server error
/spark/{submissionId}/describe:
get:
tags:
- Examination
summary: Get spark application spec and related events as a text stream.
description: May return an empty stream when the Spark application has not started
yet.
operationId: describe
parameters:
- name: submissionId
in: path
required: true
schema:
type: string
- name: Client-Version
in: header
schema:
type: string
default: none
requestBody:
content:
'*/*':
schema:
$ref: '#/components/schemas/User'
responses:
"200":
description: OK
content:
application/octet-stream:
schema:
type: string
"400":
description: Bad request due to invalid submission ID or other issues
"500":
description: Internal server error
/s3/{name}:
post:
tags:
- Storage
summary: Upload an artifact to S3 and save as a S3 object.
description: The content length parameter must be exactly same as the size of
the stream. DO NOT upload any sensitive data file.
operationId: uploadStream
parameters:
- name: name
in: path
description: name of the artifact without parent folders
required: true
schema:
type: string
example: artifact.jar
- name: content-length
in: query
description: content length can be provided in either query or header
schema:
type: integer
format: int64
- name: content-length
in: header
description: content length can be provided in either query or header
schema:
type: string
- name: folder
in: query
description: the folder path to which you want to publish the artifact
schema:
type: string
example: your/folder/
requestBody:
content:
application/octet-stream: {}
responses:
default:
description: default response
content:
application/json:
schema:
$ref: '#/components/schemas/UploadS3Response'
/healthcheck/status:
get:
tags:
- Health Check
summary: Check the current service status
operationId: healthcheckStatus
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/HealthcheckResponse'
components:
schemas:
User:
type: object
properties:
name:
type: string
DeleteSubmissionResponse:
type: object
properties:
submissionId:
type: string
HealthcheckResponse:
type: object
properties:
status:
type: string
GetSubmissionStatusResponse:
type: object
properties:
creationTime:
type: integer
format: int64
sparkApplicationId:
type: string
executionAttempts:
type: integer
format: int32
terminationTime:
type: integer
format: int64
duration:
type: integer
format: int64
applicationState:
type: string
applicationErrorMessage:
type: string
sparkUIUrl:
type: string
SubmitApplicationResponse:
type: object
properties:
submissionId:
type: string
SubmitApplicationRequest:
required:
- driver
- executor
- mainApplicationFile
- sparkVersion
type: object
properties:
submissionIdSuffix:
type: string
description: "If specified, the suffix will be appended to the submission\
\ ID"
applicationName:
type: string
description: Name of the application. This will help listing submissions
under the same application later.
type:
type: string
description: "Should be: Java / Scala / Python. If not specified, the API\
\ will try to figure out by itself."
image:
type: string
spotInstance:
type: boolean
description: To enable Spot Instance feature that schedules all Spark Executor
pods to Spot nodes
sparkVersion:
type: string
description: "Spark version in the format of x.y, where x and y are integers."
mainClass:
type: string
description: The main class in the jar provided in mainApplicationFile for
a Java/Scala Spark job
example: com.spark.examples.OneStageApp
mainApplicationFile:
type: string
description: "For Java/Scala Spark jobs, provide the full path to the jar\
\ file. For PySpark jobs, provide the full path to the Python file."
arguments:
type: array
items:
type: string
annotations:
type: object
additionalProperties:
type: string
driver:
$ref: '#/components/schemas/DriverSpec'
executor:
$ref: '#/components/schemas/ExecutorSpec'
deps:
$ref: '#/components/schemas/Dependencies'
pythonVersion:
type: string
queue:
type: string
description: "If no queue is specified, a default 'poc' queue will be used."
description: Submit Application Request
SparkApplicationSpec:
type: object
properties:
type:
type: string
sparkVersion:
type: string
originalUser:
type: string
proxyUser:
type: string
image:
type: string
mainClass:
type: string
mainApplicationFile:
type: string
arguments:
type: array
items:
type: string
annotations:
type: object
additionalProperties:
type: string
driver:
$ref: '#/components/schemas/DriverSpec'
executor:
$ref: '#/components/schemas/ExecutorSpec'
deps:
$ref: '#/components/schemas/Dependencies'
pythonVersion:
type: string
GetDriverInfoResponse:
type: object
properties:
podName:
type: string
startTime:
type: integer
format: int64
ExecutorSpec:
type: object
properties:
cores:
type: integer
format: int32
coreRequest:
type: string
coreLimit:
type: string
memory:
type: string
memoryOverhead:
type: string
image:
type: string
env:
type: array
items:
$ref: '#/components/schemas/EnvVar'
annotations:
type: object
additionalProperties:
type: string
instances:
type: integer
format: int32
UploadS3Response:
type: object
properties:
url:
type: string
EnvVar:
type: object
properties:
name:
type: string
value:
type: string
Dependencies:
type: object
properties:
jars:
type: array
items:
type: string
files:
type: array
items:
type: string
pyFiles:
type: array
items:
type: string
packages:
type: array
items:
type: string
excludePackages:
type: array
items:
type: string
repositories:
type: array
items:
type: string
archives:
type: array
items:
type: string
DriverSpec:
type: object
properties:
cores:
type: integer
format: int32
coreRequest:
type: string
coreLimit:
type: string
memory:
type: string
memoryOverhead:
type: string
image:
type: string
env:
type: array
items:
$ref: '#/components/schemas/EnvVar'
annotations:
type: object
additionalProperties:
type: string