basePath: /
definitions:
  clinic_internal_api.ActivitiesResponse:
    properties:
      activities:
        items:
          $ref: '#/definitions/clinic_internal_api.Activity'
        type: array
      cursor:
        type: string
      partial:
        type: boolean
    type: object
  clinic_internal_api.Activity:
    properties:
      activity_id:
        type: string
      application_id:
        type: string
      author:
        type: string
      calibration_time:
        type: integer
      catalog:
        type: string
      concept_id:
        type: string
      context:
        items:
          type: string
        type: array
      context_id:
        type: string
      display_name:
        type: string
      name:
        type: string
      payload: {}
      severity:
        type: integer
      source:
        type: string
      tags:
        additionalProperties:
          type: string
        type: object
      target_id:
        type: string
      type:
        type: string
    type: object
  clinic_internal_api.HealthCheckReport:
    properties:
      clusterId:
        type: string
      createdAt:
        type: string
      errorMessage:
        type: string
      items:
        items:
          $ref: '#/definitions/clinic_internal_api.HealthCheckReportItem'
        type: array
      orgId:
        type: string
      portalOrgId:
        type: string
      reportId:
        type: string
      status:
        type: string
      strategyId:
        type: string
      timeRangeAEnd:
        type: string
      timeRangeAStart:
        type: string
      timeRangeBEnd:
        type: string
      timeRangeBStart:
        type: string
      updatedAt:
        type: string
    type: object
  clinic_internal_api.HealthCheckReportCheckItem:
    properties:
      checkType:
        type: string
      description:
        type: string
      errorMessage:
        type: string
      name:
        type: string
      status:
        type: string
    type: object
  clinic_internal_api.HealthCheckReportItem:
    properties:
      checkType:
        type: string
      content:
        type: object
      description:
        type: string
      errorMessage:
        type: string
      name:
        type: string
      params:
        type: object
      status:
        type: string
    type: object
  clinic_internal_api.HealthCheckReportPage:
    properties:
      items:
        items:
          $ref: '#/definitions/clinic_internal_api.HealthCheckReportSummary'
        type: array
      page:
        type: integer
      pageSize:
        type: integer
      total:
        type: integer
    type: object
  clinic_internal_api.HealthCheckReportSummary:
    properties:
      checkItems:
        items:
          $ref: '#/definitions/clinic_internal_api.HealthCheckReportCheckItem'
        type: array
      clusterId:
        type: string
      createdAt:
        type: string
      errorMessage:
        type: string
      orgId:
        type: string
      portalOrgId:
        type: string
      reportId:
        type: string
      status:
        type: string
      strategyId:
        type: string
      timeRangeAEnd:
        type: string
      timeRangeAStart:
        type: string
      timeRangeBEnd:
        type: string
      timeRangeBStart:
        type: string
      updatedAt:
        type: string
    type: object
  clinic_internal_api.ResourcePoolComponent:
    properties:
      component_type:
        type: string
      cpu:
        type: integer
      id:
        type: string
      image:
        $ref: '#/definitions/clinic_internal_api.ResourcePoolImage'
      max_node_count:
        type: integer
      memory_gi:
        type: integer
      min_node_count:
        type: integer
      node_count:
        type: integer
      phase:
        type: string
      storages:
        items:
          $ref: '#/definitions/clinic_internal_api.ResourcePoolStorage'
        type: array
      version:
        type: string
    type: object
  clinic_internal_api.ResourcePoolImage:
    properties:
      repo:
        type: string
      tag:
        type: string
    type: object
  clinic_internal_api.ResourcePoolStorage:
    properties:
      iops:
        type: integer
      name:
        type: string
      size_gi:
        type: integer
      throughput_mbs:
        type: integer
      type:
        type: string
    type: object
  clustercontext.Cluster:
    properties:
      clusterId:
        type: string
      createdAt:
        type: string
      deleted:
        type: boolean
      deployType:
        type: string
      deployTypeV2:
        type: string
      diagnosticContext:
        $ref: '#/definitions/clustercontext.DiagnosticContext'
      name:
        type: string
      orgId:
        type: string
      provider:
        type: string
      region:
        type: string
      status:
        type: string
      version:
        type: string
    type: object
  clustercontext.DiagnosticContext:
    properties:
      keyspaceId:
        type: string
      parentId:
        type: string
      projectId:
        type: string
      shootName:
        type: string
    type: object
  clustercontext.Page:
    properties:
      items:
        items:
          $ref: '#/definitions/clustercontext.Cluster'
        type: array
      page:
        type: integer
      pageSize:
        type: integer
      total:
        type: integer
    type: object
  dto.BatchSchemaResponse:
    properties:
      count:
        description: Schema 数量
        type: integer
      schemas:
        description: Schema 列表
        items:
          $ref: '#/definitions/dto.SchemaResponse'
        type: array
    type: object
  dto.CanonicalDataProxyQueryRequest:
    properties:
      sql:
        maxLength: 1048576
        minLength: 1
        type: string
      timeout:
        description: seconds; zero uses the service default
        maximum: 1800
        minimum: 0
        type: integer
    required:
    - sql
    type: object
  dto.ColumnInfo:
    properties:
      comment:
        description: 列注释
        type: string
      name:
        description: 列名
        type: string
      type:
        description: 数据类型
        type: string
    type: object
  dto.DataProxyBatchQueryResponse:
    properties:
      count:
        type: integer
      results:
        items:
          $ref: '#/definitions/dto.DataProxyQueryResult'
        type: array
    type: object
  dto.DataProxyCapabilitiesResponse:
    properties:
      service:
        type: string
      supported_vendors:
        items:
          type: string
        type: array
      version:
        type: string
    type: object
  dto.DataProxyQueryResult:
    properties:
      columns:
        description: 列名
        items:
          type: string
        type: array
      metadata:
        allOf:
        - $ref: '#/definitions/dto.DataProxyResultMetadata'
        description: 元数据
      rows:
        description: 数据行
        items:
          items: {}
          type: array
        type: array
    type: object
  dto.DataProxyResultMetadata:
    properties:
      bytesScanned:
        description: 扫描字节数
        type: integer
      engine:
        description: 使用的引擎
        type: string
      engineExecutionTime:
        description: 后端引擎执行时间
        type: string
      executionTime:
        description: 执行时间（格式化为易读形式，如 "2.3s"）
        type: string
      queryId:
        description: 查询 ID（MaxCompute 为 InstanceID）
        type: string
      region:
        description: Region
        type: string
      rowCount:
        description: 查询结果行数
        type: integer
      vendor:
        description: 云厂商
        type: string
    type: object
  dto.MetricsErrorDetails:
    properties:
      retryable:
        type: boolean
      upstreamErrorType:
        type: string
      upstreamStatus:
        type: integer
    type: object
  dto.PartitionDef:
    properties:
      name:
        description: 分区字段名
        type: string
      type:
        description: 分区字段类型
        type: string
    type: object
  dto.PrometheusResponse:
    properties:
      code:
        description: Stable Clinic error code when classified
        type: string
      data:
        description: Query result data
      details:
        allOf:
        - $ref: '#/definitions/dto.MetricsErrorDetails'
        description: Safe structured error metadata
      error:
        description: Error message when status is "error"
        type: string
      errorType:
        description: Error type when status is "error"
        type: string
      status:
        description: '"success" or "error"'
        type: string
      warnings:
        description: Optional warnings
        items:
          type: string
        type: array
    type: object
  dto.SchemaResponse:
    properties:
      columns:
        description: 列信息列表
        items:
          $ref: '#/definitions/dto.ColumnInfo'
        type: array
      dataSource:
        description: 数据源 URI
        type: string
      database:
        description: 数据库名
        type: string
      is_view:
        description: 是否为 VIEW
        type: boolean
      location:
        description: 表的 S3 存储位置
        type: string
      partitions:
        description: 分区定义列表
        items:
          $ref: '#/definitions/dto.PartitionDef'
        type: array
      table:
        description: 表名
        type: string
    type: object
  errors.APIError:
    properties:
      code:
        type: string
      details: {}
      message:
        type: string
      requestId:
        type: string
    type: object
  handlers.CanonicalSystemLogDatasourcesResponse:
    properties:
      data:
        $ref: '#/definitions/service.SystemLogsDatasources'
      status:
        type: string
    type: object
  handlers.byocContinuousProfilingGroupProfile:
    properties:
      component_num:
        additionalProperties:
          type: integer
        type: object
      profile_duration_secs:
        type: integer
      state:
        type: string
      ts:
        type: integer
    type: object
  handlers.byocContinuousProfilingGroupProfileDetail:
    properties:
      profile_duration_secs:
        type: integer
      state:
        type: string
      target_profiles:
        items:
          $ref: '#/definitions/handlers.byocContinuousProfilingGroupProfileDetailItem'
        type: array
      ts:
        type: integer
    type: object
  handlers.byocContinuousProfilingGroupProfileDetailItem:
    properties:
      error:
        type: string
      profile_type:
        type: string
      state:
        type: string
      target:
        $ref: '#/definitions/handlers.byocContinuousProfilingGroupProfileDetailTarget'
    type: object
  handlers.byocContinuousProfilingGroupProfileDetailTarget:
    properties:
      address:
        type: string
      component:
        type: string
    type: object
  handlers.byocTopSQLResponse:
    properties:
      data:
        items:
          additionalProperties: true
          type: object
        type: array
      status:
        minLength: 1
        type: string
    required:
    - data
    - status
    type: object
  service.SystemLogsDatasource:
    properties:
      datasource:
        type: string
      is_default:
        type: boolean
      provider:
        type: string
      region:
        type: string
      uid:
        type: string
    type: object
  service.SystemLogsDatasources:
    properties:
      datasources:
        items:
          $ref: '#/definitions/service.SystemLogsDatasource'
        type: array
      default_datasource:
        type: string
    type: object
  ticdc.Changefeed:
    properties:
      arch:
        type: string
      checkpoint_ts:
        type: integer
      checkpoint_tso:
        type: string
      cluster_type:
        type: string
      created_at:
        type: integer
      display_id:
        type: string
      display_name:
        type: string
      downstream_config:
        additionalProperties: true
        type: object
      downstream_type:
        type: string
      id:
        type: string
      network_info:
        $ref: '#/definitions/ticdc.NetworkInfo'
      rcu:
        type: string
      start_position:
        $ref: '#/definitions/ticdc.StartPosition'
      status:
        type: string
      table_config:
        $ref: '#/definitions/ticdc.TableConfig'
      ticdc_cluster:
        $ref: '#/definitions/ticdc.TiCDCCluster'
      ticdc_cluster_name:
        type: string
    type: object
  ticdc.DetailResponse:
    properties:
      changefeed:
        $ref: '#/definitions/ticdc.Changefeed'
    type: object
  ticdc.EventFilter:
    properties:
      ignored_delete_value_expression:
        type: string
      ignored_events:
        items:
          type: string
        type: array
      ignored_insert_value_expression:
        type: string
      ignored_sql_statements:
        items:
          type: string
        type: array
      ignored_update_new_value_expression:
        type: string
      ignored_update_old_value_expression:
        type: string
      table_matchers:
        items:
          type: string
        type: array
    type: object
  ticdc.ListResponse:
    properties:
      changefeeds:
        items:
          $ref: '#/definitions/ticdc.Changefeed'
        type: array
    type: object
  ticdc.NetworkInfo:
    properties:
      advertised_pattern_group:
        additionalProperties:
          type: string
        type: object
      kafka_id:
        type: string
      network_type:
        type: string
      ports:
        items:
          type: integer
        type: array
      private_link_service_name:
        type: string
      sink_endpoint_id:
        type: string
    type: object
  ticdc.StartPosition:
    properties:
      mode:
        type: string
      timestamp:
        type: string
      tso:
        type: string
    type: object
  ticdc.TableConfig:
    properties:
      case_sensitive:
        type: boolean
      event_filters:
        items:
          $ref: '#/definitions/ticdc.EventFilter'
        type: array
      filter_rules:
        items:
          type: string
        type: array
      mode:
        type: string
    type: object
  ticdc.TiCDCCluster:
    properties:
      cluster_type:
        type: string
      control_plane_arch:
        type: string
      created_at:
        type: integer
      deploy_type:
        type: string
      id:
        type: string
      name:
        type: string
      operator_version:
        type: string
      provider_type:
        type: string
      region:
        type: string
      specification_code:
        type: string
      status:
        type: string
      tidb_cluster_id:
        type: string
      version:
        type: string
    type: object
