diff --git a/components/schemas/includes/IncludedPipelines.yml b/components/schemas/includes/IncludedPipelines.yml new file mode 100644 index 00000000..c7dc7c39 --- /dev/null +++ b/components/schemas/includes/IncludedPipelines.yml @@ -0,0 +1,6 @@ +title: IncludedPipelines +description: | + A map of pipelines, keyed by ID, included on endpoints that support it when passing the matching includes query parameter. +type: object +additionalProperties: + $ref: ../pipelines/Pipeline.yml diff --git a/components/schemas/includes/IncludedTriggerKeys.yml b/components/schemas/includes/IncludedTriggerKeys.yml new file mode 100644 index 00000000..c53078af --- /dev/null +++ b/components/schemas/includes/IncludedTriggerKeys.yml @@ -0,0 +1,6 @@ +title: IncludedTriggerKeys +description: | + A map of trigger keys, keyed by ID, included on endpoints that support it when passing the matching includes query parameter. +type: object +additionalProperties: + $ref: ../pipelines/trigger-keys/TriggerKey.yml diff --git a/components/schemas/pipelines/runs/PipelineRunIncludes.yml b/components/schemas/pipelines/runs/PipelineRunIncludes.yml new file mode 100644 index 00000000..2e104a0e --- /dev/null +++ b/components/schemas/pipelines/runs/PipelineRunIncludes.yml @@ -0,0 +1,10 @@ +title: PipelineRunIncludes +description: Resources related to a pipeline run, that can be included on supported endpoints when the matching includes query parameter is passed. +type: object +properties: + creators: + $ref: ../../../../components/schemas/includes/CreatorInclude.yml + pipelines: + $ref: ../../../../components/schemas/includes/IncludedPipelines.yml + keys: + $ref: ../../../../components/schemas/includes/IncludedTriggerKeys.yml diff --git a/platform/api.yml b/platform/api.yml index edc9d82b..45b7207c 100644 --- a/platform/api.yml +++ b/platform/api.yml @@ -692,6 +692,8 @@ paths: $ref: "./paths/pipelines/pipeline.yml" "/v1/pipelines/{pipelineId}/access": $ref: "./paths/pipelines/access.yml" + "/v1/pipelines/runs": + $ref: "./paths/pipelines/all-runs.yml" "/v1/pipelines/{pipelineId}/runs": $ref: "./paths/pipelines/runs.yml" "/v1/pipelines/{pipelineId}/runs/{runId}": diff --git a/platform/paths/pipelines/all-runs.yml b/platform/paths/pipelines/all-runs.yml new file mode 100644 index 00000000..2f9a2a37 --- /dev/null +++ b/platform/paths/pipelines/all-runs.yml @@ -0,0 +1,47 @@ +get: + operationId: "getAllPipelineRuns" + summary: List All Pipeline Runs + description: | + Lists all pipeline runs, regardless of the pipeline they are associated with. + + Requires the `pipelines-view` capability. + tags: + - Pipelines + parameters: + - $ref: ../../../components/parameters/PageParam.yml + - $ref: ../../../components/parameters/SortParam.yml + - name: include + in: query + required: false + description: + A comma separated list of include values. Included resources will show + up under the root document's `include` field, with the key being the id of the included + resource. In the case of applying an include to a collection of resources, if two + resources share the same include, it will only appear once in the return. + schema: + type: array + items: + type: string + enum: + - creators + - keys + - pipelines + responses: + 200: + description: Returns a list of pipeline runs. + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: ../../../components/schemas/pipelines/runs/PipelineRun.yml + includes: + $ref: ../../../components/schemas/pipelines/runs/PipelineRunIncludes.yml + + default: + $ref: ../../../components/responses/errors/DefaultError.yml diff --git a/platform/paths/pipelines/runs.yml b/platform/paths/pipelines/runs.yml index 1541fda2..3d4b255e 100644 --- a/platform/paths/pipelines/runs.yml +++ b/platform/paths/pipelines/runs.yml @@ -31,7 +31,7 @@ get: - creators responses: 200: - description: Returns a list of Pipeline runs. + description: Returns a list of pipeline runs. content: application/json: schema: