basePath: /api/v1/admin
definitions:
  forms.CalcNodeProfileResp:
    properties:
      code:
        type: integer
      component_node_profiles:
        items:
          $ref: '#/definitions/forms.NodeProfilesWithComponentType'
        type: array
      message:
        type: string
    type: object
  forms.CodeMsgResponse:
    properties:
      code:
        type: integer
      message:
        type: string
    type: object
  forms.ComponentScale:
    properties:
      component_type:
        type: string
      node_profile_id:
        example: "0"
        type: string
      replicas:
        type: integer
      storage_size_gi:
        type: integer
    required:
    - component_type
    - node_profile_id
    - replicas
    type: object
  forms.DashboardLink:
    properties:
      link:
        type: string
      name:
        type: string
    type: object
  forms.EmptyResponse:
    type: object
  forms.GetDashboardLinksResp:
    properties:
      dashboards:
        items:
          $ref: '#/definitions/forms.DashboardLink'
        type: array
    type: object
  forms.ListProvidersResp:
    properties:
      items:
        items:
          $ref: '#/definitions/forms.Provider'
        type: array
      total:
        type: integer
    type: object
  forms.ListRegionResp:
    properties:
      items:
        items:
          $ref: '#/definitions/forms.ProviderRegion'
        type: array
      total:
        type: integer
    type: object
  forms.ListTenantClusterLifeCycleResp:
    properties:
      items:
        items:
          $ref: '#/definitions/forms.TenantClusterLifecycle'
        type: array
      total:
        type: integer
    type: object
  forms.ListTenantClustersResp:
    properties:
      code:
        type: integer
      items:
        items:
          $ref: '#/definitions/forms.TenantCluster'
        type: array
      message:
        type: string
      total:
        type: integer
    type: object
  forms.NodeProfile:
    properties:
      default_node_num:
        type: integer
      id:
        example: "0"
        type: string
      max_storage_size_gi:
        type: integer
      min_storage_size_gi:
        type: integer
      name:
        type: string
    type: object
  forms.NodeProfileCompute:
    properties:
      cpu:
        type: integer
      memory_mi:
        type: integer
    type: object
  forms.NodeProfileOfComponent:
    properties:
      compute:
        $ref: '#/definitions/forms.NodeProfileCompute'
      name:
        type: string
      node_profile_id:
        example: "0"
        type: string
      storage_gi:
        type: integer
    type: object
  forms.NodeProfilesWithComponentType:
    properties:
      component_type:
        description: core.proto:ComponentType.string()
        type: string
      profiles:
        items:
          $ref: '#/definitions/forms.NodeProfile'
        type: array
    type: object
  forms.Provider:
    properties:
      name:
        type: string
      status:
        type: string
    required:
    - name
    type: object
  forms.ProviderRegion:
    properties:
      area:
        type: string
      country_code:
        type: string
      default_backup_time:
        type: string
      display_name:
        type: string
      id:
        example: "0"
        type: string
      is_public:
        type: boolean
      name:
        type: string
      opened_org_ids:
        items:
          type: string
        type: array
      priority:
        type: integer
      provider:
        type: string
      status:
        type: string
      zones:
        items:
          type: string
        type: array
    type: object
  forms.ReplaceProfileResponse:
    properties:
      code:
        type: integer
      message:
        type: string
      version_id:
        type: integer
    type: object
  forms.ScaleComponentReq:
    properties:
      components:
        items:
          $ref: '#/definitions/forms.ComponentScale'
        type: array
    required:
    - components
    type: object
  forms.TenantCluster:
    properties:
      create_time:
        type: integer
      cross_account_deployment_id:
        example: "0"
        type: string
      id:
        example: "0"
        type: string
      is_dev_tier:
        type: boolean
      name:
        type: string
      profile:
        type: string
      project_id:
        example: "0"
        type: string
      project_name:
        type: string
      provider:
        type: string
      region:
        type: string
      status:
        type: string
      tenant_components:
        $ref: '#/definitions/forms.TenantComponents'
      version:
        type: string
    type: object
  forms.TenantClusterLifecycle:
    properties:
      created_at:
        type: integer
      deleted_at:
        type: integer
      id:
        example: "0"
        type: string
      project_id:
        example: "0"
        type: string
    type: object
  forms.TenantComponent:
    properties:
      machineType:
        description: 'TODO(chenfei): remove. used by gitops to overlay configuration
          for component for now'
        type: string
      node_profile:
        $ref: '#/definitions/forms.NodeProfileOfComponent'
      replicas:
        type: integer
    type: object
  forms.TenantComponents:
    properties:
      pd:
        $ref: '#/definitions/forms.TenantComponent'
      tidb:
        $ref: '#/definitions/forms.TenantComponent'
      tiflash:
        $ref: '#/definitions/forms.TenantComponent'
      tikv:
        $ref: '#/definitions/forms.TenantComponent'
    type: object
host: 127.0.0.1:8080
info:
  contact: {}
  description: This is a management portal server
  title: Management Portal API
  version: "1.0"