info:
  contact: {}
  description: Clinic Data Proxy and diagnostic service APIs.
  title: Clinic Data Service API
  version: "1.0"
paths:
  /api/v1/orgs/{orgId}/data-proxy/clusters/{clusterId}/ticdc/changefeeds:
    get:
      parameters:
      - description: TiDB Cloud org ID
        in: path
        name: orgId
        required: true
        type: integer
      - description: TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/ticdc.ListResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List TiCDC changefeeds
      tags:
      - ticdc
  /api/v1/orgs/{orgId}/data-proxy/clusters/{clusterId}/ticdc/changefeeds/{changefeedId}:
    get:
      parameters:
      - description: TiDB Cloud org ID
        in: path
        name: orgId
        required: true
        type: integer
      - description: TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: integer
      - description: Changefeed ID
        in: path
        name: changefeedId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/ticdc.DetailResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get TiCDC changefeed
      tags:
      - ticdc
  /data-proxy/api/v1/capabilities:
    get:
      operationId: canonical-get-capabilities
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.DataProxyCapabilitiesResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get Data Proxy capabilities
      tags:
      - data-proxy
  /data-proxy/api/v1/clusters/{clusterId}:
    get:
      parameters:
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/clustercontext.Cluster'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get cluster metadata by cluster ID
      tags:
      - cluster-metadata
  /data-proxy/api/v1/orgs/{orgId}/clusters:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - default: 1
        description: 1-based page
        in: query
        maximum: 1000000
        minimum: 1
        name: page
        type: integer
      - default: 50
        description: Page size, max 200
        in: query
        maximum: 200
        minimum: 1
        name: pageSize
        type: integer
      - description: Cluster ID or name contains
        in: query
        name: query
        type: string
      - default: false
        description: Include deleted clusters
        in: query
        name: showDeleted
        type: boolean
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/clustercontext.Page'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List clusters in a TiDB Cloud org
      tags:
      - cluster-metadata
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/clustercontext.Cluster'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get org-scoped cluster metadata
      tags:
      - cluster-metadata
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/activities:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Inclusive window start in Unix seconds
        in: query
        minimum: 0
        name: begin_ts
        required: true
        type: integer
      - description: Inclusive window end in Unix seconds
        in: query
        minimum: 0
        name: end_ts
        required: true
        type: integer
      - description: Activity catalog
        in: query
        name: catalog
        type: string
      - description: Activity type
        in: query
        name: type
        type: string
      - description: Activity name
        in: query
        name: name
        type: string
      - default: 0
        description: Minimum severity
        in: query
        maximum: 8
        minimum: -4
        name: severity
        type: integer
      - default: 20
        description: Page size
        in: query
        maximum: 100
        minimum: 20
        name: limit
        type: integer
      - description: Opaque ActivityHub pagination cursor
        in: query
        name: cursor
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/clinic_internal_api.ActivitiesResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List cluster activity events
      tags:
      - activity-events
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/components:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/clinic_internal_api.ResourcePoolComponent'
            type: array
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List cluster components
      tags:
      - topology
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/continuous-profiling/group-profiles:
    get:
      operationId: canonical-byoc-continuous-profiling-group-profiles
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Inclusive window start in positive Unix seconds; O11y rounds
          down to the minute
        in: query
        maximum: 253402300799
        minimum: 1
        name: begin_time
        required: true
        type: integer
      - description: Inclusive window end in positive Unix seconds; minute-rounded
          span is at most 3 hours
        in: query
        maximum: 253402300799
        minimum: 1
        name: end_time
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/handlers.byocContinuousProfilingGroupProfile'
            type: array
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List physical BYOC Continuous Profiling groups
      tags:
      - data-proxy-continuous-profiling
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/continuous-profiling/group-profiles/{ts}:
    get:
      description: Returns JSON null with HTTP 200 when O11y has no group for the
        requested timestamp.
      operationId: canonical-byoc-continuous-profiling-group-profile-detail
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Profiling group timestamp in positive Unix seconds
        in: path
        maximum: 253402300799
        minimum: 1
        name: ts
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: Group detail, or JSON null when no group exists
          schema:
            $ref: '#/definitions/handlers.byocContinuousProfilingGroupProfileDetail'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get a physical BYOC Continuous Profiling group
      tags:
      - data-proxy-continuous-profiling
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/health-check/reports:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - default: 1
        description: One-based page number
        in: query
        maximum: 1000000
        minimum: 1
        name: page
        type: integer
      - default: 20
        description: Page size
        in: query
        maximum: 100
        minimum: 1
        name: pageSize
        type: integer
      - collectionFormat: multi
        description: Report status; repeat to select multiple values
        in: query
        items:
          type: string
        name: status
        type: array
      - description: Inclusive report creation time in RFC3339
        in: query
        name: createdFrom
        type: string
      - description: Inclusive report creation time in RFC3339
        in: query
        name: createdTo
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/clinic_internal_api.HealthCheckReportPage'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List Health Check reports
      tags:
      - health-check-reports
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/health-check/reports/{reportId}:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Health Check report ID
        in: path
        name: reportId
        required: true
        type: string
      - collectionFormat: multi
        description: Report item name; repeat to fetch a subset
        in: query
        items:
          type: string
        name: itemName
        type: array
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/clinic_internal_api.HealthCheckReport'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get a Health Check report
      tags:
      - health-check-reports
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/logs/labels:
    get:
      operationId: canonical-logs-labels
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List cluster log labels
      tags:
      - data-proxy-logs
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/logs/labels/{name}/values:
    get:
      operationId: canonical-logs-label-values
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Loki label name
        in: path
        name: name
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List cluster log label values
      tags:
      - data-proxy-logs
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/logs/query-range:
    get:
      operationId: canonical-logs-query-range
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: LogQL expression
        in: query
        name: query
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Execute a cluster log range query
      tags:
      - data-proxy-logs
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/logs/series:
    get:
      operationId: canonical-logs-series
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - collectionFormat: csv
        description: LogQL stream selectors
        in: query
        items:
          type: string
        name: match[]
        required: true
        type: array
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List matching cluster log streams
      tags:
      - data-proxy-logs
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/metrics/query:
    get:
      consumes:
      - application/x-www-form-urlencoded
      operationId: canonical-metrics-query-get
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: PromQL expression
        in: query
        name: query
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      security:
      - BearerAuth: []
      summary: Execute a cluster instant metrics query
      tags:
      - data-proxy-metrics
    post:
      consumes:
      - application/x-www-form-urlencoded
      operationId: canonical-metrics-query-post
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: PromQL expression
        in: formData
        name: query
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      security:
      - BearerAuth: []
      summary: Execute a cluster instant metrics query
      tags:
      - data-proxy-metrics
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/metrics/query-range:
    get:
      consumes:
      - application/x-www-form-urlencoded
      operationId: canonical-metrics-query-range-get
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: PromQL expression
        in: query
        name: query
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      security:
      - BearerAuth: []
      summary: Execute a cluster range metrics query
      tags:
      - data-proxy-metrics
    post:
      consumes:
      - application/x-www-form-urlencoded
      operationId: canonical-metrics-query-range-post
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: PromQL expression
        in: formData
        name: query
        required: true
        type: string
      - description: Range start
        in: formData
        name: start
        required: true
        type: string
      - description: Range end
        in: formData
        name: end
        required: true
        type: string
      - description: Query resolution step
        in: formData
        name: step
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      security:
      - BearerAuth: []
      summary: Execute a cluster range metrics query
      tags:
      - data-proxy-metrics
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/metrics/series:
    get:
      consumes:
      - application/x-www-form-urlencoded
      operationId: canonical-metrics-series-get
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - collectionFormat: csv
        description: Series selectors
        in: query
        items:
          type: string
        name: match[]
        required: true
        type: array
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      security:
      - BearerAuth: []
      summary: List matching cluster metrics series
      tags:
      - data-proxy-metrics
    post:
      consumes:
      - application/x-www-form-urlencoded
      operationId: canonical-metrics-series-post
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - collectionFormat: csv
        description: Series selectors
        in: formData
        items:
          type: string
        name: match[]
        required: true
        type: array
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      security:
      - BearerAuth: []
      summary: List matching cluster metrics series
      tags:
      - data-proxy-metrics
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/slow-queries:
    get:
      operationId: canonical-byoc-slow-query-list
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Window start in Unix seconds
        in: query
        minimum: 0
        name: begin_time
        required: true
        type: integer
      - description: Window end in Unix seconds
        in: query
        minimum: 0
        name: end_time
        required: true
        type: integer
      - description: Comma-separated result fields
        in: query
        name: fields
        type: string
      - collectionFormat: multi
        description: Database filters; repeat the parameter
        in: query
        items:
          type: string
        name: db
        type: array
      - default: 100
        description: Result limit, 1-1000
        in: query
        maximum: 1000
        minimum: 1
        name: limit
        type: integer
      - description: SQL text filter
        in: query
        name: text
        type: string
      - default: timestamp
        description: Sort field
        enum:
        - timestamp
        - query_time
        - memory_max
        - total_keys
        - process_keys
        in: query
        name: orderBy
        type: string
      - default: false
        description: Sort descending
        in: query
        name: desc
        type: boolean
      - collectionFormat: multi
        description: Plan digest filters; repeat the parameter
        in: query
        items:
          type: string
        name: plans
        type: array
      - description: SQL digest filter
        in: query
        name: digest
        type: string
      - default: false
        description: Include internal SQL
        in: query
        name: show_internal
        type: boolean
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              additionalProperties: true
              type: object
            type: array
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List BYOC slow queries
      tags:
      - data-proxy-slow-queries
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/slow-queries/available-fields:
    get:
      operationId: canonical-byoc-slow-query-available-fields
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              type: string
            type: array
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List BYOC slow-query fields
      tags:
      - data-proxy-slow-queries
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/slow-queries/detail:
    get:
      operationId: canonical-byoc-slow-query-detail
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: SQL digest
        in: query
        name: digest
        required: true
        type: string
      - description: Execution timestamp in Unix seconds
        in: query
        name: timestamp
        required: true
        type: number
      - description: Unsigned connection ID
        in: query
        name: connect_id
        required: true
        type: string
      - default: false
        description: Include internal SQL
        in: query
        name: show_internal
        type: boolean
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get BYOC slow-query detail
      tags:
      - data-proxy-slow-queries
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/sql-queries:
    post:
      consumes:
      - application/json
      operationId: canonical-create-sql-query
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Numeric warehouse cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: SQL query request
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/dto.CanonicalDataProxyQueryRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.DataProxyQueryResult'
        "400":
          description: Invalid request; UNKNOWN_FIELD details are returned for unresolved
            query fields
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Execute a cluster SQL query
      tags:
      - data-proxy-sql
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/sql-query-batches:
    post:
      consumes:
      - application/json
      operationId: canonical-create-sql-query-batch
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Numeric warehouse cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: SQL query request array
        in: body
        name: request
        required: true
        schema:
          items:
            $ref: '#/definitions/dto.CanonicalDataProxyQueryRequest'
          type: array
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.DataProxyBatchQueryResponse'
        "400":
          description: Invalid request; indexed UNKNOWN_FIELD details are returned
            for unresolved query fields
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Execute a same-cluster SQL query batch
      tags:
      - data-proxy-sql
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/statements:
    get:
      operationId: canonical-byoc-statements-list
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Window start in Unix seconds; range must not exceed 259500 seconds
        in: query
        maximum: 253402300799
        minimum: 0
        name: begin_time
        required: true
        type: integer
      - description: Window end in Unix seconds; range must not exceed 259500 seconds
        in: query
        maximum: 253402300799
        minimum: 0
        name: end_time
        required: true
        type: integer
      - collectionFormat: multi
        description: Schema filters; repeat the parameter, at most 64 values
        in: query
        items:
          type: string
        name: schemas
        type: array
      - collectionFormat: multi
        description: Statement-type filters; repeat the parameter, at most 64 values
        in: query
        items:
          type: string
        name: stmt_types
        type: array
      - description: SQL text filter, at most 4096 bytes
        in: query
        maxLength: 4096
        name: text
        type: string
      - description: Comma-separated result field names, at most 4096 bytes
        in: query
        maxLength: 4096
        name: fields
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              additionalProperties: true
              type: object
            type: array
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List BYOC SQL Statements
      tags:
      - data-proxy-statements
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/statements/available-fields:
    get:
      operationId: canonical-byoc-statements-available-fields
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              type: string
            type: array
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List BYOC SQL Statement fields
      tags:
      - data-proxy-statements
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/statements/plan-detail:
    get:
      operationId: canonical-byoc-statements-plan-detail
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Window start in Unix seconds; range must not exceed 259500 seconds
        in: query
        maximum: 253402300799
        minimum: 0
        name: begin_time
        required: true
        type: integer
      - description: Window end in Unix seconds; range must not exceed 259500 seconds
        in: query
        maximum: 253402300799
        minimum: 0
        name: end_time
        required: true
        type: integer
      - description: SQL digest, exactly 64 hexadecimal characters
        in: query
        maxLength: 64
        minLength: 64
        name: digest
        required: true
        type: string
      - collectionFormat: multi
        description: Optional plan digests; omit for all plans, otherwise repeat the
          parameter (at most 64)
        in: query
        items:
          type: string
        name: plans
        type: array
      - description: Schema filter, at most 256 bytes
        in: query
        maxLength: 256
        name: schema_name
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get BYOC SQL Statement plan detail
      tags:
      - data-proxy-statements
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/statements/plans:
    get:
      operationId: canonical-byoc-statements-plans
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Window start in Unix seconds; range must not exceed 259500 seconds
        in: query
        maximum: 253402300799
        minimum: 0
        name: begin_time
        required: true
        type: integer
      - description: Window end in Unix seconds; range must not exceed 259500 seconds
        in: query
        maximum: 253402300799
        minimum: 0
        name: end_time
        required: true
        type: integer
      - description: SQL digest, exactly 64 hexadecimal characters
        in: query
        maxLength: 64
        minLength: 64
        name: digest
        required: true
        type: string
      - description: Schema filter, at most 256 bytes
        in: query
        maxLength: 256
        name: schema_name
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              additionalProperties: true
              type: object
            type: array
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List BYOC SQL Statement plans
      tags:
      - data-proxy-statements
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/statements/statement-types:
    get:
      operationId: canonical-byoc-statements-types
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              type: string
            type: array
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List BYOC SQL Statement types
      tags:
      - data-proxy-statements
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/table-schemas:
    get:
      operationId: canonical-list-table-schemas
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Numeric warehouse cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Comma-separated standard logical table names
        in: query
        name: tables
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.BatchSchemaResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List cluster table schemas
      tags:
      - data-proxy-sql
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/ticdc/changefeeds:
    get:
      parameters:
      - description: TiDB Cloud org ID
        in: path
        name: orgId
        required: true
        type: integer
      - description: TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/ticdc.ListResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      summary: List TiCDC changefeeds (internal)
      tags:
      - ticdc
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/ticdc/changefeeds/{changefeedId}:
    get:
      parameters:
      - description: TiDB Cloud org ID
        in: path
        name: orgId
        required: true
        type: integer
      - description: TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: integer
      - description: Changefeed ID
        in: path
        name: changefeedId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/ticdc.DetailResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      summary: Get TiCDC changefeed (internal)
      tags:
      - ticdc
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/top-ru/summary:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Inclusive window start in Unix seconds
        in: query
        name: start
        required: true
        type: integer
      - description: Inclusive window end in Unix seconds
        in: query
        name: end
        required: true
        type: integer
      - description: Top N SQL digests
        in: query
        name: top
        required: true
        type: integer
      - description: 'Ranking metric: ru, exec_count, or duration'
        in: query
        name: order_by
        type: string
      - description: Omit for all users; user= selects empty/NULL user
        in: query
        name: user
        type: string
      - description: O11y data source, normally deltalake
        in: query
        name: data_source
        type: string
      - description: Trend bucket size in seconds
        in: query
        name: step
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get Top RU summary
      tags:
      - top-ru
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/top-ru/summary-plan:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Inclusive window start in Unix seconds
        in: query
        name: start
        required: true
        type: integer
      - description: Inclusive window end in Unix seconds
        in: query
        name: end
        required: true
        type: integer
      - description: Top N SQL/plan groups
        in: query
        name: top
        required: true
        type: integer
      - description: Filter to a single SQL digest
        in: query
        name: digest
        type: string
      - description: 'Ranking metric: ru, exec_count, or duration'
        in: query
        name: order_by
        type: string
      - description: Omit for all users; user= selects empty/NULL user
        in: query
        name: user
        type: string
      - description: O11y data source, normally deltalake
        in: query
        name: data_source
        type: string
      - description: Trend bucket size in seconds
        in: query
        name: step
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get Top RU summary by plan
      tags:
      - top-ru
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/top-ru/user-stats:
    get:
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Opaque TiDB Cloud cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Inclusive window start in Unix seconds
        in: query
        name: start
        required: true
        type: integer
      - description: Inclusive window end in Unix seconds
        in: query
        name: end
        required: true
        type: integer
      - description: Top N users; O11y default is 20
        in: query
        name: top
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get Top RU user statistics
      tags:
      - top-ru
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/top-sql/instances:
    get:
      operationId: canonical-byoc-top-sql-instances
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Strict decimal Unix seconds; the start/end span is at most 15
          days
        in: query
        maximum: 253402300799
        minimum: 0
        name: start
        required: true
        type: number
      - description: Strict decimal Unix seconds; the start/end span is at most 15
          days
        in: query
        maximum: 253402300799
        minimum: 0
        name: end
        required: true
        type: number
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.byocTopSQLResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List BYOC Top SQL instances
      tags:
      - data-proxy-top-sql
  /data-proxy/api/v1/orgs/{orgId}/clusters/{clusterId}/top-sql/summary:
    get:
      operationId: canonical-byoc-top-sql-summary
      parameters:
      - description: TiDB Cloud/DBAAS org ID
        in: path
        name: orgId
        required: true
        type: string
      - description: Logical BYOC or physical byoc-host cluster ID
        in: path
        name: clusterId
        required: true
        type: string
      - description: Strict decimal Unix seconds; the start/end span is at most 15
          days
        in: query
        maximum: 253402300799
        minimum: 0
        name: start
        required: true
        type: number
      - description: Strict decimal Unix seconds; the start/end span is at most 15
          days
        in: query
        maximum: 253402300799
        minimum: 0
        name: end
        required: true
        type: number
      - description: Whole-second Go duration from 1s through 360h; at most 4096 windows
        in: query
        name: window
        required: true
        type: string
      - description: Top N SQL statements
        in: query
        maximum: 100
        minimum: 1
        name: top
        required: true
        type: integer
      - description: Top SQL instance
        in: query
        maxLength: 512
        minLength: 1
        name: instance
        required: true
        type: string
      - description: Top SQL instance type
        enum:
        - tidb
        - tikv
        - pd
        in: query
        name: instance_type
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.byocTopSQLResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "413":
          description: Request Entity Too Large
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Get BYOC Top SQL summary
      tags:
      - data-proxy-top-sql
  /data-proxy/api/v1/system-log-datasources:
    get:
      operationId: canonical-list-system-log-datasources
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.CanonicalSystemLogDatasourcesResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List system-log datasources
      tags:
      - data-proxy-system-logs
  /data-proxy/api/v1/system-log-datasources/{datasourceUID}/logs/labels:
    get:
      operationId: canonical-system-logs-labels
      parameters:
      - description: System-log datasource UID
        in: path
        name: datasourceUID
        required: true
        type: string
      - description: Inclusive range start as a Loki timestamp
        in: query
        name: start
        type: string
      - description: Inclusive range end as a Loki timestamp
        in: query
        name: end
        type: string
      - description: LogQL stream selector
        in: query
        name: query
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "499":
          description: ""
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List system-log labels
      tags:
      - data-proxy-system-logs
  /data-proxy/api/v1/system-log-datasources/{datasourceUID}/logs/labels/{name}/values:
    get:
      operationId: canonical-system-logs-label-values
      parameters:
      - description: System-log datasource UID
        in: path
        name: datasourceUID
        required: true
        type: string
      - description: Loki label name
        in: path
        name: name
        required: true
        type: string
      - description: Inclusive range start as a Loki timestamp
        in: query
        name: start
        type: string
      - description: Inclusive range end as a Loki timestamp
        in: query
        name: end
        type: string
      - description: LogQL stream selector
        in: query
        name: query
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "499":
          description: ""
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List system-log label values
      tags:
      - data-proxy-system-logs
  /data-proxy/api/v1/system-log-datasources/{datasourceUID}/logs/query-range:
    get:
      operationId: canonical-system-logs-query-range
      parameters:
      - description: System-log datasource UID
        in: path
        name: datasourceUID
        required: true
        type: string
      - description: LogQL query
        in: query
        name: query
        required: true
        type: string
      - description: Inclusive range start as a Loki timestamp
        in: query
        name: start
        type: string
      - description: Inclusive range end as a Loki timestamp
        in: query
        name: end
        type: string
      - description: Maximum entries; clamped by Data Proxy
        in: query
        name: limit
        type: integer
      - description: 'Query direction: forward or backward'
        in: query
        name: direction
        type: string
      - description: Relative lookback duration
        in: query
        name: since
        type: string
      - description: Query resolution step
        in: query
        name: step
        type: string
      - description: Query interval
        in: query
        name: interval
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "499":
          description: ""
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: Query system logs over a time range
      tags:
      - data-proxy-system-logs
  /data-proxy/api/v1/system-log-datasources/{datasourceUID}/logs/series:
    get:
      operationId: canonical-system-logs-series
      parameters:
      - description: System-log datasource UID
        in: path
        name: datasourceUID
        required: true
        type: string
      - collectionFormat: csv
        description: LogQL stream selectors
        in: query
        items:
          type: string
        name: match[]
        required: true
        type: array
      - description: Inclusive range start as a Loki timestamp
        in: query
        name: start
        type: string
      - description: Inclusive range end as a Loki timestamp
        in: query
        name: end
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/errors.APIError'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/errors.APIError'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/errors.APIError'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/errors.APIError'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/errors.APIError'
        "499":
          description: ""
          schema:
            $ref: '#/definitions/errors.APIError'
        "502":
          description: Bad Gateway
          schema:
            $ref: '#/definitions/errors.APIError'
        "503":
          description: Service Unavailable
          schema:
            $ref: '#/definitions/errors.APIError'
        "504":
          description: Gateway Timeout
          schema:
            $ref: '#/definitions/errors.APIError'
      security:
      - BearerAuth: []
      summary: List system-log series
      tags:
      - data-proxy-system-logs
  /data-proxy/metrics/{cluster_id}/api/v1/query:
    get:
      consumes:
      - application/json
      - application/x-www-form-urlencoded
      description: Evaluates an instant query at a single point in time (Prometheus-compatible)
      parameters:
      - description: Cluster ID
        in: path
        name: cluster_id
        required: true
        type: string
      - description: PromQL expression
        in: query
        name: query
        required: true
        type: string
      - description: Evaluation timestamp (RFC3339 or Unix timestamp)
        in: query
        name: time
        type: string
      - description: Evaluation timeout
        in: query
        name: timeout
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      summary: Instant query
      tags:
      - metrics
  /data-proxy/metrics/{cluster_id}/api/v1/query_range:
    get:
      consumes:
      - application/json
      - application/x-www-form-urlencoded
      description: Evaluates an expression query over a range of time (Prometheus-compatible)
      parameters:
      - description: Cluster ID
        in: path
        name: cluster_id
        required: true
        type: string
      - description: PromQL expression
        in: query
        name: query
        required: true
        type: string
      - description: Start timestamp (RFC3339 or Unix timestamp)
        in: query
        name: start
        required: true
        type: string
      - description: End timestamp (RFC3339 or Unix timestamp)
        in: query
        name: end
        required: true
        type: string
      - description: Query resolution step width (duration format, e.g., 15s, 1m)
        in: query
        name: step
        required: true
        type: string
      - description: Evaluation timeout
        in: query
        name: timeout
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      summary: Range query
      tags:
      - metrics
  /data-proxy/metrics/{cluster_id}/api/v1/series:
    get:
      consumes:
      - application/json
      - application/x-www-form-urlencoded
      description: Returns the list of time series that match a certain label set
        (Prometheus-compatible)
      parameters:
      - description: Cluster ID
        in: path
        name: cluster_id
        required: true
        type: string
      - collectionFormat: csv
        description: Series selector (at least one required)
        in: query
        items:
          type: string
        name: match[]
        required: true
        type: array
      - description: Start timestamp (RFC3339 or Unix timestamp)
        in: query
        name: start
        type: string
      - description: End timestamp (RFC3339 or Unix timestamp)
        in: query
        name: end
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "422":
          description: Unprocessable Entity
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/dto.PrometheusResponse'
      summary: Series query
      tags:
      - metrics
securityDefinitions:
  BearerAuth:
    description: Use `Bearer <clinic-api-key>`.
    in: header
    name: Authorization
    type: apiKey
swagger: "2.0"
