forked from tektoncd/results
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
756 lines (741 loc) · 24 KB
/
openapi.yaml
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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
# Copyright 2020 The Tekton Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
openapi: 3.0.0
info:
title: Tekton Results API Specification
version: v1alpha2
description: >-
Tekton Results aims to help users logically group CI/CD workload history and
separate out long term result storage away from the Pipeline controller.
This allows you to:
* Provide custom Result metadata about your CI/CD workflows not available in
the Tekton TaskRun/PipelineRun CRDs (for example: post-run actions)
* Group related workloads together (e.g. bundle related TaskRuns and
PipelineRuns into a single unit)
* Make long-term result history independent of the Pipeline CRD controller,
letting you free up etcd resources for Run execution.
This is the Tekton Results API documentation
termsOfService: https://github.com/tektoncd/results/blob/main/LICENSE
contact:
name: Tekton Community
url: https://github.com/tektoncd/community/blob/main/contact.md
email: tekton-dev@googlegroups.com
license:
name: Apache 2.0
url: https://github.com/tektoncd/results/blob/main/LICENSE
x-logo:
url: ""
servers:
- url: https://{server_url}/apis/results.tekton.dev
description: The common url format for tekton results API
variables:
server_url:
default: localhost:8080
description: URL of the API server
x-last-modified: 1677677605032
paths:
/v1alpha2/parents/{parent}/results:
summary: List Results
get:
tags:
- Results
responses:
"200":
$ref: "#/components/responses/ResultsList"
x-last-modified: 1677673623817
operationId: list_results_by_parent_name
summary: Get the list of the Results
description: >-
Results can be read across parents by specifying `-` as the `parent`.
This is useful for listing all results stored in the system without
prior knowledge about the available parents.
parameters:
- $ref: "#/components/parameters/parent"
name: parent
x-last-modified: 1677826043887
- $ref: "#/components/parameters/filter"
name: filter
x-last-modified: 1679484691871
- $ref: "#/components/parameters/page_token"
name: page_token
x-last-modified: 1679484706871
- $ref: "#/components/parameters/page_size"
name: page_size
x-last-modified: 1679484719471
- $ref: "#/components/parameters/order_by"
name: order_by
x-last-modified: 1679484733009
x-last-modified: 1677671948697
/v1alpha2/parents/{parent}/results/{result_uid}/records/{record_uid}:
summary: Create, delete or update records
get:
tags:
- Records
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Record"
description: Default response
operationId: get_record_by_uid
summary: Get a record given uid
description: ""
post:
requestBody:
description: The record to be created.
content:
application/json:
schema:
$ref: "#/components/schemas/Record"
required: true
tags:
- Records
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Record"
description: Default response
operationId: create_record_by_uid
summary: Create record with given uid
description: ""
delete:
tags:
- Records
responses:
"200":
content:
application/json:
schema:
description: ""
type: object
example: ""
example: ""
description: ""
x-last-modified: 1677760439227
operationId: delete_record_by_uid
summary: Delete record given the uid
description: ""
patch:
requestBody:
description: The record to be updated.
content:
application/json:
schema:
$ref: "#/components/schemas/Record"
required: true
tags:
- Records
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Record"
description: Default response
operationId: ""
summary: Update a record given the uid
description: ""
parameters:
- $ref: "#/components/parameters/parent"
name: parent
x-last-modified: 1677672324160
- $ref: "#/components/parameters/result_uid"
name: result_uid
x-last-modified: 1677672338019
- $ref: "#/components/parameters/record_uid"
name: record_uid
x-last-modified: 1677672352453
x-last-modified: 1677672432307
/v1alpha2/parents/{parent}/results/{result_uid}:
summary: Get, Create, Delete or update result
get:
tags:
- Results
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Result"
description: Default response
operationId: get_result_by_uid
summary: Get a single result given the UID
description: ""
post:
requestBody:
description: The result to be created
content:
application/json:
schema:
$ref: "#/components/schemas/Result"
required: true
tags:
- Results
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Result"
description: Default response
operationId: create_result_by_uid
summary: Create a Result given data and UID
description: ""
delete:
tags:
- Results
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Result"
example: ""
description: Default response
operationId: delete_result_by_uid
summary: Delete a particular result using UID
description: ""
patch:
requestBody:
description: The result to be updated.
content:
application/json:
schema:
$ref: "#/components/schemas/Result"
required: true
tags:
- Results
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Result"
description: Default response
operationId: update_result_by_uid
summary: Update result given the UID
description: ""
parameters:
- $ref: "#/components/parameters/parent"
name: parent
x-last-modified: 1677672496911
- $ref: "#/components/parameters/result_uid"
name: result_uid
x-last-modified: 1677672511792
x-last-modified: 1677672484697
/v1alpha2/parents/{parent}/results/{result_uid}/logs:
summary: List logs associated with a result
get:
tags:
- Logs
responses:
"200":
$ref: "#/components/responses/RecordsList"
x-last-modified: 1677673949442
operationId: list_logs_by_result_uid
summary: List Logs given the Result UID
description: >-
Logs can be read across Results by specifying `-` as the `result_uid` or
across parents by specifying `-` as the `parent`. (e.g.,
**default/results/-** or **-/results/-**). This can be used to read and
filter matching Logs without knowing the exact Result name.
parameters:
- $ref: "#/components/parameters/parent"
name: parent
x-last-modified: 1677672653795
- $ref: "#/components/parameters/result_uid"
name: result_uid
x-last-modified: 1677672667367
- $ref: "#/components/parameters/filter"
name: filter
x-last-modified: 1679485318262
- $ref: "#/components/parameters/page_size"
name: page_size
x-last-modified: 1679485331528
- $ref: "#/components/parameters/page_token"
name: page_token
x-last-modified: 1679485343811
- $ref: "#/components/parameters/order_by"
name: order_by
x-last-modified: 1679485356281
x-last-modified: 1677672632222
/v1alpha2/parents/{parent}/results/{result_uid}/logs/{log_uid}:
summary: Get or Delete Logs
get:
tags:
- Logs
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Log"
description: ""
x-last-modified: 1677676553132
operationId: get_log_by_uid
summary: Get a Log given UID
delete:
tags:
- Logs
responses:
"200":
content:
text/plain:
schema:
description: ""
type: object
example: ""
example: ""
description: ""
x-last-modified: 1677760513398
operationId: delete_log_by_uid
summary: Delete a log given the UID
parameters:
- $ref: "#/components/parameters/parent"
name: parent
x-last-modified: 1677672795198
- $ref: "#/components/parameters/result_uid"
name: result_uid
x-last-modified: 1677672810563
- $ref: "#/components/parameters/log_uid"
name: log_uid
x-last-modified: 1677672825675
x-last-modified: 1677774010236
/v1alpha2/parents/{parent}/results/{result_uid}/records:
summary: "Get list of records associated with a result "
get:
tags:
- Records
responses:
"200":
$ref: "#/components/responses/RecordsList"
x-last-modified: 1677828297346
operationId: get_records_by_results_uid
summary: Get list of records
description: >-
Records can be read across Results by specifying `-` as the `result_uid`
or across parents by specifying `-` as the `parent` . (e.g.,
**default/results/-** or **-/results/-**). This can be used to read and
filter matching Records without knowing the exact Result name.
parameters:
- $ref: "#/components/parameters/parent"
name: parent
x-last-modified: 1677828269940
- $ref: "#/components/parameters/result_uid"
name: result_uid
x-last-modified: 1677828284019
- $ref: "#/components/parameters/filter"
name: filter
x-last-modified: 1679484834694
- $ref: "#/components/parameters/order_by"
name: order_by
x-last-modified: 1679485370769
- $ref: "#/components/parameters/page_size"
name: page_size
x-last-modified: 1679485384718
- $ref: "#/components/parameters/page_token"
name: page_token
x-last-modified: 1679485400765
x-last-modified: 1677828254610
components:
schemas:
RecordType:
description: >-
It is unique identifier if the data type stored in the value. This is
used as a type to hint to determine how to unmarshal values. Limited to
128 characters. Currently RecordType can be one of the following:
* PipelineRun Record: `tekton.dev/v1beta1.PipelineRun`
* TaskRun Record: `tekton.dev/v1beta1.TaskRun`
* Log Record: `results.tekton.dev/v1alpha2.Log`
enum:
- tekton.dev/v1beta1.PipelineRun
- tekton.dev/v1beta1.TaskRun
- results.tekton.dev/v1alpha2.Log
type: string
x-last-modified: 1677762811698
Status:
description: "Completion status of the Record. "
enum:
- UNKNOWN
- SUCCESS
- FAILURE
- TIMEOUT
- CANCELLED
type: string
x-last-modified: 1677763193271
LogSummary:
description: Summary of the log properties.
required:
- record
- bytesRecieved
type: object
properties:
record:
description: the name of the Record this summary represents.
type: string
bytesReceived:
format: int64
description: Number of bytes received while streaming.
type: integer
x-last-modified: 1677768952407
Log:
description: Log is a chunk of a log.
required:
- contentType
- data
type: object
properties:
contentType:
description: Resource content type header for the log.
type: string
data:
format: byte
description: The log data as bytes.
type: string
x-last-modified: 1677768995130
RecordSummary:
description: >-
RecordSummary is a high level overview of a Record, typically
representing a "root" record for a result. It includes type agonstic
information so that UI's and other tools do not need to be aware of
underlying types.
required:
- record
- type
- status
- startTime
- endTime
type: object
properties:
record:
description: The name of the Record this summary represents.
type: string
example: >-
default/results/2be47d31-4d7f-4762-9616-969f2d7d9cc3/records/2be47d31-4d7f-4762-9616-969f2d7d9cc3
type:
description: Identifier of underlying data.
type: string
example: pipelines.tekton.dev/PipelineRun
status:
$ref: "#/components/schemas/Status"
startTime:
format: date-time
type: string
endTime:
format: date-time
type: string
annotations:
description: >-
Key-value pairs representing abitrary underlying record data that
clients want to include that aren't covered by the above fields.
type: object
x-last-modified: 1677769046145
Any:
description: Any represents lossely typed data to be stored within a Record.
required:
- value
- type
type: object
properties:
value:
format: byte
description: JSON encoded data.
type: string
example: VGhpcyBpcyBhbiBleG1hcGxlIG9mIHJlY29yZCBkYXRhCg==
type:
$ref: "#/components/schemas/RecordType"
type: object
x-last-modified: 1677769074438
Record:
description: >-
Record belonging to a Result. Typically will be Tekton
TaskRun/PipelineRun, but may also include other execution information
e.g alternative configs, DSLs, input payloads, post-execution actions
etc.
required:
- uid
- name
- data
type: object
properties:
id:
deprecated: true
description: "DEPRECATED: use uid instead."
type: string
uid:
description: Server assigned identifier of the Record.
type: string
example: bc19969d-14ef-483c-b8c7-a83523cb5669
etag:
description: >-
The etag for this record. If this is provided on update, it must
match the server's etag.
type: string
example: bc19969d-14ef-483c-b8c7-a83523cb5669-1675088191915705326
name:
description: Resource name, must be rooted in parent result
type: string
example: >-
default/results/2be47d31-4d7f-4762-9616-969f2d7d9cc3/records/293d2bf0-e673-30c6-b5ca-4f35f020effc
createdTime:
deprecated: true
format: date-time
description: "DEPRECATED: use createTime instead."
type: string
createTime:
format: date-time
description: Server assigned timestamp for when the record was created.
type: string
updatedTime:
deprecated: true
format: date-time
description: "DEPRECATED: use updateTime instead."
type: string
updateTime:
format: date-time
description: Server assigned timestamp for when the record was updated.
type: string
data:
$ref: "#/components/schemas/Any"
x-last-modified: 1677769164720
Result:
description: >-
Results are aggregators of Records, allowing users to refer to groups of
Records as a single entity.
required:
- uid
- name
type: object
properties:
annotations:
description: Arbitrary user provided labels for the result.
type: object
uid:
description: "server assigned identified of the Results "
type: string
example: 0e0536c1-eccc-4727-9f99-5bb26ce3db90
name:
description: User assigned identifier of the Result. Encodes Parent information.
type: string
example: default/results/2be47d31-4d7f-4762-9616-969f2d7d9cc3
summary:
$ref: "#/components/schemas/RecordSummary"
description: >-
High level overview of the root record for the Result. This is
provided as a convinence for clients to query Record state without
needing to make multiple calls to fetch the underlying Records.
createdTime:
deprecated: true
format: date-time
description: "DEPRECATED: Use createTime instead"
type: string
createTime:
format: date-time
description: Server assigned timestamp for when the result was created.
type: string
updatedTime:
deprecated: true
format: date-time
description: "DEPRECATED: Use updateTime instead"
type: string
updateTime:
format: date-time
description: Server assigned timestamp for when the result was updated.
type: string
id:
deprecated: true
description: "DEPRECATED: use uid instead"
type: string
example: 0e0536c1-eccc-4727-9f99-5bb26ce3db90
etag:
description: >-
This is etag for Results. If this is provided on update, it must
match the server's etag.
type: string
example: 0e0536c1-eccc-4727-9f99-5bb26ce3db90-1675088191880127798
x-last-modified: 1677769213630
responses:
ResultsList:
content:
application/json:
schema:
description: List of Results with nextPageToken
required:
- results
- nextPageToken
type: object
properties:
results:
type: array
items:
$ref: "#/components/schemas/Result"
nextPageToken:
type: string
description: List of Results with nextPageToken
x-last-modified: 1677674976067
RecordsList:
content:
application/json:
schema:
description: List of Records with nextPageToken.
required:
- nextPageToken
- records
type: object
properties:
records:
type: array
items:
$ref: "#/components/schemas/Record"
nextPageToken:
type: string
description: List of Records with nextPageToken.
x-last-modified: 1677674985612
parameters:
page_token:
deprecated: false
name: page_token
description: >-
It can be used to fetch the next set of responses when the response is
paginated. It corresponds to `NextPageToken` in the response.
schema:
type: string
in: query
required: false
allowEmptyValue: false
x-last-modified: 1679485085921
page_size:
deprecated: false
name: page_size
description: >-
Number of response to fetch in one request. This query can be used for
pagination.
schema:
type: integer
in: query
required: false
allowEmptyValue: false
x-last-modified: 1679485107020
log_uid:
deprecated: false
name: log_uid
description: It is an alias to the record uid denoting a log.
schema:
format: uuid
type: string
in: path
required: true
x-last-modified: 1679485114681
record_uid:
deprecated: false
name: record_uid
description: Record UID is the server assigned identifier of the Record.
schema:
format: uuid
type: string
in: path
required: true
x-last-modified: 1679485126722
result_uid:
deprecated: false
name: result_uid
description: Result UID is the server assigned identifier of the result.
schema:
format: uuid
type: string
in: path
required: true
x-last-modified: 1679485137131
parent:
deprecated: false
name: parent
description: Parent name refers to the namespace name or workspace name.
schema:
type: string
in: path
required: true
x-last-modified: 1679485145042
filter:
deprecated: false
name: filter
description: >-
This query can be used to pass CEL Expressions to filter the response.
See more details
[here](https://github.com/tektoncd/results/tree/main/docs/api#filtering).
schema:
type: string
externalDocs:
url: https://github.com/tektoncd/results/tree/main/docs/api#filtering
in: query
required: false
allowEmptyValue: false
x-last-modified: 1679485842876
order_by:
deprecated: false
name: order_by
description: >-
This query can be used to order the response based on parameters. More
details can be found
[here](https://github.com/tektoncd/results/tree/main/docs/api#ordering).
Note: Add `%20` instead of space when adding an optional direction
qualifier, e.g `created_by%20asc`.
schema:
type: string
externalDocs:
url: https://github.com/tektoncd/results/tree/main/docs/api#ordering
in: query
required: false
allowEmptyValue: false
x-last-modified: 1679489217285
securitySchemes:
BasicAuth:
scheme: bearer
type: http
description: |-
Example:
> Authorization: Bearer ZGVtbzpwQDU1dzByZA ==
x-last-modified: 1677672932761
headers: {}
security:
- BasicAuth: []
tags:
- name: Records
description: >-
Records are individual instances of data. These will commonly be execution
data (e.g. PipelineRun, TaskRuns, Logs), but could also reference
additional data about the event/execution. Records are intended to be
flexible to support arbitrary information tools want to provide around a
CI event.
externalDocs:
url: https://github.com/tektoncd/results#data-model
x-last-modified: 1677767456366
- name: Logs
description: "Logs is a type of Record. "
x-last-modified: 1677767481655
- name: Results
description: >
Results are aggregators of Records, allowing users to refer to groups of
Records as a single entity. For example, you might have a single Result
that groups the following Records:
* Source Event (e.g. pull request, push) that kicked off the action.
* The PipelineRun that occurred.
* The TaskRuns that occurred in response of the PipelineRun (one per Task).
* Receipt of Cloud Event delivery.
* Receipt of Source status update.
externalDocs:
url: https://github.com/tektoncd/results#data-model
x-last-modified: 1677767734084
externalDocs:
description: See Results API Documentation
url: https://github.com/tektoncd/results/tree/main/docs/api