---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    config.couchbase.com/version: 2.3.0
    controller-gen.kubebuilder.io/version: v0.8.0
  name: couchbasemigrationreplications.couchbase.com
spec:
  group: couchbase.com
  names:
    kind: CouchbaseMigrationReplication
    listKind: CouchbaseMigrationReplicationList
    plural: couchbasemigrationreplications
    singular: couchbasemigrationreplication
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.bucket
      name: bucket
      type: string
    - jsonPath: .spec.remoteBucket
      name: remote bucket
      type: string
    - jsonPath: .spec.paused
      name: paused
      type: boolean
    - jsonPath: .metadata.creationTimestamp
      name: age
      type: date
    name: v2
    schema:
      openAPIV3Schema:
        description: The CouchbaseScopeMigration resource represents the use of the
          special migration mapping within XDCR to take a filtered list from the default
          scope and collection of the source bucket, replicate it to named scopes
          and collections within the target bucket. The bucket-to-bucket replication
          cannot duplicate any used by the CouchbaseReplication resource, as these
          two types of replication are mutually exclusive between buckets. https://docs.couchbase.com/server/current/learn/clusters-and-availability/xdcr-with-scopes-and-collections.html#migration
        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
          migrationMapping:
            description: The migration mappings to use, should never be empty as that
              is just an implicit bucket-to-bucket replication then.
            properties:
              mappings:
                description: The migration mappings to use, should never be empty
                  as that is just an implicit bucket-to-bucket replication then.
                items:
                  description: Indicates whether this is using migration mapping or
                    not. This is only valid when using the default scope/collection.
                  properties:
                    filter:
                      default: _default._default
                      description: A filter to select from the source default scope
                        and collection. Defaults to select everything in the default
                        scope and collection.
                      type: string
                    targetKeyspace:
                      description: The destination of our migration, must be a scope
                        and collection.
                      properties:
                        collection:
                          description: The optional collection within the scope. May
                            be empty to just work at scope level.
                          maxLength: 251
                          minLength: 1
                          pattern: ^(_default|[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,250})$
                          type: string
                        scope:
                          description: The scope to use.
                          maxLength: 251
                          minLength: 1
                          pattern: ^(_default|[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,250})$
                          type: string
                      required:
                      - scope
                      type: object
                  required:
                  - targetKeyspace
                  type: object
                type: array
            required:
            - mappings
            type: object
          spec:
            description: CouchbaseReplicationSpec allows configuration of an XDCR
              replication.
            properties:
              bucket:
                description: Bucket is the source bucket to replicate from.  This
                  refers to the Couchbase bucket name, not the resource name of the
                  bucket.  A bucket with this name must be defined on this cluster.  Legal
                  bucket names have a maximum length of 100 characters and may be
                  composed of any character from "a-z", "A-Z", "0-9" and "-_%\.".
                maxLength: 100
                pattern: ^[a-zA-Z0-9-_%\.]{1,100}$
                type: string
              compressionType:
                default: Auto
                description: CompressionType is the type of compression to apply to
                  the replication. When None, no compression will be applied to documents
                  as they are transferred between clusters.  When Auto, Couchbase
                  server will automatically compress documents as they are transferred
                  to reduce bandwidth requirements. This field must be one of "None"
                  or "Auto", defaulting to "Auto".
                enum:
                - None
                - Auto
                type: string
              filterExpression:
                description: FilterExpression allows certain documents to be filtered
                  out of the replication.
                type: string
              paused:
                description: Paused allows a replication to be stopped and restarted
                  without having to restart the replication from the beginning.
                type: boolean
              remoteBucket:
                description: RemoteBucket is the remote bucket name to synchronize
                  to.  This refers to the Couchbase bucket name, not the resource
                  name of the bucket.  Legal bucket names have a maximum length of
                  100 characters and may be composed of any character from "a-z",
                  "A-Z", "0-9" and "-_%\.".
                maxLength: 100
                pattern: ^[a-zA-Z0-9-_%\.]{1,100}$
                type: string
            required:
            - bucket
            - remoteBucket
            type: object
        required:
        - migrationMapping
        - spec
        type: object
    served: true
    storage: true
