openapi: 3.0.1
info:
  title: KubeBlocks Cloud Internal API
  version: 1.0.0
  x-logo:
    url: https://kubeblocks.io/img/logo.png
    altText: ApeCloud logo
  description: |
    The Internal API is using for interaction of ApeCloud platform microservices.
servers:
  - url: https://cloudapi.apecloud.cn
    description: Secure server for production environment
security:
  - BasicAuth: []
paths:
  /internal/v1/environments/{environmentName}/backupRepo:
    post:
      tags:
        - environment
      operationId: createBackupRepoInternal
      summary: Create a backup repository
      description: Creates a backup repository. With envInstall enabled, uses the persisted environment installation storage and repository selection, reserves names before Kubernetes creation, and resumes the same installation on retries.
      parameters:
        - name: environmentName
          in: path
          required: true
          schema:
            type: string
        - name: uid
          in: query
          required: true
          schema:
            type: string
        - name: envInstall
          in: query
          description: Use the environment installation repository selection and retry handling. Omitted or false performs ordinary repository creation.
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/backupRepoCreate'
      responses:
        '200':
          description: Repository created or installation resumed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/backupRepo'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
  /internal/v1/environments/{environmentName}/modules/{moduleName}/uninstall:
    post:
      tags:
        - environment
      operationId: executeEnvironmentModuleUninstall
      summary: Execute a persisted module uninstall step
      parameters:
        - name: environmentName
          in: path
          required: true
          schema:
            type: string
        - name: moduleName
          in: path
          required: true
          schema:
            type: string
        - name: stage
          in: query
          required: true
          schema:
            type: string
            enum:
              - detach
              - delete
        - name: uid
          in: query
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Component-specific resource identities saved by the uninstall task.
              additionalProperties: true
      responses:
        '200':
          description: Step completed
        '202':
          description: Waiting for resource deletion; repeat the same step with the same payload
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
  /internal/v1/environments/{environmentName}/alertConfigs/sync:
    post:
      tags:
        - environment
      operationId: syncEnvironmentAlertConfigs
      summary: Reconcile alert configuration for an environment
      parameters:
        - name: environmentName
          in: path
          required: true
          schema:
            type: string
        - name: wait
          in: query
          schema:
            type: boolean
            default: false
      responses:
        '202':
          description: Reconciliation scheduled
        '204':
          description: Synchronous reconciliation completed
        '500':
          description: Reconciliation failed
  /internal/v1/alertWebhook/{orgName}/{strategyId}:
    post:
      operationId: alertWebhookProxy
      summary: Proxy alert webhook
      parameters:
        - name: strategyId
          in: path
          description: id of the alert strategyId
          required: true
          schema:
            type: string
        - name: orgName
          in: path
          description: name of the org
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postableAlert'
        required: true
      responses:
        '204':
          description: A successful response.
          content: {}
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-codegen-request-body-name: body
      tags:
        - alert
  /internal/v1/alerts/rules/config:
    get:
      tags:
        - alert
      summary: Get internal alert config
      description: Get alert config
      operationId: getInternalAlertConfig
      responses:
        '200':
          content:
            application/json:
              type: string
              description: Alert rule configuration content in YAML format
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /internal/v1/alertWebhook/record:
    post:
      tags:
        - alert
      summary: Record alert webhook
      description: Record alert webhook
      operationId: recordAlertWebhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postableAlert'
        required: true
      responses:
        '204':
          description: A successful response.
          content: {}
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /internal/v1/environments:
    post:
      operationId: createEnvironment
      summary: Create environment
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/environmentCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/environment'
          description: Returned when environment is created successfully.
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      tags:
        - environment
      x-codegen-request-body-name: body
  /internal/v1/tasks:
    get:
      operationId: listInternalTasks
      summary: List tasks, newest first, optionally filtered by resource and task type
      parameters:
        - name: resourceType
          in: query
          schema:
            type: string
        - name: resourceId
          in: query
          schema:
            type: string
        - name: taskType
          in: query
          description: Comma-separated task types.
          schema:
            type: string
        - name: pageSize
          in: query
          schema:
            type: integer
            minimum: 1
            default: 10
        - name: pageNumber
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
      responses:
        '200':
          description: Task identities and status without messages, inputs or outputs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internalTaskList'
        '400':
          $ref: '#/components/responses/400'
      tags:
        - task
  /internal/v1/tasks/{taskId}:
    get:
      operationId: getInternalTask
      summary: Get task status independently of the resource lifecycle
      parameters:
        - name: taskId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Task identity and status without messages, inputs or outputs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internalTask'
        '404':
          $ref: '#/components/responses/404'
      tags:
        - task
  /internal/v1/tasks/{taskId}/retry:
    patch:
      operationId: retryInternalTask
      summary: Retry a failed or stopped task using the existing task retry policy
      parameters:
        - name: taskId
          in: path
          required: true
          schema:
            type: string
        - name: mode
          in: query
          schema:
            $ref: '#/components/schemas/taskRetryMode'
      responses:
        '200':
          description: Task identity and status without messages, inputs or outputs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internalTask'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      tags:
        - task
  /internal/v1/imageRegistries:
    get:
      operationId: listInternalImageRegistries
      summary: List image registry names and URLs without credentials
      responses:
        '200':
          description: Registry metadata without usernames or passwords.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internalImageRegistryList'
      tags:
        - image_registry
    post:
      operationId: createImageRegistry
      summary: Create image registry
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/imageRegistry'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/imageRegistry'
          description: Returned when image registry is created successfully.
      tags:
        - imageRegistry
      x-codegen-request-body-name: body
  /internal/v1/environments/{environmentName}/kubeconfig:
    get:
      operationId: getEnvironmentKubeconfigInternal
      summary: Get environment kubeconfig
      parameters:
        - description: name of the Org
          in: query
          name: orgName
          required: false
          schema:
            type: string
        - description: the uid of the impersonating user
          in: query
          name: uid
          required: false
          schema:
            type: string
        - description: name of the Environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpBody'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      tags:
        - environment
  /internal/v1/environments/{environmentName}/nodepolane:
    post:
      tags:
        - nodeplane
      summary: Mark node plane for environemnt
      description: Mark region & zone labels and set control plane nodes for environemnt
      operationId: markNodePlane
      parameters:
        - description: name of the Environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties: {}
              additionalProperties: false
              type: object
        required: false
      responses:
        '204':
          description: NoContent
        '401':
          $ref: '#/components/responses/401'
      x-codegen-request-body-name: body
  /internal/v1/environments/{environmentName}/imagepullsecret:
    post:
      tags:
        - imagepullsecret
      summary: Create image pull secret for environment
      description: Create image pull secret for environment bootstrap. The environment's imageRegistry value must be a registry URL matching image_registries.url (not image_registries.name).
      operationId: imagePullSecret
      parameters:
        - description: name of the Environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties: {}
              additionalProperties: false
              type: object
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/imageRegistry'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
      x-codegen-request-body-name: body
  /internal/v1/organizations/{orgName}/recycleBin/clusters/{clusterName}:
    delete:
      tags:
        - recycleBinCluster
      operationId: deleteRecycleBinCluster
      summary: Delete cluster from the Recycle Bin of the Org
      parameters:
        - name: orgName
          in: path
          description: name of the Org
          required: true
          schema:
            type: string
        - name: clusterName
          in: path
          description: name of the cluster
          required: true
          schema:
            type: string
        - name: orgID
          in: query
          required: true
          schema:
            type: string
            pattern: ^[1-9][0-9]*$
        - name: clusterID
          in: query
          required: true
          schema:
            type: string
            pattern: ^[1-9][0-9]*$
        - name: uid
          in: query
          description: the uid of the impersonating user
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Returned when object is deleted successfully.
          content: {}
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /internal/v1/datasources:
    post:
      tags:
        - datasource
      summary: Create a new Grafana datasource
      description: Create a new datasource configuration for Grafana
      operationId: grafanaDataSourceCreate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/grafanaDatasourceCreate'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/grafanaDatasource'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
  /internal/v1/datasource/environments/{environmentID}:
    patch:
      tags:
        - datasource
      summary: Update a new Grafana datasource
      description: Update a new datasource configuration for Grafana
      operationId: grafanaDataSourceUpdate
      parameters:
        - description: id of the Environment
          in: path
          name: environmentID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/grafanaDatasource'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
  /internal/v1/environments/{environmentName}/minio:
    post:
      operationId: createMinioCluster
      summary: Create Environment Minio Cluster
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/environmentStorage'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cluster'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      tags:
        - cluster
    delete:
      operationId: deleteMinioCluster
      summary: Delete Environment Minio Cluster
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cluster'
          description: Deletion accepted. The cluster hash identifies the Kubernetes Cluster to wait for.
        '204':
          $ref: '#/components/responses/204'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      tags:
        - cluster
  /internal/v1/environments/{environmentName}/minio/storage:
    post:
      operationId: createStorageByMinioCluster
      summary: Create Storage by Minio Cluster
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/storage'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      tags:
        - storage
  /internal/v1/environments/{environmentName}/storages:
    delete:
      operationId: deleteEnvironmentStorage
      summary: Delete Environment Storage Resource
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      responses:
        '204':
          content:
            application/json:
              schema:
                type: object
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      tags:
        - cluster
  /internal/v1/environments/{environmentName}/victoriaMetricsCluster:
    post:
      tags:
        - victoriaMetricsCluster
      summary: create metrics Monitor
      description: create VictoriaMetrics Cluster and install victoria-metrics addon when it's uninstalled
      operationId: createVictoriaMetricsCluster
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      requestBody:
        description: Per-component resources for a new cluster, or reusedClusterName and reusedClusterNamespace to attach an existing cluster. Reuse does not apply component overrides.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/staticCluster'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cluster'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
    delete:
      operationId: deleteVictoriaMetricsCluster
      summary: Delete Environment VictoriaMetrics Cluster
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cluster'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      tags:
        - cluster
  /internal/v1/environments/{environmentName}/victoriaLogsCluster:
    post:
      tags:
        - victoriaLogsCluster
      summary: Create VictoriaLogs cluster
      description: Create VictoriaLogs with optional per-component resources and retention, or attach an existing cluster. Reuse does not apply component overrides or retention changes. Omitted components keep installer defaults on create.
      operationId: createVictoriaLogsCluster
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/victoriaLogsConfig'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cluster'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
  /internal/v1/organizations/{orgName}/clusters:
    get:
      tags:
        - cluster
      operationId: listCluster
      summary: List clusters in the Org
      parameters:
        - name: orgName
          in: path
          description: name of the Org
          required: true
          schema:
            type: string
        - name: clusterDefinition
          in: query
          description: The clusterDefinition in the List request
          schema:
            type: string
        - name: environmentName
          in: query
          description: Environment Type
          schema:
            type: string
        - name: environmentType
          in: query
          description: Environment Type
          schema:
            $ref: '#/components/schemas/environmentType'
        - name: tagKey
          in: query
          description: Tag key
          schema:
            type: string
        - name: tagValue
          in: query
          description: Tag value
          schema:
            type: string
        - name: tagKeys
          in: query
          description: A list of tags' keys
          schema:
            type: array
            items:
              type: string
        - name: tagValues
          in: query
          description: A list of tags' values corresponding to the tagKeys
          schema:
            type: array
            items:
              type: string
        - name: licenseId
          in: query
          description: license id
          schema:
            type: integer
        - name: endpointHost
          in: query
          description: Case-insensitive substring to match against the host part of cached cluster endpoints
          schema:
            type: string
        - name: includeEndpoints
          in: query
          description: Whether to include cached user-visible endpoints in each cluster item
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/clusterList'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
    post:
      operationId: createCluster
      summary: Create new cluster
      parameters:
        - description: name of the Org
          in: path
          name: orgName
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/cluster'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cluster'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      tags:
        - cluster
      x-codegen-request-body-name: body
  /internal/v1/organizations/{orgName}/clusters/{clusterName}:
    get:
      operationId: getCluster
      summary: Get cluster details
      parameters:
        - description: name of the Org
          in: path
          name: orgName
          required: true
          schema:
            type: string
        - description: name of the KubeBlocks cluster
          in: path
          name: clusterName
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cluster'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
      tags:
        - cluster
    patch:
      description: Update the specified Cluster
      summary: Update cluster specified fields
      operationId: patchCluster
      parameters:
        - description: name of the Org
          in: path
          name: orgName
          required: true
          schema:
            type: string
        - description: name of the KubeBlocks cluster
          in: path
          name: clusterName
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/clusterUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cluster'
          description: Returned when project is deleted successfully.
        '401':
          $ref: '#/components/responses/401'
      tags:
        - cluster
      x-codegen-request-body-name: body
    delete:
      tags:
        - cluster
      operationId: deleteCluster
      summary: Delete cluster
      parameters:
        - name: orgName
          in: path
          description: name of the Org
          required: true
          schema:
            type: string
        - name: clusterName
          in: path
          description: name of the KubeBlocks cluster
          required: true
          schema:
            type: string
        - name: force
          in: query
          description: if it is true, the cluster will be deleted no matter what the termination policy is, and will not be moved to the recycle bin.
          schema:
            type: boolean
      responses:
        '204':
          description: Returned when project is deleted successfully.
          content:
            application/json:
              schema:
                type: object
        '403':
          description: Returned when the user does not have permission to access the resource.
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Returned when the resource does not exist.
          content:
            application/json:
              schema:
                type: string
  /internal/v1/organizations/{orgName}/clusters/{clusterName}/endpoints:
    get:
      operationId: listEndpoints
      summary: List cluster endpoints
      parameters:
        - description: name of the Org
          in: path
          name: orgName
          required: true
          schema:
            type: string
        - description: name of the KubeBlocks cluster
          in: path
          name: clusterName
          required: true
          schema:
            type: string
        - description: count of the NodePort host
          in: query
          name: nodePortHostCount
          schema:
            type: integer
            default: 3
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/endpointList'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      tags:
        - cluster
  /internal/v1/organizations/{orgName}/clusters/{clusterName}/parameters:
    get:
      operationId: listParameterProps
      summary: List parameter properties of the cluster
      tags:
        - parameter
        - shared
      parameters:
        - description: name of the organization
          in: path
          name: orgName
          required: true
          schema:
            type: string
        - description: name of the cluster
          in: path
          name: clusterName
          required: true
          schema:
            type: string
        - description: component type
          in: query
          name: component
          required: false
          schema:
            type: string
        - description: whether to return the raw template content
          in: query
          name: rawContent
          schema:
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/parameterList'
          description: get configuration of the cluster successfully
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /internal/v1/organizations/{orgName}/clusters/{clusterName}/reconfigure:
    post:
      operationId: reconfigureCluster
      summary: Update cluster configuration
      parameters:
        - description: name of the Org
          in: path
          name: orgName
          required: true
          schema:
            type: string
        - description: name of the KubeBlocks cluster
          in: path
          name: clusterName
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/reconfigureCreate'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/opsRequestName'
          description: Accepted
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      tags:
        - opsrequest
        - shared
      x-codegen-request-body-name: body
  /internal/v1/environments/{environmentName}:
    get:
      operationId: getEnvironment
      summary: Get environment
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/environment'
          description: A successful response.
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      tags:
        - environment
    delete:
      operationId: deleteEnvironment
      summary: Delete Environment
      parameters:
        - description: name of the environment
          in: path
          name: environmentName
          required: true
          schema:
            type: string
      responses:
        '204':
          content: {}
          description: Returned when project is deleted successfully.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      tags:
        - environment
  /internal/v1/status:
    get:
      summary: Get API server status
      description: Returns the current status of the API server
      operationId: getStatus
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiserverStatusResponse'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      tags:
        - apiserver
  /internal/v1/engines:
    get:
      operationId: listAllEngines
      summary: List all engines
      parameters:
        - description: engine name
          in: query
          name: name
          schema:
            type: string
        - description: engine Type
          in: query
          name: type
          schema:
            type: string
        - description: engine version
          in: query
          name: version
          schema:
            type: string
        - name: provider
          in: query
          description: engine provider
          schema:
            type: string
        - name: all
          in: query
          description: list all engines include uninstall engines
          schema:
            type: boolean
            default: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/engineList'
          description: A successful response.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      tags:
        - engine
  /internal/v1/3rdsync/userList:
    get:
      tags:
        - dbdoctor
      operationId: dbDoctorSyncUser
      summary: Sync users from 3rd party system
      parameters:
        - description: last query time
          in: query
          name: startTime
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DBDoctorResponse'
          description: Success
        '401':
          $ref: '#/components/responses/401'
  /internal/v1/3rdsync/clusterList:
    get:
      tags:
        - dbdoctor
      operationId: dbDoctorSyncClusterInfo
      summary: Sync clusters from 3rd party system
      parameters:
        - description: last query time
          in: query
          name: startTime
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DBDoctorResponse'
          description: Success
        '401':
          $ref: '#/components/responses/401'
  /internal/v1/environments/{environmentName}/outages:
    post:
      summary: Batch create or update cluster outage record
      description: Batch create or update cluster outage record
      operationId: CreateOrUpdateClusterOutages
      tags:
        - SLA
      parameters:
        - name: environmentName
          in: path
          description: name of the environment
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OutageRecordList'
      responses:
        '200':
          description: Outage record created or updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutageRecordList'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /internal/v1/sla/outages:
    get:
      summary: List outage record for environments
      description: List outage record for environments
      operationId: ListEnvironmentOutageRecord
      tags:
        - SLA
      parameters:
        - name: environmentName
          in: query
          description: name of the environment, if not specified, return all environments
          schema:
            type: string
          required: false
        - name: orgName
          in: query
          description: name of the organization
          required: false
          schema:
            type: string
        - name: clusterID
          in: query
          description: id of the cluster
          required: false
          schema:
            type: string
        - name: activeOnly
          in: query
          description: whether to return only active outage records
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: Outage record retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutageRecordList'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /internal/v1/environments/{environmentName}/sla:
    get:
      summary: Check SLA config in env
      description: Check SLA config in a environment
      operationId: CheckSLAConfigInEnv
      tags:
        - SLA
      parameters:
        - name: environmentName
          in: path
          description: name of the environment
          required: true
          schema:
            type: string
      responses:
        '200':
          description: SLA config checked successfully
          content:
            application/json:
              schema:
                type: boolean
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /internal/v1/platformParameters/{platformParameterName}:
    get:
      tags:
        - platformParameter
        - shared
      operationId: getPlatformParameter
      summary: get platformParameter by name
      parameters:
        - description: name of the platformParameter
          in: path
          name: platformParameterName
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/platformParameter'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /internal/v1/llm:
    get:
      operationId: listLLMWithAPIKey
      summary: List LLM with plaintext api_key
      description: Returns LLM configs with plaintext api_key for internal service-to-service callers.
      produces:
        - application/json
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/llmList'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      tags:
        - llm
  /internal/v1/llm/{id}:
    get:
      tags:
        - llm
      operationId: getLLMWithAPIKey
      summary: Get LLM by ID with plaintext api_key
      description: Returns the LLM config with plaintext api_key for internal service-to-service callers.
      parameters:
        - description: ID of the LLM
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: LLM by ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/llm'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
components:
  securitySchemes:
    BasicAuth:
      description: HTTP Basic Authentication for internal service-to-service communication
      type: http
      scheme: basic
  schemas:
    backupRepoAccessMethod:
      description: the access method for backup repo
      default: Tool
      enum:
        - Mount
        - Tool
      type: string
    backupRepoPVReclaimPolicy:
      description: Specify the reclaim policy for PVs created by this backup repo
      enum:
        - Retain
        - Delete
      type: string
    backupRepoCreate:
      description: BackupRepoCreate is the payload to create a KubeBlocks cluster backup repo
      properties:
        storageID:
          description: the id of storage that backup repo used
          type: string
        accessMethod:
          $ref: '#/components/schemas/backupRepoAccessMethod'
        default:
          description: default specifies whether the backupRepo is the default backupRepo
          type: boolean
        name:
          description: name of the backupRepo
          type: string
        params:
          type: object
          description: the parameters to create the storage
          additionalProperties:
            type: string
        pvReclaimPolicy:
          $ref: '#/components/schemas/backupRepoPVReclaimPolicy'
        volumeCapacity:
          description: Specify the capacity of the new created PVC
          type: string
      required:
        - name
        - storageID
      type: object
    storageDisplayName:
      type: object
      description: the storage displayName
      properties:
        zh:
          type: string
        en:
          type: string
    backupRepoCheckStatus:
      type: string
      enum:
        - Passed
        - Failed
        - NotChecked
    backupRepoCheckResult:
      type: object
      description: Result of the platform storage access check, independent of the BackupRepo CR phase.
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/backupRepoCheckStatus'
        message:
          type: string
        checkedAt:
          type: string
          format: date-time
          x-nullable: true
    backupRepo:
      description: backupRepo is the payload for KubeBlocks cluster backup repo
      properties:
        accessMethod:
          $ref: '#/components/schemas/backupRepoAccessMethod'
        id:
          description: the id of backup repo
          type: string
        backupNums:
          description: backupNums specifies the number of backups in the backupRepo
          type: integer
        config:
          additionalProperties:
            type: string
          description: config specifies the configuration of the backupRepo
          type: object
        createdAt:
          description: createdAt specifies the creation time of the backupRepo
          format: date-time
          type: string
        default:
          description: default specifies whether the backupRepo is the default backupRepo
          type: boolean
        environmentId:
          description: environmentId of the backupRepo
          format: uuid
          type: string
        environmentName:
          description: environmentName of the backupRepo
          type: string
        name:
          description: name of the backupRepo
          type: string
        status:
          description: status specifies the status of the backupRepo
          type: string
        storageName:
          description: the name of storage used by backup repo
          type: string
        storageID:
          description: the id of storage used by backup repo
          type: string
        storageProvider:
          description: storageProvider specifies the storage provider of the backupRepo
          type: string
        storageProviderDisplayName:
          description: Localized display name from the storage provider metadata. Omitted when the provider or its display name is unavailable.
          readOnly: true
          $ref: '#/components/schemas/storageDisplayName'
        totalSize:
          description: totalSize specifies the total size of backups in the backupRepo
          type: string
        check:
          $ref: '#/components/schemas/backupRepoCheckResult'
        failedReason:
          type: string
          description: failedReason specifies the reason of the backupRepo failure
        failedMessage:
          type: string
          description: failedMessage specifies the message of the backupRepo failure
      required:
        - config
        - createdAt
        - default
        - environmentId
        - environmentName
        - name
        - storageProvider
      type: object
    APIErrorResponse:
      description: API error response.
      properties:
        code:
          description: The HTTP status code.
          type: integer
        reason:
          description: The reason for the error.
          type: string
        message:
          description: The message for the error.
          type: string
        errorCode:
          description: Stable business error code for programmatic handling.
          type: string
      required:
        - code
      type: object
    alertStatus:
      enum:
        - resolved
        - firing
      type: string
    alert:
      properties:
        annotations:
          additionalProperties:
            type: string
          type: object
        endsAt:
          format: date-time
          type: string
        fingerprint:
          type: string
        generatorURL:
          type: string
        labels:
          additionalProperties:
            type: string
          type: object
        startsAt:
          format: date-time
          type: string
        formattedStartsAt:
          type: string
        formattedEndsAt:
          type: string
        status:
          $ref: '#/components/schemas/alertStatus'
        Reason:
          type: string
          nullable: true
      type: object
    postableAlert:
      properties:
        alerts:
          items:
            $ref: '#/components/schemas/alert'
          type: array
        commonAnnotations:
          additionalProperties:
            type: string
          type: object
        commonLabels:
          additionalProperties:
            type: string
          type: object
        externalURL:
          type: string
        groupKey:
          type: string
        groupLabels:
          additionalProperties:
            type: string
          type: object
        receiver:
          type: string
        status:
          $ref: '#/components/schemas/alertStatus'
        truncatedAlerts:
          format: double
          type: number
        version:
          type: string
      type: object
    environmentType:
      type: string
      description: Type of this environment
      enum:
        - public
        - private
      default: public
    clusterSchedulingPolicy:
      type: string
      enum:
        - HardAntiAffinity
        - SoftAntiAffinity
        - Disabled
        - None
      default: SoftAntiAffinity
      description: |
        * `HardAntiAffinity` - Strictly enforce pod anti-affinity across nodes. Pods will not be scheduled when the anti-affinity constraints cannot be satisfied.
        * `SoftAntiAffinity` - Prefer to spread pods across nodes using anti-affinity, but allow scheduling on the same node when constraints cannot be fully satisfied.
        * `Disabled` - Do not apply pod anti-affinity constraints on nodes.
        * `None` - Inherit the engine-level default scheduling policy.
    tolerateDefaultTaints:
      title: TolerateDefaultTaints
      description: When creating a cluster, add the default tolerations from the bootstrap node to the pods
      type: object
      properties:
        enabled:
          type: boolean
        taints:
          type: array
          items:
            type: string
    systemComponentSchedulerPolicy:
      type: string
      enum:
        - default
        - koordinator
      default: default
    koordinatorReservationResourceClass:
      type: string
      enum:
        - database
        - business
    schedulingConfig:
      type: object
      title: SchedulingConfig
      description: Configuration of resource scheduling for this environment
      properties:
        clusterSchedulingPolicy:
          $ref: '#/components/schemas/clusterSchedulingPolicy'
        additionalTopologyKeys:
          type: array
          nullable: true
          default: []
          description: Additional Kubernetes topology label keys used by pod anti-affinity and topology spread for subsequently created or re-rendered clusters; existing Pods are not migrated automatically. Omit or use null during environment creation to store an empty list. Values must be valid Kubernetes qualified label keys. For KubeBlocks 1.x, the standard topology.kubernetes.io/zone key uses soft zone spread regardless of the scheduling policy. Infrastructure integrations or administrators must label all eligible nodes consistently; missing labels can cause unintended scheduling behavior and undermine failure-domain isolation. Too few eligible topology domains can leave Pods Pending under hard anti-affinity. If the Kubernetes LimitPodHardAntiAffinityTopology admission plugin is enabled, Pod creation is rejected for required anti-affinity using topology keys other than kubernetes.io/hostname, which can prevent the database cluster from becoming ready.
          items:
            type: string
        tolerateDefaultTaints:
          $ref: '#/components/schemas/tolerateDefaultTaints'
        systemComponentSchedulerPolicy:
          $ref: '#/components/schemas/systemComponentSchedulerPolicy'
          description: Scheduler policy used by internal system component clusters, including MinIO, VictoriaMetrics, and Victoria Logs. The persisted policy is resolved to the current scheduler name when a component is created.
        systemComponentReservationResourceClass:
          nullable: true
          $ref: '#/components/schemas/koordinatorReservationResourceClass'
          description: Optional Reservation resource class used by internal system component clusters when the Koordinator scheduler is selected. No Reservation label is added unless the user explicitly selects a resource class. The value is persisted on the environment.
    environmentRegisterType:
      type: string
      description: Configuration for privisoining environment resources
      enum:
        - kubeconfig
    register:
      type: object
      description: Register manifest for environment
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/environmentRegisterType'
        kubeconfig:
          description: The base64 encoded kubeconfig file contents to connect to this environment
          format: byte
          type: string
    component:
      type: object
      description: Component info in environment
      required:
        - defaultStorageClass
      properties:
        kubernetesVersion:
          type: string
          description: Kubernetes version of the environment
        kbVersion:
          type: string
          description: KubeBlocks version of the environment
        geminiVersion:
          type: string
          description: Gemini version of the environment
        oteldVersion:
          type: string
          description: Oteld version of the environment
        imageRegistry:
          type: string
          description: Image registry URL used by the environment. Must match image_registries.url, not image_registries.name.
        defaultStorageClass:
          description: Default storage class that used by KubeBlocks to create cluster
          type: string
        cpuOvercommitRatio:
          description: CPU overcommit ratio of this environment
          type: number
          format: double
        memoryOvercommitRatio:
          description: Memory overcommit ratio of this environment
          type: number
          format: double
        replicas:
          description: the replicas of core component, such as kubeblocks and gemini
          type: integer
          minimum: 1
          default: 1
        namespaces:
          items:
            type: string
          default:
            - kubeblocks-cloud-ns
          type: array
          description: Namespace info for environment
    nodePoolNode:
      title: NodePoolNode
      description: Node info for environment
      type: object
      required:
        - name
        - availabilityZone
      properties:
        name:
          type: string
        availabilityZone:
          type: string
        markControlPlane:
          type: boolean
          default: false
        markDataPlane:
          description: Mark the node as a data plane, which will always be true when markControlPlane is not specified
          type: boolean
          default: true
        nodeGroup:
          description: The node group to assign this node to
          type: string
    nodePool:
      title: NodePool
      description: Create your node plan, and the selected nodes will be used for pod scheduling
      type: array
      items:
        $ref: '#/components/schemas/nodePoolNode'
      minItems: 1
    environmentStorageType:
      description: the storage type
      type: string
      enum:
        - remote
        - local
    storageCreate:
      description: storageCreate is the schema for the storage create request
      type: object
      required:
        - storageProvider
      properties:
        name:
          type: string
          description: Name of the storage
        storageProvider:
          type: string
          minLength: 1
          x-nullable: false
          description: Name of the storage provider
        params:
          type: object
          description: the parameters to create the storage
          additionalProperties:
            type: string
        clusterID:
          type: string
          description: the id of cluster that storage used
        tags:
          type: object
          description: the tags for the storage
          additionalProperties:
            type: string
    staticClusterComponent:
      type: object
      required:
        - component
      properties:
        component:
          type: string
          minLength: 1
          description: Exact component name supported by the selected engine during environment installation. Each component may appear only once.
        replicas:
          type: integer
          format: int64
          nullable: true
          minimum: 1
          description: Number of replicas. Omit to keep the installer default.
        classCode:
          type: string
          description: Resource class for this exact engine, mode and component. Omit to keep the installer default.
        storage:
          type: number
          format: double
          nullable: true
          minimum: 1
          description: Disk capacity in Gi. Only vm-storage, vlstorage and minio accept this field.
    staticCluster:
      type: object
      properties:
        components:
          type: array
          maxItems: 3
          description: Optional component overrides. Unknown, duplicate or other-engine components are rejected. Must be omitted when reusedClusterName is set; adding an environment does not resize an existing cluster.
          items:
            $ref: '#/components/schemas/staticClusterComponent'
        reusedClusterName:
          type: string
          description: Kubernetes name of an existing cluster to attach. Set together with reusedClusterNamespace. The existing cluster's actual resources are used, and component overrides are rejected.
        reusedClusterNamespace:
          type: string
          description: Namespace of the cluster named by reusedClusterName. Required when reusedClusterName is set.
    environmentStorage:
      type: object
      description: Storage config
      properties:
        name:
          description: the storage name
          type: string
        type:
          $ref: '#/components/schemas/environmentStorageType'
        reusedClusterName:
          description: the existed cluster name for creating storage
          type: string
        reusedClusterNamespace:
          description: the existed cluster namespace for creating storage
          type: string
        config:
          $ref: '#/components/schemas/storageCreate'
        cluster:
          $ref: '#/components/schemas/staticCluster'
    storageConfig:
      type: object
      description: Storage config for environment
      required:
        - storages
      properties:
        storages:
          type: array
          description: these storages will be created
          items:
            $ref: '#/components/schemas/environmentStorage'
        backup:
          type: object
          description: the storage config for backup
          properties:
            storageIndex:
              type: integer
              format: int64
              nullable: true
              minimum: 0
              description: Zero-based index of the default backup storage. Required for multiple storages when storageName is omitted.
            storageName:
              nullable: true
              type: string
              description: the name of storage
            backupRepoName:
              nullable: true
              type: string
              description: the backup repo name which will be init
            defaultBackupRepo:
              nullable: true
              type: boolean
              description: judge whether to set the backup is default which will be init
    victoriaLogsConfig:
      type: object
      allOf:
        - $ref: '#/components/schemas/staticCluster'
        - type: object
          properties:
            retentionPeriod:
              type: string
              x-nullable: false
              description: Environment installation log retention, explicitly overriding the addon default. Defaults to 100y when omitted. Accepts a number with s (seconds), h (hours), d (days), w (weeks), M (months), or y (years); a bare number means months. Must be between 1d and 100y. Disk usage retention limits still apply.
            retentionMaxDiskUsagePercent:
              type: integer
              nullable: true
              minimum: 1
              maximum: 100
              description: Maximum disk usage percentage before VictoriaLogs deletes older log partitions. Defaults to 80 when omitted. Applies independently of retentionPeriod.
    environmentModuleStatus:
      type: string
      description: Status of an environment module. Enabled is only used as the desired state when creating an environment. NotInstalled, Installing, and InstallationFailed describe quick installation; Upgradeable, Upgrading, and UpgradeFailed describe quick upgrade. Upgradeable means the component is running but an ApeCloud-bundled newer version is available. Unknown means the current state could not be determined.
      enum:
        - Running
        - Updating
        - Error
        - Disabled
        - Enabled
        - NotInstalled
        - Installing
        - InstallationFailed
        - Upgradeable
        - Upgrading
        - UpgradeFailed
        - Uninstalling
        - UninstallationFailed
        - Unknown
    clusterInfo:
      type: object
      description: Cluster information
      properties:
        clusterName:
          type: string
          description: The name of the cluster
        clusterDefinition:
          type: string
          description: The definition of the cluster
        orgName:
          type: string
          description: The organization name
    localizedDescription:
      type: object
      properties:
        zh-CN:
          type: string
          x-nullable: true
        en-US:
          type: string
          x-nullable: true
    environmentModule:
      type: object
      description: Single environment module information
      properties:
        name:
          type: string
          description: Environment module name
        version:
          type: string
          description: Currently installed environment module version
        status:
          $ref: '#/components/schemas/environmentModuleStatus'
        replicas:
          type: integer
          description: Number of replicas
        location:
          type: string
          description: Deployment location
        operationTaskId:
          type: string
          description: ID of the asynchronous task associated with the module's current operation state. It is omitted when the current state is not associated with a task.
        clusterInfo:
          $ref: '#/components/schemas/clusterInfo'
          description: Cluster information
        description:
          $ref: '#/components/schemas/localizedDescription'
          description: Module description in multiple languages
        displayName:
          $ref: '#/components/schemas/localizedDescription'
          description: Module display name in multiple languages
        optional:
          type: boolean
          description: indicate module is optional. If false, the module is required and must be installed
        defaultEnabled:
          type: boolean
          description: indicate whether module is enabled by default when creating environment. Only effective when optional is true
        actionWarning:
          $ref: '#/components/schemas/localizedDescription'
          description: Localized business-impact warning for the component action represented by the current status.
        uninstallSupported:
          type: boolean
          description: Whether the module supports the Uninstall action. A dry run checks whether it is currently safe to uninstall.
        uninstallWarning:
          $ref: '#/components/schemas/localizedDescription'
          description: Localized warning about resources and data removed by uninstallation.
      required:
        - name
        - status
    provisionConfig:
      title: ProvisionConfig
      description: Configuration to provision infrastructure for this environment
      type: object
      required:
        - register
        - component
      properties:
        register:
          $ref: '#/components/schemas/register'
        component:
          $ref: '#/components/schemas/component'
        nodePool:
          $ref: '#/components/schemas/nodePool'
        storage:
          $ref: '#/components/schemas/storageConfig'
        victoriaMetrics:
          description: Create VictoriaMetrics with optional per-component resources, or attach an existing cluster by reusedClusterName and reusedClusterNamespace. Omitted components keep installer defaults on create. Reuse uses the existing cluster's actual resources and does not resize it.
          $ref: '#/components/schemas/staticCluster'
        victoriaLogs:
          description: Create VictoriaLogs with optional per-component resources and retention, or attach an existing cluster by reusedClusterName and reusedClusterNamespace. Omitted components keep installer defaults on create. Reuse uses the existing cluster's actual resources and retention, and does not resize or reconfigure it.
          $ref: '#/components/schemas/victoriaLogsConfig'
        modules:
          type: array
          description: option modules of environment
          items:
            $ref: '#/components/schemas/environmentModule'
    environmentDeletePolicy:
      type: string
      description: Environment delete policy to protect environment from false delete
      enum:
        - Delete
        - DoNotDelete
      default: DoNotDelete
    dns:
      type: object
      properties:
        serviceName:
          type: string
          description: the name of the DNS service
        serviceNamespace:
          type: string
          description: the namespace of the DNS service
      required:
        - serviceName
        - serviceNamespace
    ipPoolProvider:
      type: string
      description: KBE provider used for Pod IP pool discovery and explicit selection.
      enum:
        - spiderpool
    environmentCreate:
      required:
        - provider
        - region
        - name
        - displayName
        - type
        - organizations
        - provisionConfig
      type: object
      description: Environment creation info
      properties:
        name:
          type: string
          description: The full, unique name of this Object in the format environments/{name}, set during creation. name must be a valid RFC 1123 compliant DNS label
        type:
          description: Environment type
          $ref: '#/components/schemas/environmentType'
        schedulingConfig:
          description: Configuration for resource schduling for an environment
          $ref: '#/components/schemas/schedulingConfig'
        provisionConfig:
          description: Configuration for provisioning an environment
          $ref: '#/components/schemas/provisionConfig'
        organizations:
          items:
            type: string
          type: array
          description: Organizations that have access for this environment
        provider:
          title: Cloud Provider
          type: string
          description: Cloud Provider
        region:
          title: Cloud Region
          type: string
          description: Cloud Region
        availabilityZones:
          title: Availability Zones
          description: Availability Zones
          items:
            type: string
          minItems: 1
          type: array
        description:
          type: string
          description: The description of the organization
        displayName:
          type: string
          description: The display name of the environment
        id:
          type: string
          format: uuid
        extraInfo:
          type: string
          description: Extra info for environment
        deletePolicy:
          $ref: '#/components/schemas/environmentDeletePolicy'
        overwrite:
          type: boolean
          description: overwrite a environment if it has been added before
          default: false
        dns:
          $ref: '#/components/schemas/dns'
        sla:
          description: whether to enable calculate the cluster SLA for the environment
          type: boolean
          default: false
        koordinatorEnabled:
          description: Whether this environment has Koordinator installed and can use Koordinator scheduler and reservations.
          type: boolean
          default: false
        ipPoolProviders:
          description: KBE Pod IP pool providers enabled for discovery and explicit pool selection.
          type: array
          default: []
          items:
            $ref: '#/components/schemas/ipPoolProvider'
    logBackendType:
      type: string
      description: Log query backend configured for this environment.
      enum:
        - loki
        - victoria-logs
    networkMode:
      enum:
        - HostNetwork
        - NodePort
        - FixedPodIP
        - HeadlessService
        - LoadBalancer
      type: string
    networkConfig:
      type: object
      title: NetworkConfig
      description: Configuration of networking for this environment
      properties:
        nodePortEnabled:
          description: Enable node port service for this environment
          type: boolean
          default: true
        lbEnabled:
          description: Enable load balancer service for this environment
          type: boolean
          default: true
        domainEnabled:
          description: Enable domain service for this environment
          type: boolean
          default: false
        internetLBEnabled:
          description: Enable the Internet load balancer service for this environment
          type: boolean
          default: true
        networkModes:
          type: array
          items:
            $ref: '#/components/schemas/networkMode'
          description: Network modes of the environment
    environmentState:
      type: string
      description: Output only. State of the Environment resource
      enum:
        - PENDING
        - REGISTERED
        - PROVISIONING
        - NOTREADY
        - READY
        - WARNING
        - UNREACHABLE
        - DELETING
        - OUTOFSTOCK
        - UPDATING
    autohealingConfig:
      type: object
      description: cluster instance autohealing process config
      required:
        - enableAutoHealing
        - rebuildStartDelaySecondsWhenNodeFail
        - rebuildStartDelaySecondsWhenInMaintenance
        - minClusterRebuildIntervalSeconds
        - rebuildConcurrencyPerNode
        - rebuildConcurrencyGlobally
      properties:
        enableAutoHealing:
          type: boolean
          description: Set to true to enable the auto-healing process, which automatically rebuilds instances when a node fails or is in maintenance mode.
        rebuildStartDelaySecondsWhenNodeFail:
          type: integer
          format: int32
          description: The number of seconds to wait before starting a rebuild when a node fails.
        rebuildStartDelaySecondsWhenInMaintenance:
          type: integer
          format: int32
          description: The number of seconds to wait before starting a rebuild when a node is in maintenance mode.
        minClusterRebuildIntervalSeconds:
          type: integer
          format: int32
          description: The minimum time in seconds between consecutive rebuild jobs for one cluster.
        rebuildConcurrencyPerNode:
          type: integer
          format: int32
          description: The maximum number of rebuild jobs that can run simultaneously for a single node.
        rebuildConcurrencyGlobally:
          type: integer
          format: int32
          description: The maximum number of rebuild jobs that can run simultaneously for the whole k8s cluster.
    clusterValidationPolicy:
      type: string
      description: Cluster operation validation policy, such as create, hscale, vscale, etc.
      enum:
        - Disabled
        - ValidateOnly
        - ForbiddenExecute
      default: ValidateOnly
    environmentArchitecture:
      title: EnvironmentArchitecture
      type: string
      description: Architecture of the environment data plane nodes (arm64, amd64, or multiarch for multiple architectures)
      enum:
        - arm64
        - amd64
        - multiarch
    environment:
      type: object
      description: Environment info
      required:
        - provider
        - region
        - availabilityZones
        - id
        - name
        - displayName
        - type
        - state
        - organizations
        - provisionConfig
        - createdAt
        - updatedAt
        - ipPoolProviders
      properties:
        taskId:
          type: string
          description: Installation task ID, returned when environment creation starts a task.
        logBackend:
          $ref: '#/components/schemas/logBackendType'
        provider:
          description: Cloud Provider
          title: Cloud Provider
          type: string
        region:
          description: Cloud Region
          title: Cloud Region
          type: string
        availabilityZones:
          title: Availability Zones
          description: Availability Zones
          items:
            type: string
          minItems: 1
          type: array
        schedulingConfig:
          $ref: '#/components/schemas/schedulingConfig'
        networkConfig:
          $ref: '#/components/schemas/networkConfig'
        description:
          description: The description of the organization
          type: string
        displayName:
          description: The display name of the context
          type: string
        id:
          format: uuid
          type: string
        name:
          description: The full, unique name of this Object in the format contexts/{name}, set during creation. name must be a valid RFC 1123 compliant DNS label
          type: string
        organizations:
          items:
            type: string
          type: array
          description: Organizations that have access for this environment
        metricsMonitorEnabled:
          description: The native VM cluster is deployed in environment or not.
          type: boolean
        state:
          $ref: '#/components/schemas/environmentState'
        type:
          $ref: '#/components/schemas/environmentType'
        provisionConfig:
          $ref: '#/components/schemas/provisionConfig'
        autohealingConfig:
          $ref: '#/components/schemas/autohealingConfig'
        createdAt:
          description: CreatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists
          format: date-time
          type: string
        updatedAt:
          description: UpdatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists
          format: date-time
          type: string
        extraInfo:
          type: string
          description: Extra info for environment
        deletePolicy:
          $ref: '#/components/schemas/environmentDeletePolicy'
        clusterValidationPolicy:
          $ref: '#/components/schemas/clusterValidationPolicy'
        architecture:
          $ref: '#/components/schemas/environmentArchitecture'
        dns:
          $ref: '#/components/schemas/dns'
        slaEnabled:
          description: whether to enable calculate the cluster SLA for the environment
          type: boolean
          default: false
        koordinatorEnabled:
          description: Whether this environment has Koordinator installed and can use Koordinator scheduler and reservations.
          type: boolean
          default: false
        ipPoolProviders:
          description: KBE Pod IP pool providers enabled for discovery and explicit pool selection.
          type: array
          items:
            $ref: '#/components/schemas/ipPoolProvider'
    taskStatus:
      type: string
      enum:
        - Pending
        - Running
        - Stopped
        - Succeed
        - Failed
        - Cancelling
        - Cancelled
        - Aborted
      description: Current status of the task
    internalTask:
      type: object
      description: Task identity and status, excluding task messages, inputs and outputs.
      required:
        - taskId
        - taskType
        - resourceType
        - resourceId
        - status
      properties:
        taskId:
          type: string
        taskType:
          type: string
        resourceType:
          type: string
        resourceId:
          type: string
        status:
          $ref: '#/components/schemas/taskStatus'
        steps:
          description: Step status included in task detail and retry responses.
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              status:
                $ref: '#/components/schemas/taskStatus'
    paginationResult:
      description: Pagination information
      properties:
        page:
          description: Current page number (1-based)
          type: integer
          minimum: 1
        pageSize:
          description: Number of records per page
          type: integer
          minimum: 1
        total:
          description: Total number of records
          type: integer
          minimum: 0
      required:
        - page
        - pageSize
        - total
      type: object
    internalTaskList:
      type: object
      required:
        - items
        - pagination
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/internalTask'
        pagination:
          $ref: '#/components/schemas/paginationResult'
    taskRetryMode:
      type: string
      enum:
        - restart
        - resume
      default: restart
      description: restart reruns all steps; resume preserves successful steps.
    internalImageRegistry:
      type: object
      description: Image registry identity for selecting the environment image source.
      required:
        - name
        - url
      properties:
        name:
          type: string
        url:
          type: string
    internalImageRegistryList:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/internalImageRegistry'
    imageRegistry:
      type: object
      description: Represents an image registry.
      properties:
        name:
          type: string
          x-nullable: false
          description: The name of the image registry.
        url:
          type: string
          description: The url of the image registry.
        username:
          type: string
          nullable: true
          description: The username used to authenticate with the image registry.
        password:
          type: string
          nullable: true
          description: The password used to authenticate with the image registry.
        id:
          type: string
          description: The id of the image registry.
        createdAt:
          type: string
          format: date-time
          description: The date and time when the image registry was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time when the image registry was last updated.
      required:
        - name
        - url
    httpBody:
      description: Represents an HTTP request or response body.
      properties:
        contentType:
          description: The HTTP Content-Type header value specifying the content type of the body.
          type: string
        data:
          description: The HTTP request/response body as raw binary.
          format: byte
          pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
          type: string
      title: ''
      type: object
    grafanaDatasourceCreate:
      description: GrafanaDatasource create option
      type: object
      required:
        - name
        - uid
        - type
        - url
        - access
      properties:
        name:
          type: string
          description: Name of the Grafana datasource
        uid:
          type: string
          description: Unique identifier for the Grafana datasource
        type:
          type: string
          description: Type of the Grafana datasource
        url:
          type: string
          description: URL of the Grafana datasource
        access:
          type: string
          description: Access mode of the Grafana datasource
        basicAuth:
          type: boolean
          description: Indicates if basic authentication is enabled for the Grafana datasource
          x-nullable: false
    grafanaDatasource:
      description: GrafanaDatasource detail configuration
      type: object
      required:
        - name
        - uid
        - type
        - url
        - access
      properties:
        name:
          type: string
          description: Name of the Grafana datasource
        uid:
          type: string
          description: Unique identifier for the Grafana datasource
        type:
          type: string
          description: Type of the Grafana datasource
        url:
          type: string
          description: URL of the Grafana datasource
        access:
          type: string
          description: Access mode of the Grafana datasource
        basicAuth:
          type: boolean
          description: Indicates if basic authentication is enabled for the Grafana datasource
    clusterType:
      title: ClusterType
      type: string
      nullable: true
      description: Describes the type of cluster
      default: Normal
      enum:
        - Normal
        - DisasterRecovery
        - BlueGreenDeployment
    clusterLicense:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        expiredAt:
          type: string
          format: date-time
        key:
          type: string
          format: binary
        keys:
          type: object
          additionalProperties:
            type: string
    parameterTemplatePartition:
      enum:
        - default
        - custom
      type: string
    paramTplsItem:
      description: the item of the parameter template
      type: object
      properties:
        component:
          type: string
          description: component type, refer to componentDef and support NamePrefix
        paramTplName:
          title: Parameter Template Name
          type: string
          description: name of assigned parameter template
        paramTplID:
          type: string
          description: id of parameter template
          nullable: true
        orgName:
          type: string
          description: org name of the parameter template
          nullable: true
        paramTplPartition:
          $ref: '#/components/schemas/parameterTemplatePartition'
    paramTpls:
      type: array
      description: Items is the list of parameter template in the list
      items:
        $ref: '#/components/schemas/paramTplsItem'
    clusterTerminationPolicy:
      title: Termination Policy
      type: string
      description: The termination policy of cluster.
      default: Delete
      enum:
        - DoNotTerminate
        - Delete
    instanceTemplateCreate:
      type: object
      additionalProperties: false
      description: 'Instance template assignment. Include every chart-rendered template exactly once, with name and replicas. env and storageClass are optional. Placement follows the mode placementScope: component scope requires template availabilityZone and permits nodeGroup; cluster scope forbids template placement.'
      required:
        - name
        - replicas
      properties:
        nodeGroup:
          type: string
          description: Optional host group in this environment and the explicitly selected availabilityZone. Requires availabilityZone; no upper-level host group is inherited.
        name:
          type: string
          minLength: 1
          description: Instance template name; must match a chart-rendered instance.
        replicas:
          type: integer
          minimum: 0
          description: Replica count for this instance template.
        availabilityZone:
          type: string
          description: Template AZ, enabled in the environment. Required when placementScope is component; forbidden in cluster scope. The containing component must omit placement. An omitted nodeGroup does not inherit an upper-level host group.
        storageClass:
          type: string
          description: StorageClass name for all persistent volumes in this template. Copied from component volumeClaimTemplates, preserving volume sizes and other settings while overriding storageClassName. Chart instance volume templates are cleared; omitted or empty leaves instance volumeClaimTemplates unset.
        env:
          type: array
          description: Declared env overrides. Names must be unique; defaults apply only to omitted variables.
          items:
            type: object
            required:
              - name
              - value
            properties:
              name:
                type: string
                minLength: 1
              value:
                type: string
                description: Literal string; optional values may be empty. valueFrom is unsupported.
    ioQuantity:
      description: IO Quantity describes IOPS and BPS of a volume
      properties:
        readIOPS:
          type: integer
          nullable: true
          format: int64
        writeIOPS:
          type: integer
          format: int64
          nullable: true
        readBPS:
          type: integer
          nullable: true
          format: int64
        writeBPS:
          type: integer
          nullable: true
          format: int64
      type: object
    componentVolumeItem:
      description: ComponentVolumeItem is the information of a component volume
      type: object
      properties:
        name:
          type: string
          description: volume name
        storage:
          title: Storage(Gi)
          minimum: 1
          type: number
          description: Storage size, the unit is Gi.
          format: double
        ioLimits:
          $ref: '#/components/schemas/ioQuantity'
        ioReserves:
          $ref: '#/components/schemas/ioQuantity'
    ipPoolSelection:
      type: object
      description: Provider-qualified Pod IP pool selection for component pod IP allocation.
      required:
        - provider
      properties:
        provider:
          $ref: '#/components/schemas/ipPoolProvider'
        ipv4Pools:
          type: array
          items:
            type: string
          description: IPv4 pool names resolved within the selected provider.
        ipv6Pools:
          type: array
          items:
            type: string
          description: IPv6 pool names resolved within the selected provider.
    componentNetwork:
      type: object
      description: Per-component network configuration.
      properties:
        ipPool:
          $ref: '#/components/schemas/ipPoolSelection'
    componentItem:
      type: object
      description: ComponentItem is the information of a component
      properties:
        annotations:
          type: object
          additionalProperties:
            type: string
          description: User-provided component annotations. Does not include chart defaults or system-generated values.
        labels:
          type: object
          additionalProperties:
            type: string
          description: User-provided component labels. Does not include chart defaults or system-generated values.
        nodeGroup:
          type: string
          description: Optional host group in this environment. Explicit placement does not inherit an upper-level host group.
        availabilityZone:
          type: string
          description: Explicit component AZ selection, if configured.
        instanceTemplates:
          type: array
          x-omitempty: true
          description: Instance template assignments with effective replicas, placement and storage class, and user-provided env.
          items:
            $ref: '#/components/schemas/instanceTemplateCreate'
        name:
          type: string
          description: component name
        component:
          type: string
          description: component type, refer to componentDef and support NamePrefix
        compNum:
          title: CompNum
          type: integer
          description: number of components
        replicas:
          title: Replicas
          type: integer
          description: The number of replicas, for standalone mode, the replicas is 1, for raftGroup mode, the default replicas is 3.
        classCode:
          type: string
        cpu:
          title: CPU
          type: number
          description: CPU cores.
          format: double
        memory:
          title: Memory(Gi)
          type: number
          description: Memory, the unit is Gi.
          format: double
        storageClass:
          title: StorageClass
          type: string
          description: StorageClass name
        volumes:
          type: array
          items:
            $ref: '#/components/schemas/componentVolumeItem'
        codeShort:
          description: Cluster main component codeShort
          type: string
        systemAccountSecretName:
          description: The name of the secret that contains the system account credentials
          type: string
        network:
          $ref: '#/components/schemas/componentNetwork'
    components:
      type: array
      description: Components is the list of components
      items:
        $ref: '#/components/schemas/componentItem'
    initOptionItem:
      description: InitOptionItem is the information of init option
      type: object
      properties:
        component:
          type: string
          description: component type, refer to componentDef and support NamePrefix'
        initParams:
          type: object
          additionalProperties:
            type: string
        specName:
          type: string
          description: config spec name
    initOptions:
      type: array
      description: InitOptions is the list of init option
      items:
        $ref: '#/components/schemas/initOptionItem'
    backupRetentionPolicy:
      type: string
      description: backup retention policy when cluster is deleted
      enum:
        - All
        - LastOne
        - WipeOut
    clusterBackup:
      description: clusterBackup is the payload for cluster backup
      properties:
        pitrEnabled:
          default: false
          description: PITREnabled or not
          type: boolean
        continuousBackupMethod:
          description: continuous backup method for pitr
          type: string
        autoBackup:
          default: false
          description: autoBackup or not
          type: boolean
        autoBackupMethod:
          description: name of the backup method
          type: string
        backupRepo:
          description: backupRepoName is the name of backupRepo and it is used to store the backup data
          type: string
        cronExpression:
          description: cronExpression specifies the cron expression
          type: string
        retentionPeriod:
          description: retentionPeriod specifies the retention period
          type: string
        retentionPolicy:
          $ref: '#/components/schemas/backupRetentionPolicy'
        snapshotVolumes:
          description: snapshotVolumes specifies whether to take snapshots of persistent volumes to back up
          type: boolean
          nullable: true
        incrementalBackupEnabled:
          description: specify whether to enable incremental backup
          default: false
          type: boolean
        incrementalCronExpression:
          description: the crop expression for incremental backup schedule
          type: string
      type: object
    serviceDescriptor:
      type: object
      description: serviceDescriptor that will be used in serviceRef. The field definition is in line with kubeblocks.
      properties:
        host:
          type: string
        port:
          type: string
        endpoint:
          type: string
        username:
          type: string
        password:
          type: string
    serviceRef:
      type: object
      description: |
        defines a serviceRef that references service provided by other cluster or external service.
        Only one of cluster or serviceDescriptor field should be set.
      required:
        - name
      properties:
        name:
          type: string
          description: refers to the serviceRef name defined in engineoption
        cluster:
          type: string
          description: |
            the cluster name that will be used in serviceRef. The referenced cluster should 
            be at the same organization as the current cluster.
        clusterDefinition:
          type: string
          description: the cluster definition of the referenced cluster.
        serviceDescriptor:
          $ref: '#/components/schemas/serviceDescriptor'
        extraForManualInput:
          type: object
          additionalProperties:
            type: string
          description: |
            extra fields for manual input of the serviceRef. The keys must be defined in the
            engineoption modeServiceRef.extraForManualInput. They are mapped to helm values
            via the corresponding helmValuePath.extraForManualInput.
    clusterReference:
      type: object
      description: Cluster reference information returned by cluster detail APIs.
      properties:
        cluster:
          type: string
          description: Name of the cluster that references this cluster.
        clusterDefinition:
          type: string
          description: Cluster definition of the referencing cluster.
    clusterObjectStorageConfig:
      type: object
      description: Specify the object storage config for cluster like starrocks
      required:
        - serviceRef
        - bucket
      properties:
        serviceRef:
          $ref: '#/components/schemas/serviceRef'
        bucket:
          type: string
          description: the bucket name for the object storage
        usePathStyle:
          type: boolean
          description: whether the object storage is using path-style. If false, virtual host style will be used.
        region:
          type: string
          description: region to use. If using a s3-compatible service that does not require a region (like minio), leave it blank.
    clusterMaintainceWindow:
      type: object
      properties:
        startHour:
          type: integer
          description: start hour, must be 0-23, use UTC timezone
          x-omitempty: false
        endHour:
          type: integer
          description: end hour, must be 0-23 and greater than start hour, use UTC timezone
          x-omitempty: false
        weekdays:
          type: string
          x-omitempty: false
          description: weekdays, comma separated values of 1-7
      description: the maintenance window for a cluster
    schedulingPolicyType:
      type: string
      enum:
        - HardAntiAffinity
        - SoftAntiAffinity
        - Disabled
      default: Disabled
      description: |
        * `HardAntiAffinity` - Strictly enforce pod anti-affinity across nodes. Pods will not be scheduled when the anti-affinity constraints cannot be satisfied.
        * `SoftAntiAffinity` - Prefer to spread pods across nodes using anti-affinity, but allow scheduling on the same node when constraints cannot be fully satisfied.
        * `Disabled` - Do not apply pod anti-affinity constraints on nodes.
    cluster:
      required:
        - engine
        - environmentName
        - name
      type: object
      properties:
        id:
          title: ID
          type: string
          description: Cluster ID
        parentId:
          title: ParentId
          type: string
          nullable: true
          description: When two clusters have a relationship, parentId records the parent cluster id.Can be empty when there is no relationship
        parentName:
          title: ParentName
          type: string
          nullable: true
          description: the name of parent cluster
        parentDisplayName:
          title: ParentDisplayName
          type: string
          nullable: true
          description: the display name of parent cluster
        clusterType:
          $ref: '#/components/schemas/clusterType'
        delay:
          title: Delay
          type: number
          format: double
          nullable: true
        orgName:
          title: Org Name
          type: string
          description: Org Name
        cloudProvider:
          title: Cloud Provider
          type: string
          description: Cloud Provider
        environmentId:
          title: Environment ID
          type: string
          description: ID of the environment
        environmentName:
          title: Environment Name
          type: string
          description: Environment Name
        cloudRegion:
          title: Cloud Region
          type: string
          description: Cloud Region
        project:
          title: Project
          type: string
          default: kubeblocks-cloud-ns
          description: Name of project, it is the alias of environment namespace
        name:
          title: Name
          type: string
          description: Name of cluster. Name must be unique within an Org
        hash:
          title: Hash
          type: string
          description: Hash of cluster. Name must be unique within an Org
        engine:
          title: Engine
          type: string
          description: Cluster Application Engine
        license:
          $ref: '#/components/schemas/clusterLicense'
        paramTpls:
          $ref: '#/components/schemas/paramTpls'
        version:
          title: Version
          type: string
          description: Cluster Application Version
        terminationPolicy:
          $ref: '#/components/schemas/clusterTerminationPolicy'
        tlsEnabled:
          title: TLS Enabled
          type: boolean
          description: Enable the cluster to provide TLS connection or not.
          default: false
        nodePortEnabled:
          title: NodePort service enabled
          type: boolean
          description: Enable the cluster to provide NodePort service or not.
          default: false
        status:
          title: Status
          type: string
          description: Cluster Status
        createdAt:
          title: CreatedAt
          type: string
          description: CreatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists
          format: date-time
        updatedAt:
          title: UpdatedAt
          type: string
          description: UpdatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists
          format: date-time
        mode:
          title: Mode
          type: string
          description: Cluster topology mode
        proxyEnabled:
          title: ProxyEnabled
          type: boolean
          description: Proxy Enabled
          default: false
        components:
          $ref: '#/components/schemas/components'
        extra:
          title: Extra
          type: object
          additionalProperties:
            type: object
            properties: {}
          description: Extra configuration for cluster
        initOptions:
          $ref: '#/components/schemas/initOptions'
        singleZone:
          title: Single availability zones
          description: Use single availability zones
          type: boolean
          default: false
        availabilityZones:
          title: Availability Zones
          description: Availability Zones
          items:
            type: string
          type: array
        podAntiAffinityEnabled:
          title: PodAntiAffinityEnabled
          description: Enable pod antiaffinity for cluster
          type: boolean
          default: true
        backup:
          description: Set cluster backup
          $ref: '#/components/schemas/clusterBackup'
        nodeGroup:
          title: NodeGroup
          description: Specify a NodeGroup for the cluster
          type: string
          nullable: true
        codeShort:
          description: Cluster main component codeShort
          type: string
        displayName:
          description: Display name of cluster.
          type: string
        static:
          description: if cluster is static cluster
          type: boolean
        networkMode:
          description: Specify the network mode for intra-cluster communication
          $ref: '#/components/schemas/networkMode'
        serviceRefs:
          description: serviceRefs used by this cluster
          type: array
          items:
            $ref: '#/components/schemas/serviceRef'
        referencedBy:
          description: this list of objects (currently, object is a cluster) that uses this cluster as a serviceRef
          type: array
          items:
            $ref: '#/components/schemas/clusterReference'
        objectStorageConfig:
          $ref: '#/components/schemas/clusterObjectStorageConfig'
        maintainceWindow:
          $ref: '#/components/schemas/clusterMaintainceWindow'
        schedulingPolicy:
          description: Scheduling policy for this cluster.
          $ref: '#/components/schemas/schedulingPolicyType'
        schedulerName:
          title: Scheduler Name
          type: string
          nullable: true
          description: Effective scheduler used when the cluster was created.
        reservationResourceClass:
          nullable: true
          $ref: '#/components/schemas/koordinatorReservationResourceClass'
      description: KubeBlocks cluster details
    storage:
      type: object
      description: Storage is a specification that provides guidance accessing remote storage.
      properties:
        id:
          type: string
          description: Unique identifier for the storage
        name:
          type: string
          description: Name of the storage
        storageProvider:
          type: string
          description: Name of the storage provider
        params:
          type: object
          description: the parameters for the storage
          additionalProperties:
            type: string
        envName:
          type: string
          description: the environment name that storage belongs to
        createdBy:
          type: string
          description: User who created the storage
          format: date-time
        clusterID:
          type: string
          description: the id of cluster that storage used
          nullable: true
        clusterMetadataAddress:
          type: string
          description: the address of cluster
          nullable: true
        updatedBy:
          type: string
          description: User who updated the storage
          format: date-time
        tags:
          type: object
          description: the tags for the storage
          additionalProperties:
            type: string
    tag:
      description: tag info
      properties:
        id:
          description: The id of the tag
          format: int64
          type: string
        key:
          description: the key of the tag
          type: string
        value:
          description: The value corresponding to the key
          type: string
      required:
        - id
      type: object
    endpointType:
      description: Type of endpoint
      type: string
      enum:
        - ClusterIP
        - NodePort
        - LoadBalancer
        - PodIP
        - HostNetwork
        - PodFQDN
    endpointNetworkType:
      description: Network type of endpoint
      type: string
      enum:
        - Internet
        - Intranet
    endpoint:
      description: Endpoint is the information of cluster endpoints
      properties:
        title:
          description: title of the endpoint
          type: string
        component:
          description: Component type name
          type: string
        hosts:
          description: Endpoint hosts
          type: array
          items:
            type: string
        port:
          description: Endpoint port
          type: integer
          format: int32
        type:
          $ref: '#/components/schemas/endpointType'
        networkType:
          $ref: '#/components/schemas/endpointNetworkType'
        serviceName:
          description: Service name of endpoint
          type: string
        podService:
          description: Pod service name of endpoint
          type: boolean
        portName:
          description: Port name of endpoint
          type: string
        instances:
          description: Endpoint backend instances
          type: array
          items:
            type: string
        mutable:
          description: Whether the endpoint is mutable
          type: boolean
      required:
        - title
        - component
        - hosts
        - port
        - type
        - networkType
        - serviceName
        - portName
        - mutable
      type: object
    clusterListItem:
      description: KubeBlocks cluster information
      properties:
        cloudProvider:
          description: Cloud Provider
          type: string
        cloudRegion:
          description: Cloud Provider
          type: string
        availabilityZones:
          title: Availability Zones
          description: Availability Zones
          items:
            type: string
          type: array
        createdAt:
          description: CreatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists
          format: date-time
          type: string
        displayName:
          description: Display name of cluster.
          type: string
        engine:
          description: Cluster Application Engine
          type: string
        mode:
          description: Cluster topology mode
          type: string
        environmentName:
          description: Environment Name
          type: string
        environmentDisplayName:
          description: Environment Display Name
          type: string
        id:
          description: ID of cluster
          type: string
        name:
          description: Name of cluster. Name must be unique within an Org
          type: string
        parentId:
          title: ParentId
          type: string
          nullable: true
          description: When two clusters have a relationship, parentId records the parent cluster id.Can be empty when there is no relationship
        parentName:
          title: ParentName
          type: string
          nullable: true
          description: the name of parent cluster
        parentDisplayName:
          title: ParentDisplayName
          type: string
          nullable: true
          description: the display name of parent cluster
        dependencyType:
          title: DependencyType
          type: string
          nullable: true
          description: |
            the dependency relationship between the cluster and the refClusterName
            query parameter. `Dependency` means the cluster is referenced by the
            refClusterName cluster (the refClusterName depends on it); `Dependent`
            means the cluster references the refClusterName cluster (it depends on
            the refClusterName). Only set when list clusters with refClusterName.
        dependencyLabel:
          title: DependencyLabel
          type: object
          additionalProperties:
            type: string
          description: |
            the localized title of the serviceRef through which the refClusterName
            cluster depends on the returned cluster. Only set for clusters with
            dependencyType `Dependency`.
        clusterType:
          $ref: '#/components/schemas/clusterType'
        delay:
          title: Delay
          type: number
          format: double
          nullable: true
        status:
          description: Cluster Status
          type: string
        terminationPolicy:
          description: Cluster termination policy
          type: string
        updatedAt:
          description: UpdatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists
          format: date-time
          type: string
        version:
          description: Cluster Application Version
          type: string
        classCode:
          description: Cluster main component classCode
          type: string
        storage:
          description: Cluster main component storage
          type: string
        codeShort:
          description: Cluster main component codeShort
          type: string
        orgName:
          description: Org Name
          type: string
        project:
          description: Name of project, it is the alias of environment namespace
          type: string
        tags:
          description: Tags bound to the cluster
          items:
            $ref: '#/components/schemas/tag'
          type: array
        endpoints:
          description: Cached user-visible endpoints of the cluster; omitted unless includeEndpoints is true
          items:
            $ref: '#/components/schemas/endpoint'
          type: array
          x-omitempty: true
      required:
        - cloudProvider
        - createdAt
        - engine
        - environmentName
        - id
        - name
        - status
        - terminationPolicy
        - updatedAt
        - version
      type: object
    pageResult:
      description: PageResult info
      properties:
        first:
          description: a link to the first page of results. This link is optional for collections that cannot be indexed directly to a given page
          type: string
        last:
          description: a link to the last page of results. This link is optional for collections that cannot be indexed directly to a given page
          type: string
        next:
          description: a link to the next page of results. A response that does not contain a next link does not have further data to fetch
          type: string
        prev:
          description: a link to the previous page of results. A response that does not contain a prev link has no previous data. This link is optional for collections that cannot be traversed backward
          type: string
        totalSize:
          description: the total count of items in the list irrespective of pagination
          format: int64
          type: integer
      type: object
    clusterList:
      description: ClusterList is a list of KubeBlocks clusters
      properties:
        items:
          description: Items is the list of KubeBlocks cluster objects in the list
          items:
            $ref: '#/components/schemas/clusterListItem'
          type: array
        pageResult:
          $ref: '#/components/schemas/pageResult'
      required:
        - items
      type: object
    clusterUpdate:
      type: object
      properties:
        terminationPolicy:
          $ref: '#/components/schemas/clusterTerminationPolicy'
        displayName:
          description: Display name of cluster.
          type: string
          nullable: true
        maintainceWindow:
          $ref: '#/components/schemas/clusterMaintainceWindow'
        newServiceRefs:
          type: array
          description: |
            ServiceRefs to add to the cluster. Each serviceRef must be supported
            by the current engine mode and must not duplicate the existing
            serviceRefs of the cluster.
          items:
            $ref: '#/components/schemas/serviceRef'
        serviceRefsUpdate:
          type: array
          description: |
            ServiceRefs to update. Each serviceRef name must match an existing
            serviceRef of the cluster, and the corresponding engine option
            modeServiceRef.update.enable must be true. ServiceRefs that auto
            create their ServiceDescriptor and Secret get their corresponding
            K8s objects updated; serviceRefs with manual input must be handled
            by each engine individually and are rejected.
          items:
            $ref: '#/components/schemas/serviceRef'
      description: ClusterUpdate is the payload to update a KubeBlocks cluster
    endpointList:
      required:
        - items
      type: object
      properties:
        items:
          type: array
          description: Items is the list of endpoint objects in the list
          items:
            $ref: '#/components/schemas/endpoint'
    parameterProp:
      type: object
      required:
        - name
        - type
        - needRestart
        - immutable
      properties:
        name:
          description: The name of the parameter
          type: string
        description:
          description: The description of the parameter
          type: string
        type:
          description: The type of the parameter value
          type: string
        value:
          description: The value of the parameter, if parameter is not set in tpl, it's value equal to cue default value.
          type: object
        default:
          description: The value of the parameter, if parameter is not set in tpl, it's value equal to cue default value.
          type: object
        needRestart:
          description: Whether the parameter requires a restart to take effect
          type: boolean
        immutable:
          description: Whether the parameter is an immutable parameter, immutable parameters cannot be modified
          type: boolean
        maximum:
          description: The maximum value of the parameter
          type: string
        minimum:
          description: The minimum value of the parameter
          type: string
        enum:
          description: The value options of the parameter
          type: array
          items: {}
        unit:
          description: The unit of the parameter value (e.g., seconds, bytes, ms, percentage)
          type: string
    parameterItem:
      type: object
      description: With the list of parameter properties and the configuration file name
      properties:
        props:
          type: array
          description: The list of parameters properties
          items:
            $ref: '#/components/schemas/parameterProp'
        additionalProps:
          type: array
          description: The additional properties of the parameter
          items:
            $ref: '#/components/schemas/parameterProp'
        fileName:
          description: The name of the configuration file
          type: string
        specName:
          description: The name of the config spec
          type: string
        rawContent:
          description: The raw content of the configuration file, return only when raw is true in the query.
          type: string
    parameterList:
      description: A list of cluster parameter
      required:
        - engine
        - component
      properties:
        engine:
          description: Name of database engine
          type: string
        component:
          description: Name of component
          type: string
        items:
          type: array
          items:
            $ref: '#/components/schemas/parameterItem'
    taskScheduleType:
      type: string
      enum:
        - immediate
        - scheduled
        - maintenanceWindow
      description: Schedule type for task execution
    taskSchedule:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/taskScheduleType'
        startTime:
          type: string
          format: date-time
          description: Start time of the execution window (required for scheduled type)
          x-nullable: true
        endTime:
          type: string
          format: date-time
          description: End time of the execution window (required for scheduled type)
          x-nullable: true
      required:
        - type
    reconfigureCreate:
      description: ReconfigureCreate is the payload to reconfigure a KubeBlocks cluster
      properties:
        component:
          description: component type
          type: string
          minLength: 1
        configFileName:
          description: config file name
          type: string
        parameters:
          additionalProperties:
            type: string
          description: Specify parameters list to be updated
          type: object
        rawContent:
          description: The raw content of the configuration file
          type: string
        schedule:
          $ref: '#/components/schemas/taskSchedule'
      required:
        - component
      type: object
    opsRequestName:
      description: OpsRequestName is the name of a KubeBlocks OpsRequest response
      properties:
        opsRequestName:
          type: string
        taskId:
          type: string
      required:
        - taskId
      type: object
    apiserverStatus:
      type: string
      enum:
        - READY
        - INITIALIZING
        - ERROR
    apiserverPhaseStatus:
      type: string
      enum:
        - IN_PROGRESS
        - COMPLETED
        - FAILED
    apiserverPhaseDetail:
      type: object
      required:
        - phase
        - status
        - description
      properties:
        phase:
          type: string
          example: DatabaseMigration
        status:
          $ref: '#/components/schemas/apiserverPhaseStatus'
        description:
          type: string
          example: Migrating database schema v1 to v2
        metadata:
          type: object
          additionalProperties: true
          description: Additional phase-specific metadata
    apiserverStatusResponse:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/apiserverStatus'
          description: Current status of the API server
        details:
          type: array
          items:
            $ref: '#/components/schemas/apiserverPhaseDetail'
      required:
        - status
        - details
    engineStatus:
      type: string
      description: engine addon status in K8s
      enum:
        - Disabled
        - Enabled
        - Failed
        - Enabling
        - Disabling
    engine:
      type: object
      properties:
        id:
          title: ID
          type: string
          description: engine ID
        description:
          title: description
          type: string
          description: the engine description
        name:
          title: Name
          type: string
          description: engine Name
        version:
          title: Version
          type: string
          description: engine version
        kbVersionConstraint:
          title: kbVersionConstraint
          type: string
          description: KubeBlocks version constrain
        type:
          title: Type
          type: string
        installed:
          type: boolean
          description: whether the engine is installed
        provider:
          title: provider
          type: string
          description: engine addon provider
        status:
          $ref: '#/components/schemas/engineStatus'
        availableVersion:
          title: availableVersion
          type: array
          description: engine available versions
          items:
            type: string
        upgradeHistory:
          title: upgradeHistory
          type: string
          description: engine upgrade history
        errMsg:
          title: errMsg
          description: engine error messages when the engine status is failed
          type: string
        clusterVersions:
          title: clusterVersions
          type: array
          description: clusterversion in the engines
          items:
            type: string
        maturityLevel:
          title: maturityLevel
          type: string
          description: engine maturity level
        extra:
          type: object
          additionalProperties: true
          nullable: true
          description: engine-specific runtime metadata for clients
    engineList:
      items:
        $ref: '#/components/schemas/engine'
      type: array
    DBDoctorResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        datas:
          additionalProperties: true
    OutageRecord:
      type: object
      description: Records the outage events of a cluster for SLA calculation. It is designed to ensure that for any given cluster, there can be at most one active outage record at any time.
      required:
        - clusterID
      properties:
        id:
          type: string
          description: The unique identifier for the outage record.
        clusterID:
          type: string
          description: The id of cluster.
        outageStartTime:
          type: integer
          format: int64
          description: The Unix timestamp (in seconds) when the outage began (UTC).
        outageEndTime:
          type: integer
          format: int64
          nullable: true
          description: The Unix timestamp (in seconds) when the outage was resolved (UTC). A null value indicates that the outage is still ongoing.
        lastFailureReason:
          type: string
          nullable: true
          description: The error message from the last failed probe.
        failureCount:
          type: integer
          format: int32
          nullable: true
          description: The number of consecutive failures in this outage event.
          default: 1
        createdAt:
          type: string
          format: date-time
          description: The timestamp when the record was created.
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when the record was last updated.
          readOnly: true
    OutageRecordList:
      type: array
      description: A list of outage records.
      items:
        $ref: '#/components/schemas/OutageRecord'
    platformParameterCategory:
      type: string
      description: platformParameter category, representing the platformParameter group
    platformParameter:
      description: platformParameter item
      type: object
      required:
        - id
        - name
        - category
        - description
        - constraints
        - type
      properties:
        id:
          type: string
          description: platformParameter ID
        name:
          type: string
          description: platformParameter name
        category:
          $ref: '#/components/schemas/platformParameterCategory'
        type:
          type: string
          description: |
            type of platformParameter value, by convention one of string, int,
            boolean or json. Values are always transferred as strings; the type
            declares how the value is interpreted and validated.
        constraints:
          type: object
          description: platformParameter constraints including min, max, enum, default value
          properties:
            min:
              type: string
              description: platformParameter min value
            max:
              type: string
              description: platformParameter max value
            enum:
              type: array
              items:
                type: string
              description: platformParameter enum constraints
            default:
              type: string
              description: platformParameter default value
        value:
          type: string
          description: platformParameter value
        description:
          $ref: '#/components/schemas/localizedDescription'
    AccessLevel:
      type: string
      enum:
        - Platform
        - Organization
    llm:
      description: llm
      properties:
        id:
          description: ID of the llm
          title: ID
          type: string
        name:
          description: Name of the llm
          title: Name
          type: string
        enabled:
          description: Whether this LLM is enabled
          title: Enabled
          type: boolean
        config:
          description: |
            Config.

            For OpenAI-compatible providers, model entries under `available_models`
            may include `max_tokens` as the maximum output token count and
            `context_length` as the total context window. `context_window` is a
            deprecated compatibility alias and should not be used by new clients.
          title: Config
          type: object
          additionalProperties:
            type: object
        level:
          $ref: '#/components/schemas/AccessLevel'
        createdAt:
          description: |-
            CreatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.

            Populated by the system. Read-only. Null for lists
          format: date-time
          type: string
        updatedAt:
          description: |-
            UpdatedAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.

            Populated by the system. Read-only. Null for lists
          format: date-time
          type: string
      required:
        - name
        - config
        - enabled
      type: object
    llmList:
      required:
        - items
      type: object
      properties:
        items:
          type: array
          x-nullable: false
          description: Items is the list of llm objects
          items:
            $ref: '#/components/schemas/llm'
  responses:
    '204':
      description: No Content
    '400':
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIErrorResponse'
      description: Bad Request
    '401':
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIErrorResponse'
      description: Unauthorized
    '403':
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIErrorResponse'
      description: Forbidden
    '404':
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIErrorResponse'
      description: Not Found
    '409':
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIErrorResponse'
      description: Conflict
    '500':
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIErrorResponse'
      description: Internal server error