paths:
  /api/v1/admin/profile/query:
    post:
      consumes:
      - multipart/form-data
      description: CalcNodeProfiles
      parameters:
      - in: formData
        name: is_dev_tier
        type: boolean
      - example: "0"
        in: formData
        name: org_id
        type: string
      - example: "0"
        in: formData
        name: project_id
        type: string
      - in: formData
        name: provider
        type: string
      - in: formData
        name: region
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.CalcNodeProfileResp'
      summary: CalcNodeProfiles
      tags:
      - Profile
  /external-api/v1/orgs/profile/replace_node_and_sku:
    post:
      consumes:
      - multipart/form-data
      description: ReplaceNodeAndSKUByYaml
      parameters:
      - in: formData
        name: dryrun
        type: string
      - example: the file of node, named by nodes.yaml
        in: formData
        name: node
        type: string
      - example: the file of sku, named by skus.yaml
        in: formData
        name: sku
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ReplaceProfileResponse'
      summary: ReplaceNodeAndSKUByYaml
      tags:
      - Profile
  /orgs/{org_id}/cluster-lifecycles:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - in: query
        name: end
        required: true
        type: integer
      - in: query
        name: start
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListTenantClusterLifeCycleResp'
      summary: ListTenantClusterLifeCycle
      tags:
      - Tenant
  /orgs/{org_id}/clusters:
    get:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - in: query
        name: page
        type: integer
      - in: query
        name: per_page
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListTenantClustersResp'
      summary: List Tenant Cluster
      tags:
      - TenantCuster
  /orgs/{org_id}/clusters/{cluster_id}:
    delete:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: cluster_id
        in: path
        name: cluster_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: Delete Tenant Cluster
      tags:
      - TenantCuster
  /orgs/{org_id}/clusters/{cluster_id}/components:
    put:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: cluster_id
        in: path
        name: cluster_id
        required: true
        type: string
      - description: scale cluster component
        in: body
        name: scale
        required: true
        schema:
          $ref: '#/definitions/forms.ScaleComponentReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: Scale Tenant Cluster
      tags:
      - TenantCuster
  /orgs/{org_id}/clusters/{cluster_id}/dashboard_links:
    get:
      consumes:
      - application/json
      description: GetDashboardLinks
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: cluster_id
        in: path
        name: cluster_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.GetDashboardLinksResp'
      summary: GetDashboardLinks
      tags:
      - TenantCuster
  /orgs/{org_id}/clusters/{cluster_id}/pause:
    post:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: cluster_id
        in: path
        name: cluster_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.CodeMsgResponse'
      summary: Pause Tenant Cluster
      tags:
      - TenantCuster
  /orgs/{org_id}/clusters/{cluster_id}/resume:
    post:
      consumes:
      - application/json
      parameters:
      - description: org_id
        in: path
        name: org_id
        required: true
        type: string
      - description: cluster_id
        in: path
        name: cluster_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.CodeMsgResponse'
      summary: Resume Tenant Cluster
      tags:
      - TenantCuster
  /providers:
    get:
      consumes:
      - application/json
      description: ListProviders
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListProvidersResp'
      summary: ListProviders
      tags:
      - Provider
    post:
      consumes:
      - application/json
      description: AddProvider
      parameters:
      - description: provider
        in: body
        name: provider
        required: true
        schema:
          $ref: '#/definitions/forms.Provider'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: AddProvider
      tags:
      - Provider
  /providers/{provider}/regions:
    get:
      consumes:
      - application/json
      description: ListRegions
      parameters:
      - description: provider
        in: path
        name: provider
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ListRegionResp'
      summary: ListRegions
      tags:
      - Provider
    post:
      consumes:
      - application/json
      description: AddRegion
      parameters:
      - description: provider
        in: path
        name: provider
        required: true
        type: string
      - description: region
        in: body
        name: region
        required: true
        schema:
          $ref: '#/definitions/forms.ProviderRegion'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ProviderRegion'
      summary: AddRegion
      tags:
      - Provider
  /providers/{provider}/regions/{region_id}:
    delete:
      consumes:
      - application/json
      description: DeleteRegion
      parameters:
      - description: provider
        in: path
        name: provider
        required: true
        type: string
      - description: region_id
        in: path
        name: region_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.EmptyResponse'
      summary: DeleteRegion
      tags:
      - Provider
    get:
      consumes:
      - application/json
      description: GetRegionByID
      parameters:
      - description: provider
        in: path
        name: provider
        required: true
        type: string
      - description: region_id
        in: path
        name: region_id
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ProviderRegion'
      summary: GetRegionByID
      tags:
      - Provider
    put:
      consumes:
      - application/json
      description: UpdateRegion
      parameters:
      - description: provider
        in: path
        name: provider
        required: true
        type: string
      - description: region_id
        in: path
        name: region_id
        required: true
        type: string
      - description: region
        in: body
        name: region
        required: true
        schema:
          $ref: '#/definitions/forms.ProviderRegion'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/forms.ProviderRegion'
      summary: UpdateRegion
      tags:
      - Provider
swagger: "2.0"
