openapi: 3.0.3
info:
  title: Kannika Armory API
  version: 0.15.2
  description: REST API for managing Kannika Armory
paths:
  /rest/backups:
    post:
      operationId: createBackup
      summary: Configure a backup
      description: Configure a backup
      tags:
        - backups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BackupInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    get:
      operationId: listBackups
      summary: Fetch all backups
      description: Returns a list of all backups and their configuration.
      tags:
        - backups
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - backups
                properties:
                  backups:
                    type: array
                    description: A list of all the available backups
                    items:
                      $ref: '#/components/schemas/BackupResource'
  /rest/backups/{name}:
    get:
      operationId: getBackup
      summary: Get a backup by name
      description: Get a backup by name
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackupResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteBackup
      summary: Delete a backup by name
      description: Delete a backup by name
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: Backup deleted
        '400':
          $ref: '#/components/responses/BadRequest'
  /rest/backups/{name}/pause:
    post:
      operationId: pauseBackup
      summary: Pause a backup by name
      description: Pause a backup by name
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackupResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/backups/{name}/resume:
    post:
      operationId: resumeBackup
      summary: Resume a backup
      description: To resume a backup that is paused by name
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackupResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/backups/{name}/topics:
    post:
      operationId: importTopicsToBackup
      summary: Import topics to a backup
      description: Import topics to a backup
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportTopicsInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    delete:
      operationId: removeTopicsFromBackup
      summary: Remove topics from a backup
      description: Delete topics from a backup given by name
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemoveTopicsInput'
      responses:
        '200':
          description: Topics removed
        '400':
          $ref: '#/components/responses/BadRequest'
  /rest/backups/{name}/topics/configure:
    post:
      operationId: configureBackupTopics
      summary: Configure backup topics
      description: Configure topics of a backup given by name
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigureTopicsInput'
      responses:
        '200':
          description: Topics configured
        '400':
          $ref: '#/components/responses/BadRequest'
  /rest/backups/{name}/topicselectors/configure:
    post:
      operationId: configureBackupTopicSelectors
      summary: Configure backup topic selectors
      description: Configure glob topic selector on a backup given by name
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigureTopicSelectorsInput'
      responses:
        '200':
          description: Topic selectors configured
        '400':
          $ref: '#/components/responses/BadRequest'
  /rest/backups/{name}/metrics:
    get:
      operationId: getBackupMetrics
      summary: Get backup metrics
      description: |
        Get metrics of a backup and its topics.
        Retrieves metrics for a backup and its topics. Metrics are fetched from the backup pods and cached for performance. The first request may take up to 5 seconds if metrics need to be collected, while subsequent requests return cached data immediately. Note: Metrics for stopped or inactive backups may be outdated and reflect the state at the time the backup last ran.
      tags:
        - backups
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackupMetrics'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/restores:
    post:
      operationId: createRestore
      summary: Create a restore
      description: Create a Restore to restore data from a Backup or Storage to an Event Hub.
      tags:
        - restores
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RestoreInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    get:
      operationId: listRestores
      summary: List all restores
      description: To get a list of the restores
      tags:
        - restores
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - restores
                properties:
                  restores:
                    type: array
                    description: A list of all the available restores
                    items:
                      $ref: '#/components/schemas/RestoreResource'
  /rest/restores/{name}:
    get:
      operationId: getRestore
      summary: Get a restore
      description: To get a restore by its name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestoreResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteRestore
      summary: Delete a restore by name
      description: Delete a restore by name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: Restore deleted
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/restores/{name}/start:
    post:
      operationId: startRestore
      summary: Start a restore by name
      description: Start a restore by name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: Restore started
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Conflict (restore already started or in draft mode)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /rest/restores/{name}/pause:
    post:
      operationId: pauseRestore
      summary: Pause a restore by name
      description: Pause a restore by name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestoreResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/restores/{name}/resume:
    post:
      operationId: resumeRestore
      summary: Resume a restore
      description: Resume a paused restore by name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestoreResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/restores/{name}/topics:
    post:
      operationId: importTopicsToRestore
      summary: Import topics to a restore
      description: Import topics to a restore given by name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportRestoreTopicsInput'
      responses:
        '200':
          description: Topics imported
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: removeTopicsFromRestore
      summary: Remove topics from a restore
      description: Delete topics from a restore given by name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemoveRestoreTopicsInput'
      responses:
        '200':
          description: Topics removed
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/restores/{name}/schemamapping:
    put:
      operationId: configureRestoreSchemaMapping
      summary: Configure restore schema mapping
      description: Set schema mapping for a restore given by id
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - mapping
              properties:
                mapping:
                  type: object
                  additionalProperties:
                    type: integer
                    format: int64
                  description: A map of schema id mappings
      responses:
        '200':
          description: Schema mapping configured
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    get:
      operationId: getRestoreSchemaMapping
      summary: Get restore schema mapping
      description: To get the schema mapping for a restore by its name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  mapping:
                    type: object
                    additionalProperties:
                      type: integer
                      format: int64
                    description: The schema mappings
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteRestoreSchemaMapping
      summary: Delete restore schema mapping
      description: Delete the schema mapping of a restore by name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: Schema mapping deleted
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/restores/{name}/metrics:
    get:
      operationId: getRestoreMetrics
      summary: Get restore metrics
      description: To get metrics of a restore by its name
      tags:
        - restores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestoreMetrics'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/storages:
    post:
      operationId: createStorage
      summary: Create a storage
      description: Configure a storage
      tags:
        - storages
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StorageInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    get:
      operationId: listStorages
      summary: List all storages
      description: To get a list of the storages
      tags:
        - storages
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - storages
                properties:
                  storages:
                    type: array
                    description: A list of all the available storages
                    items:
                      $ref: '#/components/schemas/StorageResource'
  /rest/storages/{name}:
    get:
      operationId: getStorage
      summary: Get a storage by name
      description: Get a storage by name
      tags:
        - storages
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorageResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteStorage
      summary: Delete a storage by name
      description: Delete a storage by name
      tags:
        - storages
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: Storage deleted
        '400':
          $ref: '#/components/responses/BadRequest'
  /rest/credentials:
    post:
      operationId: createCredentials
      summary: Create credentials
      description: Configure credentials
      tags:
        - credentials
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialsInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    get:
      operationId: listCredentials
      summary: List all credentials
      description: To get a list of the credentials
      tags:
        - credentials
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - credentials
                properties:
                  credentials:
                    type: array
                    description: A list of all the available credentials
                    items:
                      $ref: '#/components/schemas/CredentialsResource'
  /rest/credentials/{name}:
    get:
      operationId: getCredentials
      summary: Get credentials
      description: Get the credentials resource
      tags:
        - credentials
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialsResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteCredentials
      summary: Delete credentials by name
      description: Delete a credentials by name
      tags:
        - credentials
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: Credentials deleted
        '400':
          $ref: '#/components/responses/BadRequest'
  /rest/eventhubs:
    post:
      operationId: createEventHub
      summary: Create an event hub
      description: To create a Kafka event hub
      tags:
        - eventhubs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventHubInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    get:
      operationId: listEventHubs
      summary: List all event hubs
      description: To get a list of the event hubs
      tags:
        - eventhubs
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - event_hubs
                properties:
                  event_hubs:
                    type: array
                    description: A list of all the available event hubs
                    items:
                      $ref: '#/components/schemas/EventHubResource'
  /rest/eventhubs/{name}:
    get:
      operationId: getEventHub
      summary: Get an event hub by name
      description: Get an event hub by name
      tags:
        - eventhubs
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventHubResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteEventHub
      summary: Delete an event hub by name
      description: Delete a event hub by name
      tags:
        - eventhubs
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: Event hub deleted
        '400':
          $ref: '#/components/responses/BadRequest'
  /rest/eventhubs/{eventHubName}/topics:
    get:
      operationId: listEventHubTopics
      summary: List event hub topics
      description: To get a list of topics from the event hub
      tags:
        - eventhubs
      parameters:
        - name: eventHubName
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 253
          description: The event hub name
        - name: skip_cache
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: Force fetching topics from the event hub instead of cache
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - topics
                properties:
                  topics:
                    type: array
                    description: A list of all the topics available on the event hub
                    items:
                      type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '424':
          description: Event hub unreachable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /rest/eventhubs/{eventHubName}/credentials/{credentialsName}/topics:
    get:
      operationId: listEventHubTopicsWithCredentials
      summary: List event hub topics using specific credentials
      description: To get a list of topics from the event hub using specific credentials
      tags:
        - eventhubs
      parameters:
        - name: eventHubName
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 253
          description: The event hub name
        - name: credentialsName
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 253
          description: The credentials name
        - name: skip_cache
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: Force fetching topics from the event hub instead of cache
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - topics
                properties:
                  topics:
                    type: array
                    description: A list of all the topics available on the event hub
                    items:
                      type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '424':
          description: Event hub unreachable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /rest/schemaregistries:
    post:
      operationId: createSchemaRegistry
      summary: Create a schema registry
      description: |
        Create or update a Confluent Schema Registry.
        Optionally configure mTLS by providing PEM-encoded certificates and keys in the `tls` section.
      tags:
        - schemaregistries
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaRegistryInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    get:
      operationId: listSchemaRegistries
      summary: List all schema registries
      description: To get a list of the schema registries
      tags:
        - schemaregistries
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - schema_registries
                properties:
                  schema_registries:
                    type: array
                    description: A list of all the available schema registries
                    items:
                      $ref: '#/components/schemas/SchemaRegistryResource'
  /rest/schemaregistries/{name}:
    get:
      operationId: getSchemaRegistry
      summary: Get a schema registry by name
      description: Get a schema registry by name
      tags:
        - schemaregistries
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaRegistryResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteSchemaRegistry
      summary: Delete a schema registry
      description: Delete a schema registry by name
      tags:
        - schemaregistries
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: Schema registry deleted
        '400':
          $ref: '#/components/responses/BadRequest'
  /rest/schemaregistrybackups:
    post:
      operationId: createSchemaRegistryBackup
      summary: Create a schema registry backup
      description: To create a schema registry backup
      tags:
        - schemaregistrybackups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaRegistryBackupInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    get:
      operationId: listSchemaRegistryBackups
      summary: List all schema registry backups
      description: To get a list of the schema registry backups
      tags:
        - schemaregistrybackups
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - schema_registry_backups
                properties:
                  schema_registry_backups:
                    type: array
                    description: A list of all the available schema registry backups
                    items:
                      $ref: '#/components/schemas/SchemaRegistryBackupResource'
  /rest/schemaregistrybackups/{name}:
    get:
      operationId: getSchemaRegistryBackup
      summary: Get a schema registry backup by name
      description: Get a schema registry backup by name
      tags:
        - schemaregistrybackups
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaRegistryBackupResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/schemaregistrybackups/{name}/pause:
    post:
      operationId: pauseSchemaRegistryBackup
      summary: Pause a schema registry backup
      description: To pause a schema registry backup that is paused by name
      tags:
        - schemaregistrybackups
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaRegistryBackupResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/schemaregistrybackups/{name}/resume:
    post:
      operationId: resumeSchemaRegistryBackup
      summary: Resume a schema registry backup
      description: To resume a schema registry backup that is paused by name
      tags:
        - schemaregistrybackups
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaRegistryBackupResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/schemaregistryrestores:
    post:
      operationId: createSchemaRegistryRestore
      summary: Create a schema registry restore
      description: To create a schema registry restore
      tags:
        - schemaregistryrestores
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaRegistryRestoreInput'
      responses:
        '201':
          $ref: '#/components/responses/Created'
        '400':
          $ref: '#/components/responses/BadRequest'
    get:
      operationId: listSchemaRegistryRestores
      summary: List all schema registry restores
      description: To get a list of the schema registry restores
      tags:
        - schemaregistryrestores
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - schema_registry_restores
                properties:
                  schema_registry_restores:
                    type: array
                    description: A list of all the available schema registry restores
                    items:
                      $ref: '#/components/schemas/SchemaRegistryRestoreResource'
  /rest/schemaregistryrestores/{name}:
    get:
      operationId: getSchemaRegistryRestore
      summary: Get a schema registry restore by name
      description: Get a schema registry restore by name
      tags:
        - schemaregistryrestores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaRegistryRestoreResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
  /rest/schemaregistryrestores/{name}/start:
    post:
      operationId: startSchemaRegistryRestore
      summary: Start a schema registry restore
      description: To start a schema registry restore that is paused by name
      tags:
        - schemaregistryrestores
      parameters:
        - $ref: '#/components/parameters/name'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaRegistryRestoreResource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    TopicMatcher:
      type: object
      required:
        - name
      properties:
        name:
          type: object
          description: The name pattern to match against topic names
          properties:
            literal:
              type: string
              maxLength: 249
              description: A literal topic name selector
            glob:
              type: string
              description: A glob topic name selector
            regex:
              type: string
              description: A regex topic name selector
    TopicSelectors:
      type: object
      properties:
        matchers:
          type: array
          items:
            $ref: '#/components/schemas/TopicMatcher'
          description: List of matchers to include topics
    SegmentRolloverTriggers:
      type: object
      properties:
        size:
          type: string
          description: Maximum size of a backup segment
        timeout_seconds:
          type: integer
          format: int64
          description: Maximum time before a backup segment is flushed
    DataRetentionPolicy:
      type: object
      properties:
        delete:
          type: object
          required:
            - after
          properties:
            after:
              type: string
              pattern: ^([0-9]+(ns|us|ms|[smhdwy]))(\s?[0-9]+(ns|us|ms|[smhdwy]))*$
              description: Amount of time after which backup data will be deleted
    Compression:
      type: object
      required:
        - algorithm
      properties:
        algorithm:
          type: string
          enum:
            - NONE
            - ZSTD
            - GZIP
            - BZIP2
            - XZ
            - DEFLATE
            - BROTLI
            - LZMA
            - ZLIB
          description: The compression algorithm used to store the backup data
        quality:
          type: integer
          description: The compression quality of the chosen compression algorithm
    ResourceRequirements:
      type: object
      properties:
        requests:
          type: object
          properties:
            cpu:
              type: string
              description: The CPU request for the Kubernetes Deployment
            memory:
              type: string
              description: The memory request for the Kubernetes Deployment
        limits:
          type: object
          properties:
            cpu:
              type: string
              description: The CPU limit for the Kubernetes Deployment
            memory:
              type: string
              description: The memory limit for the Kubernetes Deployment
    WorkGroup:
      type: object
      required:
        - workers
      properties:
        workers:
          type: integer
          minimum: 1
          maximum: 16
          description: The number of worker pods for the backup
        seed:
          type: integer
          minimum: 1
          description: The seed to alter topic distribution over worker pods
    BackupResource:
      type: object
      required:
        - name
        - source
        - sink
        - topics
        - compression
        - paused
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the backup
        uuid:
          type: string
          description: The uid of the kubernetes resource
        description:
          type: string
          maxLength: 1000
          description: The description of the backup
        source:
          type: string
          description: The source of the backup
        source_credentials:
          type: string
          description: The credentials used to authenticate with the source
        source_additional_props:
          type: object
          additionalProperties:
            type: string
          description: Additional properties for the source event hub
        sink:
          type: string
          description: The sink of the backup
        sink_credentials:
          type: string
          description: The credentials used to authenticate with the sink
        sink_additional_props:
          type: object
          additionalProperties:
            type: string
          description: Additional properties for the sink storage
        service_account:
          type: string
          description: The service account used by the backup
        topics:
          type: array
          items:
            type: string
          description: All the topics that are backed up
        topic_selectors:
          allOf:
            - $ref: '#/components/schemas/TopicSelectors'
          description: The topic selectors for this backup
        segment_rollover_triggers:
          $ref: '#/components/schemas/SegmentRolloverTriggers'
        data_retention_policy:
          $ref: '#/components/schemas/DataRetentionPolicy'
        compression:
          $ref: '#/components/schemas/Compression'
        resources:
          $ref: '#/components/schemas/ResourceRequirements'
        work_group:
          $ref: '#/components/schemas/WorkGroup'
        paused:
          type: boolean
          description: Indicates whether the backup is enabled or not
    BackupInput:
      type: object
      required:
        - name
        - source
        - sink
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: Name of the backup
        description:
          type: string
          maxLength: 1000
          description: Description of the backup
        source:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: Name of the source event hub
        source_credentials:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: Name of the source credentials
        source_additional_props:
          type: object
          additionalProperties:
            type: string
        sink:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: Name of the sink storage
        sink_credentials:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: Name of the sink credentials
        sink_additional_props:
          type: object
          additionalProperties:
            type: string
        service_account:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: Name of the service account
        segment_rollover_triggers:
          $ref: '#/components/schemas/SegmentRolloverTriggers'
        data_retention_policy:
          $ref: '#/components/schemas/DataRetentionPolicy'
        compression:
          $ref: '#/components/schemas/Compression'
        work_group:
          $ref: '#/components/schemas/WorkGroup'
        resources:
          $ref: '#/components/schemas/ResourceRequirements'
    ErrorResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Error message
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                description: The field that failed validation
              message:
                type: string
                description: The validation error message
              spec:
                type: array
                items:
                  type: string
                description: The field constraints.
              failed:
                type: array
                items:
                  type: string
                description: The constraints that failed
              location:
                type: object
                properties:
                  line:
                    type: integer
                  column:
                    type: integer
    ImportTopicsInput:
      type: object
      required:
        - topics
      properties:
        topics:
          type: array
          maxItems: 10000
          items:
            type: string
            maxLength: 249
            pattern: ^[a-zA-Z0-9._-]+$
          description: The topics to import
        enable:
          type: boolean
          default: true
          description: |-
            To enable the topics on the backup 
            Default: true
    RemoveTopicsInput:
      type: object
      required:
        - topics
      properties:
        topics:
          type: array
          maxItems: 10000
          items:
            type: string
            maxLength: 249
            pattern: ^[a-zA-Z0-9._-]+$
          description: List of topics to be removed
    ConfigureTopicsInput:
      type: object
      properties:
        topics:
          type: array
          maxItems: 1000
          items:
            type: string
            maxLength: 249
            pattern: ^[a-zA-Z0-9._-]+$
          description: The complete list of topics that need to be in the backup
        topics_to_add:
          type: array
          maxItems: 1000
          items:
            type: string
            maxLength: 249
            pattern: ^[a-zA-Z0-9._-]+$
          description: List of topics to add to the existing list of topics
        topics_to_remove:
          type: array
          maxItems: 1000
          items:
            type: string
            maxLength: 249
            pattern: ^[a-zA-Z0-9._-]+$
          description: List of topics to remove from the existing list of topics
        enable:
          type: boolean
          default: true
          description: |-
            To enable the topics on the backup 
            Default: true
    ConfigureTopicSelectorsInput:
      type: object
      properties:
        topic_selectors:
          type: object
          description: |
            Automatically discover topics at runtime that match a certain condition.
            Exclude selectors take precedence over include selectors.
            https://docs.kannika.io/user-guide/backup/#automatically-importing-topics
          properties:
            matchers:
              type: array
              items:
                $ref: '#/components/schemas/TopicMatcher'
              description: |
                List of matchers to include topics.
                Each matcher specifies a name pattern using glob, regex, or literal.
            excludeMatchers:
              type: array
              items:
                $ref: '#/components/schemas/TopicMatcher'
              description: |
                List of matchers to exclude topics.
                Each matcher specifies a name pattern using glob, regex, or literal.
    BackupMetrics:
      type: object
      required:
        - topics
      properties:
        topics:
          type: array
          description: List of topic metrics for the backup
          items:
            type: object
            required:
              - name
              - status
            properties:
              name:
                type: string
                description: Name of the topic
              status:
                type: string
                description: |
                  Current status of the topic backup: PENDING, STARTING, RUNNING, STOPPING, STOPPED, FAILED, SUCCEEDED, UNKNOWN.
                  Note that the status could be `RUNNING` while the backup is paused.
              status_message:
                type: string
                description: Optional status message providing additional context
              status_hints:
                type: array
                description: Optional hints providing remediation steps for the status
                items:
                  type: string
              ingestion_rate:
                type: object
                description: Ingestion rate metrics
                properties:
                  bytes_per_second:
                    type: integer
                    format: int64
                    description: Number of bytes ingested per second
              message_count:
                type: integer
                format: int64
                description: Total number of messages backed up
              compressed_size:
                type: integer
                format: int64
                description: Total size of backed up data in bytes (compressed)
              uncompressed_size:
                type: integer
                format: int64
                description: Total size of backed up data in bytes (uncompressed)
              progression:
                type: object
                description: Backup progression metrics
                properties:
                  backup_rate:
                    type: integer
                    format: int64
                    description: Rate at which messages are being backed up (messages/second)
                  produce_rate:
                    type: integer
                    format: int64
                    description: Rate at which messages are being produced to the topic (messages/second)
                  catch_up_time_seconds:
                    type: integer
                    description: Estimated time in seconds to catch up with the current topic offset
              offset_lag:
                type: integer
                format: int64
                description: Number of messages between the current consumer offset and the maximum offset
              partitions:
                type: array
                description: List of partition-level metrics
                items:
                  type: object
                  required:
                    - number
                  properties:
                    number:
                      type: integer
                      description: Partition number
                    sink_offset:
                      type: integer
                      nullable: true
                      format: int64
                      description: |
                        Latest offset written to the backup storage.
                        In case no messages have been written to the storage yet (e.g. the topic is empty),
                        this value can be null.
                    consumer_offset:
                      type: integer
                      format: int64
                      description: |
                        Latest offset consumed by the backup.
                        Defaults to 0 in case no messages have been consumed yet.
                    max_offset:
                      type: integer
                      format: int64
                      description: |
                        Maximum offset available in the topic partition.
    RestoreResource:
      type: object
      required:
        - id
        - name
        - status
        - source
        - sink
        - topics
      properties:
        id:
          type: string
          description: The id of the restore
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: |
            The name of the Restore.
            This corresponds to the Kubernetes resource name.
            Each name is unique within a Kubernetes namespace.
        uuid:
          type: string
          description: |
            The uid of the Kubernetes resource.
            This is a unique identifier assigned by Kubernetes to each resource.
            It is immutable and cannot be changed.
        description:
          type: string
          maxLength: 1000
          description: |
            An optional description of the Restore.
            This field can be used to provide additional context or information about the Restore.
        status:
          type: string
          enum:
            - DRAFT
            - READY
            - INITIALIZING
            - RUNNING
            - PAUSED
            - DONE
            - INVALID_CONFIGURATION
            - FAILED
            - INTERRUPTED
          description: |
            The status of the restore.
            Possible values: DRAFT, READY, INITIALIZING, RUNNING, PAUSED, DONE, INVALID_CONFIGURATION, FAILED, INTERRUPTED.
            See https://docs.kannika.io/user-guide/restore/lifecycle/
        source:
          type: string
          description: The source storage of the restore
        source_credentials:
          type: string
          description: |
            The name of the Credentials used to authenticate with the source storage.
            If not provided, no authentication will be used (unless a service account is provided).
            See https://docs.kannika.io/user-guide/authentication/credentials/
        source_additional_props:
          type: object
          additionalProperties:
            type: string
          description: |
            Additional property key-value pair for the source storage.
            Not all storage types support additional properties.
            See https://docs.kannika.io/user-guide/restore/additional-properties/
        sink:
          type: string
          description: |
            The name of the EventHub to which the Restore refers.
            This EventHub is the destination for the restored data.
        sink_credentials:
          type: string
          description: |
            The name of the Credentials used to authenticate with the sink EventHub.
            If not provided, no authentication will be used.
            See https://docs.kannika.io/user-guide/authentication/credentials/
        sink_additional_props:
          type: object
          additionalProperties:
            type: string
          description: |
            Additional property key-value pair for the sink EventHub.
            This can be used, for example, to provide extra configuration properties to Kafka clients.
            https://docs.kannika.io/user-guide/restore/additional-properties/
        service_account:
          type: string
          description: |
            The name of a Kubernetes ServiceAccount to use for the Pod.
            This is useful when using workload identity or when the Pod needs specific permissions.
            See https://docs.kannika.io/user-guide/authentication/iam-service-account/
        restore_from_date_time:
          type: string
          format: date-time
          description: |
            The point of time to restore from.
            This is in the past compared to 'restore_until_date_time'.
            The value will be returned in ISO-8601 format in UTC timezone (e.g., 2023-01-30T15:04:05Z).
            See https://docs.kannika.io/user-guide/restore/#restoring-data-between-two-dates
            Deprecated: Use `filters.time.absolute.from_date_time` instead.
        restore_until_date_time:
          type: string
          format: date-time
          description: |
            The point of time to restore to.
            This is in the future compared to 'restore_from_date_time'.
            The value will be returned ISO-8601 format in UTC timezone (e.g., 2023-01-30T15:04:05Z).
            See https://docs.kannika.io/user-guide/restore/#restoring-data-between-two-dates
            Deprecated: Use `filters.time.absolute.to_date_time` instead.
        filters:
          type: object
          description: |
            Filters applied to the restore job, including time-based and retention-based filters.
          properties:
            time:
              type: object
              description: Time-based filters for the restore job.
              properties:
                absolute:
                  type: object
                  description: Absolute time range filter.
                  properties:
                    from_date_time:
                      type: string
                      format: date-time
                      description: |
                        Start of the time range (inclusive).
                        Returned in ISO-8601 format in UTC timezone.
                    to_date_time:
                      type: string
                      format: date-time
                      description: |
                        End of the time range (exclusive).
                        Returned in ISO-8601 format in UTC timezone.
                retention:
                  type: object
                  description: Retention-based filter.
                  properties:
                    policies:
                      type: array
                      description: Retention policies applied to the restore.
                      items:
                        type: string
        legacy_offset_header:
          type: string
          description: |
            The header to add to the restored messages to indicate the original offset.
            If not provided, no header will be added.
            Note that this will increase the size of each message.
            See https://docs.kannika.io/user-guide/restore/#adding-the-legacy-offset-to-the-headers
        parallelism:
          type: integer
          description: The number of topics to restore in parallel
        max_producers:
          type: integer
          description: Maximum number of concurrent producers
        topics:
          type: array
          description: The topics to restore
          items:
            type: object
            required:
              - source
              - target
              - partitions
            properties:
              source:
                type: string
                description: The source topic name
              target:
                type: string
                description: The target topic name
              disable_preflight_checks:
                type: boolean
                description: Whether preflight checks are disabled
              partitions:
                type: array
                description: The partition configurations
                items:
                  type: object
                  required:
                    - number
                  properties:
                    number:
                      type: integer
                      minimum: 0
                      maximum: 99999
                      description: The partition number
                    restore_from_offset:
                      type: integer
                      format: int64
                      minimum: 0
                      description: The offset to restore from
                    restore_until_offset:
                      type: integer
                      format: int64
                      minimum: 0
                      description: The offset to restore until
        resources:
          $ref: '#/components/schemas/ResourceRequirements'
    RestoreInput:
      type: object
      required:
        - sink
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: |
            The name of the Restore.
            This must adhere to the Kubernetes resource naming conventions.
            Must be unique within the namespace.
            If no name is provided, a name will be generated.
            See https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
        description:
          type: string
          maxLength: 1000
          description: The description of the restore
        backup:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: |
            The name of the Backup where to restore data from.
            When this field is provided, the Storage of the Backup will be used as the source for the Restore.
            This field is mutually exclusive with 'source'.
            In case `backup` is provided, the platform can perform additional validations and optimizations,
            and display more accurate information in the UI,
            thus it is preferred to use 'backup' over 'source'.
            See https://docs.kannika.io/user-guide/backup/
        source:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: |
            The name of the Storage that contains the data to restore from.
            This field is mutually exclusive with 'backup'.
            In case the Storage is used directly,
            the platform cannot perform additional validations and optimizations as when using 'backup',
            and the UI might display less accurate information.
            Thus it is preferred to use 'backup' over 'source'.
            However, this field can be used to restore from storage locations that do not have a corresponding Backup
            (e.g. when the Backup has been deleted but the data remains in the Storage).
            See https://docs.kannika.io/user-guide/storage/
        source_credentials:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The credentials used for the source connection
        source_additional_props:
          type: object
          additionalProperties:
            type: string
          description: Additional properties for the source storage
        sink:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The sink of where the restore goes to
        sink_credentials:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The credentials used for the sink connection
        sink_additional_props:
          type: object
          additionalProperties:
            type: string
          description: Additional properties for the sink event hub
        service_account:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The service account used for the restore
        restore_from_date_time:
          type: string
          format: date-time
          description: |
            The point of time to restore from.
            Must be in the past compared to 'restore_until_date_time'.
            The value must be in ISO-8601 format.
            See https://docs.kannika.io/user-guide/restore/#restoring-data-between-two-dates
            Deprecated: Use `filters.from_date_time` instead. If both this field and `filters` are set, `filters` takes precedence.
        restore_until_date_time:
          type: string
          format: date-time
          description: |
            The point of time to restore to.
            Must be in the future compared to 'restore_from_date_time'.
            The value must be in ISO-8601 format.
            See https://docs.kannika.io/user-guide/restore/#restoring-data-between-two-dates
            Deprecated: Use `filters.to_date_time` instead. If both this field and `filters` are set, `filters` takes precedence.
        filters:
          type: object
          description: |
            Filters for the restore job. This is the preferred way to configure time-based and retention-based filters. If both `filters` and the deprecated `restore_from_date_time`/`restore_until_date_time` fields are set, `filters` takes precedence.
          properties:
            time:
              type: object
              description: Time-based filters for the restore job.
              properties:
                absolute:
                  type: object
                  description: Absolute time range filter.
                  properties:
                    from_date_time:
                      type: string
                      format: date-time
                      description: |
                        Start of the time range (inclusive). ISO-8601 format.
                    to_date_time:
                      type: string
                      format: date-time
                      description: |
                        End of the time range (exclusive). ISO-8601 format.
                        Must be after `from_date_time`.
                retention:
                  type: object
                  description: Retention-based filter.
                  properties:
                    policies:
                      type: array
                      maxItems: 100
                      description: |
                        Retention policies to apply.
                        Supported values: `ApplyTargetTopicRetention`.
                      items:
                        type: string
                        minLength: 1
                        maxLength: 255
        legacy_offset_header:
          type: string
          description: |
            The header to add to the restored messages to indicate the original offset.
            If not provided, no header will be added.
            Note that this will increase the size of each message.
            See https://docs.kannika.io/user-guide/restore/#adding-the-legacy-offset-to-the-headers
        parallelism:
          type: integer
          minimum: 1
          description: |
            The number of parallel tasks to use for the restore.
            Note that the maximum parallelism can be limited by the number of producers available from `max_producers`.
            If not provided, the restore will restore each topic sequentially.
            See https://docs.kannika.io/user-guide/restore/#restore-to-multiple-topics-in-parallel
        max_producers:
          type: integer
          minimum: 1
          description: |
            The size of the producer pool used to restore the data.
            Producers are created based on the topic settings in the sink.
            For example, different producers will be created for Kafka topics due to `max.message.bytes` setting to avoid message size issues.
            Topics with the same settings will share producers from the pool.
            When restoring multiple topics in parallel, having a higher number of producers can help to increase throughput.
            If not provided, there will be maximum of 1 producer at a time.
            See https://docs.kannika.io/user-guide/restore/#restore-to-multiple-topics-in-parallel
        topics:
          type: array
          maxItems: 1000
          description: The topics that need to be restored
          items:
            type: object
            required:
              - source
              - target
            properties:
              source:
                type: string
                maxLength: 249
                pattern: ^[a-zA-Z0-9._-]+$
                description: The name of the source topic
              target:
                type: string
                maxLength: 249
                pattern: ^[a-zA-Z0-9._-]+$
                description: |
                  The name of the target topic.
                  This must be unique among all target topics in the restore
              disable_preflight_checks:
                type: boolean
                default: false
                description: |
                  A flag indicating whether preflight checks should be disabled for this target topic.
                  This is needed when repartitioning the topic, as the number of partitions will differ.
                  If not provided, preflight checks will be performed.
                  See https://docs.kannika.io/user-guide/restore/#disabling-preflight-checks and
                  https://docs.kannika.io/user-guide/plugins/topic-repartitioning/
              partitions:
                type: array
                items:
                  type: object
                  required:
                    - number
                  properties:
                    number:
                      type: integer
                      minimum: 0
                      maximum: 99999
                      description: The partition number
                    restore_from_offset:
                      type: integer
                      format: int64
                      minimum: 0
                      description: |
                        Restore the partition from this offset.
                        If not provided, the restore will start from the earliest offset available in the source.
                        See https://docs.kannika.io/user-guide/restore/#selecting-offsets-to-restore
                    restore_until_offset:
                      type: integer
                      format: int64
                      minimum: 0
                      description: |
                        Restore the partition until this offset.
                        If not provided, the restore will continue until the latest offset available in the source.
                        See https://docs.kannika.io/user-guide/restore/#selecting-offsets-to-restore
        resources:
          $ref: '#/components/schemas/ResourceRequirements'
    ImportRestoreTopicsInput:
      type: object
      required:
        - topics
      properties:
        topics:
          type: array
          maxItems: 1000
          description: Map of topics to be imported
          items:
            type: object
            required:
              - source
              - target
            properties:
              source:
                type: string
                maxLength: 249
                pattern: ^[a-zA-Z0-9._-]+$
                description: The name of the source topic
              target:
                type: string
                maxLength: 249
                pattern: ^[a-zA-Z0-9._-]+$
                description: The name of the target topic
              disable_preflight_checks:
                type: boolean
                default: false
              partitions:
                type: array
                items:
                  type: object
                  required:
                    - number
                  properties:
                    number:
                      type: integer
                      minimum: 0
                      maximum: 99999
                    restore_from_offset:
                      type: integer
                      format: int64
                      minimum: 0
                    restore_until_offset:
                      type: integer
                      format: int64
                      minimum: 0
    RemoveRestoreTopicsInput:
      type: object
      required:
        - topics
      properties:
        topics:
          type: array
          maxItems: 10000
          items:
            type: string
            maxLength: 249
            pattern: ^[a-zA-Z0-9._-]+$
          description: List of topics to be deleted
    RestoreMetrics:
      type: object
      required:
        - topics
      properties:
        topics:
          type: array
          description: The metrics for each topic in the restore
          items:
            type: object
            required:
              - name
              - status
            properties:
              name:
                type: string
                description: The name of the topic
              status:
                type: string
                description: 'The status of the restore of this topic: PENDING, STARTING, RUNNING, STOPPING, STOPPED, FAILED, SUCCEEDED, UNKNOWN'
              status_message:
                type: string
                description: A message with more details about the status
              status_hints:
                type: array
                description: Optional hints providing remediation steps for the status
                items:
                  type: string
              ingestion_rate:
                type: object
                properties:
                  bytes_per_second:
                    type: integer
                    format: int64
                    description: The bytes per second being restored for this topic
              messages_to_restore:
                type: integer
                format: int64
                description: The number of message to restore of this topic
              size_to_restore:
                type: integer
                format: int64
                description: The size all messages to restore of this topic
              restored_size:
                type: integer
                format: int64
                description: The size of all restored messages of this topic
              last_offsets:
                type: array
                description: The last partitions per partition that were restored
                items:
                  type: object
                  required:
                    - partition
                    - offset
                  properties:
                    partition:
                      type: integer
                      description: The partition number
                    offset:
                      type: integer
                      format: int64
                      description: The last restored offset for this partition
    AzureStorageResource:
      type: object
      properties:
        container_name:
          type: string
          description: The bucket name of the Azure storage
        location:
          type: string
          description: The path of the Azure storage
        directory:
          type: string
          description: The directory path of the Azure storage
        storage_uri:
          type: string
          description: The URI of the Azure storage
    GcsStorageResource:
      type: object
      properties:
        bucket_name:
          type: string
          description: The bucket name of the Google cloud storage
        bucket_prefix:
          type: string
          description: The path of the Google cloud storage
        bucket_uri:
          type: string
          description: The URI of the Google cloud storage
    S3StorageResource:
      type: object
      properties:
        bucket_name:
          type: string
          description: The bucket name of the S3 storage
        bucket_region:
          type: string
          description: The region of the S3 storage
        bucket_prefix:
          type: string
          description: The path of the S3 storage
        bucket_uri:
          type: string
          description: The URI of the S3 storage
        endpoint:
          type: string
          format: uri
          description: |
            The custom S3-compatible endpoint URL (e.g. http://minio:9000). Present when using a non-AWS S3 provider such as MinIO or Ceph.
        force_path_style:
          type: boolean
          description: |
            Whether path-style bucket addressing is used instead of virtual-hosted-style. Typically enabled for S3-compatible providers such as MinIO.
    VolumeStorageResource:
      type: object
      properties:
        capacity:
          type: string
          description: The storage capacity of the volume in bytes or capacity units (e.g. 10Gi)
    StorageResource:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the storage
        uuid:
          type: string
          description: The uid of the kubernetes resource
        description:
          type: string
          description: The description of the storage
        type:
          type: string
          enum:
            - AZURE
            - GCS
            - S3
            - VOLUME
          description: The type of the storage
        azure:
          $ref: '#/components/schemas/AzureStorageResource'
        gcs:
          $ref: '#/components/schemas/GcsStorageResource'
        s3:
          $ref: '#/components/schemas/S3StorageResource'
        volume:
          $ref: '#/components/schemas/VolumeStorageResource'
    AzureStorageInput:
      type: object
      required:
        - container_name
        - location
      properties:
        container_name:
          type: string
          minLength: 3
          maxLength: 63
          pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
          description: The name of the Azure container
        location:
          type: string
          format: uri
          description: The location of the Azure container (e.g https://mycompany.blob.core.windows.net/)
        directory:
          type: string
          maxLength: 1024
          description: The directory of the Azure container (e.g /backups)
    GcsStorageInput:
      type: object
      required:
        - bucket_name
      properties:
        bucket_name:
          type: string
          minLength: 3
          maxLength: 222
          description: The name of the GCS bucket
        bucket_prefix:
          type: string
          maxLength: 1024
          description: The prefix for the GCS bucket (e.g path/to/dir)
    S3StorageInput:
      type: object
      required:
        - bucket_name
        - bucket_region
      properties:
        bucket_name:
          type: string
          minLength: 3
          maxLength: 63
          description: The name of the S3 bucket
        bucket_region:
          type: string
          pattern: ^[a-z]+(-[a-z]*)+-[0-9]$
          description: The region of the S3 bucket (e.g. eu-central-1)
        bucket_prefix:
          type: string
          maxLength: 1024
          description: The prefix for the S3 bucket (e.g path/to/dir)
        endpoint:
          type: string
          format: uri
          maxLength: 1024
          description: |
            Custom S3-compatible endpoint URL (e.g. http://minio:9000). Required for non-AWS S3 providers such as MinIO or Ceph.
        force_path_style:
          type: boolean
          default: false
          description: |
            Use path-style bucket addressing instead of virtual-hosted-style. Required for most S3-compatible providers such as MinIO.
    VolumeStorageInput:
      type: object
      required:
        - capacity
      properties:
        capacity:
          type: string
          description: The capacity of the volume
    StorageInput:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the storage
        description:
          type: string
          maxLength: 1000
          description: The description of the storage
        azure:
          $ref: '#/components/schemas/AzureStorageInput'
        gcs:
          $ref: '#/components/schemas/GcsStorageInput'
        s3:
          $ref: '#/components/schemas/S3StorageInput'
        volume:
          $ref: '#/components/schemas/VolumeStorageInput'
    SaslCredentialsResource:
      type: object
      properties:
        mechanism:
          type: string
          enum:
            - PLAIN
            - SCRAMSHA256
            - SCRAMSHA512
            - OAUTHBEARER
          description: The mechanism used to login
        use_ssl:
          type: boolean
          description: Indicates if SSL is enabled
        token_endpoint:
          type: string
          description: The OAuth token endpoint URL
        scope:
          type: string
          description: The OAuth scope
        extensions:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                description: Extension key
              value:
                type: string
                description: Extension value
          description: SASL OAUTHBEARER extensions
    CredentialsResource:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the credentials
        uuid:
          type: string
          description: The uid of the kubernetes resource
        type:
          type: string
          enum:
            - AWS
            - AZURE
            - GCP
            - SASL
            - MTLS
            - HTTP_BASIC
          description: The type of the credentials
        sasl:
          $ref: '#/components/schemas/SaslCredentialsResource'
    AwsCredentialsInput:
      type: object
      description: The AWS configuration
      required:
        - access_key_id
        - secret_access_key
      properties:
        access_key_id:
          type: string
          pattern: '[A-Za-z0-9_]+'
          description: The access key id of the AWS credentials
        secret_access_key:
          type: string
          pattern: '[a-zA-Z0-9/+=]+'
          description: The secret of the access key of the AWS credentials
    AzureCredentialsInput:
      type: object
      description: The Azure Storage Credentials configuration
      required:
        - sas_token
      properties:
        sas_token:
          type: string
          description: The SAS token to authenticate with the Azure Storage
    GcpCredentialsInput:
      type: object
      description: The GCP configuration
      required:
        - service_account_json
      properties:
        service_account_json:
          type: string
          description: The service account JSON
    SaslSslInput:
      type: object
      properties:
        client_key:
          type: string
          description: The client key used to authenticate
        client_key_password:
          type: string
          description: The client key used to decrypt the client key
        client_certificate:
          type: string
          description: The client certificate used to authenticate
        ca_certificate:
          type: string
          description: The ca certificate used to authenticate
    SaslCredentialsInput:
      type: object
      description: The SASL configuration
      required:
        - mechanism
      properties:
        mechanism:
          type: string
          enum:
            - PLAIN
            - SCRAMSHA256
            - SCRAMSHA512
            - OAUTHBEARER
          description: The mechanism used to login
        username:
          type: string
          maxLength: 256
          description: The username used to login
        password:
          type: string
          maxLength: 1024
          description: The password used to login
        use_ssl:
          type: boolean
          default: false
          description: To indicate if SSL is enabled
        ssl_conf:
          $ref: '#/components/schemas/SaslSslInput'
        token_endpoint:
          type: string
          maxLength: 1024
          description: The OAuth token endpoint URL
        client_id:
          type: string
          maxLength: 1024
          description: The OAuth client ID
        client_secret:
          type: string
          maxLength: 1024
          description: The OAuth client secret
        scope:
          type: string
          maxLength: 1024
          description: The OAuth scope
        extensions:
          type: array
          maxItems: 100
          items:
            type: object
            required:
              - key
              - value
            properties:
              key:
                type: string
                maxLength: 256
                description: Extension key
              value:
                type: string
                maxLength: 256
                description: Extension value
          description: SASL OAUTHBEARER extensions
    MtlsCredentialsInput:
      type: object
      description: The mTLS configuration
      required:
        - client_key
        - client_certificate
        - ca_certificate
      properties:
        client_key:
          type: string
          description: The client key used to authenticate
        client_key_password:
          type: string
          description: The client key used to decrypt the client key
        client_certificate:
          type: string
          description: The client certificate used to authenticate
        ca_certificate:
          type: string
          description: The ca certificate used to authenticate
    HttpBasicCredentialsInput:
      type: object
      description: The HTTP Basic configuration
      required:
        - username
        - password
      properties:
        username:
          type: string
          description: The username used to authenticate
        password:
          type: string
          description: The password used to authenticate
    CredentialsInput:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the credentials
        uuid:
          type: string
          description: Optional UUID for idempotent updates
        description:
          type: string
          maxLength: 1000
          description: The description of the credentials
        aws:
          $ref: '#/components/schemas/AwsCredentialsInput'
        azure:
          $ref: '#/components/schemas/AzureCredentialsInput'
        gcp:
          $ref: '#/components/schemas/GcpCredentialsInput'
        sasl:
          $ref: '#/components/schemas/SaslCredentialsInput'
        mtls:
          $ref: '#/components/schemas/MtlsCredentialsInput'
        http_basic:
          $ref: '#/components/schemas/HttpBasicCredentialsInput'
    KafkaResource:
      type: object
      properties:
        bootstrap_servers:
          type: string
          description: The bootstrap servers of the Kafka cluster
        properties:
          type: object
          additionalProperties:
            type: string
          description: Properties of the kafka configuration
    EventHubResource:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the event hub
        uuid:
          type: string
          description: The uid of the kubernetes resource
        description:
          type: string
          description: The description of the event hub
        type:
          type: string
          enum:
            - KAFKA
          description: The type of the event hub
        kafka:
          $ref: '#/components/schemas/KafkaResource'
    KafkaInput:
      type: object
      description: The Kafka configuration
      required:
        - bootstrap_servers
      properties:
        bootstrap_servers:
          type: string
          description: The bootstrap servers of the Kafka cluster
        properties:
          type: object
          additionalProperties:
            type: string
          description: Additional properties of the kafka configuration
    EventHubInput:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the event hub
        uuid:
          type: string
          description: Optional UUID for idempotent updates
        description:
          type: string
          maxLength: 1000
          description: The description of the event hub
        kafka:
          $ref: '#/components/schemas/KafkaInput'
    ConfluentSchemaRegistryResource:
      type: object
      properties:
        url:
          type: string
          description: The URL of the Confluent Schema Registry endpoint
        sslConf:
          type: object
          description: |
            TLS/mTLS configuration of the schema registry.
            Contains references to Kubernetes secrets holding the certificate and key material.
          properties:
            caCertificate:
              type: object
              description: Reference to the Kubernetes secret containing the PEM-encoded CA certificate (X.509)
              properties:
                name:
                  type: string
                  description: The name of the Kubernetes secret
                key:
                  type: string
                  description: The key within the Kubernetes secret
            clientCertificate:
              type: object
              description: Reference to the Kubernetes secret containing the PEM-encoded client certificate (X.509)
              properties:
                name:
                  type: string
                  description: The name of the Kubernetes secret
                key:
                  type: string
                  description: The key within the Kubernetes secret
            clientKey:
              type: object
              description: Reference to the Kubernetes secret containing the PEM-encoded client private key (PKCS#8)
              properties:
                name:
                  type: string
                  description: The name of the Kubernetes secret
                key:
                  type: string
                  description: The key within the Kubernetes secret
            clientKeyPassword:
              type: object
              description: Reference to the Kubernetes secret containing the client private key password
              properties:
                name:
                  type: string
                  description: The name of the Kubernetes secret
                key:
                  type: string
                  description: The key within the Kubernetes secret
    SchemaRegistryResource:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the schema registry
        uuid:
          type: string
          description: The uid of the kubernetes resource
        description:
          type: string
        type:
          type: string
          enum:
            - CONFLUENT
          description: The type of the schema registry
        confluent:
          $ref: '#/components/schemas/ConfluentSchemaRegistryResource'
    SchemaRegistrySslConfInput:
      type: object
      description: |
        Optional TLS/mTLS configuration for secure connections to the schema registry.
        All certificate and key values must be PEM-encoded.
      properties:
        caCertificate:
          type: string
          description: |
            PEM-encoded CA certificate (X.509) used for server trust verification.
            Supports certificate bundles containing intermediate and root CA certificates.
        clientCertificate:
          type: string
          description: |
            PEM-encoded client certificate (X.509) used for mutual TLS (mTLS) authentication.
            Supports certificate chains.
        clientKey:
          type: string
          description: |
            PEM-encoded client private key in PKCS#8 format used for mTLS authentication.
            Can be encrypted or unencrypted.
        clientKeyPassword:
          type: string
          description: |
            Password to decrypt the encrypted client private key.
            Required when the PKCS#8 private key is encrypted, omit for unencrypted keys.
    ConfluentSchemaRegistryInput:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: The URL of the Confluent Schema Registry endpoint
        ssl_conf:
          $ref: '#/components/schemas/SchemaRegistrySslConfInput'
    SchemaRegistryInput:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The unique name of the schema registry
        uuid:
          type: string
          description: Optional UUID for idempotent updates
        description:
          type: string
          maxLength: 1000
          description: The description of the schema registry
        confluent:
          $ref: '#/components/schemas/ConfluentSchemaRegistryInput'
    SchemaRegistryBackupResource:
      type: object
      required:
        - name
        - config
        - paused
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the schema registry backup
        uuid:
          type: string
          description: The uid of the kubernetes resource
        description:
          type: string
          description: The description of the schema registry backup
        config:
          type: object
          required:
            - registry
            - storage
          properties:
            registry:
              type: string
              description: The name of the registry to backup
            registry_credentials:
              type: string
              description: The credentials to use to authenticate with the schema registry
            storage:
              type: string
              description: The storage to save the backup to
            storage_credentials:
              type: string
              description: The credentials to authenticate with the storage provider
            service_account:
              type: string
              description: The service account to use
            resources:
              $ref: '#/components/schemas/ResourceRequirements'
            backup_interval_seconds:
              type: integer
              format: int64
              description: The interval when to run the backup
        paused:
          type: boolean
          description: Indicates whether the schema registry backup is enabled or not
    SchemaRegistryBackupInput:
      type: object
      required:
        - name
        - registry
        - storage
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the schema registry backup
        uuid:
          type: string
          description: Optional UUID for idempotent updates
        description:
          type: string
          maxLength: 1000
          description: The description of the schema registry backup
        registry:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the registry to backup
        registry_credentials:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The credentials to use to authenticate with the schema registry
        storage:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The storage to save the backup to
        storage_credentials:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The credentials to authenticate with the storage provider
        service_account:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The service account to use
        resources:
          $ref: '#/components/schemas/ResourceRequirements'
        backup_interval_seconds:
          type: integer
          description: The interval when to run the backup
    SchemaRegistryRestoreResource:
      type: object
      required:
        - name
        - config
        - status
        - enabled
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the schema registry restore
        uuid:
          type: string
          description: The uid of the kubernetes resource
        description:
          type: string
          description: The description of the schema registry restore
        config:
          type: object
          required:
            - registry
            - storage
          properties:
            registry:
              type: string
              description: The name of the registry to restore
            registry_credentials:
              type: string
              description: The credentials to use to authenticate with the schema registry
            storage:
              type: string
              description: The storage to save the restore to
            storage_credentials:
              type: string
              description: The credentials to authenticate with the storage provider
            service_account:
              type: string
              description: The service account to use
            resources:
              $ref: '#/components/schemas/ResourceRequirements'
            import_mode:
              type: boolean
              description: Indicates whether import mode is enabled or not
        status:
          type: string
          enum:
            - READY
            - INITIALIZING
            - RUNNING
            - DONE
            - FAILED
          description: The status of the schema registry restore
        enabled:
          type: boolean
          description: Indicates whether the schema registry restore is enabled or not
    SchemaRegistryRestoreInput:
      type: object
      required:
        - registry
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the schema registry restore
        uuid:
          type: string
          description: Optional UUID for idempotent updates
        description:
          type: string
          maxLength: 1000
          description: The description of the schema registry restore
        registry:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The name of the registry to restore
        registry_credentials:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The credentials to use to authenticate with the schema registry
        schema_registry_backup:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The SR backup name (exactly one of schema_registry_backup or storage is required)
        storage:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The storage to save the restore to
        storage_credentials:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The credentials to authenticate with the storage provider
        service_account:
          type: string
          minLength: 1
          maxLength: 253
          pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
          description: The service account to use
        resources:
          $ref: '#/components/schemas/ResourceRequirements'
        import_mode:
          type: boolean
          default: false
          description: Whether to use import mode
  responses:
    Created:
      description: Resource created
      headers:
        Location:
          description: The URL of the created resource
          schema:
            type: string
            format: uri
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  parameters:
    name:
      name: name
      in: path
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 253
        pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
      description: |
        The name of the resource.
        Must adhere to the Kubernetes naming conventions.
        See https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
