Kubeshop test-sources API

The test-sources API from Kubeshop — 2 operation(s) for test-sources.

OpenAPI Specification

kubeshop-test-sources-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Testkube Standalone Agent api test-sources API
  description: API for Testkube Standalone Agent
  contact:
    email: info@testkube.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
servers:
- url: https://api.testkube.io
  description: Testkube Cloud Control Plane API Endpoint
- url: https://<your-testkube-api-host>
  description: Testkube On-Prem API Endpoint
tags:
- name: test-sources
paths:
  /test-sources:
    get:
      tags:
      - test-sources
      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
      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
      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
      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
      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:
      - 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:
      - 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'
components:
  schemas:
    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
    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
    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
    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
    TestContent:
      type: object
      properties:
        type:
          type: string
          description: "type of sources a runner can get data from.\n  string: String content (e.g. Postman JSON file).\n  file-uri: content stored on the webserver.\n  git-file: the file stored in the Git repo in the given repository.path field (Deprecated: use git instead).\n  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).\n  git: automatically provisions either a file, directory or whole git repository depending on the repository.path field.\n"
          enum:
          - string
          - file-uri
          - git-file
          - 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
    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
    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
    TestSourceBatchRequest:
      description: Test source batch request
      type: object
      required:
      - batch
      properties:
        batch:
          type: array
          items:
            $ref: '#/components/schemas/TestSourceUpsertRequest'
    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
  parameters:
    Selector:
      in: query
      name: selector
      schema:
        type: string
        description: Labels to filter by
    ID:
      in: path
      name: id
      schema:
        type: string
      required: true
      description: unique id of the object