---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.2
  name: exports.cloud.pingcap.com
spec:
  group: cloud.pingcap.com
  names:
    kind: Export
    listKind: ExportList
    plural: exports
    singular: export
  preserveUnknownFields: false
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: Export is the Schema for the export 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: ExportSpec defines the desired state of Export
            properties:
              clusterName:
                description: ClusterName is the target cluster name, target cluster
                  must exist in the same namespace as export
                type: string
              options:
                description: Options is the configuration of the export
                properties:
                  columnSelectors:
                    description: |-
                      ColumnSelectors select output columns for matching tables. They are passed
                      to Dumpling as repeated --column-filter arguments.
                    items:
                      description: |-
                        ColumnSelector selects columns from tables matched by Matcher. The matcher
                        and columns syntax is shared with TiCDC column selectors.
                      properties:
                        columns:
                          items:
                            type: string
                          minItems: 1
                          type: array
                        matcher:
                          items:
                            type: string
                          minItems: 1
                          type: array
                      type: object
                    type: array
                  compression:
                    description: Compression is the compression algorithm of the export
                      file
                    type: string
                  consistency:
                    description: Consistency is the consistency level of the export
                    type: string
                  csvOptions:
                    description: CSVOptions is the configuration of the CSV file
                    properties:
                      delimiter:
                        description: Delimiter is the delimiter of the CSV file
                        type: string
                      dialect:
                        description: |-
                          Dialect is the CSV output dialect of dumpling (e.g. "snowflake",
                          "bigquery", "redshift"). Empty means the dumpling default dialect.
                        type: string
                      lineTerminator:
                        description: LineTerminator is the line terminator of the
                          CSV file
                        type: string
                      noHeader:
                        description: NoHeader Export CSV files of the tables without
                          generating header
                        type: boolean
                      "null":
                        description: Null is the null of the CSV file
                        type: string
                      separator:
                        description: Separator is the separator of the CSV file
                        type: string
                    type: object
                  escapeBackslash:
                    description: |-
                      EscapeBackslash controls whether dumpling escapes special characters with a
                      backslash (\) in the export file. It is tri-state: nil leaves the dumpling
                      default (escaping enabled), while an explicit true/false forces the setting.
                    type: boolean
                  fileType:
                    description: FileType is the exported file type
                    type: string
                  filter:
                    description: Filter is the Table filter expression in dumpling
                    type: string
                  parquetOptions:
                    description: ParquetOptions is the configuration of the parquet
                      file
                    properties:
                      compression:
                        description: Compression is the inside compression of parquet
                        type: string
                    type: object
                  partition:
                    items:
                      type: string
                    type: array
                  rows:
                    description: Rows Enable the in-table concurrency to speed up
                      the export
                    type: boolean
                  snapshot:
                    description: Snapshot is the snapshot TSO of the export
                    type: string
                  sql:
                    description: SQL export data according to the specified SQL statement
                    type: string
                  tableFilter:
                    description: TableFilter is the table filter expression in dumpling
                    items:
                      type: string
                    type: array
                  thread:
                    description: Thread is the number of threads in dumpling
                    format: int32
                    type: integer
                  where:
                    description: Where is the where condition of the export
                    type: string
                required:
                - fileType
                type: object
                x-kubernetes-validations:
                - message: sql and columnSelectors cannot be used together
                  rule: '!has(self.sql) || self.sql == '''' || !has(self.columnSelectors)
                    || size(self.columnSelectors) == 0'
              secret:
                description: Secret is the secret of the export
                properties:
                  password:
                    type: string
                  user:
                    type: string
                type: object
              target:
                description: Target is the target of the export
                properties:
                  azure:
                    properties:
                      accessTier:
                        type: string
                      accountKey:
                        type: string
                      accountName:
                        type: string
                      containerName:
                        type: string
                      encryptionKey:
                        type: string
                      encryptionScope:
                        type: string
                      sasToken:
                        type: string
                      sasUrl:
                        type: string
                    type: object
                  exportType:
                    description: ExportType is the type of export target
                    type: string
                  gcs:
                    properties:
                      bucketUri:
                        type: string
                      credentialsFile:
                        type: string
                      predefinedAcl:
                        type: string
                      serviceAccountKey:
                        type: string
                      storageClass:
                        type: string
                    type: object
                  local:
                    type: string
                  region:
                    type: string
                  s3:
                    properties:
                      accessKey:
                        type: string
                      bucketUri:
                        description: BucketUri is the s3 bucket uri
                        type: string
                      endpoint:
                        type: string
                      provider:
                        type: string
                      roleArn:
                        type: string
                      secretAccess:
                        type: string
                    type: object
                required:
                - exportType
                type: object
            required:
            - clusterName
            - options
            - secret
            - target
            type: object
          status:
            description: ExportStatus defines the observed state of Export
            properties:
              compressedSize:
                description: CompressedSize is the size of the compressed exported
                  data.
                type: string
              finishedSize:
                description: FinishedSize is the size of the exported data.
                type: string
              message:
                description: Message is the error message of the Export.
                type: string
              phase:
                description: Phase is lifecycle phase of the Export
                enum:
                - Prepare
                - Running
                - Failed
                - Completed
                - Cancel
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
