Kubeshop secrets API

The secrets API from Kubeshop — 2 operation(s) for secrets.

OpenAPI Specification

kubeshop-secrets-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Testkube Standalone Agent api secrets 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: secrets
paths:
  /secrets:
    get:
      tags:
      - secrets
      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
      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
      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
      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
      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'
components:
  schemas:
    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
    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
    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
    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
    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:
    Namespace:
      in: query
      name: namespace
      schema:
        type: string
        default: testkube
        description: Namespace of the object
    All:
      in: query
      name: all
      schema:
        type: boolean
        default: false
      description: flag to request all resources
      required: false
    ID:
      in: path
      name: id
      schema:
        type: string
      required: true
      description: unique id of the object