Kubeshop webhook-template API

The webhook-template API from Kubeshop — 2 operation(s) for webhook-template.

OpenAPI Specification

kubeshop-webhook-template-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Testkube Standalone Agent api webhook-template 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: webhook-template
paths:
  /webhook-templates:
    get:
      tags:
      - webhook-template
      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
      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
      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:
      - 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:
      - 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
      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'
components:
  schemas:
    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'
        sync:
          $ref: '#/components/schemas/Syncable'
        target:
          $ref: '#/components/schemas/ExecutionTarget'
    WebhookTemplateUpdateRequest:
      description: webhook template update request body
      type: object
      nullable: true
      allOf:
      - $ref: '#/components/schemas/WebhookTemplate'
    Syncable:
      description: 'source information about resources that may have been synced from multiple sources.

        An empty source indicates that the source was the UI/API for backwards compatibility.

        '
      type: object
      properties:
        creationSource:
          description: the original source from which the resource was created
          $ref: '#/components/schemas/Source'
        lastModificationSource:
          description: the source from which the last modification of the resource originated
          $ref: '#/components/schemas/Source'
    Source:
      description: synchronisation sources
      type: string
      enum:
      - kubernetes
    EventType:
      type: string
      enum:
      - queue-testworkflow
      - start-testworkflow
      - end-testworkflow-success
      - end-testworkflow-failed
      - end-testworkflow-aborted
      - end-testworkflow-canceled
      - end-testworkflow-not-passed
      - become-testworkflow-up
      - become-testworkflow-down
      - become-testworkflow-failed
      - become-testworkflow-aborted
      - become-testworkflow-canceled
      - become-testworkflow-not-passed
      - created
      - updated
      - deleted
    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
    WebhookConfig:
      type: object
      description: configuration values
      additionalProperties:
        $ref: '#/components/schemas/WebhookConfigValue'
    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
    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
    BoxedString:
      type: object
      properties:
        value:
          type: string
      required:
      - value
    WebhookTemplateCreateRequest:
      description: webhook template create request body
      type: object
      allOf:
      - $ref: '#/components/schemas/WebhookTemplate'
    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'
    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
  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