basePath: /api/v1
definitions:
  formatter.JUnitFailure:
    properties:
      contents:
        type: string
      message:
        type: string
      type:
        type: string
    type: object
  formatter.JUnitProperty:
    properties:
      name:
        type: string
      value:
        type: string
    type: object
  formatter.JUnitSkipMessage:
    properties:
      message:
        type: string
    type: object
  formatter.JUnitTestCase:
    properties:
      classname:
        type: string
      failure:
        $ref: '#/definitions/formatter.JUnitFailure'
      name:
        type: string
      skipMessage:
        $ref: '#/definitions/formatter.JUnitSkipMessage'
      time:
        type: string
      xmlname:
        $ref: '#/definitions/xml.Name'
    type: object
  formatter.JUnitTestSuite:
    properties:
      failures:
        type: integer
      name:
        type: string
      properties:
        items:
          $ref: '#/definitions/formatter.JUnitProperty'
        type: array
      testCases:
        items:
          $ref: '#/definitions/formatter.JUnitTestCase'
        type: array
      tests:
        type: integer
      time:
        type: string
      xmlname:
        $ref: '#/definitions/xml.Name'
    type: object
  formatter.JUnitTestSuites:
    properties:
      suites:
        items:
          $ref: '#/definitions/formatter.JUnitTestSuite'
        type: array
      xmlname:
        $ref: '#/definitions/xml.Name'
    type: object
  handler.AffectedVersionCase:
    properties:
      name:
        type: string
      versions:
        items:
          $ref: '#/definitions/handler.AffectedVersionCaseStatus'
        type: array
    type: object
  handler.AffectedVersionCaseStatus:
    properties:
      status:
        type: string
      version:
        type: string
    type: object
  handler.GetAffectedVersionCasesResponse:
    properties:
      cases:
        items:
          $ref: '#/definitions/handler.AffectedVersionCase'
        type: array
      trigger:
        $ref: '#/definitions/model.TestTrigger'
        description: Trigger is the metadata for the trigger.
    type: object
  handler.GetTriggerStatusForDailyCIResp:
    properties:
      finished:
        type: boolean
    type: object
  handler.HTTPError:
    properties:
      errors:
        $ref: '#/definitions/service.Error'
    type: object
  handler.TriggerTestsResp:
    properties:
      id:
        type: integer
      triggeredCount:
        type: integer
    type: object
  model.CPUResource:
    properties:
      core:
        type: number
    type: object
  model.CaseExecutionListResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.TestCaseExecution'
        type: array
      total:
        type: integer
    type: object
  model.CaseListResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.TestCase'
        type: array
      total:
        type: integer
    type: object
  model.CaseParamBind:
    properties:
      name:
        type: string
      value:
        type: string
    type: object
  model.CaseParamDecl:
    properties:
      default:
        type: string
      name:
        type: string
      type:
        default: STRING
        type: string
    type: object
  model.CaseSearchResponse:
    properties:
      data:
        items:
          properties:
            _formatted:
              $ref: '#/definitions/model.TestCase'
            automation:
              default: NOT_AUTOMATED
              type: string
            category:
              default: FUNCTIONALITY
              type: string
            createdAt:
              type: string
            email:
              type: string
            expectedResult:
              type: string
            framework:
              $ref: '#/definitions/model.FrameworkUnion'
            id:
              description: additional Meta
              type: integer
            name:
              type: string
            parameters:
              items:
                $ref: '#/definitions/model.CaseParamDecl'
              type: array
            preconditions:
              type: string
            priority:
              default: P1
              type: string
            steps:
              type: string
            summary:
              type: string
            supportedVersions:
              items:
                type: string
              type: array
            tags:
              items:
                type: string
              type: array
            updatedAt:
              type: string
          type: object
        type: array
      total:
        type: integer
    type: object
  model.CaseTriage:
    properties:
      caseExecutionID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      caseID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      createdAt:
        type: string
      forkedFrom:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      id:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      issueLink:
        type: string
      note:
        type: string
      planExecutionID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      planID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      reason:
        type: string
      solution:
        type: string
      updatedAt:
        type: string
    type: object
  model.CaseTriageSummary:
    properties:
      case:
        $ref: '#/definitions/model.TestCase'
      execution:
        $ref: '#/definitions/model.TestCaseExecution'
      triage:
        $ref: '#/definitions/model.CaseTriage'
    type: object
  model.DailySummary:
    properties:
      caseSummary:
        $ref: '#/definitions/model.DailySummaryDetails'
      date:
        type: string
      planSummary:
        $ref: '#/definitions/model.DailySummaryDetails'
    type: object
  model.DailySummaryDetails:
    properties:
      failReasonSummary:
        additionalProperties:
          type: integer
        type: object
      failureExecIDIncreased:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
      statusSummary:
        additionalProperties:
          type: integer
        type: object
    type: object
  model.ExecutionMeta:
    additionalProperties:
      type: string
    type: object
  model.FrameworkUnion:
    properties:
      generic:
        $ref: '#/definitions/model.GenericFrameworkSpec'
    type: object
  model.GenericFrameworkSpec:
    properties:
      command:
        items:
          type: string
        minItems: 1
        type: array
      defaultTimeout:
        type: integer
      env:
        additionalProperties:
          type: string
        type: object
      image:
        type: string
      imagePullPolicy:
        default: Always
        type: string
      workingDir:
        default: /
        type: string
    required:
    - image
    type: object
  model.GetPlanExecSummaryResponse:
    properties:
      caseExecFailureCnt:
        type: integer
      caseExecTotal:
        type: integer
      caseTriageSummaries:
        items:
          $ref: '#/definitions/model.CaseTriageSummary'
        type: array
      id:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      planExec:
        $ref: '#/definitions/model.TestPlanExecution'
      planTriage:
        $ref: '#/definitions/model.Triage'
    type: object
  model.GetReleaseSummaryResponse:
    properties:
      caseExecFailureCnt:
        type: integer
      caseExecTotal:
        type: integer
      errorPlanExecsSummary:
        items:
          $ref: '#/definitions/model.GetPlanExecSummaryResponse'
        type: array
      failedPlanExecsSummary:
        items:
          $ref: '#/definitions/model.GetPlanExecSummaryResponse'
        type: array
      planExecErrorCnt:
        type: integer
      planExecFailureCnt:
        type: integer
      planExecTotal:
        type: integer
    type: object
  model.HistoryRecord:
    properties:
      action:
        type: string
      createdAt:
        type: string
      email:
        type: string
      id:
        description: additional Meta
        type: integer
      revision:
        description: additional Meta
        type: integer
    type: object
  model.ListReleasePlansResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.TestPlanWithTriggerred'
        type: array
      total:
        type: integer
    type: object
  model.MemoryResource:
    properties:
      byte:
        type: integer
    type: object
  model.PersonalAccessTokenInfo:
    properties:
      createdAt:
        type: string
      id:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      lastUsedAt:
        type: string
      name:
        type: string
      scopes:
        type: string
      updatedAt:
        type: string
      user:
        $ref: '#/definitions/model.User'
      userID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
    type: object
  model.PersonalAccessTokenInfoListResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.PersonalToken'
        type: array
      total:
        type: integer
    type: object
  model.PersonalToken:
    properties:
      createdAt:
        type: string
      id:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      lastUsedAt:
        type: string
      name:
        type: string
      scopes:
        type: string
      updatedAt:
        type: string
      userID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
    type: object
  model.PhysicalResource:
    properties:
      cpu:
        $ref: '#/definitions/model.CPUResource'
      memory:
        $ref: '#/definitions/model.MemoryResource'
    type: object
  model.PipelineStep:
    properties:
      after:
        description: |-
          After is the list of pipeline-steps that this pipeline-step depends on.
          NOTE: `after` is forbidden for `steps`, only `pipeline` can use it.
        items:
          type: string
        type: array
      arguments:
        items:
          $ref: '#/definitions/model.CaseParamBind'
        type: array
      caseID:
        description: additional Meta
        type: integer
      caseImage:
        type: string
      caseName:
        type: string
      name:
        type: string
      timeout:
        type: integer
    type: object
  model.PlanCreateResponse:
    properties:
      branch:
        description: Branch is the master part on above example
        type: string
      commit:
        description: |-
          CommitHash is the 7dae1d3 part for example

          We uses the commit hash for data integrity and idempotent, since we don't need to
          decide how to remove a add/deleted/update a pipeline.
        type: string
      commitTs:
        description: CommitTs is the commit unix nano timestamp
        type: integer
      createdAt:
        description: If specified, will fail this plan-execution if any of its child
          case-executions has failed.
        type: string
      email:
        type: string
      failFast:
        description: If specified, will fail this plan-execution if any of its child
          case-executions has failed.
        type: boolean
      id:
        type: integer
      metaParams:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      name:
        description: |-
          For the GitHub Plan, name is in the format of: $plan_name@$branch
          For the OnShot Plan, name is no need
        type: string
      path:
        description: Path is the tidb/sql-infra/ddl/shard-bits.daily.yaml part for
          example
        type: string
      pipeline:
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      planExecutionURL:
        description: Only oneshot plan has this field.
        type: string
      repo:
        description: Repo is the pingcap/test-plan part for example, it's reserved
          and may use in the future
        type: string
      schedule:
        description: Cron Schedule
        type: string
      steps:
        description: Steps is a pipeline that executes serially. Incompatible with
          `Pipeline`.
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      tags:
        description: Tags is used to selected TestPlan, for example, release manager
          can tag one plan as ["release"] so that this one should be selected when
          release test
        items:
          type: string
        type: array
      testbed:
        $ref: '#/definitions/model.TestBed'
      type:
        default: ONE_SHOT
        type: string
      updatedAt:
        type: string
      variables:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      waitTimeout:
        description: todo maybe should be in exec, but use can set here for one-shot
          plan
        type: integer
    type: object
  model.PlanExecutionSearchResponse:
    properties:
      data:
        items:
          properties:
            _formatted:
              $ref: '#/definitions/model.TestPlanExecution'
            argoURL:
              description: 'TODO(lijie,gaozifeng): Write argo url to plan-execution
                table.'
              type: string
            completedAt:
              description: 'TODO: Change type to `time.Time`.'
              type: integer
            createdAt:
              description: 'TODO: Change type to `time.Time`.'
              type: integer
            email:
              type: string
            id:
              type: integer
            meta:
              $ref: '#/definitions/model.ExecutionMeta'
            metaParams:
              items:
                $ref: '#/definitions/model.PlanVarBind'
              type: array
            name:
              type: string
            note:
              type: string
            output:
              type: string
            planID:
              description: 'Deprecated: Use PlanIDAndName.ID instead.'
              type: integer
            priority:
              default: 0
              description: Only for GITHUB type
              type: integer
            reason:
              type: string
            rerunID:
              description: The execution ID that it reruns. Empty if it's not a rerun
                execution.
              type: integer
            retryCnt:
              type: integer
            startedAt:
              description: 'TODO: Change type to `time.Time`.'
              type: integer
            status:
              type: string
            steps:
              description: The plan-steps to run.
              items:
                type: string
              type: array
            triggerID:
              description: 'Deprecated: Use PlanIDAndName.ID instead.'
              type: integer
            updatedAt:
              type: string
            variables:
              items:
                $ref: '#/definitions/model.PlanVarBind'
              type: array
          type: object
        type: array
      total:
        type: integer
    type: object
  model.PlanListResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.TestPlan'
        type: array
      total:
        type: integer
    type: object
  model.PlanVarBind:
    properties:
      name:
        type: string
      value:
        type: string
    type: object
  model.PlanVarDecl:
    properties:
      default:
        type: string
      name:
        type: string
    type: object
  model.RMS:
    properties:
      createdAt:
        type: string
      endpoint:
        type: string
      id:
        description: The execution ID that it reruns. Empty if it's not a rerun execution.
        type: integer
      name:
        type: string
      token:
        type: string
      updatedAt:
        type: string
    type: object
  model.ResourceDuration:
    properties:
      cpuDuration:
        description: 'unit: hour * 1 core'
        type: integer
      createdAt:
        type: string
      id:
        description: The execution ID that it reruns. Empty if it's not a rerun execution.
        type: integer
      memoryDuration:
        description: 'unit: hour * 1 GB'
        type: integer
      planExecutionID:
        description: The execution ID that it reruns. Empty if it's not a rerun execution.
        type: integer
      type:
        type: string
      updatedAt:
        type: string
    type: object
  model.ResourcePool:
    properties:
      aliases:
        type: string
      createdAt:
        type: string
      id:
        description: The execution ID that it reruns. Empty if it's not a rerun execution.
        type: integer
      idleResource:
        $ref: '#/definitions/model.PhysicalResource'
      name:
        type: string
      nonTestbedOccupationResource:
        $ref: '#/definitions/model.PhysicalResource'
      rmsName:
        type: string
      rmsURL:
        type: string
      totalResource:
        $ref: '#/definitions/model.PhysicalResource'
      updatedAt:
        type: string
    type: object
  model.ResourcePoolListResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.ResourcePool'
        type: array
      total:
        type: integer
    type: object
  model.TestBed:
    properties:
      generateName:
        description: |-
          GenerateName is an optional prefix, used by the RMS server, to generate a unique
          name ONLY IF the Name field has not been provided.
        type: string
      items:
        items:
          $ref: '#/definitions/model.TestBedItem'
        type: array
      name:
        description: Name can be generated by scheduler from GenerateName
        type: string
      physicalResourceRequest:
        $ref: '#/definitions/model.PhysicalResource'
        description: If left empty, scheduler will try to estimate it
      qos:
        items:
          $ref: '#/definitions/resource.QosClaim'
        type: array
      reclaimPolicy:
        $ref: '#/definitions/resource.ReclaimPolicy'
        description: ReclaimPolicy shows how to clean the whole testbed resources
      resourcePool:
        default: default
        description: ResourcePool can be re-written by scheduler
        type: string
      rmsUrl:
        description: RmsUrl is the url added by scheduler and used by executor
        type: string
    type: object
  model.TestBedInfo:
    properties:
      createdAt:
        type: string
      id:
        description: The execution ID that it reruns. Empty if it's not a rerun execution.
        type: integer
      initiatedAt:
        type: string
      leaseDDL:
        description: |-
          LeaseDDL is the time when a testbed will be released
          LeaseDDL = CreatedAt + ReclaimPolicy.Lease
        type: string
      name:
        type: string
      physicalResourceRequest:
        $ref: '#/definitions/model.PhysicalResource'
      planExecutionID:
        description: The execution ID that it reruns. Empty if it's not a rerun execution.
        type: integer
      releasedAt:
        type: string
      releasedBy:
        description: The execution ID that it reruns. Empty if it's not a rerun execution.
        type: integer
      resourceItems:
        items:
          $ref: '#/definitions/model.TestBedInfoResourceItem'
        type: array
      resourcePool:
        $ref: '#/definitions/model.ResourcePool'
      setUpLogURL:
        type: string
      status:
        description: TestBedInfoStatus = {"INITIATING", "READY", "RELEASED", "ERROR"}
        type: string
      type:
        type: string
      updatedAt:
        type: string
      url:
        description: URL is the url to the testbed.
        type: string
    type: object
  model.TestBedInfoListResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.TestBedInfo'
        type: array
      total:
        type: integer
    type: object
  model.TestBedInfoResourceItem:
    properties:
      details:
        $ref: '#/definitions/resource.Details'
      name:
        description: Name is the name of the test resource
        maxLength: 255
        type: string
      provider:
        description: Provider indicates the name of provider who creates the resource.
        type: string
      ready:
        description: Ready identifies whether the test resource is in the ready state,
          it's generated on the RMS server side
        type: boolean
      testbed:
        description: Testbed is the name of test resource's testbed and it's required
          unless the Type value equals to TEST_BED
        type: string
      type:
        description: Type is the resource type
        type: string
    required:
    - type
    type: object
  model.TestBedItem:
    properties:
      name:
        description: Name is the name of the test resource
        maxLength: 255
        type: string
      provider:
        description: Provider indicates the name of provider who creates the resource.
        type: string
      qos:
        description: Qos is the quality of service on test resource
        items:
          type: integer
        type: array
      ready:
        description: Ready identifies whether the test resource is in the ready state,
          it's generated on the RMS server side
        type: boolean
      spec:
        description: |-
          Spec is the specification of test resource
          TODO(@mahjonp): add a validator(used on the TCMS server)
        items:
          type: integer
        type: array
      testbed:
        description: Testbed is the name of test resource's testbed and it's required
          unless the Type value equals to TEST_BED
        type: string
      type:
        description: Type is the resource type
        type: string
    required:
    - type
    type: object
  model.TestCase:
    properties:
      automation:
        default: NOT_AUTOMATED
        type: string
      category:
        default: FUNCTIONALITY
        type: string
      createdAt:
        type: string
      email:
        type: string
      expectedResult:
        type: string
      framework:
        $ref: '#/definitions/model.FrameworkUnion'
      id:
        description: additional Meta
        type: integer
      name:
        type: string
      parameters:
        items:
          $ref: '#/definitions/model.CaseParamDecl'
        type: array
      preconditions:
        type: string
      priority:
        default: P1
        type: string
      steps:
        type: string
      summary:
        type: string
      supportedVersions:
        items:
          type: string
        type: array
      tags:
        items:
          type: string
        type: array
      updatedAt:
        type: string
    type: object
  model.TestCaseBase:
    properties:
      framework:
        $ref: '#/definitions/model.FrameworkUnion'
      name:
        type: string
      parameters:
        items:
          $ref: '#/definitions/model.CaseParamDecl'
        type: array
    type: object
  model.TestCaseExecution:
    properties:
      argoURL:
        description: 'TODO(lijie,gaozifeng): Write argo url to plan-execution table.'
        type: string
      caseID:
        description: additional Meta
        type: integer
      completedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      createdAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      id:
        description: additional Meta
        type: integer
      meta:
        $ref: '#/definitions/model.ExecutionMeta'
      name:
        type: string
      note:
        type: string
      output:
        type: string
      reason:
        type: string
      rootPlanExecID:
        description: additional Meta
        type: integer
      rootPlanID:
        description: additional Meta
        type: integer
      startedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      status:
        type: string
      stepName:
        type: string
      stepSeq:
        type: integer
      updatedAt:
        type: string
    type: object
  model.TestPlan:
    properties:
      branch:
        description: Branch is the master part on above example
        type: string
      commit:
        description: |-
          CommitHash is the 7dae1d3 part for example

          We uses the commit hash for data integrity and idempotent, since we don't need to
          decide how to remove a add/deleted/update a pipeline.
        type: string
      commitTs:
        description: CommitTs is the commit unix nano timestamp
        type: integer
      createdAt:
        description: If specified, will fail this plan-execution if any of its child
          case-executions has failed.
        type: string
      email:
        type: string
      failFast:
        description: If specified, will fail this plan-execution if any of its child
          case-executions has failed.
        type: boolean
      id:
        type: integer
      metaParams:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      name:
        description: |-
          For the GitHub Plan, name is in the format of: $plan_name@$branch
          For the OnShot Plan, name is no need
        type: string
      path:
        description: Path is the tidb/sql-infra/ddl/shard-bits.daily.yaml part for
          example
        type: string
      pipeline:
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      repo:
        description: Repo is the pingcap/test-plan part for example, it's reserved
          and may use in the future
        type: string
      schedule:
        description: Cron Schedule
        type: string
      steps:
        description: Steps is a pipeline that executes serially. Incompatible with
          `Pipeline`.
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      tags:
        description: Tags is used to selected TestPlan, for example, release manager
          can tag one plan as ["release"] so that this one should be selected when
          release test
        items:
          type: string
        type: array
      testbed:
        $ref: '#/definitions/model.TestBed'
      type:
        default: ONE_SHOT
        type: string
      updatedAt:
        type: string
      variables:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      waitTimeout:
        description: todo maybe should be in exec, but use can set here for one-shot
          plan
        type: integer
    type: object
  model.TestPlanExecution:
    properties:
      argoURL:
        description: 'TODO(lijie,gaozifeng): Write argo url to plan-execution table.'
        type: string
      completedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      createdAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      email:
        type: string
      id:
        type: integer
      meta:
        $ref: '#/definitions/model.ExecutionMeta'
      metaParams:
        items:
          $ref: '#/definitions/model.PlanVarBind'
        type: array
      name:
        type: string
      note:
        type: string
      output:
        type: string
      planID:
        description: 'Deprecated: Use PlanIDAndName.ID instead.'
        type: integer
      priority:
        default: 0
        description: Only for GITHUB type
        type: integer
      reason:
        type: string
      rerunID:
        description: The execution ID that it reruns. Empty if it's not a rerun execution.
        type: integer
      retryCnt:
        type: integer
      startedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      status:
        type: string
      steps:
        description: The plan-steps to run.
        items:
          type: string
        type: array
      triggerID:
        description: 'Deprecated: Use PlanIDAndName.ID instead.'
        type: integer
      updatedAt:
        type: string
      variables:
        items:
          $ref: '#/definitions/model.PlanVarBind'
        type: array
    type: object
  model.TestPlanWithTriggerred:
    properties:
      branch:
        description: Branch is the master part on above example
        type: string
      commit:
        description: |-
          CommitHash is the 7dae1d3 part for example

          We uses the commit hash for data integrity and idempotent, since we don't need to
          decide how to remove a add/deleted/update a pipeline.
        type: string
      commitTs:
        description: CommitTs is the commit unix nano timestamp
        type: integer
      createdAt:
        description: If specified, will fail this plan-execution if any of its child
          case-executions has failed.
        type: string
      email:
        type: string
      failFast:
        description: If specified, will fail this plan-execution if any of its child
          case-executions has failed.
        type: boolean
      id:
        type: integer
      metaParams:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      name:
        description: |-
          For the GitHub Plan, name is in the format of: $plan_name@$branch
          For the OnShot Plan, name is no need
        type: string
      path:
        description: Path is the tidb/sql-infra/ddl/shard-bits.daily.yaml part for
          example
        type: string
      pipeline:
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      repo:
        description: Repo is the pingcap/test-plan part for example, it's reserved
          and may use in the future
        type: string
      schedule:
        description: Cron Schedule
        type: string
      steps:
        description: Steps is a pipeline that executes serially. Incompatible with
          `Pipeline`.
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      tags:
        description: Tags is used to selected TestPlan, for example, release manager
          can tag one plan as ["release"] so that this one should be selected when
          release test
        items:
          type: string
        type: array
      testbed:
        $ref: '#/definitions/model.TestBed'
      triggerred:
        type: boolean
      type:
        default: ONE_SHOT
        type: string
      updatedAt:
        type: string
      variables:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      waitTimeout:
        description: todo maybe should be in exec, but use can set here for one-shot
          plan
        type: integer
    type: object
  model.TestTrigger:
    properties:
      active:
        type: boolean
      createdAt:
        type: string
      email:
        type: string
      expr:
        type: string
      id:
        type: integer
      lastTriggeredAt:
        type: integer
      name:
        type: string
      planID:
        type: integer
      planIDs:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
      priority:
        type: integer
      releaseBranch:
        description: Used in Release Test
        type: string
      summary:
        type: string
      type:
        type: string
      updatedAt:
        type: string
      variables:
        items:
          $ref: '#/definitions/model.PlanVarBind'
        type: array
    type: object
  model.Triage:
    properties:
      TriagePhase:
        type: string
      createdAt:
        type: string
      id:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      note:
        type: string
      planExecutionID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      planID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      reasons:
        items:
          type: string
        type: array
      solution:
        type: string
      startedAt:
        type: string
      toTriageCaseExecIDs:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
      triagedAt:
        type: string
      triagedCaseExecIDs:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
      triagingUsers:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
      updatedAt:
        type: string
    type: object
  model.TriggerListResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.TestTrigger'
        type: array
      total:
        type: integer
    type: object
  model.User:
    properties:
      avatar:
        type: string
      email:
        type: string
      id:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      name:
        type: string
    type: object
  model.UserListResponse:
    properties:
      data:
        items:
          $ref: '#/definitions/model.User'
        type: array
      total:
        type: integer
    type: object
  request.CaseCreateRequest:
    properties:
      apiVersion:
        type: string
      automation:
        default: NOT_AUTOMATED
        type: string
      category:
        default: FUNCTIONALITY
        type: string
      designer:
        type: string
      expectedResult:
        type: string
      framework:
        $ref: '#/definitions/model.FrameworkUnion'
      kind:
        type: string
      name:
        type: string
      parameters:
        items:
          $ref: '#/definitions/model.CaseParamDecl'
        type: array
      preconditions:
        type: string
      priority:
        default: P1
        type: string
      steps:
        type: string
      summary:
        type: string
      supportedVersions:
        items:
          type: string
        type: array
      tags:
        items:
          type: string
        type: array
    type: object
  request.CaseExecutionCreateRequest:
    properties:
      argoURL:
        type: string
      caseID:
        description: additional Meta
        type: integer
      completedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      meta:
        $ref: '#/definitions/model.ExecutionMeta'
      output:
        type: string
      rootPlanExecID:
        description: additional Meta
        type: integer
      startedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      status:
        type: string
      stepName:
        type: string
      stepSeq:
        type: integer
    required:
    - caseID
    - rootPlanExecID
    type: object
  request.CaseExecutionUpdateRequest:
    properties:
      argoURL:
        type: string
      completedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      meta:
        $ref: '#/definitions/model.ExecutionMeta'
      output:
        type: string
      startedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      status:
        type: string
    type: object
  request.CaseTriageUpdateRequest:
    properties:
      issueLink:
        type: string
      note:
        type: string
      reason:
        type: string
      solution:
        type: string
    type: object
  request.CaseUpdateRequest:
    properties:
      apiVersion:
        type: string
      automation:
        default: NOT_AUTOMATED
        type: string
      category:
        default: FUNCTIONALITY
        type: string
      designer:
        type: string
      expectedResult:
        type: string
      framework:
        $ref: '#/definitions/model.FrameworkUnion'
      kind:
        type: string
      name:
        type: string
      parameters:
        items:
          $ref: '#/definitions/model.CaseParamDecl'
        type: array
      preconditions:
        type: string
      priority:
        default: P1
        type: string
      steps:
        type: string
      summary:
        type: string
      supportedVersions:
        items:
          type: string
        type: array
      tags:
        items:
          type: string
        type: array
    type: object
  request.ExecutionNoteUpdateRequest:
    properties:
      note:
        type: string
    type: object
  request.ExecutionReasonUpdateRequest:
    properties:
      reason:
        type: string
    type: object
  request.PlanCreateRequest:
    properties:
      branch:
        description: Branch is the master part on above example
        type: string
      cases:
        items:
          $ref: '#/definitions/model.TestCaseBase'
        type: array
      commit:
        description: |-
          CommitHash is the 7dae1d3 part for example

          We uses the commit hash for data integrity and idempotent, since we don't need to
          decide how to remove a add/deleted/update a pipeline.
        type: string
      commitTs:
        description: CommitTs is the commit unix nano timestamp
        type: integer
      failFast:
        description: If specified, will fail this plan-execution if any of its child
          case-executions has failed.
        type: boolean
      metaParams:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      name:
        description: |-
          For the GitHub Plan, name is in the format of: $plan_name@$branch
          For the OnShot Plan, name is no need
        type: string
      path:
        description: Path is the tidb/sql-infra/ddl/shard-bits.daily.yaml part for
          example
        type: string
      pipeline:
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      priority:
        default: 0
        description: Only for GITHUB type
        enum:
        - -100
        - 0
        - 50
        - 100
        - 101
        type: integer
      repo:
        description: Repo is the pingcap/test-plan part for example, it's reserved
          and may use in the future
        type: string
      schedule:
        description: Cron Schedule
        type: string
      steps:
        description: Steps is a pipeline that executes serially. Incompatible with
          `Pipeline`.
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      tags:
        description: Tags is used to selected TestPlan, for example, release manager
          can tag one plan as ["release"] so that this one should be selected when
          release test
        items:
          type: string
        type: array
      testbed:
        $ref: '#/definitions/model.TestBed'
      type:
        default: ONE_SHOT
        type: string
      variables:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      waitTimeout:
        default: 604800
        type: integer
    type: object
  request.PlanExecutionUpdateRequest:
    properties:
      argoURL:
        type: string
      completedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      meta:
        $ref: '#/definitions/model.ExecutionMeta'
      output:
        type: string
      priority:
        default: 0
        description: Only for GITHUB type
        type: integer
      retryCnt:
        type: integer
      startedAt:
        description: 'TODO: Change type to `time.Time`.'
        type: integer
      status:
        type: string
    type: object
  request.PlanTriageUpdateRequest:
    properties:
      note:
        type: string
      solution:
        type: string
      triagePhase:
        type: string
      triagingUsers:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
    type: object
  request.ResourcePoolUpdateRequest:
    properties:
      resourcePools:
        items:
          $ref: '#/definitions/model.ResourcePool'
        type: array
    type: object
  request.TriggerCreateRequest:
    properties:
      autoIncludeReleasePlans:
        description: Auto include plans with `release` tag.
        type: boolean
      expr:
        description: |-
          RFC3339 are accepted.
          NOTE: If `Expr` is empty, the plan will be triggered immediately.
        type: string
      name:
        type: string
      planID:
        type: integer
      planIDs:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
      plans:
        description: InlinePlans is only for ONCE trigger.
        items:
          $ref: '#/definitions/request.TriggerCreateRequestInlinePlan'
        type: array
      releaseBranch:
        type: string
      summary:
        type: string
      type:
        default: ONCE
        type: string
      variables:
        items:
          $ref: '#/definitions/model.PlanVarBind'
        type: array
    type: object
  request.TriggerCreateRequestInlinePlan:
    properties:
      cases:
        items:
          $ref: '#/definitions/model.TestCaseBase'
        type: array
      failFast:
        description: If specified, will fail this plan-execution if any of its child
          case-executions has failed.
        type: boolean
      metaParams:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
      name:
        description: |-
          For the GitHub Plan, name is in the format of: $plan_name@$branch
          For the OnShot Plan, name is no need
        type: string
      pipeline:
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      steps:
        description: Steps is a pipeline that executes serially. Incompatible with
          `Pipeline`.
        items:
          $ref: '#/definitions/model.PipelineStep'
        type: array
      testbed:
        $ref: '#/definitions/model.TestBed'
      variables:
        items:
          $ref: '#/definitions/model.PlanVarDecl'
        type: array
    type: object
  request.UpdateTriggerPlanRefRequest:
    properties:
      newPlanIDs:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
    type: object
  resource.Details:
    properties:
      endpoints:
        description: 'TODO(@codingpoet): add more fields here'
        items:
          $ref: '#/definitions/resource.Endpoint'
        type: array
    type: object
  resource.Endpoint:
    properties:
      externalSvcAddress:
        type: string
      name:
        type: string
      type:
        type: string
    type: object
  resource.GcAction:
    properties:
      artifact:
        $ref: '#/definitions/resource.GcArtifactAction'
      notification:
        $ref: '#/definitions/resource.GcNotificationAction'
      reserveEnv:
        $ref: '#/definitions/resource.GcReserveEnvAction'
    type: object
  resource.GcArtifactAction:
    properties:
      log:
        type: boolean
      monitor:
        type: boolean
    type: object
  resource.GcNotificationAction:
    properties:
      feishu:
        type: string
    type: object
  resource.GcReserveEnvAction:
    properties:
      durationOnWorkingHour:
        description: retain duration on working hour, if triggers on non-working hour,
          retain to next working hour
        type: string
      scaleDown:
        description: scale down to min request, on k8s impl, means removing resource
          requests(cpu & memory)
        type: boolean
      scaleIn:
        description: scale in to min replicas, to tidbcluster, is 1 tidb, 1 tikv,
          1 pd etc
        type: boolean
    type: object
  resource.GcStrategy:
    properties:
      onCompletion:
        $ref: '#/definitions/resource.GcAction'
      onFailure:
        $ref: '#/definitions/resource.GcAction'
      onSuccess:
        $ref: '#/definitions/resource.GcAction'
    type: object
  resource.QosClaim:
    properties:
      exclusive:
        description: |-
          Exclusive means whether the podGroup is mutually exclusive with other Pod or PodGroup.

          If it is set, this pod are mutually exclusive with other pods(means don't schedule on the same node)
          which has different podGroup name or without a podGroup binding
        type: boolean
      podGroup:
        description: |-
          PodGroup is the podGroup name, with the PodGroup we ensure a group of pods can be scheduled altogether.

          ref: https://github.com/PingCAP-QE/NaglfarCloud
        type: string
    type: object
  resource.ReclaimPolicy:
    properties:
      gcStrategy:
        $ref: '#/definitions/resource.GcStrategy'
      lease:
        default: 24h
        type: string
    type: object
  service.Error:
    properties:
      code:
        description: Code is the error code.
        type: integer
      message:
        type: string
    type: object
  taskruns.ArgoRef:
    properties:
      namespace:
        type: string
      nodeId:
        type: string
      templateName:
        type: string
      workflow:
        type: string
    type: object
  taskruns.GeneralMetaData:
    properties:
      createAt:
        type: string
      createBy:
        type: string
      id:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      updateAt:
        type: string
      updateBy:
        type: string
    type: object
  taskruns.OutputParam:
    properties:
      name:
        type: string
      type:
        type: string
      value:
        type: string
      valueExpr:
        type: string
    type: object
  taskruns.Schedule:
    properties:
      lastScheduleTime:
        type: string
      scheduleReason:
        $ref: '#/definitions/taskruns.ScheduleReason'
      scheduleStatus:
        type: string
      testbedSpec:
        $ref: '#/definitions/model.TestBed'
    type: object
  taskruns.ScheduleReason:
    properties:
      message:
        type: string
      relatedSetupIds:
        items:
          description: 'ID: tcms ui need planExecutionID as id here,'
          type: integer
        type: array
      schedulerName:
        type: string
    type: object
  taskruns.TaskRunRef:
    properties:
      caseRunID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      planRunID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      testbedSetupRunID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
    type: object
  taskruns.TaskRunStatus:
    properties:
      outPuts:
        items:
          $ref: '#/definitions/taskruns.OutputParam'
        type: array
      phase:
        type: string
      underlying:
        $ref: '#/definitions/taskruns.Underlying'
    type: object
  taskruns.TestbedRef:
    properties:
      planID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
    type: object
  taskruns.TestbedSetup:
    properties:
      apiVersion:
        type: string
      kind:
        type: string
      metadata:
        $ref: '#/definitions/taskruns.GeneralMetaData'
      spec:
        $ref: '#/definitions/taskruns.TestbedSetupSpec'
      status:
        $ref: '#/definitions/taskruns.TestbedSetupStatus'
    type: object
  taskruns.TestbedSetupList:
    properties:
      apiVersion:
        type: string
      items:
        items:
          $ref: '#/definitions/taskruns.TestbedSetup'
        type: array
      kind:
        type: string
      total:
        type: integer
    type: object
  taskruns.TestbedSetupReport:
    properties:
      LastReportTime:
        type: string
      retryCnt:
        type: integer
      status:
        type: string
      testbedSpec:
        $ref: '#/definitions/model.TestBed'
    type: object
  taskruns.TestbedSetupSpec:
    properties:
      outPuts:
        items:
          $ref: '#/definitions/taskruns.OutputParam'
        type: array
      parent:
        $ref: '#/definitions/taskruns.TaskRunRef'
      planExecID:
        description: 'ID: tcms ui need planExecutionID as id here,'
        type: integer
      testbedRef:
        $ref: '#/definitions/taskruns.TestbedRef'
      testbedSpec:
        $ref: '#/definitions/model.TestBed'
    type: object
  taskruns.TestbedSetupStatus:
    properties:
      report:
        $ref: '#/definitions/taskruns.TestbedSetupReport'
      run:
        $ref: '#/definitions/taskruns.TaskRunStatus'
      schedule:
        $ref: '#/definitions/taskruns.Schedule'
    type: object
  taskruns.Underlying:
    properties:
      argo:
        $ref: '#/definitions/taskruns.ArgoRef'
    type: object
  xml.Name:
    properties:
      space:
        type: string
    type: object
info:
  contact: {}
  version: "1.0"
paths:
  /case-executions:
    get:
      operationId: list-case-executions
      parameters:
      - description: Filter by root_plan_id
        in: query
        name: root_plan_id
        type: integer
      - description: Filter by root_plan_exec_id
        in: query
        name: root_plan_exec_id
        type: integer
      - collectionFormat: csv
        description: Filter by case execution ids
        in: query
        items:
          type: integer
        name: ids
        type: array
      - collectionFormat: csv
        description: Filter by case ids
        in: query
        items:
          type: integer
        name: case_ids
        type: array
      - description: Filter by status
        enum:
        - PENDING
        - RUNNING
        - SUCCESS
        - FAILURE
        - SKIPPED
        - TIMEOUT
        - CANCELLED
        - ERROR
        in: query
        name: status
        type: string
      - default: 0
        description: Offset/skip number of case-executions
        in: query
        minimum: 0
        name: offset
        type: integer
      - default: 20
        description: Number of case-executions returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      - description: Filter by StartedAt, choose by Asia/Shanghai date. format(2006-01-02)
        format: "2006-01-02"
        in: query
        name: date
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.CaseExecutionListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: List recent case-executions (order by updated time desc)
      tags:
      - case-execution
    post:
      operationId: create-case-execution
      parameters:
      - description: CaseExecution to create
        in: body
        name: case-execution
        required: true
        schema:
          $ref: '#/definitions/request.CaseExecutionCreateRequest'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestCaseExecution'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create new case-execution
      tags:
      - case-execution
  /case-executions/{id}:
    get:
      operationId: get-case-execution
      parameters:
      - description: CaseExecution ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestCaseExecution'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Get case-execution by ID
      tags:
      - case-execution
    put:
      operationId: update-case-execution
      parameters:
      - description: CaseExecution ID
        in: path
        name: id
        required: true
        type: integer
      - description: CaseExecution to update
        in: body
        name: case-execution
        required: true
        schema:
          $ref: '#/definitions/request.CaseExecutionUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestCaseExecution'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update an existing case-execution, can not update if the execution's
        status is already not PENDING or RUNNING
      tags:
      - case-execution
  /case-executions/{id}/note:
    put:
      operationId: update-case-execution-note
      parameters:
      - description: CaseExecution ID
        in: path
        name: id
        required: true
        type: integer
      - description: the note
        in: body
        name: note
        required: true
        schema:
          $ref: '#/definitions/request.ExecutionNoteUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update an case-execution note.
      tags:
      - case-execution
  /case-executions/{id}/reason:
    put:
      operationId: update-case-execution-reason
      parameters:
      - description: CaseExecution ID
        in: path
        name: id
        required: true
        type: integer
      - description: the reason
        in: body
        name: reason
        required: true
        schema:
          $ref: '#/definitions/request.ExecutionReasonUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update an case-execution reason.
      tags:
      - case-execution
  /case-executions/{id}/triage:
    get:
      operationId: get-case-triage
      parameters:
      - description: Triage CaseExecutionID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.CaseTriage'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: get case triage by case-executions id
      tags:
      - case-execution
    put:
      operationId: update-case-triage
      parameters:
      - description: Triage CaseExecutionsID
        in: path
        name: id
        required: true
        type: integer
      - description: CaseTriage to update
        in: body
        name: triage
        required: true
        schema:
          $ref: '#/definitions/request.CaseTriageUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: update case triage by case-executions id
      tags:
      - case-execution
  /case-executions/{id}/triage/fork:
    put:
      operationId: fork-case-triage
      parameters:
      - description: Triage CaseExecutionID
        in: path
        name: id
        required: true
        type: integer
      - description: lease to set
        in: query
        name: from
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.CaseTriage'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: update triage by plan-executions id
      tags:
      - plan-execution
  /case-executions/{id}/triage/suggest:
    get:
      operationId: suggest-case-triage
      parameters:
      - description: Triage CaseExecutionID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/model.CaseTriage'
            type: array
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: get case triage suggestions by case-executions id
      tags:
      - case-execution
  /case-executions/triages:
    post:
      parameters:
      - description: CaseTriage to create
        in: body
        name: triage
        required: true
        schema:
          $ref: '#/definitions/model.CaseTriage'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: create case triage
      tags:
      - case-execution
  /cases:
    get:
      operationId: list-cases
      parameters:
      - description: Search by query, all but query and tags are ignored
        in: query
        maxLength: 255
        minLength: 1
        name: query
        type: string
      - collectionFormat: csv
        description: Filter by tags label
        in: query
        items:
          type: string
        name: tags
        type: array
      - collectionFormat: csv
        description: Filter by case ids
        in: query
        items:
          type: integer
        name: ids
        type: array
      - collectionFormat: csv
        description: Filter by case names
        in: query
        items:
          type: string
        name: names
        type: array
      - description: Search by designer email
        in: query
        maxLength: 255
        minLength: 1
        name: designer
        type: string
      - description: Export as tcctl format
        in: query
        name: tcctl
        type: boolean
      - description: Export all case fields
        in: query
        name: allFields
        type: boolean
      - default: 0
        description: Offset/skip number of cases
        in: query
        minimum: 0
        name: offset
        type: integer
      - default: 20
        description: Number of cases returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.CaseSearchResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: List recent cases order by updated time desc (default not to return
        all fields).
      tags:
      - case
    post:
      operationId: create-case
      parameters:
      - default: false
        description: Dry run
        in: query
        name: dryrun
        required: true
        type: boolean
      - description: Case to create
        in: body
        name: case
        required: true
        schema:
          $ref: '#/definitions/request.CaseCreateRequest'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestCase'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create new case
      tags:
      - case
  /cases/{id}:
    delete:
      operationId: delete-case
      parameters:
      - description: Case ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Delete an existing case
      tags:
      - case
    get:
      operationId: get-case
      parameters:
      - description: Case ID
        in: path
        name: id
        required: true
        type: integer
      - description: Get case of this revision. You can view all revisions in /cases/{id}/histories.
        in: query
        name: revision
        type: integer
      - description: Get case of the most recently revision which was created before
          ts, RFC3339Nano format, e.g. 2022-02-01T16:09:53+08:00
        in: query
        name: ts
        type: string
      - description: Export as tcctl format
        in: query
        name: tcctl
        type: boolean
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestCase'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Get case by ID
      tags:
      - case
    put:
      operationId: update-case
      parameters:
      - description: Case ID
        in: path
        name: id
        required: true
        type: integer
      - description: Case to override
        in: body
        name: case
        required: true
        schema:
          $ref: '#/definitions/request.CaseUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestCase'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Override an existing case
      tags:
      - case
  /cases/{id}/histories:
    get:
      operationId: list-case-histories
      parameters:
      - description: Case ID
        in: path
        name: id
        required: true
        type: integer
      - description: Get case history after the ts. RFC3339Nano format, e.g. 2022-02-01T13:09:53+08:00
        in: query
        name: from_ts
        type: string
      - description: Get case history before the ts, RFC3339Nano format, e.g. 2022-02-01T16:09:53+08:00
        in: query
        name: to_ts
        type: string
      - default: 0
        description: Offset/skip number of items
        in: query
        minimum: 0
        name: offset
        type: integer
      - default: 20
        description: Number of items returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/model.HistoryRecord'
            type: array
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: List case histories by ID.
      tags:
      - case
  /cases/autocomplete:
    get:
      operationId: autocomplete-case
      parameters:
      - description: Filter by query
        in: query
        maxLength: 255
        minLength: 1
        name: query
        required: true
        type: string
      - default: 10
        description: Number of items returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.CaseListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Auto complete case by name.
      tags:
      - case
  /config:
    get:
      operationId: get-remote-configs
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Get configs like supported execution fail reasons.
      tags:
      - config
  /dailyci:
    get:
      operationId: get-dailyci-report
      parameters:
      - description: id
        in: query
        name: id
        required: true
        type: integer
      - default: main
        description: Filter by git branch
        in: query
        name: branch
        type: string
      - collectionFormat: csv
        description: Filter by plans
        in: query
        items:
          type: string
        name: plans
        type: array
      produces:
      - application/xml
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/formatter.JUnitTestSuites'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Returns JUnit report of executions.
      tags:
      - dailyci
  /dailyci/trigger:
    post:
      operationId: trigger-daily-tests-by-dailyci
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handler.TriggerTestsResp'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Trigger daily tests (Used by dailyci).
      tags:
      - dailyci
  /dailyci/trigger/{id}:
    get:
      operationId: get-trigger-status-for-dailyci
      parameters:
      - description: id
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handler.GetTriggerStatusForDailyCIResp'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Trigger daily tests (Used by dailyci).
      tags:
      - dailyci
  /plan-executions:
    get:
      operationId: list-plan-executions
      parameters:
      - description: Search by query
        in: query
        maxLength: 255
        minLength: 1
        name: query
        type: string
      - description: Filter by creator or maintainer
        in: query
        name: email
        type: string
      - collectionFormat: csv
        description: Filter by plan execution ids
        in: query
        items:
          type: integer
        name: ids
        type: array
      - collectionFormat: csv
        description: Filter by plan ids
        in: query
        items:
          type: integer
        name: plan_ids
        type: array
      - collectionFormat: csv
        description: Filter by trigger ids, can only choose one between plan_ids and
          trigger_ids
        in: query
        items:
          type: integer
        name: trigger_ids
        type: array
      - description: Filter by status
        enum:
        - PENDING
        - RUNNING
        - SUCCESS
        - FAILURE
        - SKIPPED
        - TIMEOUT
        - CANCELLED
        - ERROR
        in: query
        name: status
        type: string
      - description: Filter by triage_phase
        enum:
        - TO_TRIAGE
        - TRIAGING
        - TRIAGED
        in: query
        name: triage_phase
        type: string
      - description: Filter by resourcePool
        in: query
        name: resource_pool_id
        type: integer
      - description: Filter plan-execution has living testbeds
        in: query
        name: has_living_testbed
        type: boolean
      - description: Filter cron plan-execution
        in: query
        name: cron
        type: boolean
      - default: 0
        description: Offset/skip number of plan-executions
        in: query
        minimum: 0
        name: offset
        type: integer
      - default: 20
        description: Number of plan-executions returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      - description: Filter by StartedAt, choose by Asia/Shanghai date. format(2006-01-02)
        format: "2006-01-02"
        in: query
        name: date
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.PlanExecutionSearchResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: List recent plan-executions (order by created time desc)
      tags:
      - plan-execution
  /plan-executions/{id}:
    get:
      operationId: get-plan-execution
      parameters:
      - description: PlanExecution ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestPlanExecution'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Get plan-execution by ID
      tags:
      - plan-execution
    put:
      operationId: update-plan-execution
      parameters:
      - description: PlanExecution ID
        in: path
        name: id
        required: true
        type: integer
      - description: PlanExecution to update
        in: body
        name: plan-execution
        required: true
        schema:
          $ref: '#/definitions/request.PlanExecutionUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestPlanExecution'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update an existing plan-execution, can not update if the execution's
        status is already not PENDING or RUNNING
      tags:
      - plan-execution
  /plan-executions/{id}/note:
    put:
      operationId: update-plan-execution-note
      parameters:
      - description: PlanExecution ID
        in: path
        name: id
        required: true
        type: integer
      - description: the note
        in: body
        name: note
        required: true
        schema:
          $ref: '#/definitions/request.ExecutionNoteUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update an plan-execution note.
      tags:
      - plan-execution
  /plan-executions/{id}/plan:
    get:
      operationId: get-plan-by-plan-execution
      parameters:
      - description: PlanExecution ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestPlan'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Get plan rendered by plan-execution
      tags:
      - plan-execution
  /plan-executions/{id}/reason:
    put:
      operationId: update-plan-execution-reason
      parameters:
      - description: PlanExecution ID
        in: path
        name: id
        required: true
        type: integer
      - description: reason
        in: body
        name: reason
        required: true
        schema:
          $ref: '#/definitions/request.ExecutionReasonUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update an plan-execution reason.
      tags:
      - plan-execution
  /plan-executions/{id}/rerun:
    post:
      operationId: rerun-plan-execution
      parameters:
      - description: Execution ID
        in: path
        name: id
        required: true
        type: integer
      - default: false
        description: Only rerun failed steps (default to rerun all steps, include
          success)
        in: query
        name: only_failed
        type: boolean
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Rerun the plan-execution.
      tags:
      - plan-execution
  /plan-executions/{id}/resource-duration:
    get:
      operationId: get-resource-duration
      parameters:
      - description: ResourceDuration's PlanExecutionID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/model.ResourceDuration'
            type: array
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: get ResourceDuration by plan-executions id
      tags:
      - plan-execution
  /plan-executions/{id}/testbeds:
    get:
      operationId: list-plan-execution-testbed
      parameters:
      - description: Plan execution id
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestBedInfoListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: List testbeds of a plan-execution.
      tags:
      - plan-execution
  /plan-executions/{id}/testbeds/{name}:
    get:
      operationId: get-testbed
      parameters:
      - description: testbed's plan_exec_id
        in: path
        name: id
        required: true
        type: integer
      - description: testbed name
        in: path
        name: name
        required: true
        type: string
      - description: refresh testbed with resource details
        in: query
        name: with_resource_details
        type: boolean
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestBedInfo'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Release an alive testbed
      tags:
      - plan-execution
  /plan-executions/{id}/testbeds/{name}/info/status:
    put:
      operationId: update-testbed
      parameters:
      - description: testbed's plan_exec_id
        in: path
        name: id
        required: true
        type: integer
      - description: testbed name
        in: path
        name: name
        required: true
        type: string
      - description: '{''INITIATING'', ''READY'', ''RELEASED'', ''ERROR''}'
        in: query
        name: status
        required: true
        type: string
      - description: timestamp when InitiatedAt
        in: query
        name: initiated_at
        type: integer
      - description: URL to get testbed setup log
        in: query
        name: setup_log_url
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update testbed's dynamic info (such as tidb url/ prom url etc.)
      tags:
      - plan-execution
  /plan-executions/{id}/testbeds/{name}/release:
    put:
      operationId: release-testbed
      parameters:
      - description: testbed's plan_exec_id
        in: path
        name: id
        required: true
        type: integer
      - description: testbed name
        in: path
        name: name
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestBedInfo'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Release an alive testbed
      tags:
      - plan-execution
  /plan-executions/{id}/testbeds/{name}/renew:
    put:
      operationId: renew-testbed
      parameters:
      - description: testbed's plan_exec_id
        in: path
        name: id
        required: true
        type: integer
      - description: testbed name
        in: path
        name: name
        required: true
        type: string
      - description: lease to set
        in: query
        name: lease
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestBedInfo'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Release an alive testbed
      tags:
      - plan-execution
  /plan-executions/{id}/testbeds/{name}/restore-monitor:
    put:
      operationId: restore-monitor
      parameters:
      - description: testbed's plan_exec_id
        in: path
        name: id
        required: true
        type: integer
      - description: testbed name
        in: path
        name: name
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestBedInfo'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: RestoreMonitor of a dead testbed
      tags:
      - plan-execution
  /plan-executions/{id}/triage:
    get:
      operationId: get-triage
      parameters:
      - description: Triage PlanExecutionID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.Triage'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: get triage by plan-executions id
      tags:
      - plan-execution
    put:
      operationId: update-triage
      parameters:
      - description: Triage PlanExecutionsID
        in: path
        name: id
        required: true
        type: integer
      - description: PlanTriage to update
        in: body
        name: triage
        required: true
        schema:
          $ref: '#/definitions/request.PlanTriageUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: update triage by plan-executions id
      tags:
      - plan-execution
  /plan-executions/cancel:
    put:
      operationId: cancel-plan-execution
      parameters:
      - collectionFormat: csv
        description: Execution IDs
        in: query
        items:
          type: integer
        name: ids
        type: array
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Cancel pending plan-executions.
      tags:
      - plan-execution
  /plans:
    get:
      operationId: list-plans
      parameters:
      - description: Search by query, all but query and tags are ignored
        in: query
        maxLength: 255
        minLength: 1
        name: query
        type: string
      - collectionFormat: csv
        description: Filter by plan ids
        in: query
        items:
          type: integer
        name: ids
        type: array
      - description: Filter by plan type
        enum:
        - GENERAL
        - GITHUB
        - ONE_SHOT
        in: query
        name: type
        type: string
      - description: Filter by GitHub branch
        in: query
        name: branch
        type: string
      - default: 0
        description: Offset/skip number of plans
        in: query
        minimum: 0
        name: offset
        type: integer
      - default: 20
        description: Number of plans returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.PlanListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: List recent plans (order by updated time desc)
      tags:
      - plan
    post:
      operationId: create-plan
      parameters:
      - description: Plan to create
        in: body
        name: plan
        required: true
        schema:
          $ref: '#/definitions/request.PlanCreateRequest'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.PlanCreateResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create new plan (For Github plan, see `CreateGitHubPlan` in `plan_github.go`)
      tags:
      - plan
  /plans/{id}:
    delete:
      operationId: delete-plan
      parameters:
      - description: Plan ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Delete an existing plan (For Github plan, see `DeleteOldGitHubPlans`
        in `plan_github.go`)
      tags:
      - plan
    get:
      operationId: get-plan
      parameters:
      - description: Plan ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestPlan'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Get plan by ID
      tags:
      - plan
  /plans/autocomplete:
    get:
      operationId: autocomplete-plan
      parameters:
      - default: GENERAL
        description: Filter by plan type
        enum:
        - GENERAL
        - GITHUB
        - ONE_SHOT
        in: query
        name: type
        type: string
      - description: Filter by query
        in: query
        maxLength: 255
        minLength: 1
        name: query
        required: true
        type: string
      - default: 10
        description: Number of items returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestPlan'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Auto complete plan by name.
      tags:
      - plan
  /plans/branchs:
    get:
      operationId: list-ghplan-branchs
      parameters:
      - description: Filter by branch prefix
        in: query
        name: prefix
        type: string
      responses:
        "200":
          description: OK
          schema:
            items:
              type: string
            type: array
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Returns all active branchs in GitHub repo.
      tags:
      - plan
  /plans/release:
    get:
      operationId: list-release-plans
      parameters:
      - description: release trigger id
        in: query
        name: triggerID
        type: integer
      - description: Filter by GitHub branch
        in: query
        name: branch
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.ListReleasePlansResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: List release plans (order by updated time desc)
      tags:
      - plan
  /resourcepool:
    delete:
      operationId: delete-resourcepool
      parameters:
      - description: Filter by rms_name
        in: query
        name: rms_name
        type: string
      - description: Choose resourcepools in names
        in: query
        name: names
        type: string
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Delete an existing resourcepool
      tags:
      - resourcepool
    get:
      operationId: list-resourcepools
      parameters:
      - description: Filter by rms_name
        in: query
        name: rms_name
        type: string
      - description: Choose resourcepools in names
        in: query
        name: names
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.ResourcePoolListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: List ResourcePools
      tags:
      - resourcepool
    post:
      operationId: create-resourcepool
      parameters:
      - description: ResourcePool to create
        in: body
        name: resourcepool
        required: true
        schema:
          $ref: '#/definitions/model.ResourcePool'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.ResourcePool'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create ResourcePool
      tags:
      - resourcepool
    put:
      operationId: update-resourcepool
      parameters:
      - description: ResourcePool to update
        in: body
        name: resourcepool
        required: true
        schema:
          $ref: '#/definitions/model.ResourcePool'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update ResourcePool
      tags:
      - resourcepool
  /resourcepool/status:
    put:
      operationId: update-resourcepools-status
      parameters:
      - description: ResourcePools with metrics to update
        in: body
        name: resourcepools
        required: true
        schema:
          $ref: '#/definitions/request.ResourcePoolUpdateRequest'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.ResourcePoolListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update ResourcePool
      tags:
      - resourcepool
  /rms:
    get:
      operationId: list-rms
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/model.RMS'
            type: array
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: List RMSs
      tags:
      - rms
    post:
      operationId: create-rms
      parameters:
      - description: RMS to create
        in: body
        name: rms
        required: true
        schema:
          $ref: '#/definitions/model.RMS'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.RMS'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create RMS
      tags:
      - rms
    put:
      operationId: update-rms
      parameters:
      - description: RMS to update
        in: body
        name: rms
        required: true
        schema:
          $ref: '#/definitions/model.RMS'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Update RMS
      tags:
      - rms
  /rms/:name:
    get:
      operationId: get-rms
      parameters:
      - description: RMS name
        in: path
        name: name
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.RMS'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Get RMSs
      tags:
      - rms
  /summary:
    get:
      operationId: get-daily-summary
      parameters:
      - description: Filter by date, choose by asia/shanghai date. format(2006-01-02)
        format: "2006-01-02"
        in: query
        name: date
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.DailySummary'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Get Daily Summary By Date
      tags:
      - daily-summary
  /summary/release/:id:
    get:
      operationId: get-release-summary
      parameters:
      - description: release trigger id
        in: path
        name: id
        type: integer
      - description: Filter by triage_phase
        enum:
        - TO_TRIAGE
        - TRIAGING
        - TRIAGED
        in: query
        name: triage_phase
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.GetReleaseSummaryResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Get Release Summary
      tags:
      - get-release-summary
  /testbeds/info:
    get:
      operationId: list-testbed
      parameters:
      - collectionFormat: csv
        description: Filter by testbed names
        in: query
        items:
          type: string
        name: names
        type: array
      - description: Filter by plan-execution id
        in: query
        name: plan_exec_id
        type: integer
      - description: also show released testbeds
        in: query
        name: show_released
        type: boolean
      - default: 0
        description: Offset/skip number of testbeds
        in: query
        minimum: 0
        name: offset
        type: integer
      - default: 20
        description: Number of testbeds returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestBedInfoListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: List testbeds
      tags:
      - testbed
    post:
      operationId: create-testbed
      parameters:
      - description: Testbed to create
        in: body
        name: testbed
        required: true
        schema:
          $ref: '#/definitions/model.TestBedInfo'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestBedInfo'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create new testbed
      tags:
      - testbed
  /testbedsetups:
    get:
      operationId: list-testbed-setup
      parameters:
      - description: Filter by schedule.status
        in: query
        name: scheduleStatus
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/taskruns.TestbedSetupList'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: List testbed-setup tasks
      tags:
      - testbed-setup
    post:
      operationId: create-testbed-setup
      parameters:
      - default: false
        description: Dry run
        in: query
        name: dryrun
        required: true
        type: boolean
      - default: false
        description: Dry run
        in: query
        name: dryRun
        type: boolean
      - description: testbed setup to create
        in: body
        name: testbedSetup
        required: true
        schema:
          $ref: '#/definitions/taskruns.TestbedSetup'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/taskruns.TestbedSetup'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Create new testbed-setup
      tags:
      - testbed-setup
  /testbedsetups/{id}:
    get:
      operationId: get-testbed-setup
      parameters:
      - description: Case ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/taskruns.TestbedSetup'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Get testbed-setup by ID
      tags:
      - testbed-setup
  /testbedsetups/{id}/status/report:
    put:
      operationId: update-testbed-setup-report
      parameters:
      - description: ID
        in: path
        name: id
        required: true
        type: integer
      - default: false
        description: Dry run
        in: query
        name: dryrun
        required: true
        type: boolean
      - default: false
        description: Dry run
        in: query
        name: dryRun
        type: boolean
      - description: testbed-setup to update
        in: body
        name: testbedSetup
        required: true
        schema:
          $ref: '#/definitions/taskruns.TestbedSetup'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/taskruns.TestbedSetup'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: update testbed-setup report status
      tags:
      - testbed-setup
  /testbedsetups/{id}/status/run:
    put:
      operationId: update-testbed-setup-run
      parameters:
      - description: ID
        in: path
        name: id
        required: true
        type: integer
      - default: false
        description: Dry run
        in: query
        name: dryrun
        required: true
        type: boolean
      - default: false
        description: Dry run
        in: query
        name: dryRun
        type: boolean
      - description: testbed-setup to update
        in: body
        name: testbedSetup
        required: true
        schema:
          $ref: '#/definitions/taskruns.TestbedSetup'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/taskruns.TestbedSetup'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: update testbed-setup run status
      tags:
      - testbed-setup
  /testbedsetups/{id}/status/schedule:
    put:
      operationId: update-testbed-setup-schedule
      parameters:
      - description: ID
        in: path
        name: id
        required: true
        type: integer
      - default: false
        description: Dry run
        in: query
        name: dryrun
        required: true
        type: boolean
      - default: false
        description: Dry run
        in: query
        name: dryRun
        type: boolean
      - description: testbed-setup to update
        in: body
        name: testbedSetup
        required: true
        schema:
          $ref: '#/definitions/taskruns.TestbedSetup'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/taskruns.TestbedSetup'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: update testbed-setup schedule status
      tags:
      - testbed-setup
  /testbedsetups/schedule-graph:
    get:
      operationId: pending-testbed-setup-graph
      produces:
      - text/html
      responses:
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: generate pending task graph
      tags:
      - testbed-setup
  /tokens:
    delete:
      operationId: revoke-token
      parameters:
      - collectionFormat: csv
        description: Token ids
        in: query
        items:
          type: integer
        name: ids
        type: array
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Revokes user's tokens, revoke all tokens if ids is not specified.
      tags:
      - token
    get:
      operationId: list-tokens
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.PersonalAccessTokenInfoListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create a personal access token.
      tags:
      - token
    post:
      operationId: create-token
      parameters:
      - description: Token name
        in: query
        maxLength: 255
        minLength: 1
        name: name
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create a personal access token.
      tags:
      - token
  /tokens/validate:
    get:
      operationId: validate-token
      parameters:
      - description: Personal access token
        in: query
        name: token
        required: true
        type: string
      - description: Also return the user info
        enum:
        - "1"
        in: query
        name: user
        type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.PersonalAccessTokenInfo'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Validate token and return info
      tags:
      - token
  /triggers:
    get:
      operationId: list-triggers
      parameters:
      - description: Filter by plan ID
        in: query
        name: plan_id
        type: integer
      - description: Filter by trigger type
        enum:
        - ONCE
        - CRON
        - RELEASE
        in: query
        name: type
        type: string
      - description: Filter by creator's ID
        in: query
        name: creator
        type: integer
      - description: Filter by release branch
        in: query
        name: release_branch
        type: string
      - default: 0
        description: Offset/skip number of triggers
        in: query
        minimum: 0
        name: offset
        type: integer
      - default: 20
        description: Number of triggers returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TriggerListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: List recent triggers (order by updated time desc)
      tags:
      - trigger
    post:
      operationId: create-trigger
      parameters:
      - description: Trigger to create
        in: body
        name: trigger
        required: true
        schema:
          $ref: '#/definitions/request.TriggerCreateRequest'
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestTrigger'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Create new trigger
      tags:
      - trigger
  /triggers/{id}:
    delete:
      operationId: delete-trigger
      parameters:
      - description: Trigger ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Delete an existing trigger
      tags:
      - trigger
    get:
      operationId: get-trigger
      parameters:
      - description: Trigger ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TestTrigger'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Get trigger by ID
      tags:
      - trigger
  /triggers/{id}/affected-version/cases:
    get:
      operationId: get-affected-version-cases
      parameters:
      - description: Trigger ID
        in: path
        name: id
        required: true
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handler.GetAffectedVersionCasesResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Get Affected Version Summary.
      tags:
      - trigger
  /triggers/{id}/plan-ref:
    put:
      operationId: update-trigger-plan-ref
      parameters:
      - description: Trigger ID
        in: path
        name: id
        required: true
        type: integer
      - description: PlanIDs to override into PlanRef
        in: body
        name: planIDs
        required: true
        schema:
          $ref: '#/definitions/request.UpdateTriggerPlanRefRequest'
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Override an existing trigger's PlanRef
      tags:
      - trigger
  /triggers/autocomplete:
    get:
      operationId: autocomplete-trigger
      parameters:
      - description: Filter by query
        in: query
        maxLength: 255
        minLength: 1
        name: query
        required: true
        type: string
      - default: CRON
        description: Filter by type
        enum:
        - CRON
        in: query
        name: type
        type: string
      - default: 10
        description: Number of items returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.TriggerListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Auto complete trigger by name. This API only works on CRON trigger.
      tags:
      - trigger
  /users:
    get:
      operationId: list-users
      parameters:
      - collectionFormat: csv
        description: Filter by user ids
        in: query
        items:
          type: integer
        name: ids
        type: array
      - collectionFormat: csv
        description: Filter by user emails
        in: query
        items:
          type: string
        name: emails
        type: array
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.UserListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: List users
      tags:
      - user
  /users/autocomplete:
    get:
      operationId: autocomplete-user
      parameters:
      - description: Filter by query
        in: query
        name: query
        required: true
        type: string
      - default: 10
        description: Number of items returned
        in: query
        maximum: 100
        minimum: 1
        name: count
        type: integer
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.UserListResponse'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Auto complete user by email.
      tags:
      - user
  /users/current:
    get:
      operationId: current-user
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/model.User'
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      security:
      - Bearer: []
      summary: Get current user
      tags:
      - user
  /users/login/google-auth:
    get:
      operationId: login-google-auth
      parameters:
      - description: Google OAuth id_token
        in: query
        name: id_token
        required: true
        type: string
      responses:
        "200":
          description: OK
          schema:
            additionalProperties: true
            type: object
        default:
          description: ""
          schema:
            $ref: '#/definitions/handler.HTTPError'
      summary: Login via Google OAuth2
      tags:
      - user
securityDefinitions:
  Bearer:
    in: header
    name: Authorization
    type: apiKey
swagger: "2.0"
