forked from jenkinsci/pipeline-graph-view-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
646 lines (614 loc) · 17.8 KB
/
openapi.yaml
File metadata and controls
646 lines (614 loc) · 17.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
637
638
639
640
641
642
643
644
645
646
openapi: 3.1.0
info:
title: Jenkins Pipeline Graph View Plugin API
description: |
REST API for the Jenkins Pipeline Graph View Plugin. This plugin provides enhanced visualization
and interaction capabilities for Jenkins pipeline builds.
The plugin exposes two main sets of endpoints:
- Pipeline Overview APIs: For individual pipeline run details, console output, and build control
- Multi-Pipeline Graph APIs: For viewing multiple pipeline runs in aggregate
version: 1.0.0
contact:
name: Jenkins Pipeline Graph View Plugin
url: https://github.com/jenkinsci/pipeline-graph-view-plugin
license:
name: MIT License
url: https://opensource.org/licenses/MIT
servers:
- url: "{build_url}/pipeline-overview"
description: Pipeline Overview API - Individual pipeline run
variables:
build_url:
default: http://localhost:8080/jenkins/job/my-pipeline/1
description: Complete build URL including Jenkins server, job path, and build number
- url: "{job_url}/multi-pipeline-graph"
description: Multi-Pipeline Graph API - Multiple pipeline runs
variables:
job_url:
default: http://localhost:8080/jenkins/job/my-pipeline
description: Complete job URL including Jenkins server and job path
tags:
- name: Pipeline Overview
description: APIs for individual pipeline run visualization and control
- name: Multi-Pipeline Graph
description: APIs for viewing multiple pipeline runs
paths:
/tree:
get:
tags:
- Pipeline Overview
summary: Get pipeline stage tree
description: |
Returns the complete stage tree structure for the pipeline run, including all stages,
their states, timing information, and hierarchy.
operationId: getPipelineTree
responses:
"200":
description: Pipeline tree structure
headers:
Cache-Control:
description: Cache control header - immutable if complete, no-store if running
schema:
type: string
examples:
- "private, immutable, max-age=86400"
content:
application/json:
schema:
$ref: "#/components/schemas/PipelineTreeResponse"
"500":
description: Internal server error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/allSteps:
get:
tags:
- Pipeline Overview
summary: Get all pipeline steps
description: |
Returns all steps across all stages in the pipeline run. This endpoint reduces
the number of API calls needed by providing all step information at once.
operationId: getAllSteps
responses:
"200":
description: All pipeline steps
headers:
Cache-Control:
description: Cache control header - immutable if complete, no-store if running
schema:
type: string
content:
application/json:
schema:
$ref: "#/components/schemas/StepListResponse"
"500":
description: Internal server error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/steps:
get:
tags:
- Pipeline Overview
summary: Get steps for a specific node
description: |
Returns steps for a specific stage or node. This is a legacy endpoint
maintained for compatibility.
operationId: getStepsByNode
parameters:
- name: nodeId
in: query
required: true
description: The ID of the stage/node to get steps for
schema:
type: string
responses:
"200":
description: Steps for the specified node
content:
application/json:
schema:
$ref: "#/components/schemas/StepListResponse"
"400":
description: Missing or invalid nodeId parameter
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/exceptionText:
get:
tags:
- Pipeline Overview
summary: Get exception text of a failed step
description: |
Returns exception text of a specific failed step or stage.
operationId: getExceptionText
parameters:
- name: nodeId
in: query
required: true
description: The ID of the step/stage to get the exception text from
schema:
type: string
responses:
"200":
description: Exception text
content:
text/plain:
schema:
type: string
"400":
description: Missing or invalid parameters
content:
text/plain:
schema:
type: string
/log:
get:
tags:
- Pipeline Overview
summary: Get raw console text
description: |
Returns raw console text for a step or stage. For stages, returns concatenated
logs from all steps within the stage.
operationId: getConsoleText
parameters:
- name: nodeId
in: query
required: true
description: The ID of the step/stage to get console text for
schema:
type: string
responses:
"200":
description: Raw console text
content:
text/plain:
schema:
type: string
"400":
description: Missing nodeId parameter
/consoleBuildOutput:
get:
tags:
- Pipeline Overview
summary: Get full build console output
description: |
Returns the complete console output for the entire build in HTML format.
operationId: getBuildConsoleOutput
responses:
"200":
description: Full build console output in HTML
content:
text/html:
schema:
type: string
/nextBuild:
get:
tags:
- Pipeline Overview
summary: Check for next build
description: |
Checks if a build with the specified queue ID has started and returns
its URL if available.
operationId: hasNextBuild
parameters:
- name: queueId
in: query
required: true
description: Queue ID to check for started build
schema:
type: string
responses:
"200":
description: Next build information (empty if not found)
content:
application/json:
schema:
$ref: "#/components/schemas/NextBuildResponse"
"400":
description: Missing or invalid queueId
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/doRerun:
post:
tags:
- Pipeline Overview
summary: Rerun the pipeline
description: |
Reruns the pipeline using the Jenkins Replay Action feature with the same
script and parameters.
operationId: rerunPipeline
security:
- jenkins_auth: ["BUILD"]
responses:
"200":
description: Rerun scheduled successfully
content:
application/json:
schema:
$ref: "#/components/schemas/RerunResponse"
"403":
description: Insufficient permissions
"400":
description: Build cannot be rerun (not buildable)
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/doCancel:
post:
tags:
- Pipeline Overview
summary: Cancel the running pipeline
description: |
Cancels the currently running pipeline build.
operationId: cancelPipeline
security:
- jenkins_auth: ["CANCEL"]
responses:
"200":
description: Pipeline cancelled successfully
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
"403":
description: Insufficient permissions
"400":
description: Pipeline cannot be cancelled (not running)
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/runs:
get:
tags:
- Multi-Pipeline Graph
summary: Get recent pipeline runs
description: |
Returns information about recent pipeline runs for the job. Supports
ETags for efficient caching.
operationId: getPipelineRuns
parameters:
- name: If-None-Match
in: header
required: false
description: ETag value for conditional requests
schema:
type: string
responses:
"200":
description: List of recent pipeline runs
headers:
ETag:
description: ETag for caching
schema:
type: string
Cache-Control:
description: Cache control header
schema:
type: string
examples:
- "no-cache"
content:
application/json:
schema:
$ref: "#/components/schemas/PipelineRunsResponse"
"304":
description: Not modified (ETag match)
components:
securitySchemes:
jenkins_auth:
type: http
scheme: basic
description: Jenkins basic authentication
schemas:
PipelineTreeResponse:
type: object
properties:
status:
type: string
enum: [ok]
data:
$ref: "#/components/schemas/PipelineGraph"
PipelineGraph:
type: object
properties:
complete:
type: boolean
description: Whether the pipeline run is complete
stages:
type: array
items:
$ref: "#/components/schemas/PipelineStage"
PipelineStage:
type: object
properties:
id:
type: string
description: Unique identifier for the stage
name:
type: string
description: Display name of the stage
state:
$ref: "#/components/schemas/PipelineState"
type:
type: string
description: Type of the stage (e.g., "STAGE", "PARALLEL")
title:
type: string
description: Full title/description of the stage
pauseDurationMillis:
type: integer
format: int64
description: Duration in milliseconds the stage was paused
startTimeMillis:
type: integer
format: int64
description: Stage start time in milliseconds since epoch
totalDurationMillis:
types:
- integer
- null
format: int64
description: Total duration in milliseconds (null if still running)
waitingForInput:
type: boolean
description: Whether the stage is waiting for user input
children:
type: array
items:
$ref: "#/components/schemas/PipelineStage"
description: Child stages (for parallel or nested stages)
seqContainerName:
types:
- string
- null
description: Name of sequential container if applicable
nextSibling:
types:
- object
- null
$ref: "#/components/schemas/PipelineStage"
isSequential:
type: boolean
description: Whether this stage is sequential
synthetic:
type: boolean
description: Whether this is a synthetic stage
placeholder:
type: boolean
description: Whether this is a placeholder stage
agent:
types:
- string
- null
description: Agent information for the stage
url:
type: string
description: URL to view this stage in the UI
PipelineState:
type: string
enum:
- queued
- running
- paused
- skipped
- not_built
- finished
- success
- unstable
- failure
- unknown
- aborted
StepListResponse:
type: object
properties:
status:
type: string
enum: [ok]
data:
$ref: "#/components/schemas/StepList"
StepList:
type: object
properties:
steps:
type: array
items:
$ref: "#/components/schemas/PipelineStep"
runIsComplete:
type: boolean
description: Whether the pipeline run is complete
PipelineStep:
type: object
properties:
id:
type: string
description: Unique identifier for the step
name:
type: string
description: Display name of the step
state:
$ref: "#/components/schemas/PipelineState"
type:
type: string
description: Type of the step
title:
type: string
description: Full title/description of the step
pauseDurationMillis:
type: integer
format: int64
description: Duration in milliseconds the step was paused
startTimeMillis:
type: integer
format: int64
description: Step start time in milliseconds since epoch
totalDurationMillis:
types:
- integer
- null
format: int64
description: Total duration in milliseconds (null if still running)
stageId:
type: string
description: ID of the parent stage
inputStep:
types:
- object
- null
$ref: "#/components/schemas/InputStep"
InputStep:
type: object
properties:
message:
type: string
description: Input message displayed to user
cancel:
type: string
description: Cancel button text
id:
type: string
description: Input step ID
ok:
type: string
description: OK button text
parameters:
type: boolean
description: Whether the input step has parameters
NextBuildResponse:
type: object
properties:
status:
type: string
enum: [ok]
data:
type: object
properties:
nextBuildUrl:
type: string
description: URL of the next build (empty object if not found)
RerunResponse:
type: object
properties:
status:
type: string
enum: [ok]
data:
type: object
properties:
message:
type: string
description: Success message
queueId:
type: integer
format: int64
description: Queue ID of the scheduled rerun
PipelineRunsResponse:
type: object
properties:
status:
type: string
enum: [ok]
data:
type: array
items:
$ref: "#/components/schemas/PipelineRun"
PipelineRun:
type: object
properties:
id:
type: string
description: Unique run identifier
displayName:
type: string
description: Display name of the run
timestamp:
type: integer
format: int64
description: Run start timestamp in milliseconds since epoch
duration:
type: integer
format: int64
description: Run duration in milliseconds
changesCount:
type: integer
description: Number of changes in this run
result:
$ref: "#/components/schemas/PipelineState"
SuccessResponse:
type: object
properties:
status:
type: string
enum: [ok]
data:
type: object
ErrorResponse:
type: object
properties:
status:
type: string
enum: [error]
data:
type: object
properties:
error:
type: string
description: Error message
examples:
PipelineTreeExample:
summary: Example pipeline tree
value:
status: ok
data:
complete: true
stages:
- id: "6"
name: "Build"
state: "success"
type: "STAGE"
title: "Build"
pauseDurationMillis: 0
startTimeMillis: 1692024000000
totalDurationMillis: 30000
children: []
seqContainerName: null
nextSibling: null
isSequential: false
synthetic: false
placeholder: false
agent: "linux"
url: "/job/my-pipeline/1/pipeline-overview?selected-node=6"
StepListExample:
summary: Example step list
value:
status: ok
data:
steps:
- id: "7"
name: "Shell Script"
state: "success"
type: "STEP"
title: "sh"
pauseDurationMillis: 0
startTimeMillis: 1692024010000
totalDurationMillis: 5000
stageId: "6"
inputStep: null
runIsComplete: true
ConsoleOutputExample:
summary: Example console output
value:
status: ok
data:
text: "+ echo 'Hello World'\nHello World\n"
startByte: 0
endByte: 27
nodeIsActive: false