openapi: 3.0.1

info:
  title: Testkube API
  description: "Testkube provides a Kubernetes-native framework for test definition, execution and results"
  contact:
    email: testkube@kubeshop.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0

externalDocs:
  description: "Find out more about Testkube"
  url: https://testkube.kubeshop.io/

tags:
  - name: api
    description: "Testkube API operations"
  - name: tests
    description: "Tests operations"
  - name: executions
    description: "Test suites and tests execution operations"
  - name: test-suites
    description: "Test suites orchestration operations"
  - name: labels
    description: "Listing all available labels"
  - name: artifacts
    description: "Artifact operations"
  - name: logs
    description: "Log operations"
  - name: executor
    description: "Executor operations"
  - name: webhook
    description: "Webhook operations"
  - name: webhook-templates
    description: "Webhook template operations"
  - name: test-triggers
    description: "Test Triggers CRUD operations"
  - name: keymap
    description: "Keymap for fields in a form"

paths:
  /keymap/triggers:
    get:
      tags:
        - keymap
        - api
      summary: Test triggers keymap
      description: Returns a keymap (supported/allowed fields) for the test trigger UI screen
      operationId: getKeyMap
      responses:
        200:
          description: successful get operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestTriggerKeyMap"

  /triggers:
    get:
      tags:
        - test-triggers
        - api
      parameters:
        - $ref: "#/components/parameters/Namespace"
        - $ref: "#/components/parameters/Selector"
      summary: List test triggers
      description: List test triggers from the kubernetes cluster
      operationId: listTestTriggers
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestTrigger"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    post:
      tags:
        - test-triggers
        - api
      summary: "Create new test trigger"
      description: "Create new test trigger CRD inside a Kubernetes cluster"
      operationId: createTestTrigger
      requestBody:
        description: test trigger body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestTriggerUpsertRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestTrigger"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with test trigger definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    patch:
      tags:
        - test-triggers
        - api
      summary: "Bulk update test triggers"
      description: "Updates test triggers provided as an array in the request body"
      operationId: bulkUpdateTestTriggers
      requestBody:
        description: array of test trigger upsert requests
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/TestTriggerUpsertRequest"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestTrigger"
        400:
          description: "problem with test trigger definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    delete:
      tags:
        - test-triggers
        - api
      summary: "Delete test triggers"
      description: "Deletes all or labeled test triggers"
      operationId: deleteTestTriggers
      parameters:
        - $ref: "#/components/parameters/Namespace"
        - $ref: "#/components/parameters/Selector"
      responses:
        204:
          description: "no content"
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test trigger not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /triggers/{id}:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/Namespace"
      tags:
        - test-triggers
        - api
      summary: Get test trigger by ID
      description: Get test trigger by ID from CRD in kubernetes cluster
      operationId: getTestTriggerByID
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestTrigger"
            text/yaml:
              schema:
                type: string
        404:
          description: "test trigger not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/Namespace"
      tags:
        - test-triggers
        - api
      summary: "Update test trigger"
      description: "Update test trigger"
      operationId: updateTestTrigger
      requestBody:
        description: test trigger upsert request
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestTriggerUpsertRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestTrigger"
        400:
          description: "problem with test trigger definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test trigger not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    delete:
      tags:
        - test-triggers
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/Namespace"
      summary: Delete test trigger
      description: Deletes a test trigger
      operationId: deleteTestTrigger
      responses:
        204:
          description: "no content"
        404:
          description: "test trigger not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suites:
    post:
      tags:
        - test-suites
        - api
      summary: "Create new test suite"
      description: "Create new test suite action"
      operationId: createTestSuite
      requestBody:
        description: test details body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestSuiteUpsertRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            text/yaml:
              schema:
                type: string
        201:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuite"
        400:
          description: "problem with test suite definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    get:
      tags:
        - test-suites
        - api
      summary: "Get all test suites"
      description: "Returns array of test suites"
      operationId: listTestSuites
      parameters:
        - $ref: "#/components/parameters/Selector"
        - $ref: "#/components/parameters/TextSearch"
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestSuite"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with listing test suites from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - test-suites
        - api
      summary: "Delete test suites"
      description: "Deletes all or labeled test suites"
      operationId: deleteTestSuites
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        204:
          description: "no content"
        404:
          description: "test suite not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suites/{id}:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - test-suites
        - api
      summary: "Get test suite by ID"
      description: "Returns test suite with given name"
      operationId: getTestSuiteByID
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuite"
            text/yaml:
              schema:
                type: string
        404:
          description: "test suite not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "could not get execution result from the database"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - test-suites
        - api
      summary: "Update test suite"
      description: "Update test based on test suite content or git based data"
      operationId: updateTestSuite
      requestBody:
        description: test suite details body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestSuiteUpdateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuite"
        400:
          description: "problem with test suite definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test suite not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    delete:
      tags:
        - test-suites
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/SkipDeleteCRD"
      summary: "Delete test suite"
      description: "Deletes a test suite"
      operationId: deleteTestSuite
      responses:
        204:
          description: "no content"
        404:
          description: "test suite not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suites/{id}/metrics:
    get:
      tags:
        - tests
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/LastNDays"
        - $ref: "#/components/parameters/Limit"
      summary: "Get test suite metrics"
      description: "Gets test suite metrics for given tests executions, with particular execution status and timings"
      operationId: getTestSuiteMetrics
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutionsMetrics"
        500:
          description: "problem with read information from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suites/{id}/tests:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - test-suites
        - api
      summary: "List tests for test suite"
      description: "List available tests for test suite"
      operationId: listTestSuiteTests
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Test"
            text/yaml:
              schema:
                type: string
        404:
          description: "test suite not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suites/{id}/abort:
    post:
      tags:
        - test-suites
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: "Abort all executions of a test suite"
      description: "Abort all test executions of a test suite"
      operationId: abortTestSuiteExecutions
      responses:
        204:
          description: "no content"
        404:
          description: "no execution found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with aborting test suite execution"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suite-with-executions:
    get:
      tags:
        - test-suites
        - api
      summary: "Get all test suite with executions"
      description: "Returns array of test suite with executions"
      operationId: listTestSuiteWithExecutions
      parameters:
        - $ref: "#/components/parameters/Selector"
        - $ref: "#/components/parameters/TextSearch"
        - $ref: "#/components/parameters/TestExecutionsStatusFilter"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageIndex"
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestSuiteWithExecutionSummary"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting test suite with executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with getting test suite from Kubernetes clusteer"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suite-with-executions/{id}:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - test-suites
        - api
      summary: "Get test suite by ID with execution"
      description: "Returns test suite with given name with execution"
      operationId: getTestSuiteByIDWithExecution
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuiteWithExecution"
            text/yaml:
              schema:
                type: string
        500:
          description: "problem with getting test suite with execution from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suites/{id}/executions:
    post:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/Namespace"
        - $ref: "#/components/parameters/LastNDays"
        - $ref: "#/components/parameters/TestSuiteExecutionName"
      tags:
        - api
        - test-suites
        - executions
      summary: "Starts new test suite execution"
      description: "New test suite execution returns new execution details on successful execution start"
      operationId: executeTestSuite
      requestBody:
        description: body passed to configure execution
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestSuiteExecutionRequest"
      responses:
        201:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuiteExecutionsResult"
        400:
          description: "problem with request body"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test suite not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with test suite execution"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    get:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageIndex"
        - $ref: "#/components/parameters/TestExecutionsStatusFilter"
        - $ref: "#/components/parameters/StartDateFilter"
        - $ref: "#/components/parameters/EndDateFilter"
      tags:
        - api
        - test-suites
        - executions
      summary: "Get all test suite executions"
      description: "Returns array of all available test suite executions"
      operationId: listTestSuiteExecutions
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuiteExecutionsResult"
        500:
          description: "problem with getting test suite executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suites/{id}/executions/{executionID}:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/executionID"
      tags:
        - api
        - test-suites
        - executions
      summary: "Get test suite execution"
      description: "Returns test suite execution with given executionID"
      operationId: getTestSuiteExecution
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuiteExecution"
        404:
          description: "test not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting test suite executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with Kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/executionID"
      tags:
        - api
        - test-suites
        - executions
      summary: "Aborts testsuite execution"
      description: "Aborts testsuite execution with given executionID"
      operationId: abortTestSuiteExecution
      responses:
        204:
          description: "no content"
        404:
          description: "test suite not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with read information from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suites/{id}/executions/{executionID}/artifacts:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/executionID"
      tags:
        - api
        - test-suites
        - executions
      summary: "Get test suite execution artifacts"
      description: "Returns test suite execution artifacts with given executionID"
      operationId: getTestSuiteExecutionArtifactsByTestsuite
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Artifact"
        404:
          description: "test suite not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting test suite executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suite-executions:
    post:
      parameters:
        - $ref: "#/components/parameters/Namespace"
        - $ref: "#/components/parameters/Selector"
        - $ref: "#/components/parameters/ConcurrencyLevel"
      tags:
        - api
        - test-suites
        - executions
      summary: "Starts new test suite executions"
      description: "New test suite executions returns new executions details on successful executions start"
      operationId: executeTestSuites
      requestBody:
        description: body passed to configure executions
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestSuiteExecutionRequest"
      responses:
        201:
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestSuiteExecutionsResult"
        400:
          description: "problem with request body"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with test suites executions"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    get:
      tags:
        - executions
        - api
      summary: "Get all test suite executions"
      description: "Returns array of test suite executions"
      operationId: listAllTestSuiteExecutions
      parameters:
        - $ref: "#/components/parameters/LastNDays"
        - $ref: "#/components/parameters/TestName"
        - $ref: "#/components/parameters/TextSearch"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageIndex"
        - $ref: "#/components/parameters/TestExecutionsStatusFilter"
        - $ref: "#/components/parameters/StartDateFilter"
        - $ref: "#/components/parameters/EndDateFilter"
        - $ref: "#/components/parameters/Selector"
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuiteExecutionsResult"
        500:
          description: "problem with getting test suite executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-suite-executions/{executionID}:
    get:
      parameters:
        - $ref: "#/components/parameters/executionID"
        - $ref: "#/components/parameters/LastNDays"
      tags:
        - executions
        - api
      summary: "Get test suite execution by ID"
      description: "Returns test suite execution with given executionID"
      operationId: getTestSuiteExecutionByID
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSuiteExecution"
        500:
          description: "problem with getting test suite execution from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    patch:
      parameters:
        - $ref: "#/components/parameters/executionID"
      tags:
        - api
        - executions
      summary: "Aborts testsuite execution"
      description: "Aborts testsuite execution with given executionID"
      operationId: abortTestSuiteExecutionByID
      responses:
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        204:
          description: "no content"

  /test-suite-executions/{executionID}/artifacts:
    get:
      parameters:
        - $ref: "#/components/parameters/executionID"
      tags:
        - api
        - test-suites
        - executions
      summary: "Get test suite execution artifacts"
      description: "Returns test suite execution artifacts with given executionID"
      operationId: getTestSuiteExecutionArtifacts
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Artifact"
        500:
          description: "problem with getting test suite executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executions:
    post:
      parameters:
        - $ref: "#/components/parameters/Namespace"
        - $ref: "#/components/parameters/Selector"
        - $ref: "#/components/parameters/ExecutionSelector"
        - $ref: "#/components/parameters/ConcurrencyLevel"
      tags:
        - api
        - tests
        - executions
      summary: "Starts new test executions"
      description: "New test executions returns new executions details on successful executions start"
      operationId: executeTests
      requestBody:
        description: body passed to configure executions
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExecutionRequest"
      responses:
        201:
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ExecutionResult"
        400:
          description: "problem with request body"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with test executions"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    get:
      tags:
        - executions
        - api
      summary: "Get all test executions"
      description: "Returns array of test executions"
      operationId: listExecutions
      parameters:
        - $ref: "#/components/parameters/TestName"
        - $ref: "#/components/parameters/Type"
        - $ref: "#/components/parameters/TextSearch"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageIndex"
        - $ref: "#/components/parameters/ExecutionsStatusFilter"
        - $ref: "#/components/parameters/StartDateFilter"
        - $ref: "#/components/parameters/EndDateFilter"
        - $ref: "#/components/parameters/Selector"
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutionsResult"
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting test executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executions/{executionID}:
    get:
      parameters:
        - $ref: "#/components/parameters/executionID"
      tags:
        - executions
        - api
      summary: "Get test execution by ID"
      description: "Returns execution with given executionID"
      operationId: getExecutionByID
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Execution"
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting test executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with reading secrets from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executions/{id}/artifacts:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - artifacts
        - executions
        - api
      summary: "Get execution's artifacts by ID"
      description: "Returns artifacts of the given executionID"
      operationId: getExecutionArtifacts
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Artifact"
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting execution's artifacts from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executions/{id}/logs:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - logs
        - executions
        - api
      summary: "Get execution's logs by ID"
      description: "Returns logs of the given executionID"
      operationId: getExecutionLogs
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ExecutorOutput"
        500:
          description: "problem with getting execution's logs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executions/{id}/logs/v2:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - logs
        - executions
        - api
      summary: "Get execution's logs by ID version 2"
      description: "Returns logs of the given executionID version 2"
      operationId: getExecutionLogsV2
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/LogV2"
        500:
          description: "problem with getting execution's logs version 2"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executions/{id}/artifacts/{filename}:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/Filename"
      tags:
        - artifacts
        - executions
        - api
      summary: "Download artifact"
      description: "Download the artifact file from the given execution"
      operationId: downloadFile
      responses:
        200:
          description: "successful operation"
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting artifacts from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executions/{id}/artifact-archive:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/Mask"
      tags:
        - artifacts
        - executions
        - api
      summary: "Download artifact archive"
      description: "Download the artifact archive from the given execution"
      operationId: downloadArchive
      responses:
        200:
          description: "successful operation"
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting artifact archive from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /tests:
    get:
      tags:
        - tests
        - api
      summary: "List tests"
      description: "List available tests"
      operationId: listTests
      parameters:
        - $ref: "#/components/parameters/Selector"
        - $ref: "#/components/parameters/TextSearch"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Test"
            text/yaml:
              schema:
                type: string
        400:
          description: "invalid parameters"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - tests
        - api
      summary: "Create new test"
      description: "Create new test based on file content, uri or git based data"
      operationId: createTest
      requestBody:
        description: test details body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestUpsertRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            text/yaml:
              schema:
                type: string
        201:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Test"
        400:
          description: "problem with test definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - tests
        - api
      summary: "Delete tests"
      description: "Deletes all or labeled tests"
      operationId: deleteTests
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        204:
          description: "no content"
        404:
          description: "no tests found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with deleting tests and their executions"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /tests/{id}:
    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - tests
        - api
      summary: "Update test"
      description: "Update test based on test content or git based data"
      operationId: updateTest
      requestBody:
        description: test details body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestUpdateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Test"
        400:
          description: "problem with test definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    get:
      tags:
        - tests
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: "Get test"
      description: "Gets the specified test"
      operationId: getTest
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Test"
            text/yaml:
              schema:
                type: string
        400:
          description: "invalid parameters"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - tests
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/SkipDeleteExecutions"
        - $ref: "#/components/parameters/SkipDeleteCRD"
      summary: "Delete test"
      description: "Deletes a test"
      operationId: deleteTest
      responses:
        204:
          description: "no content"
        404:
          description: "no tests found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with deleting test and its executions"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /tests/{id}/abort:
    post:
      tags:
        - tests
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: "Abort all executions of a test"
      description: "Abort all test executions"
      operationId: abortTestExecutions
      responses:
        204:
          description: "no content"
        404:
          description: "no execution found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with aborting test execution"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /tests/{id}/metrics:
    get:
      tags:
        - tests
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/LastNDays"
        - $ref: "#/components/parameters/Limit"
      summary: "Get test metrics"
      description: "Gets test metrics for given tests executions, with particular execution status and timings"
      operationId: getTestMetrics
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutionsMetrics"
        500:
          description: "problem with getting metrics"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-with-executions:
    get:
      tags:
        - tests
        - api
      summary: "List test with executions"
      description: "List available test with executions"
      operationId: listTestWithExecutions
      parameters:
        - $ref: "#/components/parameters/Selector"
        - $ref: "#/components/parameters/TextSearch"
        - $ref: "#/components/parameters/ExecutionsStatusFilter"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageIndex"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWithExecutionSummary"
            text/yaml:
              schema:
                type: string
        400:
          description: "invalid parameters"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting tests and their executions"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-with-executions/{id}:
    get:
      tags:
        - tests
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: "Get test with execution"
      description: "Gets the specified test with execution"
      operationId: getTestWithExecution
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWithExecution"
            text/yaml:
              schema:
                type: string
        400:
          description: "invalid parameters"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "no tests found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting tests and their executions"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /tests/{id}/executions:
    post:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/Namespace"
        - $ref: "#/components/parameters/TestExecutionName"
      tags:
        - api
        - tests
        - executions
      summary: "Starts new test execution"
      description: "New test execution returns new execution details on successful execution start"
      operationId: executeTest
      requestBody:
        description: body passed to configure execution
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExecutionRequest"
      responses:
        201:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutionResult"
        400:
          description: "problem with request body"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with test execution"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/LastNDays"
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageIndex"
        - $ref: "#/components/parameters/ExecutionsStatusFilter"
        - $ref: "#/components/parameters/StartDateFilter"
        - $ref: "#/components/parameters/EndDateFilter"
      tags:
        - api
        - tests
        - executions
      summary: "Get all test executions"
      description: "Returns array of all available test executions"
      operationId: listTestExecutions
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutionsResult"
        404:
          description: "test or execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting test executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /tests/{id}/executions/{executionID}:
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/executionID"
      tags:
        - api
        - tests
        - executions
      summary: "Get test execution"
      description: "Returns execution with given executionID"
      operationId: getTestExecution
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Execution"
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting test executions from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with reading secrets from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/executionID"
      tags:
        - api
        - tests
        - executions
      summary: "Aborts execution"
      description: "Aborts execution with given executionID"
      operationId: abortExecution
      responses:
        204:
          description: "no content"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /executors:
    get:
      tags:
        - executor
        - api
      summary: "List executors"
      description: "List executors available in cluster"
      operationId: listExecutors
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Executor"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - executor
        - api
      summary: "Create new executor"
      description: "Create new executor based on variables passed in request"
      operationId: createExecutor
      requestBody:
        description: executor request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExecutorUpsertRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            text/yaml:
              schema:
                type: string
        201:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutorDetails"
        400:
          description: "problem with executor definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - executor
        - api
      summary: "Delete executors"
      description: "Deletes labeled executors"
      operationId: deleteExecutors
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        204:
          description: "no content"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executors/{id}:
    delete:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - executor
      summary: "Delete executor"
      description: "Deletes executor by its name"
      operationId: deleteExecutor
      responses:
        204:
          description: executor deleted successfuly
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - executor
      summary: "Get executor details"
      description: "Returns executors data with executions passed to executor"
      operationId: getExecutor
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutorDetails"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting executor data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - executor
        - api
      summary: "Update executor"
      description: "Update new executor based on variables passed in request"
      operationId: updateExecutor
      requestBody:
        description: executor request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExecutorUpdateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutorDetails"
        400:
          description: "problem with executor definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "executor not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /executor-by-types:
    get:
      parameters:
        - $ref: "#/components/parameters/TestType"
      tags:
        - api
        - executor
      summary: "Get executor details by type"
      description: "Returns executors data with executions passed to executor"
      operationId: getExecutorByType
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutorDetails"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting executor data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /labels:
    get:
      tags:
        - labels
      summary: "List labels"
      description: "list all available labels"
      operationId: listLabels
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  app:
                    - backend
                  env:
                    - prod
                  toDelete:
                    - "yes"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /tags:
    get:
      tags:
        - tags
      summary: "List tags"
      description: "list all available tags"
      operationId: listTags
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  app:
                    - backend
                  env:
                    - prod
                  toDelete:
                    - "yes"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /webhooks:
    get:
      tags:
        - webhook
        - api
      summary: "List webhooks"
      description: "List webhooks available in cluster"
      operationId: listWebhooks
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Webhook"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - webhook
        - api
      summary: "Create new webhook"
      description: "Create new webhook based on variables passed in request"
      operationId: createWebhook
      requestBody:
        description: webhook request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookCreateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            text/yaml:
              schema:
                type: string
        201:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
        400:
          description: "problem with webhook definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - webhook
        - api
      summary: "Delete webhooks"
      description: "Deletes labeled webhooks"
      operationId: deleteWebhooks
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        204:
          description: "no content"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /webhooks/{id}:
    delete:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - webhook
      summary: "Delete webhook"
      description: "Deletes webhook by its name"
      operationId: deleteWebhook
      responses:
        204:
          description: webhook deleted successfuly
        404:
          description: "webhook not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - webhook
      summary: "Get webhook details"
      description: "Returns webhook"
      operationId: getWebhook
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "webhook not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting webhook data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - webhook
        - api
      summary: "Update new webhook"
      description: "Update new webhook based on variables passed in request"
      operationId: updateWebhook
      requestBody:
        description: webhook request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookUpdateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
        400:
          description: "problem with webhook definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "webhook not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /webhook-templates:
    get:
      tags:
        - webhook-template
        - api
      summary: "List webhook templates"
      description: "List webhook templates available in cluster"
      operationId: listWebhookTemplates
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WebhookTemplate"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - webhook-template
        - api
      summary: "Create new webhook template"
      description: "Create new webhook template based on variables passed in request"
      operationId: createWebhookTemplate
      requestBody:
        description: webhook template request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookTemplateCreateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            text/yaml:
              schema:
                type: string
        201:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplate"
        400:
          description: "problem with webhook template definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - webhook-template
        - api
      summary: "Delete webhook templates"
      description: "Deletes labeled webhook templates"
      operationId: deleteWebhookTemplates
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        204:
          description: "no content"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /webhook-templates/{id}:
    delete:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - webhook-template
      summary: "Delete webhook template"
      description: "Deletes webhook template by its name"
      operationId: deleteWebhookTemplate
      responses:
        204:
          description: webhook template deleted successfuly
        404:
          description: "webhook template not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - webhook-template
      summary: "Get webhook template details"
      description: "Returns webhook template"
      operationId: getWebhookTemplate
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplate"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "webhook template not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting webhook template data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - webhook-template
        - api
      summary: "Update new webhook template"
      description: "Update new webhook template based on variables passed in request"
      operationId: updateWebhookTemplate
      requestBody:
        description: webhook template request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookTemplateUpdateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplate"
        400:
          description: "problem with webhook template definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "webhook template not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /templates:
    get:
      tags:
        - templates
        - api
      summary: "List templates"
      description: "List templates available in cluster"
      operationId: listTemplates
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Template"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - template
        - api
      summary: "Create new template"
      description: "Create new template based on variables passed in request"
      operationId: createTemplate
      requestBody:
        description: template request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TemplateCreateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            text/yaml:
              schema:
                type: string
        201:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Template"
        400:
          description: "problem with template definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - template
        - api
      summary: "Delete templates"
      description: "Deletes labeled templates"
      operationId: deleteTemplates
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        204:
          description: "no content"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /templates/{id}:
    delete:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - template
      summary: "Delete template"
      description: "Deletes template by its name"
      operationId: deleteTemplate
      responses:
        204:
          description: template deleted successfuly
        404:
          description: "template not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - template
      summary: "Get template details"
      description: "Returns template"
      operationId: getTemplate
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Template"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "template not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting template data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - template
        - api
      summary: "Update new template"
      description: "Update new template based on variables passed in request"
      operationId: updateTemplate
      requestBody:
        description: template request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TemplateUpdateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Template"
        400:
          description: "problem with template definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "template not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /config:
    patch:
      tags:
        - api
      summary: "Update config"
      description: "Updates config in cluster storage state"
      operationId: updateConfigKey
      requestBody:
        description: config request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Config"
      responses:
        200:
          description: update successful
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Config"
        400:
          description: "problem with input"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "config not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with updating key in cluster storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    get:
      tags:
        - api
      summary: "Get config"
      description: "Get config from cluster storage state"
      operationId: getConfig
      responses:
        200:
          description: get successful
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Config"
        404:
          description: "config not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting config from cluster storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /debug:
    get:
      tags:
        - api
      summary: "Get debug information"
      description: "Gets information that is needed for debugging and opening Testkube bug reports"
      operationId: getDebugInfo
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DebugInfo"
        500:
          description: "problem with getting execution logs from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with getting debug information from the Kuberenetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-sources:
    get:
      tags:
        - test-sources
        - api
      summary: "List test sources"
      description: "List test sources available in cluster"
      operationId: listTestSources
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestSource"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - test-sources
        - api
      summary: "Create new test source"
      description: "Create new test source based on variables passed in request"
      operationId: createTestSource
      requestBody:
        description: test source request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestSourceUpsertRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            text/yaml:
              schema:
                type: string
        201:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSource"
        400:
          description: "problem with test source definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    patch:
      tags:
        - test-sources
        - api
      summary: "Process test source batch (create, update, delete)"
      description: "Process test source batch based on variables passed in request"
      operationId: processTestSourceBatch
      requestBody:
        description: test source batch request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestSourceBatchRequest"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSourceBatchResult"
        400:
          description: "problem with test source definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - test-sources
        - api
      summary: "Delete test sources"
      description: "Deletes labeled test sources"
      operationId: deleteTestSources
      parameters:
        - $ref: "#/components/parameters/Selector"
      responses:
        204:
          description: "no content"
        502:
          description: "problem with read information from kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-sources/{id}:
    patch:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - test-sources
        - api
      summary: "Update test source"
      description: "Update test source based on test content or git based data"
      operationId: updateTestSource
      requestBody:
        description: test source body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestSourceUpdateRequest"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSource"
        400:
          description: "problem with test source definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test source not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - test-sources
      summary: "Delete test source"
      description: "Deletes test source by its name"
      operationId: deleteTestSource
      responses:
        204:
          description: test source deleted successfuly
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    get:
      parameters:
        - $ref: "#/components/parameters/ID"
      tags:
        - api
        - test-sources
      summary: "Get test source data"
      description: "Returns test sources data"
      operationId: getTestSource
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestSource"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with input for CRD generation"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "test source not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting test source data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /uploads:
    post:
      tags:
        - api
        - tests
        - executions
      summary: "Upload file"
      description: "Upload file to be used in executions and tests"
      operationId: uploads
      requestBody:
        $ref: "#/components/requestBodies/UploadsBody"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: string
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with the input"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "could not upload file"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /repositories:
    post:
      tags:
        - repository
        - api
      summary: "Validate new repository"
      description: "Validate new repository based on variables passed in request"
      operationId: validateRepository
      requestBody:
        description: repository request body data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Repository"
      responses:
        204:
          description: "no content"
        400:
          description: "problem with repository definition - probably some bad input occurs (invalid JSON body or similar)"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with creating folder for partial git checkout"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster or git server"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /secrets:
    get:
      tags:
        - secrets
        - api
      parameters:
        - $ref: "#/components/parameters/All"
        - $ref: "#/components/parameters/Namespace"
      summary: "List secrets"
      description: "List secrets available in cluster"
      operationId: listSecrets
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Secret"
        403:
          description: "secret management is disabled"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - secrets
        - api
      summary: "Create secret"
      description: "Create secret in the cluster"
      operationId: createSecret
      requestBody:
        description: secret data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SecretInput"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Secret"
        400:
          description: "invalid input data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        403:
          description: "secret management or modification are disabled"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /secrets/{id}:
    delete:
      tags:
      - secrets
      - api
      parameters:
      - $ref: "#/components/parameters/Namespace"
      - $ref: "#/components/parameters/ID"
      summary: "Delete secret"
      description: "Delete secret in the cluster"
      operationId: deleteSecret
      responses:
        204:
          description: "successful operation"
        400:
          description: "invalid input data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        403:
          description: "secret is not controlled by Testkube or secret management or modification are disabled"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "secret has not been found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - secrets
      - api
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: "Update secret"
      description: "Update secret in the cluster"
      operationId: updateSecret
      requestBody:
        description: secret data
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SecretUpdate"
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Secret"
        400:
          description: "invalid input data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        403:
          description: "secret is not controlled by Testkube or secret management or modification are disabled"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "secret not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    get:
      tags:
      - secrets
      - api
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: "Get secret"
      description: "Get secret in the cluster"
      operationId: getSecret
      responses:
        200:
          description: "successful operation"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Secret"
        400:
          description: "invalid input data"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        403:
          description: "secret is not controlled by Testkube or secret management is disabled"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "secret not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: "problem with communicating with kubernetes cluster"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-workflows:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/Selector"
      summary: List test workflows
      description: List test workflows from the kubernetes cluster
      operationId: listTestWorkflows
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflow"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/Selector"
        - $ref: "#/components/parameters/TestWorkflowNames"
      summary: Delete test workflows
      description: Delete test workflows from the kubernetes cluster
      operationId: deleteTestWorkflows
      responses:
        204:
          description: no content
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - test-workflows
        - api
        - pro
      summary: Create test workflow
      description: Create test workflow in the kubernetes cluster
      operationId: createTestWorkflow
      requestBody:
        description: test workflow body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflow"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: successful creation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflow"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with body parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflow-with-executions:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/Selector"
      summary: List test workflows with latest execution
      description: List test workflows from the kubernetes cluster with latest execution
      operationId: listTestWorkflowWithExecutions
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflowWithExecutionSummary"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflow-with-executions/{id}:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: Get test workflow details with latest execution
      description: Get test workflow details from the kubernetes cluster with latest execution
      operationId: getTestWorkflowWithExecution
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWorkflowWithExecution"
            text/yaml:
              schema:
                type: string
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "the resource has not been found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflow-with-executions/{id}/tags:
    get:
      tags:
        - test-workflows
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: List test workflow execution tags
      description: List test workflow execution tags for all executed test workflows
      operationId: listTestWorkflowWithExecutionTags
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  app:
                    - backend
                  env:
                    - prod
                  toDelete:
                    - "yes"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflows/{id}/executions:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/TagSelector"
        - $ref: "#/components/parameters/ActorName"
        - $ref: "#/components/parameters/ActorType"
      summary: List test workflow executions
      description: List test workflow executions
      operationId: listTestWorkflowExecutionsByTestWorkflow
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflowExecutionsResult"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/TestWorkflowExecutionName"
      summary: Execute test workflow
      description: Execute test workflow in the kubernetes cluster
      operationId: executeTestWorkflow
      requestBody:
        description: test workflow execution request
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflowExecutionRequest"
      responses:
        200:
          description: successful execution
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflowExecution"
        400:
          description: "problem with body parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflows/{id}/tags:
    get:
      tags:
        - test-workflows
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: List test workflow execution tags
      description: List test workflow execution tags for all executed test workflows
      operationId: listTestWorkflowTagsByTestWorkflow
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  app:
                    - backend
                  env:
                    - prod
                  toDelete:
                    - "yes"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflows/{id}/metrics:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: Get test workflow metrics
      description: Get metrics of test workflow executions
      operationId: getTestWorkflowMetrics
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutionsMetrics"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflows/{id}/executions/{executionID}:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/executionID"
      summary: Get test workflow execution
      description: Get test workflow execution details
      operationId: getTestWorkflowExecutionByTestWorkflow
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWorkflowExecution"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflows/{id}/executions/{executionID}/abort:
    post:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/executionID"
      summary: Abort test workflow execution
      description: Abort test workflow execution
      operationId: abortTestWorkflowExecutionByTestWorkflow
      responses:
        204:
          description: "no content"
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflows/{id}/executions/{executionID}/rerun:
    post:
      tags:
        - test-workflows
        - api
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/executionID"
      summary: Rerun test workflow execution
      description: Rerun test workflow execution
      operationId: rerunTestWorkflowExecutionByTestWorkflow
      requestBody:
        description: test workflow running context
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflowRunningContext"
      responses:
        200:
          description: successful execution
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWorkflowExecution"
        400:
          description: "problem with body parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflow-executions:
    post:
      parameters:
        - $ref: "#/components/parameters/Selector"
        - $ref: "#/components/parameters/ConcurrencyLevel"
      tags:
        - api
        - test-workflows
        - pro
      summary: "Execute test workflows"
      description: "Execute test workflows in the kubernetes cluster"
      operationId: executeTestWorkflows
      requestBody:
        description: test workflow execution request
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflowExecutionRequest"
      responses:
        200:
          description: successful execution
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflowExecution"
        400:
          description: "problem with body parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/TagSelector"
        - $ref: "#/components/parameters/ActorName"
        - $ref: "#/components/parameters/ActorType"
      summary: List test workflow executions
      description: List test workflow executions
      operationId: listTestWorkflowExecutions
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflowExecutionsResult"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflow-executions/{executionID}:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/executionID"
      summary: Get test workflow execution
      description: Get test workflow execution details
      operationId: getTestWorkflowExecution
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflowExecution"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-workflow-executions/{executionID}/artifacts:
    get:
      parameters:
        - $ref: "#/components/parameters/executionID"
      tags:
        - test-workflows
        - artifacts
        - executions
        - api
        - pro
      summary: "Get test workflow execution's artifacts by ID"
      description: "Returns artifacts of the given executionID"
      operationId: getTestWorkflowExecutionArtifacts
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Artifact"
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting execution's artifacts from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-workflow-executions/{executionID}/artifacts/{filename}:
    get:
      parameters:
        - $ref: "#/components/parameters/executionID"
        - $ref: "#/components/parameters/Filename"
      tags:
        - test-workflows
        - artifacts
        - executions
        - api
        - pro
      summary: "Download test workflow artifact"
      description: "Download the artifact file from the given execution"
      operationId: downloadTestWorkflowArtifact
      responses:
        200:
          description: "successful operation"
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting artifacts from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-workflow-executions/{executionID}/artifact-archive:
    get:
      parameters:
        - $ref: "#/components/parameters/executionID"
        - $ref: "#/components/parameters/Mask"
      tags:
        - test-workflows
        - artifacts
        - executions
        - api
        - pro
      summary: "Download test workflow artifact archive"
      description: "Download the artifact archive from the given execution"
      operationId: downloadTestWorkflowArtifactArchive
      responses:
        200:
          description: "successful operation"
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        404:
          description: "execution not found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        500:
          description: "problem with getting artifact archive from storage"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-workflow-executions/{executionID}/abort:
    post:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/executionID"
      summary: Abort test workflow execution
      description: Abort test workflow execution
      operationId: abortTestWorkflowExecution
      responses:
        204:
          description: "no content"
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflow-executions/{executionID}/rerun:
    post:
      tags:
        - test-workflows
        - api
      parameters:
        - $ref: "#/components/parameters/executionID"
      summary: Rerun test workflow execution
      description: Rerun test workflow execution
      operationId: rerunTestWorkflowExecution
      requestBody:
        description: test workflow running context
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflowRunningContext"
      responses:
        200:
          description: successful execution
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWorkflowExecution"
        400:
          description: "problem with body parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-workflows/{id}/abort:
    post:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: Abort all test workflow executions
      description: Abort all test workflow executions
      operationId: abortAllTestWorkflowExecutions
      responses:
        204:
          description: "no content"
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /preview-test-workflow:
    post:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/InlineTemplates"
      summary: Preview test workflow
      description: Preview test workflow after including templates inside
      operationId: previewTestWorkflow
      requestBody:
        description: test workflow body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflow"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: resolved test workflow
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflow"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with body parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflows/{id}:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: Get test workflow details
      description: Get test workflow details from the kubernetes cluster
      operationId: getTestWorkflow
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWorkflow"
            text/yaml:
              schema:
                type: string
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "the resource has not been found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    put:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: Update test workflow details
      description: Update test workflow details in the kubernetes cluster
      operationId: updateTestWorkflow
      requestBody:
        description: test workflow body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflow"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWorkflow"
            text/yaml:
              schema:
                type: string
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "the resource has not been found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
        - $ref: "#/components/parameters/SkipDeleteExecutions"
        - $ref: "#/components/parameters/SkipDeleteCRD"
      summary: Delete test workflow
      description: Delete test workflow from the kubernetes cluster
      operationId: deleteTestWorkflow
      responses:
        204:
          description: no content
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "the resource has not been found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

  /test-workflow-templates:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/Selector"
      summary: List test workflow templates
      description: List test workflow templates from the kubernetes cluster
      operationId: listTestWorkflowTemplates
      responses:
        200:
          description: successful list operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflowTemplate"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/Selector"
      summary: Delete test workflow templates
      description: Delete test workflow templates from the kubernetes cluster
      operationId: deleteTestWorkflowTemplates
      responses:
        204:
          description: no content
        400:
          description: "problem with selector parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    post:
      tags:
        - test-workflows
        - api
        - pro
      summary: Create test workflow template
      description: Create test workflow template in the kubernetes cluster
      operationId: createTestWorkflowTemplate
      requestBody:
        description: test workflow template body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflowTemplate"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: successful creation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TestWorkflowTemplate"
            text/yaml:
              schema:
                type: string
        400:
          description: "problem with body parsing - probably some bad input occurs"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
  /test-workflow-templates/{id}:
    get:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: Get test workflow template details
      description: Get test workflow template details from the kubernetes cluster
      operationId: getTestWorkflowTemplate
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWorkflowTemplate"
            text/yaml:
              schema:
                type: string
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "the resource has not been found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    put:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: Update test workflow template details
      description: Update test workflow template details in the kubernetes cluster
      operationId: updateTestWorkflowTemplate
      requestBody:
        description: test workflow template body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestWorkflowTemplate"
          text/yaml:
            schema:
              type: string
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestWorkflowTemplate"
            text/yaml:
              schema:
                type: string
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "the resource has not been found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
    delete:
      tags:
        - test-workflows
        - api
        - pro
      parameters:
        - $ref: "#/components/parameters/ID"
      summary: Delete test workflow template
      description: Delete test workflow template from the kubernetes cluster
      operationId: deleteTestWorkflowTemplate
      responses:
        204:
          description: no content
        402:
          description: "missing Pro subscription for a commercial feature"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        404:
          description: "the resource has not been found"
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"
        502:
          description: problem communicating with kubernetes cluster
          content:
            application/problem+json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Problem"

