Skip to content

Latest commit

 

History

History
473 lines (338 loc) · 11 KB

rest-api-spec.md

File metadata and controls

473 lines (338 loc) · 11 KB

Tekton Results REST API Specification

NOTE: This documentation is only for refernce, please use Swaggar UI (or similar services) with link to the openapi spec to see complete information.

Version: v1alpha2

See Results API Documentation

/v1alpha2/parents/{parent}/results

GET

Summary

Get the list of the Results

Parameters
Name Required Schema
parent Yes parent
Responses
Code Description
200 Results List

/v1alpha2/parents/{parent}/results/{result_uid}/records/{record_uid}

GET

Summary

Get a record given the uid

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
record_uid Yes record_uid
Responses
Code Description
200 Record

POST

Summary

Create a record with given uid

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
record_uid Yes record_uid
Responses
Code Description
200 Record

DELETE

Summary

Delete a record given the uid

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
record_uid Yes record_uid
Responses
Code Description
200 {}

PATCH

Summary

Update a record with given uid

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
record_uid Yes record_uid
Responses
Code Description
200 Record

/v1alpha2/parents/{parent}/results/{result_uid}

GET

Summary

Get a single result given the UID

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
Responses
Code Description
200 Result

POST

Summary

Create a Result given data and UID

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
Responses
Code Description
200 Result

DELETE

Summary

Delete a particular result using UID

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
Responses
Code Description
200 {}

PATCH

Summary

Update result given the UID

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
Responses
Code Description
200 Result

/v1alpha2/parents/{parent}/results/{result_uid}/logs

GET

Summary

List Logs given the Result UID

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
Responses
Code Description
200 Logs List

/v1alpha2/parents/{parent}/results/{result_uid}/logs/{log_uid}

GET

Summary

Get a Log given UID

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
log_uid Yes log_uid
Responses
Code Description
200 Log

DELETE

Summary

Delete a log given the UID

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
log_uid Yes log_uid
Responses
Code Description
200 {}

/v1alpha2/parents/{parent}/results/{result_uid}/records

GET

Summary

Get list of records

Parameters
Name Required Schema
parent Yes parent
result_uid Yes result_uid
Responses
Code Description
200 Records List

Parameters Description

parent

Type Located in Description
string path Parent name refers to the namespace name or workspace name.

result_uid

Type Located in Description
string path Result UID is the server assigned identifier of the result.

record_uid

Type Located in Description
string path Record UID is the server assigned identifier of the Record.

logs_uid

Type Located in Description
string path It is an alias to the record uid denoting a log.

filter

Type Located in Description
string query Add a CEL Expression Filter. See here for reference.

page_size

Type Located in Description
integer query This query can be used for pagination.

page_token

Type Located in Description
string query This can be used to fetch a particular page when response are paginated.

order_by

Type Located in Description
string query This query can be used to order the response based on created_on or updated_on. See here for reference.

Responses Example

Result Response

{
  "name": "default/results/640d1af3-9c75-4167-8167-4d8e4f39d403",
  "id": "338481c9-3bc6-472f-9d1b-0f7705e6cb8c",
  "uid": "338481c9-3bc6-472f-9d1b-0f7705e6cb8c",
  "createdTime": "2023-03-02T07:26:48.972907Z",
  "createTime": "2023-03-02T07:26:48.972907Z",
  "updatedTime": "2023-03-02T07:26:54.191114Z",
  "updateTime": "2023-03-02T07:26:54.191114Z",
  "annotations": {},
  "etag": "338481c9-3bc6-472f-9d1b-0f7705e6cb8c-1677742014191114634",
  "summary": {
    "record": "default/results/640d1af3-9c75-4167-8167-4d8e4f39d403/records/640d1af3-9c75-4167-8167-4d8e4f39d403",
    "type": "tekton.dev/v1beta1.TaskRun",
    "startTime": null,
    "endTime": "2023-03-02T07:26:54Z",
    "status": "SUCCESS",
    "annotations": {}
  }
}

Results List Response

