
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.4.1
  creationTimestamp: null
  name: imports.cloud.pingcap.com
spec:
  group: cloud.pingcap.com
  names:
    kind: Import
    listKind: ImportList
    plural: imports
    singular: import
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.clusterName
      name: Cluster
      type: string
    - jsonPath: .status.phase
      name: PHASE
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: AGE
      type: date
    name: v1
    schema:
      openAPIV3Schema:
        description: Import is the Schema for the imports API
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: ImportSpec defines the desired state of Import
            properties:
              accessConfig:
                description: AccessConfig includes the information for access the
                  import source.
                properties:
                  roleArn:
                    description: RoleArn is the ARN of the AWS role which the workload
                      will assume.
                    type: string
                type: object
              clusterName:
                description: ClusterName specifies the name of the cluster where the
                  data is imported to, the Cluster must exist in the same namespace
                  as Import
                type: string
              dryRun:
                description: With DryRun marked as true, the import job will only
                  run a dry run job to verify the permission to access the import
                  source
                type: boolean
              source:
                description: Source specifies where the import data should be retrieved
                  and parsed
                properties:
                  csvFormat:
                    description: CsvFormat is the format of the CSV files.
                    properties:
                      backslashEscape:
                        type: boolean
                      delimiter:
                        type: string
                      header:
                        type: boolean
                      notNull:
                        type: boolean
                      "null":
                        type: string
                      separator:
                        type: string
                      trimLastSeparator:
                        type: boolean
                    required:
                    - backslashEscape
                    - delimiter
                    - header
                    - notNull
                    - "null"
                    - separator
                    - trimLastSeparator
                    type: object
                  filters:
                    items:
                      type: string
                    type: array
                  format:
                    description: 'Format is the data format of the source data 0:
                      Unknown 1: SQL 2: Parquet 3: CSV'
                    format: int32
                    type: integer
                  password:
                    description: Password is the TiDB password for Import job
                    type: string
                  storage:
                    description: Storage specifies where the data is located
                    properties:
                      gcs:
                        properties:
                          region:
                            type: string
                          url:
                            type: string
                        required:
                        - region
                        - url
                        type: object
                      s3:
                        properties:
                          region:
                            type: string
                          url:
                            type: string
                        required:
                        - region
                        - url
                        type: object
                    type: object
                  userName:
                    description: UserName is the TiDB username for Import job
                    type: string
                required:
                - format
                - password
                - storage
                - userName
                type: object
              storageRequest:
                description: StorageRequest specifies additional storage size for
                  the import job to use
                type: string
            required:
            - clusterName
            - source
            type: object
          status:
            description: ImportStatus defines the observed state of Import
            properties:
              completedPercent:
                format: int32
                type: integer
              completedTables:
                format: int32
                type: integer
              currentTables:
                items:
                  properties:
                    completed_percent:
                      format: int32
                      type: integer
                    name:
                      type: string
                    size:
                      format: int64
                      type: integer
                  required:
                  - completed_percent
                  - name
                  - size
                  type: object
                type: array
              message:
                type: string
              pendingTables:
                format: int32
                type: integer
              phase:
                type: string
              totalFiles:
                format: int32
                type: integer
              totalSize:
                format: int64
                type: integer
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
    subresources:
      status: {}
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []
