definitions:
  api.CreateTaskResponse:
    properties:
      task_id:
        example: 1
        type: integer
    type: object
  api.FileMetaInfo:
    properties:
      created_at_unix_sec:
        type: integer
      download_path:
        type: string
      download_url:
        type: string
      filename:
        type: string
      key:
        type: string
      size:
        type: integer
    type: object
  api.GetClinicPublicAddressResponse:
    properties:
      addresses:
        items:
          type: string
        type: array
    type: object
  api.HeapProfile:
    properties:
      cum:
        type: string
      cum_perc:
        type: number
      flat:
        type: string
      flat_perc:
        type: number
      function:
        type: string
      sum_perc:
        type: number
    type: object
  api.HeapResult:
    properties:
      top_inuse_space:
        items:
          $ref: '#/definitions/api.HeapProfile'
        type: array
      total_inuse_space:
        type: string
    type: object
  api.IndexAdvisorResult:
    properties:
      checked_time:
        type: integer
      db:
        type: string
      ddl:
        type: string
      id:
        type: integer
      indexes:
        items:
          $ref: '#/definitions/index_advisor.Index'
        type: array
      slow_queries:
        items:
          $ref: '#/definitions/index_advisor.SlowQuery'
        type: array
      table:
        type: string
      type:
        description: missing_index
        type: string
      version:
        description: '"" / "v1"'
        type: string
    type: object
  api.InstanceItem:
    properties:
      instance:
        type: string
      instance_type:
        type: string
    type: object
  api.LatestTaskResponse:
    properties:
      latest:
        $ref: '#/definitions/api.Task'
      latest_finished:
        $ref: '#/definitions/api.Task'
    type: object
  api.ListData:
    properties:
      records:
        items:
          $ref: '#/definitions/api.ListFileRecord'
        type: array
    type: object
  api.ListFileRecord:
    properties:
      files:
        items:
          $ref: '#/definitions/api.FileMetaInfo'
        type: array
      instance:
        type: string
    type: object
  api.ListIndexAdvisesResponse:
    properties:
      count:
        type: integer
      results:
        items:
          $ref: '#/definitions/api.IndexAdvisorResult'
        type: array
    type: object
  api.ListStatementsResponse:
    properties:
      statements:
        items:
          $ref: '#/definitions/api.Statement'
        type: array
      total:
        type: integer
    type: object
  api.ListTaskResponse:
    properties:
      tasks:
        items:
          $ref: '#/definitions/api.Task'
        type: array
      total:
        type: integer
    type: object
  api.Model:
    properties:
      avg_affected_rows:
        type: integer
      avg_backoff_time:
        type: integer
      avg_commit_backoff_time:
        type: integer
      avg_commit_time:
        type: integer
      avg_compile_latency:
        type: integer
      avg_disk:
        type: integer
      avg_get_commit_ts_time:
        type: integer
      avg_ia_read_segment_count:
        type: number
      avg_ia_remote_read_segment_size:
        type: number
      avg_ia_remote_read_segment_wait_time:
        type: number
      avg_latency:
        type: integer
      avg_local_latch_wait_time:
        type: integer
      avg_mem:
        type: integer
      avg_parse_latency:
        type: integer
      avg_prewrite_regions:
        type: integer
      avg_prewrite_time:
        type: integer
      avg_process_time:
        type: integer
      avg_processed_keys:
        type: integer
      avg_resolve_lock_time:
        type: integer
      avg_rocksdb_block_cache_hit_count:
        type: integer
      avg_rocksdb_block_read_byte:
        type: integer
      avg_rocksdb_block_read_count:
        type: integer
      avg_rocksdb_delete_skipped_count:
        type: integer
      avg_rocksdb_key_skipped_count:
        type: integer
      avg_rru:
        type: number
      avg_ru:
        type: number
      avg_ru_v2:
        type: number
      avg_total_keys:
        type: integer
      avg_txn_retry:
        type: integer
      avg_wait_time:
        type: integer
      avg_write_keys:
        type: integer
      avg_write_size:
        type: integer
      avg_wru:
        type: number
      binary_plan:
        type: string
      binary_plan_text:
        type: string
      digest:
        type: string
      digest_text:
        type: string
      exec_count:
        type: integer
      first_seen:
        type: integer
      index_names:
        type: string
      last_seen:
        type: integer
      max_backoff_time:
        type: integer
      max_commit_backoff_time:
        type: integer
      max_commit_time:
        type: integer
      max_compile_latency:
        type: integer
      max_cop_process_time:
        type: integer
      max_cop_wait_time:
        type: integer
      max_disk:
        type: integer
      max_get_commit_ts_time:
        type: integer
      max_ia_read_segment_count:
        type: integer
      max_ia_remote_read_segment_size:
        type: integer
      max_ia_remote_read_segment_wait_time:
        type: number
      max_latency:
        type: integer
      max_local_latch_wait_time:
        type: integer
      max_mem:
        type: integer
      max_parse_latency:
        type: integer
      max_prewrite_regions:
        type: integer
      max_prewrite_time:
        type: integer
      max_process_time:
        type: integer
      max_processed_keys:
        type: integer
      max_resolve_lock_time:
        type: integer
      max_rocksdb_block_cache_hit_count:
        type: integer
      max_rocksdb_block_read_byte:
        type: integer
      max_rocksdb_block_read_count:
        type: integer
      max_rocksdb_delete_skipped_count:
        type: integer
      max_rocksdb_key_skipped_count:
        type: integer
      max_rru:
        type: number
      max_ru_v2:
        type: number
      max_ru_wait_duration:
        type: integer
      max_total_keys:
        type: integer
      max_txn_retry:
        type: integer
      max_wait_time:
        type: integer
      max_write_keys:
        type: integer
      max_write_size:
        type: integer
      max_wru:
        type: number
      min_latency:
        type: integer
      plan:
        type: string
      plan_cache_hits:
        type: integer
      plan_count:
        type: integer
      plan_digest:
        type: string
      plan_hint:
        type: string
      plan_in_binding:
        type: boolean
      plan_in_cache:
        type: boolean
      prev_sample_text:
        type: string
      query_sample_text:
        type: string
      sample_user:
        type: string
      schema_name:
        type: string
      stmt_type:
        type: string
      sum_backoff_times:
        type: integer
      sum_cop_task_num:
        type: integer
      sum_errors:
        type: integer
      sum_ia_read_segment_count:
        description: IA remote read segment metrics
        type: integer
      sum_ia_remote_read_segment_size:
        type: integer
      sum_ia_remote_read_segment_wait_time:
        type: number
      sum_latency:
        type: integer
      sum_rru:
        type: number
      sum_ru:
        type: number
      sum_ru_v2:
        description: RUv2 metrics
        type: number
      sum_ru_wait_duration:
        type: integer
      sum_warnings:
        type: integer
      sum_wru:
        type: number
      summary_begin_time:
        type: integer
      summary_end_time:
        type: integer
      table_names:
        type: string
    type: object
  api.Plan:
    properties:
      avg_latency:
        type: integer
      avg_mem_byte:
        type: integer
      created_at:
        example: 1672992422
        type: integer
      exec_count:
        type: integer
      is_suggested:
        type: boolean
      max_latency:
        type: integer
      max_mem_byte:
        type: integer
      min_latency:
        type: integer
      plan_digest:
        type: string
      plan_id:
        type: integer
      task_created_at:
        example: 1672992422
        type: integer
      task_offset_hours:
        example: 1
        type: integer
      updated_at:
        example: 1672992422
        type: integer
    type: object
  api.Statement:
    properties:
      created_at:
        example: 1672992422
        type: integer
      digest:
        type: string
      digest_text:
        type: string
      has_suggested_plan:
        type: boolean
      impact:
        enum:
        - HIGH
        - MIDDLE
        - LOW
        example: HIGH
        type: string
      index_names:
        type: string
      insight_type:
        enum:
        - unstable_plan
        example: unstable_plan
        type: string
      m:
        type: number
      max_of_avg_latencies_of_plans:
        type: integer
      min_of_avg_latencies_of_plans:
        type: integer
      "n":
        type: number
      plan_count:
        type: integer
      query_sample_text:
        type: string
      sample_user:
        type: string
      schema_name:
        type: string
      statement_id:
        example: 1
        type: integer
      stmt_type:
        type: string
      suggest_plan_overview:
        $ref: '#/definitions/api.SuggestPlanOverview'
      table_names:
        type: string
      task_created_at:
        example: 1672992422
        type: integer
      task_offset_hours:
        example: 1
        type: integer
      updated_at:
        example: 1672992422
        type: integer
    type: object
  api.StatementDetails:
    properties:
      plans:
        items:
          $ref: '#/definitions/api.Plan'
        type: array
      statement:
        $ref: '#/definitions/api.Statement'
    type: object
  api.SubmitMysqlAccountRequest:
    properties:
      password:
        example: bar
        type: string
      user:
        example: foo
        type: string
    type: object
  api.SuggestPlanOverview:
    properties:
      create_binding_statement:
        type: string
      drop_binding_statement:
        type: string
      plan_digest:
        type: string
      plan_id:
        type: integer
    type: object
  api.SummaryItem:
    properties:
      cpu_time_ms:
        type: integer
      duration_per_exec_ms:
        type: number
      exec_count_per_sec:
        type: number
      is_other:
        type: boolean
      plans:
        items:
          $ref: '#/definitions/api.SummaryPlanItem'
        type: array
      scan_indexes_per_sec:
        type: number
      scan_records_per_sec:
        type: number
      sql_digest:
        type: string
      sql_text:
        type: string
    type: object
  api.SummaryPlanItem:
    properties:
      cpu_time_ms:
        items:
          type: integer
        type: array
      duration_per_exec_ms:
        type: number
      exec_count_per_sec:
        type: number
      plan_digest:
        type: string
      plan_text:
        type: string
      scan_indexes_per_sec:
        type: number
      scan_records_per_sec:
        type: number
      timestamp_sec:
        items:
          type: integer
        type: array
    type: object
  api.Task:
    properties:
      advise_count:
        example: 1
        type: integer
      cluster_id:
        example: 1
        type: integer
      created_at:
        example: 1672992422
        type: integer
      dbaas_cluster_id:
        example: 1
        type: integer
      dbaas_org_id:
        example: 1
        type: integer
      last_failed_message:
        example: failed to connect to cluster
        type: string
      material_count:
        example: 1
        type: integer
      perform_insight_cluster_id:
        example: 1
        type: integer
      status:
        enum:
        - created
        - running
        - succeeded
        - failed
        example: succeeded
        format: string
        type: string
      task_id:
        example: 1
        type: integer
      type:
        enum:
        - unstable_plan_insight
        - index_insight
        - hint_insight
        example: unstable_plan_insight
        format: string
        type: string
      update_at:
        example: 1672992422
        type: integer
    type: object
  conprof.detailResponse:
    properties:
      profile_duration_secs:
        type: integer
      state:
        type: string
      target_profiles:
        items:
          $ref: '#/definitions/conprof.detailResponseProfile'
        type: array
      ts:
        type: integer
    type: object
  conprof.detailResponseProfile:
    properties:
      error:
        type: string
      profile_type:
        type: string
      state:
        type: string
      target:
        $ref: '#/definitions/conprof.detailResponseProfileTarget'
    type: object
  conprof.detailResponseProfileTarget:
    properties:
      address:
        type: string
      component:
        type: string
    type: object
  conprof.listResponseItem:
    properties:
      component_num:
        additionalProperties:
          type: integer
        type: object
      profile_duration_secs:
        type: integer
      state:
        type: string
      ts:
        type: integer
    type: object
  error.ErrorResponse:
    properties:
      code:
        type: string
      error:
        type: boolean
      message:
        type: string
    type: object
  index_advisor.Index:
    properties:
      clustered:
        type: string
      columns:
        items:
          type: string
        type: array
      name:
        type: string
      visible:
        type: string
    type: object
  index_advisor.SlowQuery:
    properties:
      avg_latency:
        type: number
      avg_memory:
        type: number
      count:
        type: integer
      digest:
        type: string
      query:
        type: string
      time_latencies:
        items:
          $ref: '#/definitions/index_advisor.TimeLatency'
        type: array
      users:
        items:
          type: string
        type: array
    type: object
  index_advisor.TimeLatency:
    properties:
      latency:
        type: number
      time:
        type: integer
    type: object
  k.LabelKey:
    properties:
      key:
        type: string
      labels:
        items:
          type: string
        type: array
    required:
    - key
    - labels
    type: object
  k.Matrix:
    properties:
      data:
        additionalProperties:
          items:
            items:
              type: integer
            type: array
          type: array
        type: object
      keyAxis:
        items:
          $ref: '#/definitions/k.LabelKey'
        type: array
      timeAxis:
        items:
          type: integer
        type: array
    required:
    - data
    - keyAxis
    - timeAxis
    type: object
  keyviz.KeyVisualConfig:
    properties:
      auto_collection_disabled:
        type: boolean
      policy:
        type: string
      policy_kv_separator:
        type: string
    type: object
  slowquery.RequestUnitV2Metrics:
    properties:
      executor_l1:
        type: number
      executor_l2:
        type: number
      executor_l3:
        type: number
      executor_l5_insert_rows:
        type: number
      plan_cnt:
        type: number
      plan_derive_stats_paths:
        type: number
      resource_manager_read_cnt:
        type: number
      resource_manager_write_cnt:
        type: number
      result_chunk_cells:
        description: Optional detail fields (only present when non-zero)
        type: number
      session_parser_total:
        type: number
      tidb_ru:
        type: number
      tiflash_ru:
        type: number
      tikv_coprocessor_executor_iterations:
        type: number
      tikv_coprocessor_executor_work_total:
        additionalProperties:
          type: number
        type: object
      tikv_coprocessor_response_bytes:
        type: number
      tikv_kv_engine_cache_miss:
        type: number
      tikv_raftstore_store_write_trigger_wb_bytes:
        type: number
      tikv_ru:
        type: number
      tikv_storage_processed_keys_batch_get:
        type: number
      tikv_storage_processed_keys_get:
        type: number
      total_ru:
        type: number
      txn_cnt:
        type: number
    type: object
  slowquery.slowLogRespItem:
    properties:
      backoff_time:
        type: number
      backoff_types:
        type: string
      commit_backoff_time:
        type: number
      commit_time:
        type: number
      compile_time:
        type: number
      connection_id:
        description: 'TODO: Switch back to uint64 when modern browser as well as Swagger
          handles BigInt well.'
        type: string
      cop_proc_addr:
        type: string
      cop_proc_avg:
        type: number
      cop_proc_max:
        type: number
      cop_proc_p90:
        type: number
      cop_time:
        type: number
      cop_wait_addr:
        type: string
      cop_wait_avg:
        type: number
      cop_wait_max:
        type: number
      cop_wait_p90:
        type: number
      db:
        type: string
      digest:
        type: string
      disk_max:
        type: integer
      exec_retry_time:
        type: number
      get_commit_ts_time:
        type: number
      host:
        type: string
      ia_remote_read_segment_count:
        type: integer
      ia_remote_read_segment_size:
        type: integer
      ia_remote_read_segment_wait_time:
        type: number
      index_names:
        type: string
      instance:
        type: string
      is_internal:
        description: Basic
        type: integer
      local_latch_wait_time:
        type: number
      lock_keys_time:
        type: number
      memory_max:
        type: integer
      optimize_time:
        type: number
      parse_time:
        type: number
      plan:
        type: string
      plan_from_binding:
        type: integer
      plan_from_cache:
        type: integer
      prepared:
        type: integer
      preproc_subqueries_time:
        type: number
      prev_stmt:
        description: Detail
        type: string
      prewrite_region:
        type: integer
      prewrite_time:
        type: number
      process_keys:
        type: integer
      process_time:
        description: Time
        type: number
      query:
        type: string
      query_time:
        description: latency
        type: number
      request_count:
        description: Coprocessor
        type: integer
      resolve_lock_time:
        type: number
      resource_group:
        type: string
      rewrite_time:
        type: number
      rocksdb_block_cache_hit_count:
        type: integer
      rocksdb_block_read_byte:
        type: integer
      rocksdb_block_read_count:
        type: integer
      rocksdb_delete_skipped_count:
        description: RocksDB
        type: integer
      rocksdb_key_skipped_count:
        type: integer
      ru:
        description: Resource Control
        type: number
      ru_v2:
        description: RUv2 metrics
        type: number
      ru_v2_detail:
        type: string
      ru_v2_metrics:
        $ref: '#/definitions/slowquery.RequestUnitV2Metrics'
      stats:
        type: string
      success:
        type: integer
      time_queued_by_rc:
        type: number
      timestamp:
        description: finish time
        type: number
      total_keys:
        type: integer
      txn_retry:
        type: integer
      txn_start_ts:
        description: 'TODO: Switch back to uint64 when modern browser as well as Swagger
          handles BigInt well.'
        type: string
      user:
        description: Connection
        type: string
      wait_prewrite_binlog_time:
        type: number
      wait_time:
        type: number
      wait_ts:
        type: number
      warnings:
        type: string
      write_keys:
        description: Transaction
        type: integer
      write_size:
        type: integer
      write_sql_response_total:
        type: number
    type: object
  statements.StatementsDatasourceResponse:
    properties:
      v2_available:
        type: boolean
    type: object
  topru.ConfigResponse:
    properties:
      enable:
        type: boolean
    type: object
  topru.SummaryEnvelope:
    properties:
      data:
        items:
          $ref: '#/definitions/topru.TopRUSummaryItem'
        type: array
      status:
        type: string
    type: object
  topru.SummaryPlanEnvelope:
    properties:
      data:
        items:
          $ref: '#/definitions/topru.TopRUSummaryPlanItem'
        type: array
      status:
        type: string
    type: object
  topru.TopRUSummaryItem:
    properties:
      duration_ns:
        type: integer
      duration_per_exec_ms:
        type: number
      exec_count:
        type: integer
      exec_count_per_sec:
        type: number
      sql_digest:
        type: string
      sql_text:
        type: string
      timestamp_sec:
        items:
          type: integer
        type: array
      total_ru:
        type: number
      total_ru_by_time:
        items:
          type: number
        type: array
    type: object
  topru.TopRUSummaryPlanItem:
    properties:
      duration_ns:
        type: integer
      duration_per_exec_ms:
        type: number
      exec_count:
        type: integer
      exec_count_per_sec:
        type: number
      plan_digest:
        type: string
      plan_text:
        type: string
      sql_digest:
        type: string
      sql_text:
        type: string
      timestamp_sec:
        items:
          type: integer
        type: array
      total_ru:
        type: number
      total_ru_by_time:
        items:
          type: number
        type: array
    type: object
  topru.UserStatsEnvelope:
    properties:
      data:
        items:
          $ref: '#/definitions/topru.UserStatsItem'
        type: array
      status:
        type: string
    type: object
  topru.UserStatsItem:
    properties:
      duration_ns:
        type: integer
      exec_count:
        type: integer
      total_ru:
        type: number
      user:
        type: string
    type: object
  topsql.configResponse:
    properties:
      enable:
        type: boolean
    type: object
  topsql.jsonResponse:
    properties:
      data: {}
      status:
        type: string
    type: object
info:
  contact: {}
  description: This is a Ngm API
  title: Ngm API
  version: "1.0"
paths:
  /continuous_profiling/action_token:
    get:
      description: Get action token for download or view profile
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: 'deploy type: dedicated/shared/premium/nextgen/nextgen-host/byoc-host'
        in: header
        name: x-deploy-type
        required: true
        type: string
      - description: target query string
        in: query
        name: q
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: string
      summary: Get action token for download or view profile
      tags:
      - conprof
  /continuous_profiling/download:
    get:
      description: Download profile
      parameters:
      - description: token for download or view profile
        in: query
        name: token
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            type: file
      summary: Download profile
      tags:
      - conprof
  /continuous_profiling/group_profile/detail:
    get:
      description: Get detail of profile
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: 'deploy type: dedicated/shared/premium/nextgen/nextgen-host/byoc-host'
        in: header
        name: x-deploy-type
        required: true
        type: string
      - description: timestamp in seconds
        in: query
        name: ts
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/conprof.detailResponse'
      summary: Get detail of profile
      tags:
      - conprof
  /continuous_profiling/group_profiles:
    get:
      description: Get list of profile
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: 'deploy type: dedicated/shared/premium/nextgen/nextgen-host/byoc-host'
        in: header
        name: x-deploy-type
        required: true
        type: string
      - description: begin time in unix seconds
        in: query
        name: begin_time
        type: integer
      - description: end time in unix seconds
        in: query
        name: end_time
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/conprof.listResponseItem'
            type: array
      summary: Get list of profile
      tags:
      - conprof
  /continuous_profiling/single_profile/view:
    get:
      description: Single view profile for speedscope
      parameters:
      - description: token for download or view profile
        in: query
        name: token
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            type: file
      summary: Single view profile for speedscope
      tags:
      - conprof
  /keyvisual/config:
    get:
      description: Mock config for keyvisual
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/keyviz.KeyVisualConfig'
      summary: Key Visual Config
  /keyvisual/heatmaps:
    get:
      description: Heatmaps in a given range to visualize TiKV usage
      parameters:
      - description: The start of the key range
        in: query
        name: startkey
        type: string
      - description: The end of the key range
        in: query
        name: endkey
        type: string
      - description: The start of the time range (Unix)
        in: query
        name: starttime
        type: integer
      - description: The end of the time range (Unix)
        in: query
        name: endtime
        type: integer
      - description: Main types of data
        enum:
        - written_bytes
        - read_bytes
        - written_keys
        - read_keys
        - integration
        in: query
        name: type
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/k.Matrix'
      summary: Key Visual Heatmaps
  /oom_record/files:
    get:
      description: download file for oom record
      parameters:
      - description: provider aws/gcp
        in: query
        name: provider
        required: true
        type: string
      - description: region
        in: query
        name: region
        required: true
        type: string
      - description: object key
        in: query
        name: key
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: file
      summary: Download file for oom record
      tags:
      - oom record
  /oom_record/list:
    get:
      description: list file info for oom record
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: instances, separate by comma
        in: query
        name: instances
        type: string
      - description: start time in unix seconds
        in: query
        name: start
        required: true
        type: string
      - description: end time in unix seconds
        in: query
        name: end
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.ListData'
      summary: List file info for oom record
      tags:
      - oom record
  /oom_record/top10_mem_usage:
    get:
      description: get top 10 memory usage from heap profile
      parameters:
      - description: provider aws/gcp
        in: query
        name: provider
        required: true
        type: string
      - description: region
        in: query
        name: region
        required: true
        type: string
      - description: object key
        in: query
        name: key
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.HeapResult'
      summary: Get top 10 memory usage from heap profile
      tags:
      - oom record
  /performance_insight/index_advisor/results:
    get:
      description: List results of index advisor.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      - default: desc
        description: sort by update time before pagination
        enum:
        - asc
        - desc
        in: query
        name: order_by_update_time
        type: string
      - default: 30
        description: the number of items per page
        in: query
        name: limit
        type: integer
      - default: 1
        description: the page index
        in: query
        name: page
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.ListIndexAdvisesResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: List Index Advises
      tags:
      - performance_insight_index_advisor
  /performance_insight/index_advisor/results/{id}:
    get:
      description: Get details of index advisor result.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      - description: result id
        in: path
        name: id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.IndexAdvisorResult'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Get Details of Index Advise
      tags:
      - performance_insight_index_advisor
  /performance_insight/tasks:
    get:
      description: List performance insight tasks.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      - collectionFormat: csv
        description: task status list; if not specified, any status is allowed
        example: created,running,succeeded,failed
        in: query
        items:
          type: string
        name: status
        type: array
      - collectionFormat: csv
        description: task type list; if not specified, any type is allowed
        example: unstable_plan_insight,index_insight,hint_insight
        in: query
        items:
          type: string
        name: types
        type: array
      - default: desc
        description: sort by update time before pagination
        enum:
        - asc
        - desc
        in: query
        name: order_by_update_time
        type: string
      - default: 30
        description: the number of items per page
        in: query
        name: limit
        type: integer
      - default: 1
        description: the page index
        in: query
        name: page
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.ListTaskResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: List Task Overview
      tags:
      - performance_insight_task
    post:
      description: Create a performance insight task for a specific dbaas cluster.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.CreateTaskResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Create Task
      tags:
      - performance_insight_task
  /performance_insight/tasks/{task_id}:
    delete:
      description: cancel a performance insight task.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      - description: cluster id from dbaas
        in: path
        name: task_id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: succeeded
          schema:
            type: string
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Cancel A Task
      tags:
      - performance_insight_task
    get:
      description: Get a performance insight task.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      - description: cluster id from dbaas
        in: path
        name: task_id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.Task'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Get Details of A Task
      tags:
      - performance_insight_task
  /performance_insight/tasks/latest:
    get:
      description: Get the latest performance insight task.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.LatestTaskResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Get Details of the Latest Task
      tags:
      - performance_insight_task
  /performance_insight/tidb_connection:
    delete:
      description: Delete cluster info, task info and all results.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: succeeded
          schema:
            type: string
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Deactivate and Delete All records
      tags:
      - performance_insight_connection
    get:
      description: Check if the cluster is activated
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: bool
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Check if the cluster is activated
      tags:
      - performance_insight_connection
    post:
      description: Submit mysql account and password. Performance insight tasks use
        them to execute sql directly against TiDB cluster.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      - description: mysql account
        in: body
        name: account
        required: true
        schema:
          $ref: '#/definitions/api.SubmitMysqlAccountRequest'
      produces:
      - application/json
      responses:
        "200":
          description: succeeded
          schema:
            type: string
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Activate and Submit MySQL Account/Password
      tags:
      - performance_insight_connection
  /performance_insight/tidb_connection/clinic_outbound_public_addresses:
    get:
      description: Get clinic public addresses, so that customers can add them into
        the ip whitelist.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.GetClinicPublicAddressResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Get Clinic Public Addresses
      tags:
      - performance_insight_connection
  /performance_insight/unstable_plan/statements:
    get:
      description: List statement overview of unstable plan insight results.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      - default: desc
        description: sort by update time before pagination
        enum:
        - asc
        - desc
        in: query
        name: order_by_update_time
        type: string
      - default: 30
        description: the number of items per page
        in: query
        name: limit
        type: integer
      - default: 1
        description: the page index
        in: query
        name: page
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.ListStatementsResponse'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: List Statement Overview
      tags:
      - performance_insight_unstable_plan
  /performance_insight/unstable_plan/statements/{statement_id}:
    get:
      description: Get details of a statement result, including analysis results and
        related plans.
      parameters:
      - description: dbaas user header, added automatically by clinic api-gateway,
          {id:1} encodes to eyJpZCI6MX0=
        in: header
        name: X-CLOUD-USER
        required: true
        type: string
      - description: statement result id
        in: path
        name: statement_id
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.StatementDetails'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "403":
          description: Forbidden
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "404":
          description: Not Found
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "412":
          description: Precondition Failed
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "429":
          description: Too Many Requests
          schema:
            $ref: '#/definitions/error.ErrorResponse'
        "500":
          description: Internal Server Error
          schema:
            $ref: '#/definitions/error.ErrorResponse'
      summary: Get Details of A Statement
      tags:
      - performance_insight_unstable_plan
  /plan_replayer/files:
    get:
      description: download file for plan replayer
      parameters:
      - description: provider aws/gcp
        in: query
        name: provider
        required: true
        type: string
      - description: region
        in: query
        name: region
        required: true
        type: string
      - description: object key
        in: query
        name: key
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: file
      summary: Download file for plan replayer
      tags:
      - plan replayer
  /plan_replayer/list:
    get:
      description: list file info for plan replayer
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: instances, separate by comma
        in: query
        name: instances
        type: string
      - description: start time in unix seconds
        in: query
        name: start
        required: true
        type: string
      - description: end time in unix seconds
        in: query
        name: end
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.ListData'
      summary: List file info for plan replayer
      tags:
      - plan replayer
  /slow_query/analyze:
    get:
      description: Analyze slow logs and write result to victoria metrics
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: dedicated/shared
        in: header
        name: x-deploy-type
        required: true
        type: string
      - description: begin time in unix seconds
        in: query
        name: begin_time
        type: integer
      - description: end time in unix seconds
        in: query
        name: end_time
        required: true
        type: integer
      produces:
      - application/json
      responses: {}
      summary: Analyze slow logs and write result to victoria metrics
      tags:
      - slowquery
  /slow_query/available_fields:
    get:
      description: Get available fields of slow log
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: json
      summary: Get available fields of slow log
      tags:
      - slowquery
  /slow_query/databases:
    get:
      description: Get database list of slow log
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: dedicated/shared
        in: header
        name: x-deploy-type
        required: true
        type: string
      - description: begin time in unix seconds
        in: query
        name: begin_time
        type: integer
      - description: end time in unix seconds
        in: query
        name: end_time
        required: true
        type: integer
      produces:
      - application/json
      responses: {}
      summary: Get database list of slow log
      tags:
      - slowquery
  /slow_query/detail:
    get:
      description: Get detail of slow query
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: dedicated/shared
        in: header
        name: x-deploy-type
        required: true
        type: string
      - description: sql digest to match slow log item
        in: query
        name: digest
        required: true
        type: string
      - description: timestamp to match slow log item
        in: query
        name: timestamp
        required: true
        type: number
      - description: connection id to match slow log item
        in: query
        name: connect_id
        required: true
        type: string
      - description: show internal slow queries
        in: query
        name: show_internal
        type: boolean
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/slowquery.slowLogRespItem'
      summary: Get detail of slow query
      tags:
      - slowquery
  /slow_query/files:
    get:
      description: Download slow query file
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: dedicated/shared
        in: header
        name: x-deploy-type
        required: true
        type: string
      - description: begin time in unix seconds
        in: query
        name: begin_time
        type: integer
      - description: end time in unix seconds
        in: query
        name: end_time
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: file
      summary: Download slow query file
      tags:
      - slowquery
  /slow_query/list:
    get:
      description: Get list of slow query
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: dedicated/shared
        in: header
        name: x-deploy-type
        required: true
        type: string
      - description: begin time in unix seconds
        in: query
        name: begin_time
        type: integer
      - description: end time in unix seconds
        in: query
        name: end_time
        required: true
        type: integer
      - description: fields to return, separated by commas
        in: query
        name: fields
        type: string
      - collectionFormat: csv
        description: database names to search
        in: query
        items:
          type: string
        name: db
        type: array
      - description: result count limit
        in: query
        name: limit
        type: integer
      - description: text to search
        in: query
        name: text
        type: string
      - description: order by which field
        in: query
        name: orderBy
        type: string
      - description: descending order
        in: query
        name: desc
        type: boolean
      - collectionFormat: csv
        description: plan digests to search
        in: query
        items:
          type: string
        name: plans
        type: array
      - description: sql digest to search
        in: query
        name: digest
        type: string
      - description: show internal slow queries
        in: query
        name: show_internal
        type: boolean
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/slowquery.slowLogRespItem'
            type: array
      summary: Get list of slow query
      tags:
      - slowquery
  /slow_query/stats:
    get:
      description: Get slow query statistics
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: hour begin time in unix seconds
        in: query
        name: begin_time
        required: true
        type: integer
      - description: n hours (3/6/12/24/)
        in: query
        name: hours
        required: true
        type: integer
      - collectionFormat: csv
        description: statement types, default empty array for all
        in: query
        items:
          type: string
        name: statement_types
        type: array
      - description: statement types not in, default false
        in: query
        name: statement_types_not_in
        type: boolean
      - description: database name, default empty string for all
        in: query
        name: database
        type: string
      - collectionFormat: csv
        description: database names, default empty array for all
        in: query
        items:
          type: string
        name: databases
        type: array
      - description: order by field, default empty string for count
        in: query
        name: order_by
        type: string
      - description: top limit, default 10
        in: query
        name: limit
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: json
      summary: Get slow query statistics
      tags:
      - slowquery
  /slow_query/stats/databases:
    get:
      description: Get slow query statistics database list
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: hour begin time in unix seconds
        in: query
        name: begin_time
        required: true
        type: integer
      - description: n hours (3/6/12/24/)
        in: query
        name: hours
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: json
      summary: Get slow query statistics database list
      tags:
      - slowquery
  /slow_query/stats/metric:
    get:
      description: Get slow query statistics metric
      parameters:
      - description: provider aws/gcp
        in: header
        name: x-provider
        required: true
        type: string
      - description: region
        in: header
        name: x-region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: x-org-id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: x-project-id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: x-cluster-id
        required: true
        type: string
      - description: hour begin time in unix seconds
        in: query
        name: begin_time
        required: true
        type: integer
      - description: n hours (3/6/12/24/)
        in: query
        name: hours
        required: true
        type: integer
      - description: e.g. count_per_minute (default)
        in: query
        name: metric_name
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            type: json
      summary: Get slow query statistics metric
      tags:
      - slowquery
  /statements/available_fields:
    get:
      description: get available fields of Statements
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: 'deploy type: dedicated/shared/serverless/premium/nextgen/nextgen-host/byoc/byoc-host'
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              type: string
            type: array
      summary: Get available fields of Statements
      tags:
      - statements
  /statements/datasource:
    get:
      description: Proxies to O11Y GET /internal/diagnosis/api/v1/statements/datasource.
        Use before querying with data_source=v2.
      operationId: getStatementsDatasource
      parameters:
      - description: Cloud provider
        in: header
        name: X-Provider
        required: true
        type: string
      - description: Cloud region
        in: header
        name: X-Region
        required: true
        type: string
      - description: Organization ID
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: Project ID
        in: header
        name: X-Project-Id
        type: string
      - description: Cluster ID
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: Deployment tier
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/statements.StatementsDatasourceResponse'
      summary: Probe the Statements V2 datasource
      tags:
      - statements
  /statements/field_values:
    get:
      description: Transparently proxies the complete query string to O11Y GET /internal/diagnosis/api/v1/statements/field_values.
      operationId: getStatementFieldValues
      parameters:
      - description: Cloud provider
        in: header
        name: X-Provider
        required: true
        type: string
      - description: Cloud region
        in: header
        name: X-Region
        required: true
        type: string
      - description: Organization ID
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: Project ID
        in: header
        name: X-Project-Id
        type: string
      - description: Cluster ID
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: Deployment tier
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: Start time in Unix seconds
        in: query
        name: begin_time
        required: true
        type: integer
      - description: End time in Unix seconds
        in: query
        name: end_time
        required: true
        type: integer
      - description: Field name
        in: query
        name: field
        required: true
        type: string
      - description: Maximum number of distinct values
        in: query
        name: limit
        type: integer
      - collectionFormat: multi
        description: Schema filters
        in: query
        items:
          type: string
        name: schemas
        type: array
      - collectionFormat: multi
        description: Statement type filters
        in: query
        items:
          type: string
        name: stmt_types
        type: array
      - description: Datasource selector (v2)
        in: query
        name: data_source
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              type: string
            type: array
      summary: Get distinct Statement field values
      tags:
      - statements
  /statements/list:
    get:
      description: list overview of Statements
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: 'deploy type: dedicated/shared/serverless/premium/nextgen/nextgen-host/byoc/byoc-host'
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: begin time, unix timestamp
        in: query
        name: begin_time
        required: true
        type: integer
      - description: end time, unix timestamp
        in: query
        name: end_time
        required: true
        type: integer
      - collectionFormat: csv
        description: filter by schemas
        in: query
        items:
          type: string
        name: schemas
        type: array
      - collectionFormat: csv
        description: filter by stmt_types
        in: query
        items:
          type: string
        name: stmt_types
        type: array
      - description: filter by text
        in: query
        name: text
        type: string
      - description: fields to return, separated by comma
        in: query
        name: fields
        type: string
      - description: set to v2 to use the Statements V2 O11Y datasource
        in: query
        name: data_source
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/api.Model'
            type: array
      summary: List overview of Statements
      tags:
      - statements
  /statements/plan/detail:
    get:
      description: get details of plans of the certain statement
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: 'deploy type: dedicated/shared/serverless/premium/nextgen/nextgen-host/byoc/byoc-host'
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: begin time, unix timestamp
        in: query
        name: begin_time
        required: true
        type: integer
      - description: end time, unix timestamp
        in: query
        name: end_time
        required: true
        type: integer
      - description: the digest of the statement
        in: query
        name: digest
        required: true
        type: string
      - collectionFormat: csv
        description: the plan digests of the statement
        in: query
        items:
          type: string
        name: plans
        required: true
        type: array
      - description: filter by schema name
        in: query
        name: schema_name
        type: string
      - description: set to v2 to use the Statements V2 O11Y datasource
        in: query
        name: data_source
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.Model'
      summary: Get details of plans of the certain statement
      tags:
      - statements
  /statements/plans:
    get:
      description: get certain statement
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: 'deploy type: dedicated/shared/serverless/premium/nextgen/nextgen-host/byoc/byoc-host'
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: begin time, unix timestamp
        in: query
        name: begin_time
        required: true
        type: integer
      - description: end time, unix timestamp
        in: query
        name: end_time
        required: true
        type: integer
      - description: the digest of the statement
        in: query
        name: digest
        required: true
        type: string
      - description: filter by schema name
        in: query
        name: schema_name
        type: string
      - description: set to v2 to use the Statements V2 O11Y datasource
        in: query
        name: data_source
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/api.Model'
            type: array
      summary: Get certain statement
      tags:
      - statements
  /statements/stmt_types:
    get:
      description: get statement types of Statements
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: 'deploy type: dedicated/shared/serverless/premium/nextgen/nextgen-host/byoc/byoc-host'
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              type: string
            type: array
      summary: Get statement types of Statements
      tags:
      - statements
  /statements/summary:
    get:
      description: Transparently proxies the complete query string to O11Y GET /internal/diagnosis/api/v1/statements/summary.
      operationId: getStatementsSummary
      parameters:
      - description: Cloud provider
        in: header
        name: X-Provider
        required: true
        type: string
      - description: Cloud region
        in: header
        name: X-Region
        required: true
        type: string
      - description: Organization ID
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: Project ID
        in: header
        name: X-Project-Id
        type: string
      - description: Cluster ID
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: Deployment tier
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: Start time in Unix seconds
        in: query
        name: begin_time
        required: true
        type: integer
      - description: End time in Unix seconds
        in: query
        name: end_time
        required: true
        type: integer
      - collectionFormat: multi
        description: Schema filters
        in: query
        items:
          type: string
        name: schemas
        type: array
      - collectionFormat: multi
        description: Statement type filters
        in: query
        items:
          type: string
        name: stmt_types
        type: array
      - description: Top N results
        in: query
        name: top
        type: integer
      - description: Sort metric
        in: query
        name: order_by
        type: string
      - description: Grouping dimension
        in: query
        name: dimension
        type: string
      - description: Time bucket size in seconds
        in: query
        name: step
        type: integer
      - description: Datasource selector (v2)
        in: query
        name: data_source
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
      summary: Get Statement summary statistics
      tags:
      - statements
  /statements/topstats:
    get:
      description: Transparently proxies the complete query string to O11Y GET /internal/diagnosis/api/v1/statements/topstats.
      operationId: getStatementsTopStats
      parameters:
      - description: Cloud provider
        in: header
        name: X-Provider
        required: true
        type: string
      - description: Cloud region
        in: header
        name: X-Region
        required: true
        type: string
      - description: Organization ID
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: Project ID
        in: header
        name: X-Project-Id
        type: string
      - description: Cluster ID
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: Deployment tier
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: Start time in Unix seconds
        in: query
        name: begin_time
        required: true
        type: integer
      - description: End time in Unix seconds
        in: query
        name: end_time
        required: true
        type: integer
      - description: Top N results
        in: query
        name: top
        type: integer
      - description: Grouping dimension
        in: query
        name: dimension
        type: string
      - description: Sort metric
        in: query
        name: order_by
        type: string
      - description: Datasource selector (v2)
        in: query
        name: data_source
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
      summary: Get Statement top statistics
      tags:
      - statements
  /topru/config:
    get:
      description: |-
        TopRU is always enabled when using Delta Lake data source (O11Y diagnosisqueryswagger GET /topru/config).
        Clinic forwards to O11Y `GET /internal/diagnosis/api/v1/topru/config`. Cluster headers are required by Clinic to resolve the O11Y internal read endpoint; query string is passed through.
        Reference: https://github.com/tidbcloud/observability/blob/5c791d4717fe9fb90f26c0513444fb70a4e4957e/api/diagnosisqueryswagger/swagger.yaml
      operationId: getTopRUConfig
      parameters:
      - description: Cloud provider where RU data is stored (aws/gcp/azure); required
          by Clinic for cluster resolution
        in: header
        name: X-Provider
        required: true
        type: string
      - description: Cloud region; required by Clinic for cluster resolution
        in: header
        name: X-Region
        required: true
        type: string
      - description: Organization ID (x-org-id)
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: Project ID (x-project-id; optional)
        in: header
        name: X-Project-Id
        type: string
      - description: Cluster ID (x-cluster-id)
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: 'Deployment tier: dedicated/shared/nextgen/premium (and BYOC
          variants supported by Clinic)'
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/topru.ConfigResponse'
      summary: Get config of TopRU
      tags:
      - topru
  /topru/summary:
    get:
      description: |-
        Aggregate ReadUnits (RU) grouped by sql_digest within the given time range. Plans are collapsed into one row per digest. Use /topru/summaryplan?digest=... for plan breakdown. Proxies to O11Y `GET /internal/diagnosis/api/v1/topru/summary`.
        Reference: https://github.com/tidbcloud/observability/blob/5c791d4717fe9fb90f26c0513444fb70a4e4957e/api/diagnosisqueryswagger/swagger.yaml
      operationId: getTopRUSummary
      parameters:
      - description: Cloud provider where RU data is stored (aws/gcp/azure)
        in: header
        name: X-Provider
        required: true
        type: string
      - description: Cloud region where RU data is stored
        in: header
        name: X-Region
        required: true
        type: string
      - description: Organization ID (x-org-id)
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: Project ID (x-project-id; optional)
        in: header
        name: X-Project-Id
        type: string
      - description: Cluster ID (x-cluster-id)
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: 'Deployment tier: dedicated/shared/nextgen/premium'
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: Start time in Unix seconds (inclusive)
        in: query
        name: start
        required: true
        type: string
      - description: End time in Unix seconds (inclusive)
        in: query
        name: end
        required: true
        type: string
      - description: Top N SQL digests to return
        in: query
        name: top
        required: true
        type: string
      - description: 'Metric used to rank results: ru | exec_count | duration (default:
          ru)'
        in: query
        name: order_by
        type: string
      - description: Omit to not filter by user. Pass empty (user=) for empty/NULL
          user only; pass a name to filter by that user
        in: query
        name: user
        type: string
      - description: 'Data source identifier (expected: deltalake)'
        in: query
        name: data_source
        type: string
      - description: 'Bucket size in seconds. Default: 60'
        in: query
        name: step
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/topru.SummaryEnvelope'
      summary: Get TopRU summary (RU by SQL digest)
      tags:
      - topru
  /topru/summaryplan:
    get:
      description: |-
        Aggregate ReadUnits (RU) grouped by sql_digest and plan_digest. Optionally filter to one sql_digest via digest=. Proxies to O11Y `GET /internal/diagnosis/api/v1/topru/summaryplan`.
        Reference: https://github.com/tidbcloud/observability/blob/5c791d4717fe9fb90f26c0513444fb70a4e4957e/api/diagnosisqueryswagger/swagger.yaml
      operationId: getTopRUSummaryPlan
      parameters:
      - description: Cloud provider where RU data is stored (aws/gcp/azure)
        in: header
        name: X-Provider
        required: true
        type: string
      - description: Cloud region where RU data is stored
        in: header
        name: X-Region
        required: true
        type: string
      - description: Organization ID (x-org-id)
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: Project ID (x-project-id; optional)
        in: header
        name: X-Project-Id
        type: string
      - description: Cluster ID (x-cluster-id)
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: 'Deployment tier: dedicated/shared/nextgen/premium'
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: Start time in Unix seconds (inclusive)
        in: query
        name: start
        required: true
        type: string
      - description: End time in Unix seconds (inclusive)
        in: query
        name: end
        required: true
        type: string
      - description: Top N SQL/plan groups to return
        in: query
        name: top
        required: true
        type: string
      - description: Filter to a single sql_digest (drill-down from /topru/summary)
        in: query
        name: digest
        type: string
      - description: 'Metric used to rank results: ru | exec_count | duration (default:
          ru)'
        in: query
        name: order_by
        type: string
      - description: Omit to not filter by user. Pass empty (user=) for empty/NULL
          user only; pass a name to filter by that user
        in: query
        name: user
        type: string
      - description: 'Data source identifier (expected: deltalake)'
        in: query
        name: data_source
        type: string
      - description: 'Bucket size in seconds. Default: 60'
        in: query
        name: step
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/topru.SummaryPlanEnvelope'
      summary: Get TopRU summary by plan (RU by SQL/plan digest)
      tags:
      - topru
  /topru/user_stats:
    get:
      description: |-
        Aggregate RU and execution stats grouped by user over the given time range. Proxies to O11Y `GET /internal/diagnosis/api/v1/topru/user_stats`.
        Reference: https://github.com/tidbcloud/observability/blob/5c791d4717fe9fb90f26c0513444fb70a4e4957e/api/diagnosisqueryswagger/swagger.yaml
      operationId: getTopRUUserStats
      parameters:
      - description: Cloud provider where RU data is stored (aws/gcp/azure)
        in: header
        name: X-Provider
        required: true
        type: string
      - description: Cloud region where RU data is stored
        in: header
        name: X-Region
        required: true
        type: string
      - description: Organization ID (x-org-id)
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: Project ID (x-project-id; optional)
        in: header
        name: X-Project-Id
        type: string
      - description: Cluster ID (x-cluster-id)
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: Deployment tier
        in: header
        name: X-Deploy-Type
        required: true
        type: string
      - description: Start time in Unix seconds (inclusive)
        in: query
        name: start
        required: true
        type: string
      - description: End time in Unix seconds (inclusive)
        in: query
        name: end
        required: true
        type: string
      - description: 'Top N users to return (default: 20)'
        in: query
        name: top
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/topru.UserStatsEnvelope'
      summary: Get TopRU user statistics (RU per user)
      tags:
      - topru
  /topsql/config:
    get:
      description: get config of TopSQL
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/topsql.configResponse'
      summary: Get config of TopSQL
      tags:
      - topsql
  /topsql/instances:
    get:
      description: get available instances of TopSQL
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: start time in unix seconds
        in: query
        name: start
        required: true
        type: string
      - description: end time in unix seconds
        in: query
        name: end
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            allOf:
            - $ref: '#/definitions/topsql.jsonResponse'
            - properties:
                data:
                  items:
                    $ref: '#/definitions/api.InstanceItem'
                  type: array
              type: object
      summary: Get available instances of TopSQL
      tags:
      - topsql
  /topsql/summary:
    get:
      description: get summary of TopSQL
      parameters:
      - description: provider aws/gcp
        in: header
        name: X-Provider
        required: true
        type: string
      - description: region
        in: header
        name: X-Region
        required: true
        type: string
      - description: organization id from dbaas
        in: header
        name: X-Org-Id
        required: true
        type: string
      - description: project id from dbaas
        in: header
        name: X-Project-Id
        required: true
        type: string
      - description: cluster id from dbaas
        in: header
        name: X-Cluster-Id
        required: true
        type: string
      - description: start time in unix seconds
        in: query
        name: start
        required: true
        type: string
      - description: end time in unix seconds
        in: query
        name: end
        required: true
        type: string
      - description: window in duration
        in: query
        name: window
        required: true
        type: string
      - description: top n
        in: query
        name: top
        required: true
        type: integer
      - description: instance name
        in: query
        name: instance
        required: true
        type: string
      - description: instance type
        in: query
        name: instance_type
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            allOf:
            - $ref: '#/definitions/topsql.jsonResponse'
            - properties:
                data:
                  items:
                    $ref: '#/definitions/api.SummaryItem'
                  type: array
              type: object
      summary: Get summary of TopSQL
      tags:
      - topsql
swagger: "2.0"