{
  "results": [
    {
      "name": "default/results/640d1af3-9c75-4167-8167-4d8e4f39d403",
      "id": "338481c9-3bc6-472f-9d1b-0f7705e6cb8c",
      "uid": "338481c9-3bc6-472f-9d1b-0f7705e6cb8c",
      "createdTime": "2023-03-02T07:26:48.972907Z",
      "createTime": "2023-03-02T07:26:48.972907Z",
      "updatedTime": "2023-03-02T07:26:54.191114Z",
      "updateTime": "2023-03-02T07:26:54.191114Z",
      "annotations": {},
      "etag": "338481c9-3bc6-472f-9d1b-0f7705e6cb8c-1677742014191114634",
      "summary": {
        "record": "default/results/640d1af3-9c75-4167-8167-4d8e4f39d403/records/640d1af3-9c75-4167-8167-4d8e4f39d403",
        "type": "tekton.dev/v1beta1.TaskRun",
        "startTime": null,
        "endTime": "2023-03-02T07:26:54Z",
        "status": "SUCCESS",
        "annotations": {}
      }
    },
    {
      "name": "default/results/c360def0-d77e-4a3f-a1b0-5b0753e7d5af",
      "id": "9514f318-9329-485b-871c-77a4a6904891",
      "uid": "9514f318-9329-485b-871c-77a4a6904891",
      "createdTime": "2023-03-02T07:28:05.535047Z",
      "createTime": "2023-03-02T07:28:05.535047Z",
      "updatedTime": "2023-03-02T07:28:10.308632Z",
      "updateTime": "2023-03-02T07:28:10.308632Z",
      "annotations": {},
      "etag": "9514f318-9329-485b-871c-77a4a6904891-1677742090308632274",
      "summary": {
        "record": "default/results/c360def0-d77e-4a3f-a1b0-5b0753e7d5af/records/c360def0-d77e-4a3f-a1b0-5b0753e7d5af",
        "type": "tekton.dev/v1beta1.TaskRun",
        "startTime": null,
        "endTime": "2023-03-02T07:28:10Z",
        "status": "SUCCESS",
        "annotations": {}
      }
    }
  ],
  "nextPageToken": ""
}

Record Response

{
  "name": "default/results/640d1af3-9c75-4167-8167-4d8e4f39d403/records/640d1af3-9c75-4167-8167-4d8e4f39d403",
  "id": "df3904b8-a6b8-468a-9e3f-8b9386bf3673",
  "uid": "df3904b8-a6b8-468a-9e3f-8b9386bf3673",
  "data": {
    "type": "tekton.dev/v1beta1.TaskRun",
    "value": "VGhpcyBpcyBhbiBleG1hcGxlIG9mIHJlY29yZCBkYXRhCg=="
  },
  "etag": "df3904b8-a6b8-468a-9e3f-8b9386bf3673-1677742019012643389",
  "createdTime": "2023-03-02T07:26:48.997424Z",
  "createTime": "2023-03-02T07:26:48.997424Z",
  "updatedTime": "2023-03-02T07:26:59.012643Z",
  "updateTime": "2023-03-02T07:26:59.012643Z"
}

Records List Response

{
  "records": [
    {
      "name": "default/results/640d1af3-9c75-4167-8167-4d8e4f39d403/records/640d1af3-9c75-4167-8167-4d8e4f39d403",
      "id": "df3904b8-a6b8-468a-9e3f-8b9386bf3673",
      "uid": "df3904b8-a6b8-468a-9e3f-8b9386bf3673",
      "data": {
        "type": "tekton.dev/v1beta1.TaskRun",
        "value": "VGhpcyBpcyBhbiBleG1hcGxlIG9mIHJlY29yZCBkYXRhCg==="
      },
      "etag": "df3904b8-a6b8-468a-9e3f-8b9386bf3673-1677742019012643389",
      "createdTime": "2023-03-02T07:26:48.997424Z",
      "createTime": "2023-03-02T07:26:48.997424Z",
      "updatedTime": "2023-03-02T07:26:59.012643Z",
      "updateTime": "2023-03-02T07:26:59.012643Z"
    },
    {
      "name": "default/results/640d1af3-9c75-4167-8167-4d8e4f39d403/records/77add742-5361-3b14-a1d3-2dae7e4977b2",
      "id": "62e52c4d-9a61-4cf0-8f88-e816fcb0f84a",
      "uid": "62e52c4d-9a61-4cf0-8f88-e816fcb0f84a",
      "data": {
        "type": "results.tekton.dev/v1alpha2.Log",
        "value": "VGhpcyBpcyBhbiBleG1hcGxlIG9mIHJlY29yZCBkYXRhCg=="
      },
      "etag": "62e52c4d-9a61-4cf0-8f88-e816fcb0f84a-1677742014245938484",
      "createdTime": "2023-03-02T07:26:54.220068Z",
      "createTime": "2023-03-02T07:26:54.220068Z",
      "updatedTime": "2023-03-02T07:26:54.245938Z",
      "updateTime": "2023-03-02T07:26:54.245938Z"
    }
  ],
  "nextPageToken": ""
}

Get Log Response

REST implementation of GetLog directly sends the bytes with content type "text/plain"

[prepare] 2023/10/09 11:30:04 Entrypoint initialization

[hello] hello

%!s(<nil>)