components:
  schemas:
    ExecutionsMetrics:
      type: object
      properties:
        passFailRatio:
          type: number
          description: Percentage pass to fail ratio
          example: 50
        executionDurationP50:
          type: string
          description: 50th percentile of all durations
          example: "7m2.71s"
        executionDurationP50ms:
          type: integer
          description: 50th percentile of all durations in milliseconds
          example: 422
        executionDurationP90:
          type: string
          description: 90th percentile of all durations
          example: "7m2.71s"
        executionDurationP90ms:
          type: integer
          description: 90th percentile of all durations in milliseconds
          example: 422
        executionDurationP95:
          type: string
          description: 95th percentile of all durations
          example: "7m2.71s"
        executionDurationP95ms:
          type: integer
          description: 95th percentile of all durations in milliseconds
          example: 422
        executionDurationP99:
          type: string
          description: 99th percentile of all durations
          example: "7m2.71s"
        executionDurationP99ms:
          type: integer
          description: 99th percentile of all durations in milliseconds
          example: 422
        totalExecutions:
          type: integer
          description: total executions number
          example: 2
        failedExecutions:
          type: integer
          description: failed executions number
          example: 1
        executions:
          type: array
          description: List of test/testsuite executions
          items:
            $ref: "#/components/schemas/ExecutionsMetricsExecutions"

    ExecutionsMetricsExecutions:
      type: object
      properties:
        executionId:
          type: string
        duration:
          type: string
        durationMs:
          type: integer
        status:
          type: string
        name:
          type: string
        startTime:
          type: string
          format: date-time

    Variables:
      type: object
      description: "execution variables passed to executor converted to vars for usage in tests"
      additionalProperties:
        $ref: "#/components/schemas/Variable"
      example:
        var1:
          name: "var1"
          type: "basic"
          value: "value1"
        secret1:
          name: "secret1"
          type: "secret"
          value: "secretvalue1"

    Variable:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
        type:
          $ref: "#/components/schemas/VariableType"
        secretRef:
          $ref: "#/components/schemas/SecretRef"
        configMapRef:
          $ref: "#/components/schemas/ConfigMapRef"

    VariableType:
      type: string
      enum:
        - basic
        - secret

    ObjectRef:
      required:
        - name
      type: object
      properties:
        namespace:
          type: string
          description: object kubernetes namespace
          example: "testkube"
        name:
          type: string
          description: object name
          example: "name"

    SecretRef:
      required:
        - name
        - key
      type: object
      description: Testkube internal reference for secret storage in Kubernetes secrets
      properties:
        namespace:
          type: string
          description: object kubernetes namespace
        name:
          type: string
          description: object name
        key:
          type: string
          description: object key

    ConfigMapRef:
      required:
        - name
        - key
      type: object
      description: Testkube internal reference for data in Kubernetes config maps
      properties:
        namespace:
          type: string
          description: object kubernetes namespace
        name:
          type: string
          description: object name
        key:
          type: string
          description: object key

    TestSuite:
      type: object
      required:
        - name
        - status
      properties:
        name:
          type: string
          example: "test-suite1"
        namespace:
          type: string
          example: "testkube"
        description:
          type: string
          example: "collection of tests"
        before:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteBatchStep"
          description: Run these batch steps before whole suite
          example:
            - stopOnFailure: true
              execute:
                - test: "example-test"
        steps:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteBatchStep"
          description: Batch steps to run
          example:
            - stopOnFailure: true
              execute:
                - test: "example-test"
        after:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteBatchStep"
          description: Run these batch steps after whole suite
          example:
            - stopOnFailure: true
              execute:
                - test: "example-test"
        labels:
          type: object
          description: "test suite labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        schedule:
          type: string
          description: schedule to run test suite
          example: "* * * * *"
        repeats:
          type: integer
          default: 1
          example: 1
        created:
          type: string
          format: date-time
        executionRequest:
          $ref: "#/components/schemas/TestSuiteExecutionRequest"
        status:
          $ref: "#/components/schemas/TestSuiteStatus"
        readOnly:
          type: boolean
          description: if test suite is offline and cannot be executed

    TestSuiteV2:
      type: object
      required:
        - name
        - status
      properties:
        name:
          type: string
          example: "test-suite1"
        namespace:
          type: string
          example: "testkube"
        description:
          type: string
          example: "collection of tests"
        before:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteStepV2"
          description: Run this step before whole suite
          example:
            - stopTestOnFailure: true
              execute:
                namespace: "testkube"
                name: "example-test"
        steps:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteStepV2"
          description: Steps to run
          example:
            - stopTestOnFailure: true
              execute:
                namespace: "testkube"
                name: "example-test"
        after:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteStepV2"
          description: Run this step after whole suite
          example:
            - stopTestOnFailure: true
              execute:
                namespace: "testkube"
                name: "example-test"
        labels:
          type: object
          description: "test suite labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        schedule:
          type: string
          description: schedule to run test suite
          example: "* * * * *"
        repeats:
          type: integer
          default: 1
          example: 1
        created:
          type: string
          format: date-time
        executionRequest:
          $ref: "#/components/schemas/TestSuiteExecutionRequest"
        status:
          $ref: "#/components/schemas/TestSuiteStatus"

    TestSuiteStepType:
      type: string
      enum:
        - executeTest
        - delay

    TestSuiteBatchStep:
      description: set of steps run in parallel
      type: object
      required:
        - stopOnFailure
      properties:
        stopOnFailure:
          type: boolean
          default: true
        downloadArtifacts:
          $ref: "#/components/schemas/DownloadArtifactOptions"
        execute:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteStep"

    DownloadArtifactOptions:
      description: options to download artifacts from previous steps
      type: object
      properties:
        allPreviousSteps:
          type: boolean
          default: false
        previousStepNumbers:
          type: array
          description: previous step numbers starting from 1
          items:
            type: integer
        previousTestNames:
          type: array
          description: previous test names
          items:
            type: string

    TestSuiteStep:
      type: object
      properties:
        test:
          type: string
          description: object name
          example: "name"
        delay:
          type: string
          format: duration
          example: 1s
          description: delay duration in time units
        executionRequest:
          $ref: "#/components/schemas/TestSuiteStepExecutionRequest"
          description: test suite step execution request parameters

    TestSuiteStepV2:
      type: object
      required:
        - name
        - type
        - stopTestOnFailure
      properties:
        stopTestOnFailure:
          type: boolean
          default: true
        execute:
          $ref: "#/components/schemas/TestSuiteStepExecuteTestV2"
        delay:
          $ref: "#/components/schemas/TestSuiteStepDelayV2"

    TestSuiteStepExecuteTestV2:
      allOf:
        - $ref: "#/components/schemas/ObjectRef"

    TestSuiteStepDelayV2:
      type: object
      required:
        - duration
      properties:
        duration:
          type: integer
          default: 0
          description: delay duration in milliseconds

    TestSuiteExecution:
      type: object
      description: Test suite executions data
      required:
        - id
        - name
        - testSuite
      properties:
        id:
          type: string
          description: execution id
          format: bson objectId
          example: "62f395e004109209b50edfc1"
        name:
          type: string
          description: "execution name"
          example: "test-suite1.needlessly-sweet-imp"
        testSuite:
          $ref: "#/components/schemas/ObjectRef"
          description: object name and namespace
        status:
          $ref: "#/components/schemas/TestSuiteExecutionStatus"
        envs:
          deprecated: true
          type: object
          description: "Environment variables passed to executor. Deprecated: use Basic Variables instead"
          additionalProperties:
            type: string
          example:
            record: "true"
            prefix: "some-"
        variables:
          $ref: "#/components/schemas/Variables"
        secretUUID:
          type: string
          description: secret uuid
          readOnly: true
          example: "7934600f-b367-48dd-b981-4353304362fb"
        startTime:
          type: string
          description: "test start time"
          format: date-time
        endTime:
          type: string
          description: "test end time"
          format: date-time
        duration:
          type: string
          description: "test duration"
          example: "2m"
        durationMs:
          type: integer
          description: "test duration in ms"
          example: 6000
        stepResults:
          type: array
          description: "steps execution results"
          items:
            $ref: "#/components/schemas/TestSuiteStepExecutionResultV2"
            description: test execution results
        executeStepResults:
          type: array
          description: "batch steps execution results"
          items:
            $ref: "#/components/schemas/TestSuiteBatchStepExecutionResult"
            description: test execution results
        labels:
          type: object
          description: "test suite labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        runningContext:
          $ref: "#/components/schemas/RunningContext"
          description: running context for the test suite execution
        testSuiteExecutionName:
          type: string
          description: test suite execution name started the test suite execution
        disableWebhooks:
          type: boolean
          description: whether webhooks on this execution are disabled
          default: false
          example:
            - true
            - false

    TestSuiteExecutionCR:
      type: object
      required:
        - testSuite
      properties:
        testSuite:
          $ref: "#/components/schemas/ObjectRef"
          description: test suite name and namespace
        executionRequest:
          $ref: "#/components/schemas/TestSuiteExecutionRequest"
          description: test suite execution request parameters
        status:
          $ref: "#/components/schemas/TestSuiteExecutionStatusCR"
          description: test suite execution status

    TestSuiteExecutionStatusCR:
      type: object
      description: test suite execution status
      properties:
        latestExecution:
          $ref: "#/components/schemas/TestSuiteExecution"
        generation:
          type: integer
          format: int64
          description: test suite execution generation

    TestSuiteExecutionStatus:
      type: string
      enum:
        - queued
        - running
        - passed
        - failed
        - aborting
        - aborted
        - timeout

    TestSuiteStepExecutionResult:
      description: execution result returned from executor
      type: object
      properties:
        step:
          $ref: "#/components/schemas/TestSuiteStep"
        test:
          $ref: "#/components/schemas/ObjectRef"
          description: object name and namespace
        execution:
          $ref: "#/components/schemas/Execution"
          description: "test step execution, NOTE: the execution output will be empty, retrieve it directly form the test execution"

    TestSuiteStepExecutionResultV2:
      description: execution result returned from executor
      type: object
      properties:
        step:
          $ref: "#/components/schemas/TestSuiteStepV2"
        test:
          $ref: "#/components/schemas/ObjectRef"
          description: object name and namespace
        execution:
          $ref: "#/components/schemas/Execution"
          description: test step execution

    TestSuiteBatchStepExecutionResult:
      description: execution result returned from executor
      type: object
      properties:
        step:
          $ref: "#/components/schemas/TestSuiteBatchStep"
        execute:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteStepExecutionResult"
        startTime:
          type: string
          description: "step start time"
          format: date-time
        endTime:
          type: string
          description: "step end time"
          format: date-time
        duration:
          type: string
          description: "step duration"
          example: "2m"

    TestSuiteExecutionsResult:
      description: the result for a page of executions
      type: object
      required:
        - totals
        - results
      properties:
        totals:
          $ref: "#/components/schemas/ExecutionsTotals"
        filtered:
          $ref: "#/components/schemas/ExecutionsTotals"
        results:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteExecutionSummary"

    TestSuiteExecutionSummary:
      description: "Test execution summary"
      type: object
      required:
        - id
        - name
        - testSuiteName
        - status
      properties:
        id:
          type: string
          description: execution id
          format: bson objectId
          example: "62f395e004109209b50edfc1"
        name:
          type: string
          description: execution name
          example: "test-suite1.needlessly-sweet-imp"
        testSuiteName:
          type: string
          description: name of the test suite
          example: "test-suite1"
        status:
          $ref: "#/components/schemas/TestSuiteExecutionStatus"
        startTime:
          type: string
          description: "test suite execution start time"
          format: date-time
        endTime:
          type: string
          description: "test suite execution end time"
          format: date-time
        duration:
          type: string
          description: "test suite execution duration"
          example: "00:00:09"
        durationMs:
          type: integer
          description: "test suite execution duration in ms"
          example: 9009
        execution:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteBatchStepExecutionSummary"
        labels:
          type: object
          description: "test suite and execution labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"

    TestSuiteStepExecutionSummary:
      description: "Test suite execution summary"
      type: object
      required:
        - id
        - name
        - status
      properties:
        id:
          type: string
          example: "62f395e004109209b50edfc4"
        name:
          type: string
          description: execution name
          example: "run:testkube/test1"
        testName:
          type: string
          description: test name
          example: "test1"
        status:
          $ref: "#/components/schemas/ExecutionStatus"
        type:
          $ref: "#/components/schemas/TestSuiteStepType"

    TestSuiteBatchStepExecutionSummary:
      description: "Test suite batch execution summary"
      type: object
      properties:
        execute:
          type: array
          items:
            $ref: "#/components/schemas/TestSuiteStepExecutionSummary"

    TestSuiteStatus:
      type: object
      description: test suite status
      properties:
        latestExecution:
          $ref: "#/components/schemas/TestSuiteExecutionCore"

    TestSuiteExecutionCore:
      type: object
      description: test suite execution core
      properties:
        id:
          type: string
          description: execution id
          format: bson objectId
          example: "62f395e004109209b50edfc4"
        startTime:
          type: string
          description: "test suite execution start time"
          format: date-time
        endTime:
          type: string
          description: "test suite execution end time"
          format: date-time
        status:
          $ref: "#/components/schemas/TestSuiteExecutionStatus"

    Test:
      type: object
      properties:
        name:
          type: string
          description: test name
          example: "test1"
        namespace:
          type: string
          description: test namespace
          example: "testkube"
        description:
          type: string
          description: test description
          example: "this test is used for that purpose"
        type:
          type: string
          description: test type
          example: "postman/collection"
        content:
          $ref: "#/components/schemas/TestContent"
          description: test content
        source:
          type: string
          description: reference to test source resource
          example: "my-private-repository-test"
        created:
          type: string
          format: date-time
          example: "2022-07-30T06:54:15Z"
        labels:
          type: object
          description: "test labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        schedule:
          type: string
          description: schedule to run test
          example: "* * * * *"
        readOnly:
          type: boolean
          description: if test is offline and cannot be executed

        uploads:
          type: array
          items:
            type: string
          description: list of file paths that will be needed from uploads
          example:
            - settings/config.txt
        executionRequest:
          $ref: "#/components/schemas/ExecutionRequest"
        status:
          $ref: "#/components/schemas/TestStatus"

    TestExecutionCR:
      type: object
      required:
        - test
      properties:
        test:
          $ref: "#/components/schemas/ObjectRef"
          description: test name and namespace
        executionRequest:
          $ref: "#/components/schemas/ExecutionRequest"
          description: test execution request parameters
        status:
          $ref: "#/components/schemas/TestExecutionStatusCR"
          description: test execution status

    TestExecutionStatusCR:
      type: object
      description: test execution status
      properties:
        latestExecution:
          $ref: "#/components/schemas/Execution"
        generation:
          type: integer
          format: int64
          description: test execution generation

    TestContent:
      type: object
      properties:
        type:
          type: string
          description: |
            type of sources a runner can get data from.
              string: String content (e.g. Postman JSON file).
              file-uri: content stored on the webserver.
              git-file: the file stored in the Git repo in the given repository.path field (Deprecated: use git instead).
              git-dir: the entire git repo or git subdirectory depending on the  repository.path field (Testkube does a shadow clone and sparse checkout to limit IOs in the case of monorepos). (Deprecated: use git instead).
              git: automatically provisions either a file, directory or whole git repository depending on the repository.path field.

          enum:
            - string
            - file-uri
            # Deprecated: use git instead
            - git-file
            # Deprecated: use git instead
            - git-dir
            - git
        repository:
          $ref: "#/components/schemas/Repository"
        data:
          type: string
          description: test content data as string
        uri:
          type: string
          description: test content
          example: "https://github.com/kubeshop/testkube"

    TestContentRequest:
      description: test content request body
      type: object
      properties:
        repository:
          $ref: "#/components/schemas/RepositoryParameters"

    TestContentUpdate:
      description: test content update body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/TestContent"

    TestContentUpdateRequest:
      description: test content update request body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/TestContentRequest"

    TestSource:
      description: Test source resource for shared test content
      type: object
      allOf:
        - $ref: "#/components/schemas/TestContent"
      properties:
        name:
          type: string
          description: test source name
          example: "testsource1"
        namespace:
          type: string
          description: test source namespace
          example: "testkube"
        labels:
          type: object
          description: "test source labels"
          additionalProperties:
            type: string

    TestSourceUpdate:
      description: Test source resource update for shared test content
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/TestContent"
      properties:
        name:
          type: string
          description: test source name
          example: "testsource1"
        namespace:
          type: string
          description: test source namespace
          example: "testkube"
        labels:
          type: object
          description: "test source labels"
          additionalProperties:
            type: string

    TestSourceUpsertRequest:
      description: test source create request body
      type: object
      allOf:
        - $ref: "#/components/schemas/TestContent"
      properties:
        name:
          type: string
          description: test source name
          example: "testsource1"
        namespace:
          type: string
          description: test source namespace
          example: "testkube"
        labels:
          type: object
          description: "test source labels"
          additionalProperties:
            type: string

    TestSourceUpdateRequest:
      description: test source update request body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/TestContent"
      properties:
        name:
          type: string
          description: test source name
          example: "testsource1"
        namespace:
          type: string
          description: test source namespace
          example: "testkube"
        labels:
          type: object
          description: "test source labels"
          additionalProperties:
            type: string

    TestStatus:
      type: object
      description: test status
      properties:
        latestExecution:
          $ref: "#/components/schemas/ExecutionCore"

    ExecutionCore:
      type: object
      description: test execution core
      properties:
        id:
          type: string
          description: execution id
          format: bson objectId
          example: "62f395e004109209b50edfc4"
        number:
          type: integer
          description: "execution number"
          example: 1
        startTime:
          type: string
          description: "test start time"
          format: date-time
        endTime:
          type: string
          description: "test end time"
          format: date-time
        status:
          $ref: "#/components/schemas/ExecutionStatus"

    Execution:
      type: object
      description: test execution
      properties:
        id:
          type: string
          description: execution id
          format: bson objectId
          example: "62f395e004109209b50edfc4"
        testName:
          type: string
          description: unique test name (CRD Test name)
          example: "example-test"
        testSuiteName:
          type: string
          description: unique test suite name (CRD Test suite name), if it's run as a part of test suite
          example: "test-suite1"
        testNamespace:
          type: string
          description: test namespace
          example: "testkube"
        testType:
          type: string
          description: test type e.g. postman/collection
          example: "postman/collection"
        name:
          type: string
          description: "execution name"
          example: "test-suite1-example-test-1"
        number:
          type: integer
          description: "execution number"
          example: 1
        envs:
          deprecated: true
          type: object
          description: "Environment variables passed to executor. Deprecated: use Basic Variables instead"
          additionalProperties:
            type: string
          example:
            record: "true"
            prefix: "some-"
        command:
          type: array
          description: "executor image command"
          example: ["curl"]
          items:
            type: string
        args:
          type: array
          description: "additional arguments/flags passed to executor binary"
          example: ["--concurrency", "2", "--remote", "--some", "blabla"]
          items:
            type: string
        args_mode:
          type: string
          description: usage mode for arguments
          enum:
            - append
            - override
            - replace
        variables:
          $ref: "#/components/schemas/Variables"
        isVariablesFileUploaded:
          type: boolean
          description: in case the variables file is too big, it will be uploaded to storage
          example: false
        variablesFile:
          type: string
          description: variables file content - need to be in format for particular executor (e.g. postman envs file)
        testSecretUUID:
          type: string
          description: test secret uuid
          readOnly: true
          example: "7934600f-b367-48dd-b981-4353304362fb"
        testSuiteSecretUUID:
          type: string
          description: test suite secret uuid, if it's run as a part of test suite
          readOnly: true
          example: "7934600f-b367-48dd-b981-4353304362fb"
        content:
          $ref: "#/components/schemas/TestContent"
        startTime:
          type: string
          description: "test start time"
          format: date-time
        endTime:
          type: string
          description: "test end time"
          format: date-time
        duration:
          type: string
          description: "test duration"
          example: "88s"
        durationMs:
          type: integer
          description: "test duration in milliseconds"
          example: 10000
        executionResult:
          $ref: "#/components/schemas/ExecutionResult"
          description: result get from executor
        labels:
          type: object
          description: "test and execution labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        uploads:
          type: array
          items:
            type: string
          description: list of file paths that need to be copied into the test from uploads
          example:
            - settings/config.txt
        bucketName:
          type: string
          description: minio bucket name to get uploads from
          example: execution-c01d7cf6-ec3f-47f0-9556-a5d6e9009a43
        artifactRequest:
          $ref: "#/components/schemas/ArtifactRequest"
          description: configuration parameters for storing test artifacts
        preRunScript:
          type: string
          description: script to run before test execution
          example: "echo -n '$SECRET_ENV' > ./secret_file"
        postRunScript:
          type: string
          description: script to run after test execution
          example: "sleep 30"
        executePostRunScriptBeforeScraping:
          type: boolean
          description: execute post run script before scraping (prebuilt executor only)
        sourceScripts:
          type: boolean
          description: run scripts using source command (container executor only)
        runningContext:
          $ref: "#/components/schemas/RunningContext"
          description: running context for the test execution
        containerShell:
          type: string
          description: shell used in container executor
          example: "/bin/sh"
        testExecutionName:
          type: string
          description: test execution name started the test execution
        downloadArtifactExecutionIDs:
          type: array
          description: "execution ids for artifacts to download"
          items:
            type: string
        downloadArtifactTestNames:
          type: array
          description: "test names for artifacts to download from latest executions"
          items:
            type: string
        slavePodRequest:
          $ref: "#/components/schemas/PodRequest"
          description: configuration parameters for executed slave pods
        executionNamespace:
          type: string
          description: namespace for test execution (Pro edition only)
        disableWebhooks:
          type: boolean
          description: whether webhooks on this execution are disabled
          default: false
          example:
            - true
            - false

    Artifact:
      type: object
      description: API server artifact
      properties:
        name:
          type: string
          description: artifact file path
        size:
          type: integer
          description: file size in bytes
        executionName:
          type: string
          description: execution name that produced the artifact
          example: "test-1"
        status:
          type: string
          enum:
            - ready
            - processing
            - failed

    ExecutionsResult:
      description: the result for a page of executions
      type: object
      required:
        - totals
        - results
      properties:
        totals:
          $ref: "#/components/schemas/ExecutionsTotals"
        filtered:
          $ref: "#/components/schemas/ExecutionsTotals"
        results:
          type: array
          items:
            $ref: "#/components/schemas/ExecutionSummary"

    ExecutionSummary:
      description: "Execution summary"
      type: object
      required:
        - id
        - name
        - testName
        - testType
        - status
      properties:
        id:
          type: string
          description: execution id
          format: bson objectId
          example: "62f395e004109209b50edfc4"
        name:
          type: string
          description: execution name
          example: "test-suite1-test1"
        number:
          type: integer
          description: execution number
          example: 1
        testName:
          type: string
          description: name of the test
          example: "test1"
        testNamespace:
          type: string
          description: name of the test
          example: "testkube"
        testType:
          type: string
          description: the type of test for this execution
          example: "postman/collection"
        status:
          $ref: "#/components/schemas/ExecutionStatus"
        startTime:
          type: string
          description: "test execution start time"
          format: date-time
        endTime:
          type: string
          description: "test execution end time"
          format: date-time
        duration:
          type: string
          description: calculated test duration
          example: "00:00:13"
        durationMs:
          type: integer
          description: calculated test duration in ms
          example: 10000
        labels:
          type: object
          description: "test and execution labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        runningContext:
          $ref: "#/components/schemas/RunningContext"
          description: running context for the test execution

    ExecutionStatus:
      type: string
      enum:
        - queued
        - running
        - passed
        - failed
        - aborted
        - timeout
        - skipped

    ExecutionResult:
      description: execution result returned from executor
      type: object
      required:
        - status
      properties:
        status:
          $ref: "#/components/schemas/ExecutionStatus"
        output:
          type: string
          description: "RAW Test execution output, depends of reporter used in particular tool"
        outputType:
          type: string
          description: "output type depends of reporter used in particular tool"
          enum:
            - text/plain
            - application/junit+xml
            - application/json
        errorMessage:
          type: string
          description: "error message when status is error, separate to output as output can be partial in case of error"
        steps:
          type: array
          items:
            $ref: "#/components/schemas/ExecutionStepResult"
          description: execution steps (for collection of requests)
        reports:
          type: object
          properties:
            junit:
              type: string

    ExecutionStepResult:
      description: execution result data
      type: object
      required:
        - name
        - status
      properties:
        name:
          type: string
          description: step name
          example: "step1"
        duration:
          type: string
          format: duration
          example: "10m0s"
        status:
          type: string
          description: execution step status
          enum: [passed, failed]
        assertionResults:
          type: array
          items:
            $ref: "#/components/schemas/AssertionResult"

    AssertionResult:
      description: execution result data
      type: object
      properties:
        name:
          type: string
          example: "assertion1"
        status:
          type: string
          enum: [passed, failed]
        errorMessage:
          type: string
          nullable: true

    ExecutionsTotals:
      type: object
      description: various execution counters
      required:
        - results
        - passed
        - failed
        - queued
        - running
        - paused
      properties:
        results:
          type: integer
          description: the total number of executions available
        passed:
          type: integer
          description: the total number of passed executions available
        failed:
          type: integer
          description: the total number of failed executions available
        queued:
          type: integer
          description: the total number of queued executions available
        running:
          type: integer
          description: the total number of running executions available

    ServerInfo:
      type: object
      description: Server information with build version, build commit etc.
      required:
        - version
      properties:
        version:
          type: string
          description: build version
          example: "v1.4.4"
        commit:
          type: string
          description: build commit
          example: "aaff223ae68aab1af56e8ed8c84c2b80ed63d9b8"
        namespace:
          type: string
          description: server installaton namespace
          example: "my-testkube"
        clusterId:
          type: string
          description: cluster id
          example: "my-cluster-id"
        context:
          type: string
          description: currently configured testkube API context
          example: "cloud|oss"
        orgId:
          type: string
          description: cloud organization id
          example: "tkcorg_xxxx"
        envId:
          type: string
          description: cloud env id
          example: "tkcenv_xxxx"
        helmchartVersion:
          type: string
          description: helm chart version
          example: "1.4.14"
        dashboardUri:
          type: string
          description: dashboard uri
          example: "http://localhost:8080"
        enableSecretEndpoint:
          type: boolean
          description: enable secret endpoint to list secrets in namespace
          deprecated: true
        disableSecretCreation:
          type: boolean
          description: disable secret creation for tests and test sources
          deprecated: true
        secret:
          $ref: "#/components/schemas/SecretConfig"
        features:
          $ref: "#/components/schemas/Features"
        executionNamespaces:
          type: array
          description: execution namespaces
          items:
            type: string
            example: my-namespace
        dockerImageVersion:
          type: string
          description: docker image version
          example: "2.1.2"

    Repository:
      description: repository representation for tests in git repositories
      type: object
      required:
        - type
        - uri
      properties:
        type:
          type: string
          enum:
            - git
          description: VCS repository type
        uri:
          type: string
          description: uri of content file or git directory
          example: "https://github.com/kubeshop/testkube"
        branch:
          type: string
          description: branch/tag name for checkout
          example: "main"
        commit:
          type: string
          description: commit id (sha) for checkout
          example: "b928cbb7186944ab9275937ec1ac3d3738ca2e1d"
        path:
          type: string
          description: if needed we can checkout particular path (dir or file) in case of BIG/mono repositories
          example: "test/perf"
        username:
          type: string
          description: git auth username for private repositories
        token:
          type: string
          description: git auth token for private repositories
        usernameSecret:
          $ref: "#/components/schemas/SecretRef"
        tokenSecret:
          $ref: "#/components/schemas/SecretRef"
        certificateSecret:
          type: string
          description: secret with certificate for private repositories. Should contain one key ending with .crt such as "mycorp.crt", whose value is the certificate file content, suitable for git config http.sslCAInfo
        workingDir:
          type: string
          description: if provided we checkout the whole repository and run test from this directory
          example: "/"
        authType:
          type: string
          enum:
            - basic
            - header
          description: auth type for git requests

    RepositoryParameters:
      description: repository parameters for tests in git repositories
      type: object
      properties:
        branch:
          type: string
          description: branch/tag name for checkout
          example: "main"
        commit:
          type: string
          description: commit id (sha) for checkout
          example: "b928cbb7186944ab9275937ec1ac3d3738ca2e1d"
        path:
          type: string
          description: if needed we can checkout particular path (dir or file) in case of BIG/mono repositories
          example: "test/perf"
        workingDir:
          type: string
          description: if provided we checkout the whole repository and run test from this directory
          example: "/"

    RepositoryUpdate:
      description: repository update body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/Repository"

    RepositoryUpdateParameters:
      description: repository update parameters for tests in git repositories
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/RepositoryParameters"

    ArtifactRequest:
      description: artifact request body with test artifacts
      type: object
      properties:
        storageClassName:
          type: string
          description: artifact storage class name for container executor
          example: artifact-volume-local
        volumeMountPath:
          type: string
          description: artifact volume mount path for container executor
        dirs:
          type: array
          items:
            type: string
          description: artifact directories for scraping
        masks:
          type: array
          items:
            type: string
          description: regexp to filter scraped artifacts, single or comma separated
        storageBucket:
          type: string
          description: artifact bucket storage
          example: test1-artifacts
        omitFolderPerExecution:
          type: boolean
          description: don't use a separate folder for execution artifacts
        sharedBetweenPods:
          type: boolean
          description: whether to share volume between pods
        useDefaultStorageClassName:
          type: boolean
          description: whether to use default storage class name
        sidecarScraper:
          type: boolean
          description: run scraper as pod sidecar container

    ArtifactUpdateRequest:
      description: artifact request update body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/ArtifactRequest"

    PodRequest:
      description: pod request body
      type: object
      properties:
        resources:
          $ref: "#/components/schemas/PodResourcesRequest"
          description: pod resources request parameters
        podTemplate:
          type: string
          description: pod template extensions
        podTemplateReference:
          type: string
          description: name of the template resource

    PodUpdateRequest:
      description: pod request update body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/PodRequest"

    PodResourcesRequest:
      description: pod resources request specification
      type: object
      properties:
        requests:
          $ref: "#/components/schemas/ResourceRequest"
          description: pod resources requests
        limits:
          $ref: "#/components/schemas/ResourceRequest"
          description: pod resources limits

    PodResourcesUpdateRequest:
      description: pod resources update request specification
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/PodResourcesRequest"

    ResourceRequest:
      description: resource request specification
      type: object
      properties:
        cpu:
          type: string
          description: requested cpu units
          example: 250m
        memory:
          type: string
          description: requested memory units
          example: 64Mi

    ResourceUpdateRequest:
      description: resource update request specification
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/ResourceRequest"

    ExecutionRequest:
      description: test execution request body
      type: object
      properties:
        id:
          type: string
          description: execution id
          format: bson objectId
          example: "62f395e004109209b50edfc1"
        name:
          type: string
          description: test execution custom name
          example: "testing with 1000 users"
        testSuiteName:
          type: string
          description: unique test suite name (CRD Test suite name), if it's run as a part of test suite
          example: "test-suite1"
        number:
          type: integer
          description: test execution number
        executionLabels:
          type: object
          description: "test execution labels"
          additionalProperties:
            type: string
          example:
            users: "3"
            prefix: "some-"
        namespace:
          type: string
          description: test kubernetes namespace ("testkube" when not set)
          example: testkube
        isVariablesFileUploaded:
          type: boolean
          description: in case the variables file is too big, it will be uploaded
          example: false
        variablesFile:
          type: string
          description: variables file content - need to be in format for particular executor (e.g. postman envs file)
        variables:
          $ref: "#/components/schemas/Variables"
        testSecretUUID:
          type: string
          description: test secret uuid
          readOnly: true
          example: "7934600f-b367-48dd-b981-4353304362fb"
        testSuiteSecretUUID:
          type: string
          description: test suite secret uuid, if it's run as a part of test suite
          readOnly: true
          example: "7934600f-b367-48dd-b981-4353304362fb"
        command:
          type: array
          description: "executor image command"
          items:
            type: string
          example:
            - "curl"
        args:
          type: array
          description: "additional executor binary arguments"
          items:
            type: string
          example:
            - "--repeats"
            - "5"
            - "--insecure"
        args_mode:
          type: string
          description: usage mode for arguments
          enum:
            - append
            - override
            - replace
        image:
          type: string
          description: container image, executor will run inside this image
          example: kubeshop/testkube-executor-custom:1.10.11-dev-0a9c91
        imagePullSecrets:
          type: array
          description: "container image pull secrets"
          items:
            $ref: "#/components/schemas/LocalObjectReference"
        envs:
          deprecated: true
          type: object
          description: "Environment variables passed to executor. Deprecated: use Basic Variables instead"
          additionalProperties:
            type: string
          example:
            record: "true"
            prefix: "some-"
        secretEnvs:
          deprecated: true
          type: object
          description: "Execution variables passed to executor from secrets. Deprecated: use Secret Variables instead"
          additionalProperties:
            type: string
          example:
            secret_key_name1: "secret-name"
            secret_Key_name2: "secret-name"
        sync:
          type: boolean
          description: whether to start execution sync or async
        httpProxy:
          type: string
          description: http proxy for executor containers
          example: user:pass@my.proxy.server:8080
        httpsProxy:
          type: string
          description: https proxy for executor containers
          example: user:pass@my.proxy.server:8081
        negativeTest:
          type: boolean
          description: whether to run test as negative test
          example: false
        isNegativeTestChangedOnRun:
          type: boolean
          description: whether negativeTest was changed by user
          example: false
        activeDeadlineSeconds:
          type: integer
          format: int64
          description: duration in seconds the test may be active, until its stopped
          example: 1
        uploads:
          type: array
          items:
            type: string
          description: list of file paths that need to be copied into the test from uploads
          example:
            - settings/config.txt
        bucketName:
          type: string
          description: minio bucket name to get uploads from
          example: execution-c01d7cf6-ec3f-47f0-9556-a5d6e9009a43
        artifactRequest:
          $ref: "#/components/schemas/ArtifactRequest"
          description: configuration parameters for storing test artifacts
        jobTemplate:
          type: string
          description: job template extensions
        jobTemplateReference:
          type: string
          description: name of the template resource
        cronJobTemplate:
          type: string
          description: cron job template extensions
        cronJobTemplateReference:
          type: string
          description: name of the template resource
        contentRequest:
          $ref: "#/components/schemas/TestContentRequest"
          description: adjusting parameters for test content
        preRunScript:
          type: string
          description: script to run before test execution
          example: "echo -n '$SECRET_ENV' > ./secret_file"
        postRunScript:
          type: string
          description: script to run after test execution
          example: "sleep 30"
        executePostRunScriptBeforeScraping:
          type: boolean
          description: execute post run script before scraping (prebuilt executor only)
        sourceScripts:
          type: boolean
          description: run scripts using source command (container executor only)
        scraperTemplate:
          type: string
          description: scraper template extensions
        scraperTemplateReference:
          type: string
          description: name of the template resource
        pvcTemplate:
          type: string
          description: pvc template extensions
        pvcTemplateReference:
          type: string
          description: name of the template resource
        envConfigMaps:
          type: array
          description: "config map references"
          items:
            $ref: "#/components/schemas/EnvReference"
        envSecrets:
          type: array
          description: "secret references"
          items:
            $ref: "#/components/schemas/EnvReference"
        runningContext:
          $ref: "#/components/schemas/RunningContext"
          description: running context for the test execution
        testExecutionName:
          type: string
          description: test execution name started the test execution
        downloadArtifactExecutionIDs:
          type: array
          description: "execution ids for artifacts to download"
          items:
            type: string
        downloadArtifactTestNames:
          type: array
          description: "test names for artifacts to download from latest executions"
          items:
            type: string
        slavePodRequest:
          $ref: "#/components/schemas/PodRequest"
          description: configuration parameters for executed slave pods
        executionNamespace:
          type: string
          description: namespace for test execution (Pro edition only)
        disableWebhooks:
          type: boolean
          description: whether webhooks on this execution are disabled
          default: false
          example:
            - true
            - false

    TestSuiteStepExecutionRequest:
      description: test step execution request body
      type: object
      readOnly: true
      properties:
        executionLabels:
          type: object
          description: "test execution labels"
          additionalProperties:
            type: string
          example:
            users: "3"
            prefix: "some-"
        variables:
          $ref: "#/components/schemas/Variables"
        command:
          type: array
          description: "executor image command"
          items:
            type: string
          example:
            - "curl"
        args:
          type: array
          description: "additional executor binary arguments"
          items:
            type: string
          example:
            - "--repeats"
            - "5"
            - "--insecure"
        args_mode:
          type: string
          description: usage mode for arguments
          enum:
            - append
            - override
            - replace
        sync:
          type: boolean
          description: whether to start execution sync or async
        httpProxy:
          type: string
          description: http proxy for executor containers
          example: user:pass@my.proxy.server:8080
        httpsProxy:
          type: string
          description: https proxy for executor containers
          example: user:pass@my.proxy.server:8081
        negativeTest:
          type: boolean
          description: whether to run test as negative test
          example: false
        jobTemplate:
          type: string
          description: job template extensions
        jobTemplateReference:
          type: string
          description: name of the template resource
        cronJobTemplate:
          type: string
          description: cron job template extensions
        cronJobTemplateReference:
          type: string
          description: name of the template resource
        scraperTemplate:
          type: string
          description: scraper template extensions
        scraperTemplateReference:
          type: string
          description: name of the template resource
        pvcTemplate:
          type: string
          description: pvc template extensions
        pvcTemplateReference:
          type: string
          description: name of the template resource
        runningContext:
          $ref: "#/components/schemas/RunningContext"
          description: running context for the test execution
        disableWebhooks:
          type: boolean
          description: whether webhooks on the execution of this step are disabled
          default: false
          example:
            - true
            - false

    ExecutionUpdateRequest:
      description: test execution request update body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/ExecutionRequest"

    TestSuiteExecutionRequest:
      description: test suite execution request body
      type: object
      properties:
        name:
          type: string
          description: test execution custom name
          example: "testing with 1000 users"
        number:
          type: integer
          description: test suite execution number
          example: 1
        namespace:
          type: string
          description: test kubernetes namespace ("testkube" when not set)
          example: testkube
        variables:
          $ref: "#/components/schemas/Variables"
        secretUUID:
          type: string
          description: secret uuid
          readOnly: true
          example: "7934600f-b367-48dd-b981-4353304362fb"
        labels:
          type: object
          description: "test suite labels"
          additionalProperties:
            type: string
          example:
            users: "3"
            prefix: "some-"
        executionLabels:
          type: object
          description: "execution labels"
          additionalProperties:
            type: string
          example:
            users: "3"
            prefix: "some-"
        sync:
          type: boolean
          description: whether to start execution sync or async
        httpProxy:
          type: string
          description: http proxy for executor containers
          example: user:pass@my.proxy.server:8080
        httpsProxy:
          type: string
          description: https proxy for executor containers
          example: user:pass@my.proxy.server:8081
        timeout:
          type: integer
          format: int32
          description: duration in seconds the test suite may be active, until its stopped
          example: 1
        contentRequest:
          $ref: "#/components/schemas/TestContentRequest"
          description: adjusting parameters for test content
        runningContext:
          $ref: "#/components/schemas/RunningContext"
          description: running context for the test suite execution
        jobTemplate:
          type: string
          description: job template extensions
        jobTemplateReference:
          type: string
          description: name of the template resource
        cronJobTemplate:
          type: string
          description: cron job template extensions
        cronJobTemplateReference:
          type: string
          description: name of the template resource
        scraperTemplate:
          type: string
          description: scraper template extensions
        scraperTemplateReference:
          type: string
          description: name of the template resource
        pvcTemplate:
          type: string
          description: pvc template extensions
        pvcTemplateReference:
          type: string
          description: name of the template resource
        concurrencyLevel:
          type: integer
          format: int32
          description: number of tests run in parallel
          example: 10
        testSuiteExecutionName:
          type: string
          description: test suite execution name started the test suite execution
        disableWebhooks:
          type: boolean
          description: whether webhooks on the execution of this test suite are disabled
          default: false
          example:
            - true
            - false

    TestSuiteExecutionUpdateRequest:
      description: test suite execution update request body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/TestSuiteExecutionRequest"

    TestUpsertRequest:
      description: test create request body
      type: object
      allOf:
        - $ref: "#/components/schemas/Test"

    TestUpdateRequest:
      description: test update request body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/Test"

    TestSuiteUpsertRequest:
      description: test suite create request body
      type: object
      required:
        - name
        - namespace
      allOf:
        - $ref: "#/components/schemas/TestSuite"
        - $ref: "#/components/schemas/ObjectRef"

    TestSuiteUpsertRequestV2:
      description: test suite create request body
      type: object
      required:
        - name
        - namespace
      allOf:
        - $ref: "#/components/schemas/TestSuiteV2"
        - $ref: "#/components/schemas/ObjectRef"

    TestSuiteUpdateRequest:
      description: test suite update body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/TestSuite"
        - $ref: "#/components/schemas/ObjectRef"

    TestSuiteUpdateRequestV2:
      description: test suite update body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/TestSuiteV2"
        - $ref: "#/components/schemas/ObjectRef"

    TestTriggerUpsertRequest:
      description: test trigger create or update request body
      type: object
      required:
        - resource
        - resourceSelector
        - event
        - action
        - execution
        - testSelector
      allOf:
        - $ref: "#/components/schemas/TestTrigger"
        - $ref: "#/components/schemas/ObjectRef"

    ExecutorUpsertRequest:
      description: executor create request body
      type: object
      required:
        - name
        - namespace
        - types
      allOf:
        - $ref: "#/components/schemas/Executor"
        - $ref: "#/components/schemas/ObjectRef"

    ExecutorUpdateRequest:
      description: executor update request body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/Executor"
        - $ref: "#/components/schemas/ObjectRef"

    WebhookCreateRequest:
      description: webhook create request body
      type: object
      allOf:
        - $ref: "#/components/schemas/Webhook"

    WebhookUpdateRequest:
      description: webhook update request body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/Webhook"

    WebhookTemplateCreateRequest:
      description: webhook template create request body
      type: object
      allOf:
        - $ref: "#/components/schemas/WebhookTemplate"

    WebhookTemplateUpdateRequest:
      description: webhook template update request body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/WebhookTemplate"

    # Copied from CRD spec
    # https://github.com/kubeshop/testkube-operator/blob/main/config/crd/bases/executor.testkube.io_executors.yaml
    # TODO we need to sync those in some nice way
    Executor:
      description: CRD based executor data
      type: object
      properties:
        executorType:
          description:
            ExecutorType one of "rest" for rest openapi based executors
            or "job" which will be default runners for testkube soon
          type: string
        image:
          description: Image for kube-job
          type: string
        slaves:
          $ref: "#/components/schemas/SlavesMeta"
        imagePullSecrets:
          type: array
          description: "container image pull secrets"
          items:
            $ref: "#/components/schemas/LocalObjectReference"
        command:
          type: array
          description: "executor image command"
          items:
            type: string
          example:
            - "curl"
        args:
          type: array
          description: "additional executor binary argument"
          items:
            type: string
          example:
            - "--repeats"
            - "5"
            - "--insecure"
        types:
          description: Types defines what types can be handled by executor e.g.
            "postman/collection", ":curl/command" etc
          items:
            type: string
          type: array
        uri:
          description: URI for rest based executors
          type: string
        contentTypes:
          description: list of handled content types
          items:
            type: string
          type: array
        jobTemplate:
          description: Job template to launch executor
          type: string
        jobTemplateReference:
          type: string
          description: name of the template resource
        labels:
          type: object
          description: "executor labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        features:
          description: Available executor features
          type: array
          items:
            type: string
            enum:
              - artifacts
              - junit-report
        meta:
          $ref: "#/components/schemas/ExecutorMeta"
        useDataDirAsWorkingDir:
          type: boolean
          description: use data dir as working dir for executor

    ExecutorDetails:
      description: Executor details with Executor data and additional information like list of executions
      type: object
      properties:
        name:
          description: Executor name
          type: string
        executor:
          $ref: "#/components/schemas/Executor"
        executions:
          $ref: "#/components/schemas/ExecutionsResult"

    ExecutorOutput:
      description: CRD based executor data
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: One of possible output types
          enum:
            - error
            - log
            - event
            - result
        content:
          type: string
          description: Message/event data passed from executor (like log lines etc)
        result:
          $ref: "#/components/schemas/ExecutionResult"
          description: Execution result when job is finished
        time:
          type: string
          format: date-time
          description: Timestamp of log
          example: "2018-03-20T09:12:28Z"

    LogV2:
      description: Log format version 2
      type: object
      required:
        - logVersion
        - source
      properties:
        time:
          type: string
          format: date-time
          description: Timestamp of log
          example: "2018-03-20T09:12:28Z"
        content:
          type: string
          description: Message/event data passed from executor (like log lines etc)
        type:
          type: string
          description: One of possible log types
        source:
          type: string
          description: One of possible log sources
          enum:
            - job-pod
            - test-scheduler
            - container-executor
            - job-executor
        error:
          type: boolean
          description: indicates a log error
        version:
          type: string
          description: One of possible log versions
          enum:
            - v1
            - v2
        metadata:
          type: object
          description: additional log details
          additionalProperties:
            type: string
          example:
            argsl: "passed command arguments"
        v1:
          $ref: "#/components/schemas/LogV1"
          description: Old output - for backwards compatibility - will be removed for non-structured logs

    LogV1:
      description: Log format version 1
      type: object
      required:
        - type
      properties:
        result:
          $ref: "#/components/schemas/ExecutionResult"
          description: output for previous log format

    ExecutorMeta:
      description: Executor meta data
      type: object
      properties:
        iconURI:
          description: URI for executor icon
          type: string
          example: /assets/k6.jpg
        docsURI:
          description: URI for executor docs
          type: string
          example: https://docs.testkube.io/test-types/executor-k6
        tooltips:
          type: object
          description: executor tooltips
          additionalProperties:
            type: string
          example:
            general: "please provide k6 test script for execution"

    ExecutorMetaUpdate:
      description: Executor meta update data
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/ExecutorMeta"

    SlavesMeta:
      description: Slave data for executing tests in distributed environment
      type: object
      properties:
        image:
          description: slave image
          type: string
          example: kubeshop/ex-slaves-image:latest
      required:
        - image

    RunningContext:
      description: running context for test or test suite execution
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: One of possible context types
          enum:
            - userCLI
            - userUI
            - testsuite
            - testtrigger
            - scheduler
            - testworkflow
        context:
          type: string
          description: Context value depending from its type

    TestWorkflowRunningContext:
      description: running context for test workflow execution
      type: object
      required:
        - interface
        - actor
      properties:
        interface:
          $ref: "#/components/schemas/TestWorkflowRunningContextInterface"
        actor:
          $ref: "#/components/schemas/TestWorkflowRunningContextActor"

    TestWorkflowRunningContextInterface:
      description: running context interface for test workflow execution
      type: object
      required:
        - type
      properties:
        name:
          type: string
          description: interface name
        type:
          $ref: "#/components/schemas/TestWorkflowRunningContextInterfaceType"

    TestWorkflowRunningContextActor:
      description: running context actor for test workflow execution
      type: object
      required:
        - type
      properties:
        name:
          type: string
          description: actor name
        email:
          type: string
          description: actor email
        executionId:
          type: string
          description: test workflow execution id
        executionPath:
          type: string
          description: all test workflow execution ids starting from the root
        executionReference:
          type: string
          description: reference test workflow execution id         
        type:
          $ref: "#/components/schemas/TestWorkflowRunningContextActorType"

    TestWorkflowRunningContextInterfaceType:
      description: supported interfaces for test workflow running context
      type: string
      enum:
        - cli
        - ui
        - api
        - ci/cd
        - internal

    TestWorkflowRunningContextActorType:
      description: supported actors for test workflow running context
      type: string
      enum:
        - cron
        - testtrigger
        - user
        - testworkflow
        - testworkflowexecution
        - program

    Webhook:
      description: CRD based webhook data
      type: object
      required:
        - name
      properties:
        name:
          type: string
          example: "webhook1"
        namespace:
          type: string
          example: "testkube"
        uri:
          type: string
          example: "https://hooks.app.com/services/1"
        events:
          type: array
          items:
            $ref: "#/components/schemas/EventType"
        selector:
          type: string
          description: Labels to filter for tests and test suites
        payloadObjectField:
          type: string
          description: will load the generated payload for notification inside the object
        payloadTemplate:
          type: string
          description: golang based template for notification payload
        payloadTemplateReference:
          type: string
          description: name of the template resource
        headers:
          type: object
          description: "webhook headers (golang template supported)"
          additionalProperties:
            type: string
          example:
            Content-Type: "application/xml"
        labels:
          type: object
          description: "webhook labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        annotations:
          type: object
          description: "webhook annotations"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        disabled:
          type: boolean
          description: whether webhook is disabled
          default: false
          example:
            - true
            - false
        config:
          $ref: "#/components/schemas/WebhookConfig"
        parameters:
          type: array
          items:
            $ref: "#/components/schemas/WebhookParameterSchema"
        webhookTemplateRef:
          $ref: "#/components/schemas/WebhookTemplateRef"

    WebhookTemplate:
      description: CRD based webhook data template
      type: object
      required:
        - name
      properties:
        name:
          type: string
          example: "webhook1"
        namespace:
          type: string
          example: "testkube"
        uri:
          type: string
          example: "https://hooks.app.com/services/1"
        events:
          type: array
          items:
            $ref: "#/components/schemas/EventType"
        selector:
          type: string
          description: Labels to filter for tests and test suites
        payloadObjectField:
          type: string
          description: will load the generated payload for notification inside the object
        payloadTemplate:
          type: string
          description: golang based template for notification payload
        payloadTemplateReference:
          type: string
          description: name of the template resource
        headers:
          type: object
          description: "webhook headers (golang template supported)"
          additionalProperties:
            type: string
          example:
            Content-Type: "application/xml"
        labels:
          type: object
          description: "webhook labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        annotations:
          type: object
          description: "webhook annotations"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        disabled:
          type: boolean
          description: whether webhook is disabled
          default: false
          example:
            - true
            - false
        config:
          $ref: "#/components/schemas/WebhookConfig"
        parameters:
          type: array
          items:
            $ref: "#/components/schemas/WebhookParameterSchema"

    Event:
      description: Event data
      type: object
      required:
        - type
        - id
        - resourceId
        - resource
      properties:
        id:
          type: string
          description: UUID of event
        streamTopic:
          type: string
          description: stream topic
        resource:
          $ref: "#/components/schemas/EventResource"
        resourceId:
          type: string
          description: ID of resource
        type:
          $ref: "#/components/schemas/EventType"
        testExecution:
          $ref: "#/components/schemas/Execution"
        testSuiteExecution:
          $ref: "#/components/schemas/TestSuiteExecution"
        testWorkflowExecution:
          $ref: "#/components/schemas/TestWorkflowExecution"
        clusterName:
          type: string
          description: cluster name of event
        envs:
          type: object
          description: "environment variables"
          additionalProperties:
            type: string
          example:
            WEBHOOK_PARAMETER: "any value"
        external:
          type: boolean

    EventResource:
      type: string
      enum:
        - test
        - testsuite
        - executor
        - trigger
        - webhook
        - webhooktemplate
        - testexecution
        - testsuiteexecution
        - testsource
        - testworkflow
        - testworkflowexecution

    EventType:
      type: string
      enum:
        - start-test
        - end-test-success
        - end-test-failed
        - end-test-aborted
        - end-test-timeout
        - become-test-up
        - become-test-down
        - become-test-failed
        - become-test-aborted
        - become-test-timeout
        - start-testsuite
        - end-testsuite-success
        - end-testsuite-failed
        - end-testsuite-aborted
        - end-testsuite-timeout
        - become-testsuite-up
        - become-testsuite-down
        - become-testsuite-failed
        - become-testsuite-aborted
        - become-testsuite-timeout
        - queue-testworkflow
        - start-testworkflow
        - end-testworkflow-success
        - end-testworkflow-failed
        - end-testworkflow-aborted
        - become-testworkflow-up
        - become-testworkflow-down
        - become-testworkflow-failed
        - become-testworkflow-aborted
        - created
        - updated
        - deleted

    EventResult:
      description: Listener result after sending particular event
      type: object
      required:
        - type
      properties:
        id:
          type: string
          description: UUID of event
        error:
          type: string
          description: error message if any
        result:
          type: string
          format: error
          description: result of event

    TestWithExecution:
      description: Test with latest Execution result
      type: object
      required:
        - test
      properties:
        test:
          $ref: "#/components/schemas/Test"
        latestExecution:
          $ref: "#/components/schemas/Execution"

    TestWithExecutionSummary:
      description: Test with latest Execution result summary
      type: object
      required:
        - test
      properties:
        test:
          $ref: "#/components/schemas/Test"
        latestExecution:
          $ref: "#/components/schemas/ExecutionSummary"

    TestSuiteWithExecution:
      description: Test suite with latest execution result
      type: object
      required:
        - testSuite
      properties:
        testSuite:
          $ref: "#/components/schemas/TestSuite"
        latestExecution:
          $ref: "#/components/schemas/TestSuiteExecution"

    TestSuiteWithExecutionSummary:
      description: Test suite with latest execution result
      type: object
      required:
        - testSuite
      properties:
        testSuite:
          $ref: "#/components/schemas/TestSuite"
        latestExecution:
          $ref: "#/components/schemas/TestSuiteExecutionSummary"

    Config:
      description: Testkube API config data structure
      type: object
      required:
        - id
        - clusterId
        - enableTelemetry
      properties:
        id:
          type: string
        clusterId:
          type: string
        enableTelemetry:
          type: boolean

    DebugInfo:
      description: Testkube debug info
      type: object
      properties:
        clientVersion:
          type: string
          example: "1.4.9"
        serverVersion:
          type: string
          example: "v1.4.9"
        clusterVersion:
          type: string
          example: "v1.23.4"
        apiLogs:
          type: array
          items:
            type: string
          example: ["logline1", "logline2", "logline3"]
        operatorLogs:
          type: array
          items:
            type: string
          example: ["logline1", "logline2", "logline3"]

    Features:
      type: object
      required:
        - logsV2
      properties:
        logsV2:
          type: boolean
          description: Log processing version 2

    TestTrigger:
      type: object
      required:
        - resource
        - resourceSelector
        - event
        - action
        - execution
        - testSelector
      properties:
        name:
          type: string
          description: test trigger name
          example: "test1"
        namespace:
          type: string
          description: test trigger namespace
          example: "testkube"
        labels:
          type: object
          description: "test trigger labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        annotations:
          type: object
          description: "test trigger annotations"
          additionalProperties:
            type: string
          example:
            group: "teamA"
            app: "backend"
        resource:
          $ref: "#/components/schemas/TestTriggerResources"
        resourceSelector:
          $ref: "#/components/schemas/TestTriggerSelector"
        event:
          type: string
          description: listen for event for selected resource
          example: modified
        conditionSpec:
          $ref: "#/components/schemas/TestTriggerConditionSpec"
        probeSpec:
          $ref: "#/components/schemas/TestTriggerProbeSpec"
        action:
          $ref: "#/components/schemas/TestTriggerActions"
        actionParameters:
          $ref: "#/components/schemas/TestTriggerActionParameters"        
        execution:
          $ref: "#/components/schemas/TestTriggerExecutions"
        testSelector:
          $ref: "#/components/schemas/TestTriggerSelector"
        concurrencyPolicy:
          $ref: "#/components/schemas/TestTriggerConcurrencyPolicies"
        disabled:
          type: boolean
          description: whether test trigger is disabled
          default: false
          example:
            - true
            - false

    LocalObjectReference:
      description: Reference to Kubernetes object
      type: object
      properties:
        name:
          type: string

    EnvReference:
      description: Reference to env resource
      type: object
      required:
        - reference
      properties:
        reference:
          $ref: "#/components/schemas/LocalObjectReference"
        mount:
          type: boolean
          description: whether we shoud mount resource
          example: /etc/data
        mountPath:
          type: string
          description: where we shoud mount resource
        mapToVariables:
          type: boolean
          description: whether we shoud map to variables from resource
          default: false

    TestTriggerSelector:
      type: object
      properties:
        name:
          type: string
          description: kubernetes resource name selector
          example: nginx
        nameRegex:
          type: string
          description: kubernetes resource name regex
          example: nginx.*
        namespace:
          type: string
          description: resource namespace
          example: testkube
        namespaceRegex:
          type: string
          description: kubernetes resource namespace regex
          example: test*
        labelSelector:
          $ref: "https://raw.githubusercontent.com/garethr/kubernetes-json-schema/master/v1.7.8/_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
          description: label selector for Kubernetes resources

    TestTriggerResources:
      description: supported kubernetes resources for test triggers
      type: string
      enum:
        - pod
        - deployment
        - statefulset
        - daemonset
        - service
        - ingress
        - event
        - configmap

    TestTriggerExecutions:
      description: supported test resources for test triggers
      type: string
      enum:
        - test
        - testsuite
        - testworkflow

    TestTriggerActions:
      description: supported actions for test triggers
      type: string
      enum:
        - run

    TestTriggerActionParameters:
      description: supported action parameters for test triggers
      type: object
      properties:
        config:
          $ref: "#/components/schemas/TestWorkflowConfigValue"
        tags:
          $ref: "#/components/schemas/TestWorkflowTagValue"        

    TestTriggerConditionSpec:
      type: object
      properties:
        conditions:
          type: array
          items:
            $ref: "#/components/schemas/TestTriggerCondition"
          description: list of test trigger conditions
        timeout:
          type: integer
          format: int32
          description: duration in seconds the test trigger waits for conditions, until its stopped
          example: 1
        delay:
          type: integer
          format: int32
          description: duration in seconds the test trigger waits between condition checks
          example: 1

    TestTriggerCondition:
      description: supported condition for test triggers
      type: object
      required:
        - status
        - type
      properties:
        status:
          $ref: "#/components/schemas/TestTriggerConditionStatuses"
        type:
          type: string
          description: test trigger condition
          example: Progressing
        reason:
          type: string
          description: test trigger condition reason
          example: NewReplicaSetAvailable
        ttl:
          type: integer
          format: int32
          description: duration in seconds in the past from current time when the condition is still valid
          example: 1

    TestTriggerConditionStatuses:
      description: supported kubernetes condition statuses for test triggers
      type: string
      enum:
        - "True"
        - "False"
        - "Unknown"

    TestTriggerProbeSpec:
      type: object
      properties:
        probes:
          type: array
          items:
            $ref: "#/components/schemas/TestTriggerProbe"
          description: list of test trigger probes
        timeout:
          type: integer
          format: int32
          description: duration in seconds the test trigger waits for probes, until its stopped
          example: 1
        delay:
          type: integer
          format: int32
          description: duration in seconds the test trigger waits between probes
          example: 1

    TestTriggerProbe:
      description: supported probe for test triggers
      type: object
      properties:
        scheme:
          type: string
          description: test trigger condition probe scheme to connect to host, default is http
          example: http
        host:
          type: string
          description: test trigger condition probe host, default is pod ip or service name
          example: testkube-api-server
        path:
          type: string
          description: test trigger condition probe path to check, default is /
          example: /
        port:
          type: integer
          format: int32
          description: test trigger condition probe port to connect
          example: 80
        headers:
          type: object
          description: test trigger condition probe headers to submit
          additionalProperties:
            type: string
          example:
            Content-Type: "application/xml"

    TestTriggerConcurrencyPolicies:
      description: supported concurrency policies for test triggers
      type: string
      enum:
        - allow
        - forbid
        - replace

    TestTriggerKeyMap:
      type: object
      required:
        - resources
        - actions
        - executions
        - events
        - concurrencyPolicies
      properties:
        resources:
          type: array
          items:
            type: string
          description: list of supported values for resources
          example:
            [
              "pod",
              "deployment",
              "statefulset",
              "daemonset",
              "service",
              "ingress",
              "event",
              "configmap",
            ]
        actions:
          type: array
          items:
            type: string
          description: list of supported values for actions
          example: ["run"]
        executions:
          type: array
          items:
            type: string
          description: list of supported values for executions
          example: ["test", "testsuite"]
        events:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: mapping between resources and supported events
          example:
            {
              "pod": ["created", "modified", "deleted"],
              "deployment": ["created", "modified", "deleted"],
            }
        conditions:
          type: array
          items:
            type: string
          description: list of supported values for conditions
          example: ["Available", "Progressing"]
        concurrencyPolicies:
          type: array
          items:
            type: string
          description: list of supported values for concurrency policies
          example: ["allow", "forbid", "replace"]

    TestSourceBatchRequest:
      description: Test source batch request
      type: object
      required:
        - batch
      properties:
        batch:
          type: array
          items:
            $ref: "#/components/schemas/TestSourceUpsertRequest"

    TestSourceBatchResult:
      description: Test source batch result
      type: object
      properties:
        created:
          type: array
          items:
            type: string
          description: created test sources
          example: ["name1", "name2", "name3"]
        updated:
          type: array
          items:
            type: string
          description: updated test sources
          example: ["name4", "name5", "name6"]
        deleted:
          type: array
          items:
            type: string
          description: deleted test sources
          example: ["name7", "name8", "name9"]

    Template:
      description: Golang based template
      type: object
      required:
        - name
        - type
        - body
      properties:
        name:
          type: string
          description: template name for reference
          example: "webhook-template"
        namespace:
          type: string
          description: template namespace
          example: "testkube"
        type:
          $ref: "#/components/schemas/TemplateType"
        body:
          type: string
          description: template body to use
          example: '{"id": "{{ .Id }}"}'
        labels:
          type: object
          description: "template labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"

    TemplateType:
      description: template type by purpose
      type: string
      enum:
        - job
        - container
        - cronjob
        - scraper
        - pvc
        - webhook
        - pod

    TemplateCreateRequest:
      description: template create request body
      type: object
      allOf:
        - $ref: "#/components/schemas/Template"

    TemplateUpdateRequest:
      description: template update request body
      type: object
      nullable: true
      allOf:
        - $ref: "#/components/schemas/Template"

    Secret:
      description: Secret with keys
      type: object
      required:
        - name
        - controlled
      properties:
        name:
          type: string
          description: secret name
          example: "git-secret"
        namespace:
          type: string
          description: secret namespace
        type:
          type: string
          description: secret type
          default: Opaque
        createdAt:
          type: string
          format: date-time
          example: "2022-07-30T06:54:15Z"
        updatedAt:
          type: string
          format: date-time
          example: "2022-07-30T06:54:15Z"
        controlled:
          type: boolean
          description: is this Secret controlled by Testkube
        owner:
          $ref: "#/components/schemas/SecretOwner"
        labels:
          type: object
          description: labels associated with the secret
          additionalProperties:
            type: string
        keys:
          type: array
          description: secret keys
          items:
            type: string
          example: ["key1", "key2", "key3"]

    SecretInput:
      description: Secret input information
      type: object
      required:
      - name
      - data
      properties:
        name:
          type: string
          description: secret name
          example: "git-secret"
        type:
          type: string
          description: secret type
          default: Opaque
        namespace:
          type: string
          description: secret namespace
        owner:
          $ref: "#/components/schemas/SecretOwner"
        labels:
          type: object
          description: labels associated with the secret
          additionalProperties:
            type: string
        data:
          type: object
          description: data to store in the secret
          additionalProperties:
            type: string

    SecretUpdate:
      description: Secret input information to update
      type: object
      properties:
        name:
          type: string
          description: secret name
          example: "git-secret"
        owner:
          $ref: "#/components/schemas/SecretOwner"
        labels:
          type: object
          description: labels associated with the secret
          additionalProperties:
            type: string
        data:
          type: object
          description: data to store in the secret
          additionalProperties:
            type: string

    SecretOwner:
      description: Resource that owns the secret
      type: object
      required:
      - kind
      - name
      properties:
        kind:
          description: kind of the resource that is the owner
          type: string
        name:
          type: string
          description: name of the owner resource

    SecretConfig:
      type: object
      required:
      - prefix
      - list
      - listAll
      - create
      - modify
      - delete
      - autoCreate
      properties:
        prefix:
          type: string
          description: prefix for the secrets created via Testkube
        list:
          type: boolean
          description: allow to list secrets created via Testkube
        listAll:
          type: boolean
          description: allow to list all secrets
        create:
          type: boolean
          description: allow to create a new secret via Testkube
        modify:
          type: boolean
          description: allow to modify a secret created via Testkube
        delete:
          type: boolean
          description: allow to delete a secret created via Testkube
        autoCreate:
          type: boolean
          description: allow to automatically create secrets via Testkube for sensitive credentials

    TestWorkflow:
      type: object
      properties:
        name:
          type: string
          description: kubernetes resource name
        namespace:
          type: string
          description: kubernetes namespace
        description:
          type: string
          description: human-readable description
        labels:
          type: object
          description: "test workflow labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        annotations:
          type: object
          description: "test workflow annotations"
          additionalProperties:
            type: string
        created:
          type: string
          format: date-time
          example: "2022-07-30T06:54:15Z"
        updated:
          type: string
          format: date-time
          example: "2022-07-30T06:54:15Z"
        spec:
          $ref: "#/components/schemas/TestWorkflowSpec"
        readOnly:
          type: boolean
          description: if test workflow is offline and cannot be executed
        status:
          $ref: "#/components/schemas/TestWorkflowStatusSummary"

    TestWorkflowExecutionRequest:
      type: object
      properties:
        name:
          type: string
          description: custom execution name
        config:
          $ref: "#/components/schemas/TestWorkflowConfigValue"
        testWorkflowExecutionName:
          type: string
          description: test workflow execution name started the test workflow execution
        disableWebhooks:
          type: boolean
          description: whether webhooks on the execution of this test workflow are disabled
          default: false
        tags:
          $ref: "#/components/schemas/TestWorkflowTagValue"
        target:
          $ref: "#/components/schemas/ExecutionTarget"
        runningContext:
          description: running context for the test workflow execution (Pro edition only)
          $ref: "#/components/schemas/TestWorkflowRunningContext"
        parentExecutionIds:
          type: array
          description: parent execution ids
          items:
            type: string

    ExecutionTarget:
      type: object
      properties:
        match:
          type: object
          description: runner labels to match
          additionalProperties:
            type: array
            items:
              type: string
        not:
          type: object
          description: runner labels to NOT match
          additionalProperties:
            type: array
            items:
              type: string
        replicate:
          type: array
          description: list of runner labels to replicate the executions
          items:
            type: string

    TestWorkflowWithExecution:
      type: object
      properties:
        workflow:
          $ref: "#/components/schemas/TestWorkflow"
        latestExecution:
          $ref: "#/components/schemas/TestWorkflowExecution"

    TestWorkflowWithExecutionSummary:
      type: object
      properties:
        workflow:
          $ref: "#/components/schemas/TestWorkflow"
        latestExecution:
          $ref: "#/components/schemas/TestWorkflowExecutionSummary"

    TestWorkflowExecutionsResult:
      type: object
      properties:
        totals:
          $ref: "#/components/schemas/ExecutionsTotals"
        filtered:
          $ref: "#/components/schemas/ExecutionsTotals"
        results:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowExecutionSummary"
      required:
        - totals
        - filtered
        - results

    TestWorkflowExecution:
      type: object
      properties:
        id:
          type: string
          description: unique execution identifier
          format: bson objectId
          example: "62f395e004109209b50edfc1"
        groupId:
          type: string
          description: identifier for group of correlated executions
          format: bson objectId
          example: "62f395e004109209b50edfc1"
        runnerId:
          type: string
          description: identifier of the runner where it has been executed
        runnerTarget:
          $ref: "#/components/schemas/ExecutionTarget"
        runnerOriginalTarget:
          $ref: "#/components/schemas/ExecutionTarget"
        name:
          type: string
          description: execution name
          example: "some-workflow-name-1"
        namespace:
          type: string
          description: execution namespace
          example: "my-testkube"
        number:
          type: integer
          description: sequence number for the execution
        scheduledAt:
          type: string
          format: date-time
          description: when the execution has been scheduled to run
        assignedAt:
          type: string
          format: date-time
          description: when the execution has been assigned to some runner
        statusAt:
          type: string
          format: date-time
          description: when the execution result's status has changed last time (queued, passed, failed)
        signature:
          type: array
          description: structured tree of steps
          items:
            $ref: "#/components/schemas/TestWorkflowSignature"
        result:
          $ref: "#/components/schemas/TestWorkflowResult"
        output:
          type: array
          description: additional information from the steps, like referenced executed tests or artifacts
          items:
            $ref: "#/components/schemas/TestWorkflowOutput"
        reports:
          type: array
          description: generated reports from the steps, like junit
          items:
            $ref: "#/components/schemas/TestWorkflowReport"
        workflow:
          $ref: "#/components/schemas/TestWorkflow"
        resolvedWorkflow:
          $ref: "#/components/schemas/TestWorkflow"
        testWorkflowExecutionName:
          type: string
          description: test workflow execution name started the test workflow execution
        disableWebhooks:
          type: boolean
          description: whether webhooks on the execution of this test workflow are disabled
          default: false
          example:
            - true
            - false
        tags:
          $ref: "#/components/schemas/TestWorkflowTagValue"
        runningContext:
          description: running context for the test workflow execution (Pro edition only)
          $ref: "#/components/schemas/TestWorkflowRunningContext"
        configParams:
          $ref: "#/components/schemas/TestWorkflowExecutionConfig"
      required:
        - id
        - name
        - workflow

    TestWorkflowExecutionSummary:
      type: object
      properties:
        id:
          type: string
          description: unique execution identifier
          format: bson objectId
          example: "62f395e004109209b50edfc1"
        groupId:
          type: string
          description: identifier for group of correlated executions
          format: bson objectId
          example: "62f395e004109209b50edfc1"
        runnerId:
          type: string
          description: identifier of the runner where it has been executed
        name:
          type: string
          description: execution name
          example: "some-workflow-name-1"
        number:
          type: integer
          description: sequence number for the execution
        scheduledAt:
          type: string
          format: date-time
          description: when the execution has been scheduled to run
        statusAt:
          type: string
          format: date-time
          description: when the execution result's status has changed last time (queued, passed, failed)
        result:
          $ref: "#/components/schemas/TestWorkflowResultSummary"
        workflow:
          $ref: "#/components/schemas/TestWorkflowSummary"
        tags:
          $ref: "#/components/schemas/TestWorkflowTagValue"
        runningContext:
          description: running context for the test workflow execution (Pro edition only)
          $ref: "#/components/schemas/TestWorkflowRunningContext"
        configParams:
          $ref: "#/components/schemas/TestWorkflowExecutionConfig"
      required:
        - id
        - name
        - workflow

    TestWorkflowSummary:
      type: object
      properties:
        name:
          type: string
        namespace:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        annotations:
          type: object
          additionalProperties:
            type: string

    TestWorkflowResultSummary:
      type: object
      properties:
        status:
          $ref: "#/components/schemas/TestWorkflowStatus"
        predictedStatus:
          $ref: "#/components/schemas/TestWorkflowStatus"
        queuedAt:
          type: string
          format: date-time
          description: when the pod was created
        startedAt:
          type: string
          format: date-time
          description: when the pod has been successfully assigned
        finishedAt:
          type: string
          format: date-time
          description: when the pod has been completed
        duration:
          type: string
          description: Go-formatted (human-readable) duration
        totalDuration:
          type: string
          description: Go-formatted (human-readable) duration (incl. pause)
        durationMs:
          type: integer
          description: Duration in milliseconds
        totalDurationMs:
          type: integer
          description: Duration in milliseconds (incl. pause)
        pausedMs:
          type: integer
          description: Pause duration in milliseconds
      required:
        - status
        - predictedStatus
        - durationMs
        - totalDurationMs
        - pausedMs

    TestWorkflowStatusSummary:
      type: object
      description: test workflow status
      properties:
        latestExecution:
          $ref: "#/components/schemas/TestWorkflowExecutionSummary"

    TestWorkflowExecutionNotification:
      type: object
      properties:
        ts:
          type: string
          format: date-time
          description: timestamp for the notification if available
        result:
          $ref: "#/components/schemas/TestWorkflowResult"
        ref:
          type: string
          description: step reference, if related to some specific step
        log:
          type: string
          description: log content, if it's just a log. note, that it includes 30 chars timestamp + space
        output:
          $ref: "#/components/schemas/TestWorkflowOutput"
        temporary:
          type: boolean
          description: should it be considered temporary only for execution time

    TestWorkflowOutput:
      type: object
      properties:
        ref:
          type: string
          description: step reference
        name:
          type: string
          description: output kind name
        value:
          type: object
          additionalProperties: {}
          description: value returned

    TestWorkflowReport:
      type: object
      properties:
        ref:
          type: string
          description: step reference
        kind:
          type: string
          enum:
            - junit
          description: report kind/type
          example: junit
        file:
          type: string
          description: file path to full report in artifact storage
        summary:
          $ref: "#/components/schemas/TestWorkflowReportSummary"

    TestWorkflowReportSummary:
      type: object
      properties:
        tests:
          type: integer
          description: total number of test cases
        passed:
          type: integer
          description: number of passed test cases
        failed:
          type: integer
          description: number of failed test cases
        skipped:
          type: integer
          description: number of skipped test cases
        errored:
          type: integer
          description: number of error test cases
        duration:
          type: integer
          format: int64
          description: total duration of all test cases in milliseconds

    TestWorkflowResult:
      type: object
      properties:
        status:
          $ref: "#/components/schemas/TestWorkflowStatus"
        predictedStatus:
          $ref: "#/components/schemas/TestWorkflowStatus"
        queuedAt:
          type: string
          format: date-time
          description: when the pod was created
        startedAt:
          type: string
          format: date-time
          description: when the pod has been successfully assigned
        finishedAt:
          type: string
          format: date-time
          description: when the pod has been completed
        duration:
          type: string
          description: Go-formatted (human-readable) duration
        totalDuration:
          type: string
          description: Go-formatted (human-readable) total duration (incl. pause)
        durationMs:
          type: integer
          description: Duration in milliseconds
        pausedMs:
          type: integer
          description: Pause duration in milliseconds
        totalDurationMs:
          type: integer
          description: Total duration in milliseconds (incl. pause)
        pauses:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowPause"
        initialization:
          $ref: "#/components/schemas/TestWorkflowStepResult"
        steps:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/TestWorkflowStepResult"
      required:
        - status
        - predictedStatus
        - durationMs
        - pausedMs
        - totalDurationMs

    TestWorkflowPause:
      type: object
      properties:
        ref:
          type: string
          description: step at which it was paused
        pausedAt:
          type: string
          format: date-time
          description: when the pause has started
        resumedAt:
          type: string
          format: date-time
          description: when the pause has ended
      required:
      - ref
      - pausedAt

    TestWorkflowStepResult:
      type: object
      properties:
        errorMessage:
          type: string
        status:
          $ref: "#/components/schemas/TestWorkflowStepStatus"
        exitCode:
          type: number
        queuedAt:
          type: string
          format: date-time
          description: when the container was created
        startedAt:
          type: string
          format: date-time
          description: when the container was started
        finishedAt:
          type: string
          format: date-time
          description: when the container was finished

    TestWorkflowSignature:
      type: object
      properties:
        ref:
          type: string
          description: step reference
        name:
          type: string
          description: step name
        category:
          type: string
          description: step category, that may be used as name fallback
        optional:
          type: boolean
          description: is the step/group meant to be optional
        negative:
          type: boolean
          description: is the step/group meant to be negative
        children:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowSignature"

    TestWorkflowStatus:
      type: string
      enum:
        - queued
        - running
        - paused
        - passed
        - failed
        - aborted

    TestWorkflowStepStatus:
      type: string
      enum:
        - queued
        - running
        - paused
        - passed
        - failed
        - timeout
        - skipped
        - aborted

    TestWorkflowTemplate:
      type: object
      properties:
        name:
          type: string
          description: kubernetes resource name
        namespace:
          type: string
          description: kubernetes namespace
        description:
          type: string
          description: human-readable description
        labels:
          type: object
          description: "test workflow labels"
          additionalProperties:
            type: string
          example:
            env: "prod"
            app: "backend"
        annotations:
          type: object
          description: "test workflow annotations"
          additionalProperties:
            type: string
        created:
          type: string
          format: date-time
          example: "2022-07-30T06:54:15Z"
        updated:
          type: string
          format: date-time
          example: "2022-07-30T06:54:15Z"
        spec:
          $ref: "#/components/schemas/TestWorkflowTemplateSpec"

    TestWorkflowStepParallel:
      type: object
      allOf:
      - $ref: "#/components/schemas/TestWorkflowSpec"
      - $ref: "#/components/schemas/TestWorkflowStepExecuteStrategy"
      - $ref: "#/components/schemas/TestWorkflowStepControl"
      - $ref: "#/components/schemas/TestWorkflowStepOperations"
      - properties:
          parallelism:
            type: integer
            description: how many resources could be scheduled in parallel
          description:
            type: string
            description: worker description to display
          logs:
            $ref: "#/components/schemas/BoxedString"
          transfer:
            type: array
            description: list of files to send to parallel steps
            items:
              $ref: "#/components/schemas/TestWorkflowStepParallelTransfer"
          fetch:
            type: array
            description: list of files to fetch from parallel steps
            items:
              $ref: "#/components/schemas/TestWorkflowStepParallelFetch"
          template:
            $ref: "#/components/schemas/TestWorkflowTemplateRef"

    TestWorkflowIndependentStepParallel:
      type: object
      allOf:
      - $ref: "#/components/schemas/TestWorkflowTemplateSpec"
      - $ref: "#/components/schemas/TestWorkflowStepExecuteStrategy"
      - $ref: "#/components/schemas/TestWorkflowStepControl"
      - $ref: "#/components/schemas/TestWorkflowStepOperations"
      - properties:
          parallelism:
            type: integer
            description: how many resources could be scheduled in parallel
          description:
            type: string
            description: worker description to display
          logs:
            $ref: "#/components/schemas/BoxedString"
          transfer:
            type: array
            description: list of files to send to parallel steps
            items:
              $ref: "#/components/schemas/TestWorkflowStepParallelTransfer"
          fetch:
            type: array
            description: list of files to fetch from parallel steps
            items:
              $ref: "#/components/schemas/TestWorkflowStepParallelFetch"

    TestWorkflowIndependentServiceSpec:
      type: object
      allOf:
      - $ref: "#/components/schemas/TestWorkflowStepExecuteStrategy"
      - $ref: "#/components/schemas/TestWorkflowStepRun"
      - properties:
          description:
            type: string
            description: "service description to display"
          timeout:
            type: string
            description: "maximum time until reaching readiness"
          transfer:
            type: array
            description: list of files to send to parallel steps
            items:
              $ref: "#/components/schemas/TestWorkflowStepParallelTransfer"
          content:
            $ref: "#/components/schemas/TestWorkflowContent"
          pod:
            $ref: "#/components/schemas/TestWorkflowPodConfig"
          logs:
            $ref: "#/components/schemas/BoxedString"
          restartPolicy:
            type: string
          readinessProbe:
            $ref: "#/components/schemas/Probe"
          pvcs:
            type: object
            additionalProperties:
              $ref: "#/components/schemas/TestWorkflowPvcConfig"

    TestWorkflowServiceSpec:
      type: object
      allOf:
      - $ref: "#/components/schemas/TestWorkflowStepExecuteStrategy"
      - $ref: "#/components/schemas/TestWorkflowIndependentServiceSpec"
      - properties:
          use:
            type: array
            items:
              $ref: "#/components/schemas/TestWorkflowTemplateRef"

    TestWorkflowStepExecuteStrategy:
      type: object
      properties:
        count:
          $ref: "#/components/schemas/BoxedString"
        maxCount:
          $ref: "#/components/schemas/BoxedString"
        matrix:
          type: object
          description: "matrix of parameters to spawn instances"
          additionalProperties:
            description: "dynamic expression or static list of values"
            oneOf:
            - type: string
            - type: array
              items:
                type: string
        shards:
          type: object
          description: "parameters that should be distributed across sharded instances"
          additionalProperties:
            description: "dynamic expression or static list of values"
            oneOf:
            - type: string
            - type: array
              items:
                type: string

    TestWorkflowStepParallelTransfer:
      type: object
      properties:
        from:
          type: string
          description: path to load the files from
        to:
          type: string
          description: path to save the files to
        files:
          $ref: "#/components/schemas/TestWorkflowTarballFilePattern"
        mount:
          $ref: "#/components/schemas/BoxedBoolean"
      required:
      - from

    TestWorkflowStepParallelFetch:
      type: object
      properties:
        from:
          type: string
          description: path to fetch files from
        to:
          type: string
          description: path to save the files to
        files:
          $ref: "#/components/schemas/TestWorkflowTarballFilePattern"
      required:
      - from

    TestWorkflowSystem:
      type: object
      properties:
        pureByDefault:
          $ref: "#/components/schemas/BoxedBoolean"
        isolatedContainers:
          $ref: "#/components/schemas/BoxedBoolean"

    TestWorkflowSpec:
      type: object
      properties:
        use:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowTemplateRef"
        config:
          $ref: "#/components/schemas/TestWorkflowConfigSchema"
        system:
          $ref: "#/components/schemas/TestWorkflowSystem"
        content:
          $ref: "#/components/schemas/TestWorkflowContent"
        services:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/TestWorkflowServiceSpec"
        container:
          $ref: "#/components/schemas/TestWorkflowContainerConfig"
        job:
          $ref: "#/components/schemas/TestWorkflowJobConfig"
        pod:
          $ref: "#/components/schemas/TestWorkflowPodConfig"
        setup:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowStep"
        steps:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowStep"
        after:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowStep"
        events:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowEvent"
        execution:
          $ref: "#/components/schemas/TestWorkflowTagSchema"
        pvcs:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/TestWorkflowPvcConfig"

    TestWorkflowTemplateSpec:
      type: object
      properties:
        config:
          $ref: "#/components/schemas/TestWorkflowConfigSchema"
        system:
          $ref: "#/components/schemas/TestWorkflowSystem"
        content:
          $ref: "#/components/schemas/TestWorkflowContent"
        services:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/TestWorkflowIndependentServiceSpec"
        container:
          $ref: "#/components/schemas/TestWorkflowContainerConfig"
        job:
          $ref: "#/components/schemas/TestWorkflowJobConfig"
        pod:
          $ref: "#/components/schemas/TestWorkflowPodConfig"
        setup:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowIndependentStep"
        steps:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowIndependentStep"
        after:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowIndependentStep"
        events:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowEvent"
        execution:
          $ref: "#/components/schemas/TestWorkflowTagSchema"
        pvcs:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/TestWorkflowPvcConfig"

    TestWorkflowStepControl:
      type: object
      properties:
        paused:
          type: boolean
          description: should the step be paused initially
        negative:
          type: boolean
          description: is the step expected to fail
        optional:
          type: boolean
          description: is the step optional, so the failure won't affect the TestWorkflow result
        retry:
          $ref: "#/components/schemas/TestWorkflowRetryPolicy"
        timeout:
          type: string
          description: maximum time this step may take

    TestWorkflowStepOperations:
      type: object
      properties:
        delay:
          type: string
          pattern: "^((0|[1-9][0-9]*)h)?((0|[1-9][0-9]*)m)?((0|[1-9][0-9]*)s)?((0|[1-9][0-9]*)ms)?$"
          description: delay before the step
        shell:
          type: string
          description: script to run in a default shell for the container
        run:
          $ref: "#/components/schemas/TestWorkflowStepRun"
        execute:
          $ref: "#/components/schemas/TestWorkflowStepExecute"
        artifacts:
          $ref: "#/components/schemas/TestWorkflowStepArtifacts"

    TestWorkflowIndependentStep:
      type: object
      properties:
        name:
          type: string
          description: readable name for the step
        condition:
          type: string
          description: expression to declare under which conditions the step should be run; defaults to "passed", except artifacts where it defaults to "always"
        pure:
          $ref: "#/components/schemas/BoxedBoolean"
        paused:
          type: boolean
          description: should the step be paused initially
        negative:
          type: boolean
          description: is the step expected to fail
        optional:
          type: boolean
          description: is the step optional, so the failure won't affect the TestWorkflow result
        retry:
          $ref: "#/components/schemas/TestWorkflowRetryPolicy"
        timeout:
          type: string
          description: maximum time this step may take
        delay:
          type: string
          pattern: "^((0|[1-9][0-9]*)h)?((0|[1-9][0-9]*)m)?((0|[1-9][0-9]*)s)?((0|[1-9][0-9]*)ms)?$"
          description: delay before the step
        content:
          $ref: "#/components/schemas/TestWorkflowContent"
        services:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/TestWorkflowIndependentServiceSpec"
        shell:
          type: string
          description: script to run in a default shell for the container
        run:
          $ref: "#/components/schemas/TestWorkflowStepRun"
        workingDir:
          $ref: "#/components/schemas/BoxedString"
        container:
          $ref: "#/components/schemas/TestWorkflowContainerConfig"
        execute:
          $ref: "#/components/schemas/TestWorkflowStepExecute"
        artifacts:
          $ref: "#/components/schemas/TestWorkflowStepArtifacts"
        parallel:
          $ref: "#/components/schemas/TestWorkflowIndependentStepParallel"
        setup:
          type: array
          description: nested setup steps to run
          items:
            $ref: "#/components/schemas/TestWorkflowIndependentStep"
        steps:
          type: array
          description: nested steps to run
          items:
            $ref: "#/components/schemas/TestWorkflowIndependentStep"

    TestWorkflowStep:
      type: object
      properties:
        name:
          type: string
          description: readable name for the step
        condition:
          type: string
          description: expression to declare under which conditions the step should be run; defaults to "passed", except artifacts where it defaults to "always"
        pure:
          $ref: "#/components/schemas/BoxedBoolean"
        paused:
          type: boolean
          description: should the step be paused initially
        negative:
          type: boolean
          description: is the step expected to fail
        optional:
          type: boolean
          description: is the step optional, so the failure won't affect the TestWorkflow result
        use:
          type: array
          description: list of TestWorkflowTemplates to use
          items:
            $ref: "#/components/schemas/TestWorkflowTemplateRef"
        template:
          $ref: "#/components/schemas/TestWorkflowTemplateRef"
        retry:
          $ref: "#/components/schemas/TestWorkflowRetryPolicy"
        timeout:
          type: string
          description: maximum time this step may take
        delay:
          type: string
          pattern: "^((0|[1-9][0-9]*)h)?((0|[1-9][0-9]*)m)?((0|[1-9][0-9]*)s)?((0|[1-9][0-9]*)ms)?$"
          description: delay before the step
        content:
          $ref: "#/components/schemas/TestWorkflowContent"
        services:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/TestWorkflowServiceSpec"
        shell:
          type: string
          description: script to run in a default shell for the container
        run:
          $ref: "#/components/schemas/TestWorkflowStepRun"
        workingDir:
          $ref: "#/components/schemas/BoxedString"
        container:
          $ref: "#/components/schemas/TestWorkflowContainerConfig"
        execute:
          $ref: "#/components/schemas/TestWorkflowStepExecute"
        artifacts:
          $ref: "#/components/schemas/TestWorkflowStepArtifacts"
        parallel:
          $ref: "#/components/schemas/TestWorkflowStepParallel"
        setup:
          type: array
          description: nested setup steps to run
          items:
            $ref: "#/components/schemas/TestWorkflowStep"
        steps:
          type: array
          description: nested steps to run
          items:
            $ref: "#/components/schemas/TestWorkflowStep"

    TestWorkflowStepExecute:
      type: object
      properties:
        parallelism:
          type: integer
          description: how many resources could be scheduled in parallel
        async:
          type: boolean
          description: only schedule the resources, don't watch for the results (unless it is needed for parallelism)
        tests:
          type: array
          description: tests to schedule
          items:
            $ref: "#/components/schemas/TestWorkflowStepExecuteTestRef"
        workflows:
          type: array
          description: workflows to schedule
          items:
            $ref: "#/components/schemas/TestWorkflowStepExecuteTestWorkflowRef"

    TestWorkflowStepExecuteTestWorkflowRef:
      type: object
      allOf:
      - $ref: "#/components/schemas/TestWorkflowStepExecuteStrategy"
      - properties:
          name:
            type: string
            description: TestWorkflow name to include
          description:
            type: string
            description: TestWorkflow execution description to display
          executionName:
            type: string
            description: TestWorkflow execution name override
          tarball:
            type: object
            additionalProperties:
              $ref: "#/components/schemas/TestWorkflowTarballRequest"
          config:
            $ref: "#/components/schemas/TestWorkflowConfigValue"
          selector:
            $ref: "#/components/schemas/LabelSelector"
            description: label selector for test workflow

    TestWorkflowStepExecuteTestRef:
      type: object
      allOf:
      - $ref: "#/components/schemas/TestWorkflowStepExecuteStrategy"
      - properties:
          name:
            type: string
            description: test name to schedule
          description:
            type: string
            description: test execution description to display
          count:
            $ref: "#/components/schemas/BoxedString"
          maxCount:
            $ref: "#/components/schemas/BoxedString"
          executionRequest:
            $ref: "#/components/schemas/TestWorkflowStepExecuteTestExecutionRequest"
          tarball:
            type: object
            additionalProperties:
              $ref: "#/components/schemas/TestWorkflowTarballRequest"

    TestWorkflowTarballRequest:
      type: object
      properties:
        from:
          type: string
          description: path to load the files from
        files:
          $ref: "#/components/schemas/TestWorkflowTarballFilePattern"
      required:
      - from

    TestWorkflowTarballFilePattern:
      type: object
      description: "dynamic expression or static list of file patterns to pack"
      properties:
        static:
          type: array
          items: {}
        expression:
          type: string

    TestWorkflowStepExecuteTestExecutionRequest:
      type: object
      properties:
        name:
          type: string
          description: test execution custom name
          example: "testing with 1000 users"
        executionLabels:
          type: object
          description: "test execution labels"
          additionalProperties:
            type: string
          example:
            users: "3"
            prefix: "some-"
        isVariablesFileUploaded:
          type: boolean
          description: in case the variables file is too big, it will be uploaded
          example: false
        variablesFile:
          type: string
          description: variables file content - need to be in format for particular executor (e.g. postman envs file)
        variables:
          $ref: "#/components/schemas/Variables"
        testSecretUUID:
          type: string
          description: test secret uuid
          readOnly: true
          example: "7934600f-b367-48dd-b981-4353304362fb"
        command:
          type: array
          description: "executor image command"
          items:
            type: string
          example:
          - "curl"
        args:
          type: array
          description: "additional executor binary arguments"
          items:
            type: string
          example:
          - "--repeats"
          - "5"
          - "--insecure"
        argsMode:
          type: string
          description: usage mode for arguments
          enum:
          - append
          - override
          - replace
        image:
          type: string
          description: container image, executor will run inside this image
          example: kubeshop/testkube-executor-custom:1.10.11-dev-0a9c91
        imagePullSecrets:
          type: array
          description: "container image pull secrets"
          items:
            $ref: "#/components/schemas/LocalObjectReference"
        sync:
          type: boolean
          description: whether to start execution sync or async
        httpProxy:
          type: string
          description: http proxy for executor containers
          example: user:pass@my.proxy.server:8080
        httpsProxy:
          type: string
          description: https proxy for executor containers
          example: user:pass@my.proxy.server:8081
        negativeTest:
          type: boolean
          description: whether to run test as negative test
          example: false
        activeDeadlineSeconds:
          type: integer
          format: int64
          description: duration in seconds the test may be active, until its stopped
          example: 1
        artifactRequest:
          $ref: "#/components/schemas/ArtifactRequest"
          description: configuration parameters for storing test artifacts
        jobTemplate:
          type: string
          description: job template extensions
        cronJobTemplate:
          type: string
          description: cron job template extensions
        preRunScript:
          type: string
          description: script to run before test execution
          example: "echo -n '$SECRET_ENV' > ./secret_file"
        postRunScript:
          type: string
          description: script to run after test execution
          example: "sleep 30"
        executePostRunScriptBeforeScraping:
          type: boolean
          description: execute post run script before scraping (prebuilt executor only)
        sourceScripts:
          type: boolean
          description: run scripts using source command (container executor only)
        scraperTemplate:
          type: string
          description: scraper template extensions
        pvcTemplate:
          type: string
          description: pvc template extensions
        envConfigMaps:
          type: array
          description: "config map references"
          items:
            $ref: "#/components/schemas/EnvReference"
        envSecrets:
          type: array
          description: "secret references"
          items:
            $ref: "#/components/schemas/EnvReference"
        executionNamespace:
          type: string
          description: namespace for test execution (Pro edition only)

    TestWorkflowStepArtifacts:
      type: object
      properties:
        workingDir:
          $ref: "#/components/schemas/BoxedString"
        compress:
          $ref: "#/components/schemas/TestWorkflowStepArtifactsCompression"
        paths:
          type: array
          description: file paths to fetch from the container
          items:
            type: string
          minItems: 1
      required:
        - paths

    TestWorkflowStepArtifactsCompression:
      type: object
      properties:
        name:
          type: string
          description: artifact name

    TestWorkflowRetryPolicy:
      type: object
      properties:
        count:
          type: integer
          minimum: 1
          description: how many times at most it should retry
        until:
          type: string
          description: until when it should retry (defaults to "passed")
      required:
        - count

    TestWorkflowContent:
      type: object
      properties:
        git:
          $ref: "#/components/schemas/TestWorkflowContentGit"
        files:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowContentFile"
        tarball:
          type: array
          items:
            $ref: "#/components/schemas/TestWorkflowContentTarball"

    TestWorkflowContentGit:
      type: object
      properties:
        uri:
          type: string
          description: uri for the Git repository
        revision:
          type: string
          description: branch, commit or a tag name to fetch
        username:
          type: string
          description: plain text username to fetch with
        usernameFrom:
          $ref: "#/components/schemas/EnvVarSource"
        token:
          type: string
          description: plain text token to fetch with
        tokenFrom:
          $ref: "#/components/schemas/EnvVarSource"
        sshKey:
          type: string
          description: plain text SSH private key to fetch with
        sshKeyFrom:
          $ref: "#/components/schemas/EnvVarSource"
        authType:
          $ref: "#/components/schemas/ContentGitAuthType"
        mountPath:
          type: string
          description: where to mount the fetched repository contents (defaults to "repo" directory in the data volume)
        cone:
          type: boolean
          description: enable cone mode for sparse checkout with paths
        paths:
          type: array
          description: paths to fetch for the sparse checkout
          items:
            type: string

    TestWorkflowContentFile:
      type: object
      properties:
        path:
          type: string
          description: path where the file should be accessible at
          minLength: 1
        content:
          type: string
          description: plain-text content to put inside
        contentFrom:
          $ref: "#/components/schemas/EnvVarSource"
        mode:
          $ref: "#/components/schemas/BoxedInteger"
      required:
        - path

    TestWorkflowContentTarball:
      type: object
      properties:
        url:
          type: string
          description: url for the tarball to extract
        path:
          type: string
          description: path where the tarball should be extracted
        mount:
          $ref: "#/components/schemas/BoxedBoolean"
      required:
      - url
      - path

    TestWorkflowRef:
      type: object
      properties:
        name:
          type: string
          description: TestWorkflow name to include
        config:
          $ref: "#/components/schemas/TestWorkflowConfigValue"
      required:
        - name

    TestWorkflowTemplateRef:
      type: object
      properties:
        name:
          type: string
          description: TestWorkflowTemplate name to include
        config:
          $ref: "#/components/schemas/TestWorkflowConfigValue"
      required:
        - name

    TestWorkflowJobConfig:
      type: object
      properties:
        labels:
          type: object
          description: labels to attach to the job
          additionalProperties:
            type: string
        annotations:
          type: object
          description: annotations to attach to the job
          additionalProperties:
            type: string
        namespace:
          type: string
          description: namespace for execution of test workflow
        activeDeadlineSeconds:
          $ref: "#/components/schemas/BoxedInteger"

    TestWorkflowPodConfig:
      type: object
      properties:
        labels:
          type: object
          description: labels to attach to the pod
          additionalProperties:
            type: string
        annotations:
          type: object
          description: annotations to attach to the pod
          additionalProperties:
            type: string
        imagePullSecrets:
          type: array
          description: secret references for pulling images
          items:
            $ref: "#/components/schemas/LocalObjectReference"
        serviceAccountName:
          type: string
          description: default service account name for the containers
        nodeSelector:
          type: object
          description: label selector for node that the pod should land on
          additionalProperties:
            type: string
        volumes:
          type: array
          description: volumes to append to the pod
          items:
            $ref: "#/components/schemas/Volume"
        activeDeadlineSeconds:
          $ref: "#/components/schemas/BoxedInteger"
        dnsPolicy:
          type: string
        nodeName:
          type: string
        securityContext:
          $ref: "#/components/schemas/PodSecurityContext"
        hostname:
          type: string
        subdomain:
          type: string
        affinity:
          $ref: "#/components/schemas/Affinity"
        tolerations:
          type: array
          items:
            $ref: "#/components/schemas/Toleration"
        hostAliases:
          type: array
          items:
            $ref: "#/components/schemas/HostAlias"
        priorityClassName:
          type: string
        priority:
          $ref: "#/components/schemas/BoxedInteger"
        dnsConfig:
          $ref: "#/components/schemas/PodDNSConfig"
        preemptionPolicy:
          $ref: "#/components/schemas/BoxedString"
        topologySpreadConstraints:
          type: array
          items:
            $ref: "#/components/schemas/TopologySpreadConstraint"
        schedulingGates:
          type: array
          items:
            $ref: "#/components/schemas/PodSchedulingGate"
        resourceClaims:
          type: array
          items:
            $ref: "#/components/schemas/PodResourceClaim"

    TestWorkflowContainerConfig:
      type: object
      properties:
        workingDir:
          $ref: "#/components/schemas/BoxedString"
        image:
          type: string
          description: image to be used for the container
        imagePullPolicy:
          $ref: "#/components/schemas/ImagePullPolicy"
        env:
          type: array
          description: environment variables to append to the container
          items:
            $ref: "#/components/schemas/EnvVar"
        envFrom:
          type: array
          description: external environment variables to append to the container
          items:
            $ref: "#/components/schemas/EnvFromSource"
        command:
          $ref: "#/components/schemas/BoxedStringList"
        args:
          $ref: "#/components/schemas/BoxedStringList"
        resources:
          $ref: "#/components/schemas/TestWorkflowResources"
        securityContext:
          $ref: "#/components/schemas/SecurityContext"
        volumeMounts:
          type: array
          description: volumes to mount to the container
          items:
            $ref: "#/components/schemas/VolumeMount"

    TestWorkflowStepRun:
      type: object
      properties:
        workingDir:
          $ref: "#/components/schemas/BoxedString"
        image:
          type: string
          description: image to be used for the container
        imagePullPolicy:
          $ref: "#/components/schemas/ImagePullPolicy"
        env:
          type: array
          description: environment variables to append to the container
          items:
            $ref: "#/components/schemas/EnvVar"
        envFrom:
          type: array
          description: external environment variables to append to the container
          items:
            $ref: "#/components/schemas/EnvFromSource"
        command:
          $ref: "#/components/schemas/BoxedStringList"
        args:
          $ref: "#/components/schemas/BoxedStringList"
        shell:
          $ref: "#/components/schemas/BoxedString"
        resources:
          $ref: "#/components/schemas/TestWorkflowResources"
        securityContext:
          $ref: "#/components/schemas/SecurityContext"
        volumeMounts:
          type: array
          description: volumes to mount to the container
          items:
            $ref: "#/components/schemas/VolumeMount"

    TestWorkflowExecutionConfig:
      type: object
      description: map of configuration values used in the test workflow execution
      additionalProperties:
        $ref: "#/components/schemas/TestWorkflowExecutionConfigValue"

    TestWorkflowExecutionConfigValue:
      type: object
      description: configuration values used in the test workflow execution   
      properties:
        value:
          type: string
          description: configuration value
        emptyValue:
          type: boolean
          description: configuration value is empty
        defaultValue:
          type: string
          description: configuration value default
        emptyDefaultValue:
          type: boolean
          description: configuration value default is empty
        truncated:
          type: boolean
          description: indicates if the value is truncated
        sensitive:
          type: boolean
          description: marks value as sensitive

    TestWorkflowConfigValue:
      type: object
      description: configuration values to pass to the template
      additionalProperties:
        type: string

    TestWorkflowConfigSchema:
      type: object
      description: configuration definition
      additionalProperties:
        $ref: "#/components/schemas/TestWorkflowParameterSchema"

    TestWorkflowResources:
      type: object
      properties:
        limits:
          $ref: "#/components/schemas/TestWorkflowResourcesList"
        requests:
          $ref: "#/components/schemas/TestWorkflowResourcesList"

    TestWorkflowResourcesList:
      type: object
      properties:
        cpu:
          type: string
          description: number of CPUs
          pattern: "^[0-9]+m?$"
        memory:
          type: string
          description: size of RAM memory
          pattern: "^[0-9]+[GMK]i$"
        storage:
          type: string
          description: storage size
          pattern: "^[0-9]+[GMK]i$"
        ephemeral-storage:
          type: string
          description: ephemeral storage size
          pattern: "^[0-9]+[GMK]i$"

    TestWorkflowParameterSchema:
      type: object
      properties:
        description:
          type: string
          description: human-readable description for the property
        type:
          $ref: "#/components/schemas/TestWorkflowParameterType"
        enum:
          type: array
          description: list of acceptable values
          items:
            type: string
        example:
          type: string
          description: example value for the parameter
        default:
          $ref: "#/components/schemas/BoxedString"
        format:
          type: string
          description: "predefined format for the string"
        pattern:
          type: string
          description: "regular expression to match"
        minLength:
          $ref: "#/components/schemas/BoxedInteger"
        maxLength:
          $ref: "#/components/schemas/BoxedInteger"
        minimum:
          $ref: "#/components/schemas/BoxedInteger"
        maximum:
          $ref: "#/components/schemas/BoxedInteger"
        exclusiveMinimum:
          $ref: "#/components/schemas/BoxedInteger"
        exclusiveMaximum:
          $ref: "#/components/schemas/BoxedInteger"
        multipleOf:
          $ref: "#/components/schemas/BoxedInteger"
        sensitive:
          type: boolean
          default: false
          description: whether this value should be stored in the secret
      required:
        - type

    TestWorkflowParameterType:
      type: string
      description: type of the config parameter
      enum:
        - string
        - integer
        - number
        - boolean

    TestWorkflowEvent:
      type: object
      properties:
        cronjob:
          $ref: "#/components/schemas/TestWorkflowCronJobConfig"

    TestWorkflowCronJobConfig:
      type: object
      description: cron job configuration
      required:
        - cron
      properties:
        cron:
          type: string
          description: cron schedule to run a test workflow
          example: "* * * * *"
        labels:
          type: object
          description: labels to attach to the cron job
          additionalProperties:
            type: string
        annotations:
          type: object
          description: annotations to attach to the cron job
          additionalProperties:
            type: string
        config:
          $ref: "#/components/schemas/TestWorkflowConfigValue"

    TestWorkflowExecutionCR:
      type: object
      required:
        - testWorkflow
      properties:
        testWorkflow:
          $ref: "#/components/schemas/ObjectRef"
          description: test workflow name and namespace
        executionRequest:
          $ref: "#/components/schemas/TestWorkflowExecutionRequest"
          description: test workflow execution request parameters
        status:
          $ref: "#/components/schemas/TestWorkflowExecutionStatusCR"
          description: test workflow execution status

    TestWorkflowExecutionStatusCR:
      type: object
      description: test workflow execution status
      properties:
        latestExecution:
          $ref: "#/components/schemas/TestWorkflowExecution"
        generation:
          type: integer
          format: int64
          description: test workflow execution generation

    TestWorkflowTagValue:
      type: object
      description: tag values to pass to the test workflow execution
      additionalProperties:
        type: string

    TestWorkflowTagSchema:
      type: object
      description: test workflow execution tag definition
      properties:
        tags:
          $ref: "#/components/schemas/TestWorkflowTagValue"

    TestWorkflowExecutionTags:
      type: object
      properties:
        tags:
          $ref: "#/components/schemas/TestWorkflowTagValue"

    ContentGitAuthType:
      type: string
      description: auth type for git requests
      enum:
        - basic
        - header

    BoxedStringList:
      type: object
      properties:
        value:
          type: array
          items:
            type: string
      required:
        - value

    BoxedString:
      type: object
      properties:
        value:
          type: string
      required:
        - value

    BoxedInteger:
      type: object
      properties:
        value:
          type: integer
      required:
        - value

    BoxedBoolean:
      type: object
      properties:
        value:
          type: boolean
      required:
        - value

    ImagePullPolicy:
      type: string
      enum:
        - Always
        - Never
        - IfNotPresent

    EnvVar:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
        valueFrom:
          $ref: "#/components/schemas/EnvVarSource"

    ConfigMapEnvSource:
      type: object
      properties:
        name:
          type: string
        optional:
          type: boolean
          default: false
      required:
        - name

    SecretEnvSource:
      type: object
      properties:
        name:
          type: string
        optional:
          type: boolean
          default: false
      required:
        - name

    EnvFromSource:
      type: object
      properties:
        prefix:
          type: string
        configMapRef:
          $ref: "#/components/schemas/ConfigMapEnvSource"
        secretRef:
          $ref: "#/components/schemas/SecretEnvSource"

    SecurityContext:
      type: object
      properties:
        privileged:
          $ref: "#/components/schemas/BoxedBoolean"
        runAsUser:
          $ref: "#/components/schemas/BoxedInteger"
        runAsGroup:
          $ref: "#/components/schemas/BoxedInteger"
        runAsNonRoot:
          $ref: "#/components/schemas/BoxedBoolean"
        readOnlyRootFilesystem:
          $ref: "#/components/schemas/BoxedBoolean"
        allowPrivilegeEscalation:
          $ref: "#/components/schemas/BoxedBoolean"

    PodSecurityContext:
      type: object
      properties:
        runAsUser:
          $ref: "#/components/schemas/BoxedInteger"
        runAsGroup:
          $ref: "#/components/schemas/BoxedInteger"
        runAsNonRoot:
          $ref: "#/components/schemas/BoxedBoolean"
        fsGroup:
          $ref: "#/components/schemas/BoxedInteger"

    Toleration:
      type: object
      properties:
        key:
          type: string
        operator:
          type: string
        value:
          type: string
        effect:
          type: string
        tolerationSeconds:
          $ref: "#/components/schemas/BoxedInteger"

    HostAlias:
      type: object
      properties:
        ip:
          type: string
        hostnames:
          type: array
          items:
            type: string

    TopologySpreadConstraint:
      type: object
      properties:
        maxSkew:
          type: integer
        topologyKey:
          type: string
        whenUnsatisfiable:
          type: string
        labelSelector:
          $ref: "#/components/schemas/LabelSelector"
        minDomains:
          $ref: "#/components/schemas/BoxedInteger"
        nodeAffinityPolicy:
          $ref: "#/components/schemas/BoxedString"
        nodeTaintsPolicy:
          $ref: "#/components/schemas/BoxedString"
        matchLabelKeys:
          type: array
          items:
            type: string

    PodSchedulingGate:
      type: object
      properties:
        name:
          type: string

    PodResourceClaim:
      type: object
      properties:
        name:
          type: string
        source:
          $ref: "#/components/schemas/ClaimSource"

    ClaimSource:
      type: object
      properties:
        resourceClaimName:
          $ref: "#/components/schemas/BoxedString"
        resourceClaimTemplateName:
          $ref: "#/components/schemas/BoxedString"

    NodeSelectorRequirement:
      type: object
      properties:
        key:
          type: string
        operator:
          type: string
        values:
          type: array
          items:
            type: string

    NodeSelectorTerm:
      type: object
      properties:
        matchExpressions:
          type: array
          items:
            $ref: "#/components/schemas/NodeSelectorRequirement"
        matchFields:
          type: array
          items:
            $ref: "#/components/schemas/NodeSelectorRequirement"

    NodeSelector:
      type: object
      properties:
        nodeSelectorTerms:
          type: array
          items:
            $ref: "#/components/schemas/NodeSelectorTerm"

    PreferredSchedulingTerm:
      type: object
      properties:
        weight:
          type: integer
        preference:
          $ref: "#/components/schemas/NodeSelectorTerm"
      required:
      - preference

    NodeAffinity:
      type: object
      properties:
        requiredDuringSchedulingIgnoredDuringExecution:
          $ref: "#/components/schemas/NodeSelector"
        preferredDuringSchedulingIgnoredDuringExecution:
          type: array
          items:
            $ref: "#/components/schemas/PreferredSchedulingTerm"

    PodAffinity:
      type: object
      properties:
        requiredDuringSchedulingIgnoredDuringExecution:
          type: array
          items:
            $ref: "#/components/schemas/PodAffinityTerm"
        preferredDuringSchedulingIgnoredDuringExecution:
          type: array
          items:
            $ref: "#/components/schemas/WeightedPodAffinityTerm"

    LabelSelectorRequirement:
      type: object
      properties:
        key:
          type: string
        operator:
          type: string
        values:
          type: array
          items:
            type: string

    LabelSelector:
      type: object
      properties:
        matchLabels:
          type: object
          additionalProperties:
            type: string
        matchExpressions:
          type: array
          items:
            $ref: "#/components/schemas/LabelSelectorRequirement"

    PodAffinityTerm:
      type: object
      properties:
        labelSelector:
          $ref: "#/components/schemas/LabelSelector"
        namespaces:
          type: array
          items:
            type: string
        topologyKey:
          type: string
        namespaceSelector:
          $ref: "#/components/schemas/LabelSelector"

    WeightedPodAffinityTerm:
      type: object
      properties:
        weight:
          type: integer
        podAffinityTerm:
          $ref: "#/components/schemas/PodAffinityTerm"
      required:
      - podAffinityTerm

    Affinity:
      type: object
      properties:
        nodeAffinity:
          $ref: "#/components/schemas/NodeAffinity"
        podAffinity:
          $ref: "#/components/schemas/PodAffinity"
        podAntiAffinity:
          $ref: "#/components/schemas/PodAffinity"

    PodDNSConfig:
      type: object
      properties:
        nameservers:
          type: array
          items:
            type: string
        searches:
          type: array
          items:
            type: string
        options:
          type: array
          items:
            $ref: "#/components/schemas/PodDNSConfigOption"

    PodDNSConfigOption:
      type: object
      properties:
        name:
          type: string
        value:
          $ref: "#/components/schemas/BoxedString"

    Probe:
      type: object
      description: "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic."
      properties:
        initialDelaySeconds:
          type: integer
        timeoutSeconds:
          type: integer
        periodSeconds:
          type: integer
        successThreshold:
          type: integer
        failureThreshold:
          type: integer
        terminationGracePeriodSeconds:
          $ref: "#/components/schemas/BoxedInteger"
        exec:
          $ref: "#/components/schemas/ExecAction"
        httpGet:
          $ref: "#/components/schemas/HTTPGetAction"
        tcpSocket:
          $ref: "#/components/schemas/TCPSocketAction"
        grpc:
          $ref: "#/components/schemas/GRPCAction"

    ExecAction:
      type: object
      properties:
        command:
          type: array
          description: "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. Exit status of 0 is treated as live/healthy and non-zero is unhealthy."
          items:
            type: string

    HTTPGetAction:
      type: object
      properties:
        path:
          type: string
        port:
          type: string
        host:
          type: string
        scheme:
          type: string
        httpHeaders:
          type: array
          items:
            $ref: "#/components/schemas/HTTPHeader"

    HTTPHeader:
      type: object
      properties:
        name:
          type: string
        value:
          type: string

    TCPSocketAction:
      type: object
      properties:
        port:
          type: string
        host:
          type: string

    GRPCAction:
      type: object
      properties:
        port:
          type: integer
        service:
          $ref: "#/components/schemas/BoxedString"

    VolumeMount:
      description: VolumeMount describes a mounting of a Volume
        within a container.
      properties:
        mountPath:
          description: Path within the container at which the
            volume should be mounted.  Must not contain ':'.
          type: string
        mountPropagation:
          $ref: "#/components/schemas/BoxedString"
        name:
          description: This must match the Name of a Volume.
          type: string
        readOnly:
          description: Mounted read-only if true, read-write
            otherwise (false or unspecified). Defaults to false.
          type: boolean
        subPath:
          description: Path within the volume from which the
            container's volume should be mounted. Defaults to
            "" (volume's root).
          type: string
        subPathExpr:
          description: Expanded path within the volume from
            which the container's volume should be mounted.
            Behaves similarly to SubPath but environment variable
            references $(VAR_NAME) are expanded using the container's
            environment. Defaults to "" (volume's root). SubPathExpr
            and SubPath are mutually exclusive.
          type: string
      required:
        - mountPath
        - name
      type: object

    HostPathVolumeSource:
      description: 'hostPath represents a pre-existing file or
        directory on the host machine that is directly exposed
        to the container. This is generally used for system agents
        or other privileged things that are allowed to see the
        host machine. Most containers will NOT need this. More
        info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath
        --- TODO(jonesdl) We need to restrict who can use host
        directory mounts and who can/can not mount host directories
        as read/write.'
      properties:
        path:
          description: 'path of the directory on the host. If
            the path is a symlink, it will follow the link to
            the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath'
          type: string
        type:
          $ref: "#/components/schemas/BoxedString"
      required:
        - path
      type: object

    EmptyDirVolumeSource:
      description: 'emptyDir represents a temporary directory
        that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
      properties:
        medium:
          description: 'medium represents what type of storage
            medium should back this directory. The default is
            "" which means to use the node''s default medium.
            Must be an empty string (default) or Memory. More
            info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
          type: string
        sizeLimit:
          $ref: "#/components/schemas/BoxedString"
      type: object

    GCEPersistentDiskVolumeSource:
      description: 'gcePersistentDisk represents a GCE Disk resource
        that is attached to a kubelet''s host machine and then
        exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk'
      properties:
        fsType:
          description: 'fsType is filesystem type of the volume
            that you want to mount. Tip: Ensure that the filesystem
            type is supported by the host operating system. Examples:
            "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4"
            if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
            TODO: how do we prevent errors in the filesystem from
            compromising the machine'
          type: string
        partition:
          description: 'partition is the partition in the volume
            that you want to mount. If omitted, the default is
            to mount by volume name. Examples: For volume /dev/sda1,
            you specify the partition as "1". Similarly, the volume
            partition for /dev/sda is "0" (or you can leave the
            property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk'
          format: int32
          type: integer
        pdName:
          description: 'pdName is unique name of the PD resource
            in GCE. Used to identify the disk in GCE. More info:
            https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk'
          type: string
        readOnly:
          description: 'readOnly here will force the ReadOnly
            setting in VolumeMounts. Defaults to false. More info:
            https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk'
          type: boolean
      required:
        - pdName
      type: object

    AWSElasticBlockStoreVolumeSource:
      description: 'awsElasticBlockStore represents an AWS Disk
        resource that is attached to a kubelet''s host machine
        and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore'
      properties:
        fsType:
          description: 'fsType is the filesystem type of the volume
            that you want to mount. Tip: Ensure that the filesystem
            type is supported by the host operating system. Examples:
            "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4"
            if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
            TODO: how do we prevent errors in the filesystem from
            compromising the machine'
          type: string
        partition:
          description: 'partition is the partition in the volume
            that you want to mount. If omitted, the default is
            to mount by volume name. Examples: For volume /dev/sda1,
            you specify the partition as "1". Similarly, the volume
            partition for /dev/sda is "0" (or you can leave the
            property empty).'
          format: int32
          type: integer
        readOnly:
          description: 'readOnly value true will force the readOnly
            setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore'
          type: boolean
        volumeID:
          description: 'volumeID is unique ID of the persistent
            disk resource in AWS (Amazon EBS volume). More info:
            https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore'
          type: string
      required:
        - volumeID
      type: object

    SecretVolumeSource:
      description: 'secret represents a secret that should populate
        this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret'
      properties:
        defaultMode:
          $ref: "#/components/schemas/BoxedInteger"
        items:
          description: items If unspecified, each key-value pair
            in the Data field of the referenced Secret will be
            projected into the volume as a file whose name is
            the key and content is the value. If specified, the
            listed keys will be projected into the specified paths,
            and unlisted keys will not be present. If a key is
            specified which is not present in the Secret, the
            volume setup will error unless it is marked optional.
            Paths must be relative and may not contain the '..'
            path or start with '..'.
          items:
            description: Maps a string key to a path within a
              volume.
            properties:
              key:
                description: key is the key to project.
                type: string
              mode:
                $ref: "#/components/schemas/BoxedInteger"
              path:
                description: path is the relative path of the
                  file to map the key to. May not be an absolute
                  path. May not contain the path element '..'.
                  May not start with the string '..'.
                type: string
            required:
              - key
              - path
            type: object
          type: array
        optional:
          description: optional field specify whether the Secret
            or its keys must be defined
          type: boolean
        secretName:
          description: 'secretName is the name of the secret in
            the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret'
          type: string
      type: object

    NFSVolumeSource:
      description: 'nfs represents an NFS mount on the host that
        shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs'
      properties:
        path:
          description: 'path that is exported by the NFS server.
            More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs'
          type: string
        readOnly:
          description: 'readOnly here will force the NFS export
            to be mounted with read-only permissions. Defaults
            to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs'
          type: boolean
        server:
          description: 'server is the hostname or IP address of
            the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs'
          type: string
      required:
        - path
        - server
      type: object

    PersistentVolumeClaimVolumeSource:
      description: 'persistentVolumeClaimVolumeSource represents
        a reference to a PersistentVolumeClaim in the same namespace.
        More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
      properties:
        claimName:
          description: 'claimName is the name of a PersistentVolumeClaim
            in the same namespace as the pod using this volume.
            More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
          type: string
        readOnly:
          description: readOnly Will force the ReadOnly setting
            in VolumeMounts. Default false.
          type: boolean
      required:
        - claimName
      type: object

    CephFSVolumeSource:
      description: cephFS represents a Ceph FS mount on the host
        that shares a pod's lifetime
      properties:
        monitors:
          description: 'monitors is Required: Monitors is a collection
            of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it'
          items:
            type: string
          type: array
        path:
          description: 'path is Optional: Used as the mounted
            root, rather than the full Ceph tree, default is /'
          type: string
        readOnly:
          description: 'readOnly is Optional: Defaults to false
            (read/write). ReadOnly here will force the ReadOnly
            setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it'
          type: boolean
        secretFile:
          description: 'secretFile is Optional: SecretFile is
            the path to key ring for User, default is /etc/ceph/user.secret
            More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it'
          type: string
        secretRef:
          $ref: "#/components/schemas/LocalObjectReference"
        user:
          description: 'user is optional: User is the rados user
            name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it'
          type: string
      required:
        - monitors
      type: object

    AzureFileVolumeSource:
      description: azureFile represents an Azure File Service
        mount on the host and bind mount to the pod.
      properties:
        readOnly:
          description: readOnly defaults to false (read/write).
            ReadOnly here will force the ReadOnly setting in VolumeMounts.
          type: boolean
        secretName:
          description: secretName is the  name of secret that
            contains Azure Storage Account Name and Key
          type: string
        shareName:
          description: shareName is the azure share Name
          type: string
      required:
        - secretName
        - shareName
      type: object

    ConfigMapVolumeSource:
      description: configMap represents a configMap that should
        populate this volume
      properties:
        defaultMode:
          $ref: "#/components/schemas/BoxedInteger"
        items:
          description: items if unspecified, each key-value pair
            in the Data field of the referenced ConfigMap will
            be projected into the volume as a file whose name
            is the key and content is the value. If specified,
            the listed keys will be projected into the specified
            paths, and unlisted keys will not be present. If a
            key is specified which is not present in the ConfigMap,
            the volume setup will error unless it is marked optional.
            Paths must be relative and may not contain the '..'
            path or start with '..'.
          items:
            description: Maps a string key to a path within a
              volume.
            properties:
              key:
                description: key is the key to project.
                type: string
              mode:
                $ref: "#/components/schemas/BoxedInteger"
              path:
                description: path is the relative path of the
                  file to map the key to. May not be an absolute
                  path. May not contain the path element '..'.
                  May not start with the string '..'.
                type: string
            required:
              - key
              - path
            type: object
          type: array
        name:
          description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
                                TODO: Add other useful fields. apiVersion, kind, uid?'
          type: string
        optional:
          description: optional specify whether the ConfigMap
            or its keys must be defined
          type: boolean
      type: object

    AzureDiskVolumeSource:
      description: azureDisk represents an Azure Data Disk mount
        on the host and bind mount to the pod.
      properties:
        cachingMode:
          $ref: "#/components/schemas/BoxedString"
        diskName:
          description: diskName is the Name of the data disk in
            the blob storage
          type: string
        diskURI:
          description: diskURI is the URI of data disk in the
            blob storage
          type: string
        fsType:
          $ref: "#/components/schemas/BoxedString"
        kind:
          $ref: "#/components/schemas/BoxedString"
        readOnly:
          description: readOnly Defaults to false (read/write).
            ReadOnly here will force the ReadOnly setting in VolumeMounts.
          type: boolean
      required:
        - diskName
        - diskURI
      type: object

    CSIVolumeSource:
      type: object
      description: Represents a source location of a volume to mount, managed by an external CSI driver
      properties:
        driver:
          type: string
          description: driver is the name of the CSI driver that handles this volume.
        readOnly:
          $ref: "#/components/schemas/BoxedBoolean"
        fsType:
          $ref: "#/components/schemas/BoxedString"
        volumeAttributes:
          type: object
          description: volumeAttributes stores driver-specific properties that are passed to the CSI driver.
            Consult your driver's documentation for supported values.
          additionalProperties:
            type: string
        nodePublishSecretRef:
          $ref: "#/components/schemas/LocalObjectReference"

    Volume:
      type: object
      description: Volume represents a named volume in a pod that
        may be accessed by any container in the pod.
      properties:
        name:
          type: string
        hostPath:
          $ref: "#/components/schemas/HostPathVolumeSource"
        emptyDir:
          $ref: "#/components/schemas/EmptyDirVolumeSource"
        gcePersistentDisk:
          $ref: "#/components/schemas/GCEPersistentDiskVolumeSource"
        awsElasticBlockStore:
          $ref: "#/components/schemas/AWSElasticBlockStoreVolumeSource"
        secret:
          $ref: "#/components/schemas/SecretVolumeSource"
        nfs:
          $ref: "#/components/schemas/NFSVolumeSource"
        persistentVolumeClaim:
          $ref: "#/components/schemas/PersistentVolumeClaimVolumeSource"
        cephfs:
          $ref: "#/components/schemas/CephFSVolumeSource"
        azureFile:
          $ref: "#/components/schemas/AzureFileVolumeSource"
        azureDisk:
          $ref: "#/components/schemas/AzureDiskVolumeSource"
        configMap:
          $ref: "#/components/schemas/ConfigMapVolumeSource"
        csi:
          $ref: "#/components/schemas/CSIVolumeSource"
      required:
        - name

    VolumeSource:
      type: object

    EnvVarSource:
      type: object
      description: EnvVarSource represents a source for the value
        of an EnvVar.
      properties:
        configMapKeyRef:
          type: object
          required:
            - key
          description: Selects a key of a ConfigMap.
          properties:
            key:
              description: The key to select.
              type: string
            name:
              description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
                TODO: Add other useful fields. apiVersion, kind,
                uid?'
              type: string
            optional:
              description: Specify whether the ConfigMap or its
                key must be defined
              type: boolean
        fieldRef:
          type: object
          required:
            - fieldPath
          description: 'Selects a field of the pod: supports metadata.name,
            metadata.namespace, `metadata.labels[''<KEY>'']`,
            `metadata.annotations[''<KEY>'']`, spec.nodeName,
            spec.serviceAccountName, status.hostIP, status.podIP,
            status.podIPs.'
          properties:
            apiVersion:
              description: Version of the schema the FieldPath
                is written in terms of, defaults to "v1".
              type: string
            fieldPath:
              description: Path of the field to select in the
                specified API version.
              type: string
        resourceFieldRef:
          type: object
          required:
            - resource
          description: 'Selects a resource of the container: only
            resources limits and requests (limits.cpu, limits.memory,
            limits.ephemeral-storage, requests.cpu, requests.memory
            and requests.ephemeral-storage) are currently supported.'
          properties:
            containerName:
              description: 'Container name: required for volumes,
                optional for env vars'
              type: string
            divisor:
              type: string
              pattern: "^[0-9]+(m|[GMK]i)$"
            resource:
              description: 'Required: resource to select'
              type: string
        secretKeyRef:
          type: object
          required:
            - key
          description: Selects a key of a secret in the pod's
            namespace
          properties:
            key:
              description: The key of the secret to select from.  Must
                be a valid secret key.
              type: string
            name:
              description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
                TODO: Add other useful fields. apiVersion, kind,
                uid?'
              type: string
            optional:
              description: Specify whether the Secret or its key
                must be defined
              type: boolean

    TestWorkflowPvcConfig:
      type: object
      properties:
        accessModes:
          description: 'Access mode for claim storage. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes'
          type: array
          items:
            type: string
        volumeMode:
          description: 'Volume mode indicates the consumption of the volume as either a filesystem or block device.
            More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#volume-mode'
          $ref: "#/components/schemas/BoxedString"
        resources:
          description: 'Resources required for pvc'
          $ref: "#/components/schemas/TestWorkflowResources"
        storageClassName:
          description: 'Storage class name specifies the name of a StorageClass. More info: https://kubernetes.io/docs/concepts/storage/storage-classes/'
          $ref: "#/components/schemas/BoxedString"
        volumeName:
          description: 'Volume name is used to identify the volume'
          type: string
        selector:
          description: Only the volumes whose labels match the selector can be bound to the claim
          $ref: "#/components/schemas/LabelSelector"
        dataSource:
          description: 'Data source field can be used to specify either:
            * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
            * An existing PVC (PersistentVolumeClaim)'
          $ref: "#/components/schemas/TypedLocalObjectReference"
        dataSourceRef:
          description: 'Data source reference specifies the object from which to populate the volume with data, if a non-empty volume is desired'
          $ref: "#/components/schemas/TypedObjectReference"
        volumeAttributesClassName:
          description: 'Volume attributes class name may be used to set the VolumeAttributesClass used by this claim.
            More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass'
          $ref: "#/components/schemas/BoxedString"

    TypedLocalObjectReference:
      description: TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace
      type: object
      properties:
        apiGroup:
          description: api group is the group for the resource being referenced
          $ref: "#/components/schemas/BoxedString"
        kind:
          description: kind is the type of resource being referenced
          type: string
        name:
          description: name is the name of resource being referenced
          type: string

    TypedObjectReference:
      description: TypedObjectReference contains enough information to let you locate the typed referenced object inside the specified namespace
      type: object
      allOf:
      - $ref: "#/components/schemas/TypedLocalObjectReference"     
      properties:
        namespace:
          description: Namespace is the namespace of resource being referenced
          $ref: "#/components/schemas/BoxedString"

    WebhookParameterSchema:
      type: object
      description: parameter definition
      properties:
        name:
          description: unique parameter name
          type: string
        description:
          description: description for the parameter
          type: string
        required:
          description: whether parameter is required
          type: boolean
          default: false
        example:
          description: example value for the parameter
          type: string
        default:
          $ref: "#/components/schemas/BoxedString"
        pattern:
          type: string
          description: "regular expression to match"
      required:
        - name

    WebhookConfigValue:
      type: object
      description: configuration value
      properties:
        value:
          description: public value to use in webhook template
          $ref: "#/components/schemas/BoxedString"
        secret:
          description: private value stored in secret to use in webhook template
          $ref: "#/components/schemas/SecretRef"

    WebhookConfig:
      type: object
      description: configuration values
      additionalProperties:
        $ref: "#/components/schemas/WebhookConfigValue"

    WebhookTemplateRef:
      type: object
      properties:
        name:
          description: webhook template name to use
          type: string
      required:
        - name

    #
    # Errors
    #

    Problem:
      description: problem response in case of error
      type: object
      properties:
        type:
          type: string
          description: Type contains a URI that identifies the problem type.
          example: https://kubeshop.io/testkube/problems/invalidtestname
        title:
          type: string
          description: Title is a short, human-readable summary of the problem type. This title SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
          example: Invalid test name
        status:
          type: integer
          description: HTTP status code for this occurrence of the problem.
          example: 500
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence of the problem.
          example: Your test name can't contain forbidden characters like "}}}" passed
        instance:
          type: string
          description: A URI that identifies the specific occurrence of the problem. This URI may or may not yield further information if de-referenced.
          example: http://10.23.23.123:8088/tests

  #
  # Parameters
  #

  parameters:
    TestName:
      in: query
      name: test
      schema:
        type: string
        default: ""
      description: test namespaced name to filter
      required: false
    Type:
      in: query
      name: type
      schema:
        type: string
        default: ""
      description: object type
      required: false
    TextSearch:
      in: query
      name: textSearch
      schema:
        type: string
        default: ""
      description: text to search in name and test name
      required: false
    ID:
      in: path
      name: id
      schema:
        type: string
      required: true
      description: unique id of the object
    executionID:
      in: path
      name: executionID
      schema:
        type: string
      required: true
      description: unique id of the object execution
    Filename:
      in: path
      name: filename
      schema:
        type: string
      required: true
      description: filename of the object usually used for artifacts
    LastNDays:
      in: query
      name: last
      schema:
        type: integer
        default: 7
      description: last N days to show
      required: false
    Limit:
      in: query
      name: limit
      schema:
        type: integer
        default: 7
      description: limit records count same as pageSize
      required: false
    PageSize:
      in: query
      name: pageSize
      schema:
        type: integer
        default: 100
      description: the number of executions to get, setting to 0 will return only totals
      required: false
    PageIndex:
      in: query
      name: page
      schema:
        type: integer
        default: 0
      description: the page index to start at
      required: false
    StartDateFilter:
      in: query
      name: startDate
      schema:
        type: string
        format: date
      required: false
      description: startDate for filtering in ISO-8601 format, i.e. "yyyy-mm-dd"
    EndDateFilter:
      in: query
      name: endDate
      schema:
        type: string
        format: date
      required: false
      description: endDate for filtering
    TestExecutionsStatusFilter:
      in: query
      name: status
      schema:
        $ref: "#/components/schemas/TestSuiteExecutionStatus"
      description: optional status filter containing multiple values separated by comma
      required: false
    ExecutionsStatusFilter:
      in: query
      name: status
      schema:
        $ref: "#/components/schemas/ExecutionStatus"
      description: optional status filter containing multiple values separated by comma
      required: false
    Selector:
      in: query
      name: selector
      schema:
        type: string
        description: Labels to filter by
    TestWorkflowNames:
      in: query
      name: testWorkflowNames
      schema:
        items:
          type: string
        type: array
    ExecutionSelector:
      in: query
      name: executionSelector
      schema:
        type: string
        description: Execution Labels to add to executions
    ConcurrencyLevel:
      in: query
      name: concurrency
      schema:
        type: integer
        default: 10
    TestExecutionName:
      in: query
      name: testExecutionName
      schema:
        type: string
        description: test execution name stated the test execution
    TestSuiteExecutionName:
      in: query
      name: testSuiteExecutionName
      schema:
        type: string
        description: test suite execution name stated the test suite execution
    TestWorkflowExecutionName:
      in: query
      name: testWorkflowExecutionName
      schema:
        type: string
        description: test workflow execution name stated the test workflow execution
    Namespace:
      in: query
      name: namespace
      schema:
        type: string
        default: "testkube"
        description: Namespace of the object
    Name:
      in: query
      name: name
      schema:
        type: string
        description: Name of the object
    Mask:
      in: query
      name: mask
      schema:
        type: string
        description: mask to filter files
      required: false
    SkipDeleteExecutions:
      in: query
      name: skipDeleteExecutions
      schema:
        type: boolean
        default: false
      description: dont delete executions
      required: false
    TestType:
      in: query
      name: testType
      schema:
        type: string
      required: true
      description: test type of the executor
    InlineTemplates:
      in: query
      name: inline
      schema:
        type: boolean
        default: false
      description: should inline templates in the resolved workflow
      required: false
    All:
      in: query
      name: all
      schema:
        type: boolean
        default: false
      description: flag to request all resources
      required: false
    SkipDeleteCRD:
      in: query
      name: skipDeleteCRD
      schema:
        type: boolean
        default: false
      description: dont delete CRD
      required: false
    TagSelector:
      in: query
      name: tagSelector
      schema:
        type: string
        description: Test workflow execution tags
    ActorName:
      in: query
      name: actorName
      schema:
        type: string
        description: Test workflow running conntext actor name
    ActorType:
      in: query
      name: actorType
      schema:
        type: string
        description: Test workflow running conntext actor type

  requestBodies:
    UploadsBody:
      description: "Upload files request body data"
      required: true
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              parentName:
                type: string
                example: "test-1"
              parentType:
                type: string
                enum:
                  - test
                  - execution
              filePath:
                type: string
                example: folder/file.txt