---
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: couchbasebackuprestores.couchbase.com
spec:
  group: couchbase.com
  names:
    kind: CouchbaseBackupRestore
    listKind: CouchbaseBackupRestoreList
    plural: couchbasebackuprestores
    shortNames:
    - cbrestore
    singular: couchbasebackuprestore
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .status.capacityUsed
      name: capacity used
      type: string
    - jsonPath: .status.lastRun
      name: last run
      type: string
    - jsonPath: .status.lastSuccess
      name: last success
      type: string
    - jsonPath: .status.duration
      name: duration
      type: string
    - jsonPath: .status.running
      name: running
      type: boolean
    - jsonPath: .metadata.creationTimestamp
      name: age
      type: date
    name: v2
    schema:
      openAPIV3Schema:
        description: CouchbaseBackupRestore allows the restoration of all Couchbase
          cluster data from a CouchbaseBackup resource.
        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: CouchbaseBackupRestoreSpec allows the specification of data
              restoration to be configured.  This includes the backup and repository
              to restore data from, and the time range of data to be restored.
            properties:
              backoffLimit:
                default: 2
                description: Number of times the restore job should try to execute.
                format: int32
                type: integer
              backup:
                description: The backup resource name associated with this restore,
                  or the backup PVC name to restore from.
                type: string
              buckets:
                description: DEPRECATED - by spec.data. Specific buckets can be explicitly
                  included or excluded in the restore, as well as bucket mappings.  This
                  field is now ignored.
                type: object
                x-kubernetes-preserve-unknown-fields: true
              data:
                description: Data allows control over what key-value/document data
                  is included in the restore.  By default, all data is included.
                properties:
                  exclude:
                    description: Exclude defines the buckets, scopes or collections
                      that are excluded from the backup. When this field is set, it
                      implies that by default everything will be backed up, and data
                      items can be explicitly excluded.  You may define an exclusion
                      as a bucket -- `my-bucket`, a scope -- `my-bucket.my-scope`,
                      or a collection -- `my-bucket.my-scope.my-collection`. Buckets
                      may contain periods, and therefore must be escaped -- `my\.bucket.my-scope`,
                      as period is the separator used to delimit scopes and collections.  Excluded
                      data cannot overlap e.g. specifying `my-bucket` and `my-bucket.my-scope`
                      is illegal.  This field cannot be used at the same time as included
                      items.
                    items:
                      description: BucketScopeOrCollectionNameWithDefaults is the
                        name of a fully qualifed bucket, scope or collection. The
                        _default scope and collection are valid for this type. As
                        these names are period separated, and buckets can contain
                        periods, the latter need to be escaped.  This specification
                        is based on cbbackupmgr.
                      pattern: ^(?:[a-zA-Z0-9\-_%]|\\.){1,100}(\._default(\._default)?|\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29}(\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29})?)?$
                      type: string
                    minItems: 1
                    type: array
                    x-kubernetes-list-type: set
                  filterKeys:
                    description: FilterKeys only restores documents whose names match
                      the provided regular expression.
                    type: string
                  filterValues:
                    description: FilterValues only restores documents whose values
                      match the provided regular expression.
                    type: string
                  include:
                    description: Include defines the buckets, scopes or collections
                      that are included in the restore. When this field is set, it
                      implies that by default nothing will be restored, and data items
                      must be explicitly included.  You may define an inclusion as
                      a bucket -- `my-bucket`, a scope -- `my-bucket.my-scope`, or
                      a collection -- `my-bucket.my-scope.my-collection`. Buckets
                      may contain periods, and therefore must be escaped -- `my\.bucket.my-scope`,
                      as period is the separator used to delimit scopes and collections.  Included
                      data cannot overlap e.g. specifying `my-bucket` and `my-bucket.my-scope`
                      is illegal.  This field cannot be used at the same time as excluded
                      items.
                    items:
                      description: BucketScopeOrCollectionNameWithDefaults is the
                        name of a fully qualifed bucket, scope or collection. The
                        _default scope and collection are valid for this type. As
                        these names are period separated, and buckets can contain
                        periods, the latter need to be escaped.  This specification
                        is based on cbbackupmgr.
                      pattern: ^(?:[a-zA-Z0-9\-_%]|\\.){1,100}(\._default(\._default)?|\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29}(\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29})?)?$
                      type: string
                    minItems: 1
                    type: array
                    x-kubernetes-list-type: set
                  map:
                    description: Map allows data items in the restore to be remapped
                      to a different named container. Buckets can be remapped to other
                      buckets e.g. "source=target", scopes and collections can be
                      remapped to other scopes and collections within the same bucket
                      only e.g. "bucket.scope=bucket.other" or "bucket.scope.collection=bucket.scope.other".  Map
                      sources may only be specified once, and may not overlap.
                    items:
                      description: RestoreMapping allows data to be migrated on restore.
                      properties:
                        source:
                          description: Source defines the data source of the mapping,
                            this may be either a bucket, scope or collection.
                          pattern: ^(?:[a-zA-Z0-9\-_%]|\\.){1,100}(\._default(\._default)?|\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29}(\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29})?)?$
                          type: string
                        target:
                          description: Target defines the data target of the mapping,
                            this may be either a bucket, scope or collection, and
                            must refer to the same type as the restore source.
                          pattern: ^(?:[a-zA-Z0-9\-_%]|\\.){1,100}(\._default(\._default)?|\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29}(\.[a-zA-Z0-9\-][a-zA-Z0-9\-%_]{0,29})?)?$
                          type: string
                      required:
                      - source
                      - target
                      type: object
                    type: array
                    x-kubernetes-list-map-keys:
                    - source
                    x-kubernetes-list-type: map
                type: object
              end:
                description: End denotes the last backup to restore from.  Omitting
                  this field will only restore the backup referenced by start.  This
                  may be specified as an integer index (starting from 1), a string
                  specifying a short date DD-MM-YYYY, the backup name, or one of either
                  `start` or `oldest` keywords.
                properties:
                  int:
                    description: Int references a relative backup by index.
                    minimum: 1
                    type: integer
                  str:
                    description: Str references an absolute backup by name.
                    type: string
                type: object
              forceUpdates:
                description: Forces data in the Couchbase cluster to be overwritten
                  even if the data in the cluster is newer than the restore
                type: boolean
              logRetention:
                default: 168h
                description: 'Number of hours to hold restore script logs for, everything
                  older will be deleted. More info: https://golang.org/pkg/time/#ParseDuration'
                type: string
              repo:
                description: Repo is the backup folder to restore from.  If no repository
                  is specified, the backup container will choose the latest.
                type: string
              s3bucket:
                description: Name of S3 bucket to restore from. If non-empty this
                  overrides local backup.
                pattern: ^s3://[a-z0-9-\.]{3,63}$
                type: string
              services:
                default: {}
                description: This list accepts a certain set of parameters that will
                  disable that data and prevent it being restored.
                properties:
                  analytics:
                    default: true
                    description: Analytics restores analytics datasets from the backup.  This
                      field defaults to true.
                    type: boolean
                  bucketConfig:
                    description: BucketConfig restores all bucket configuration settings.
                      If you are restoring to cluster with managed buckets, then this
                      option may conflict with existing bucket settings, and the results
                      are undefined, so avoid use.  This option is intended for use
                      with unmanaged buckets.  Note that bucket durability settings
                      are not restored in versions less than and equal to 1.1.0, and
                      will need to be manually applied.  This field defaults to false.
                    type: boolean
                  bucketQuery:
                    default: true
                    description: BucketQuery enables the backup of query metadata
                      for all buckets. This field defaults to `true`.
                    type: boolean
                  clusterAnalytics:
                    default: true
                    description: ClusterAnalytics enables the backup of cluster-wide
                      analytics data, for example synonyms. This field defaults to
                      `true`.
                    type: boolean
                  clusterQuery:
                    default: true
                    description: ClusterQuery enables the backup of cluster level
                      query metadata. This field defaults to `true`.
                    type: boolean
                  data:
                    default: true
                    description: Data restores document data from the backup.  This
                      field defaults to true.
                    type: boolean
                  eventing:
                    default: true
                    description: Eventing restores eventing functions from the backup.  This
                      field defaults to true.
                    type: boolean
                  ftAlias:
                    default: true
                    description: FTAlias restores full-text search aliases from the
                      backup.  This field defaults to true.
                    type: boolean
                  ftIndex:
                    default: true
                    description: FTIndex restores full-text search indexes from the
                      backup.  This field defaults to true.
                    type: boolean
                  gsiIndex:
                    default: true
                    description: GSIIndex restores document indexes from the backup.  This
                      field defaults to true.
                    type: boolean
                  views:
                    default: true
                    description: Views restores views from the backup.  This field
                      defaults to true.
                    type: boolean
                type: object
              start:
                description: Start denotes the first backup to restore from.  This
                  may be specified as an integer index (starting from 1), a string
                  specifying a short date DD-MM-YYYY, the backup name, or one of either
                  `start` or `oldest` keywords.
                properties:
                  int:
                    description: Int references a relative backup by index.
                    minimum: 1
                    type: integer
                  str:
                    description: Str references an absolute backup by name.
                    type: string
                type: object
              threads:
                default: 1
                description: How many threads to use during the restore.
                minimum: 1
                type: integer
            required:
            - backup
            - repo
            type: object
          status:
            description: CouchbaseBackupRestoreStatus provides status indications
              of a restore from backup.  This includes whether or not the restore
              is running, whether the restore succeed or not, and the duration the
              restore took.
            properties:
              archive:
                description: Location of Backup Archive.
                type: string
              backups:
                description: Backups gives us a full list of all backups and their
                  respective repository locations.
                items:
                  properties:
                    full:
                      description: Full backup inside the repository.
                      type: string
                    incrementals:
                      description: Incremental backups inside the repository.
                      items:
                        type: string
                      type: array
                    name:
                      description: Name of the repository.
                      type: string
                  required:
                  - name
                  type: object
                type: array
              duration:
                description: 'Duration tells us how long the last restore took.  More
                  info: https://golang.org/pkg/time/#ParseDuration'
                type: string
              failed:
                description: Failed indicates whether the most recent restore has
                  failed.
                type: boolean
              job:
                description: DEPRECATED - field may no longer be populated. Job tells
                  us which job is running/ran last.
                type: string
              lastFailure:
                description: LastFailure tells us the time the last failed restore
                  failed.
                format: date-time
                type: string
              lastRun:
                description: LastRun tells us the time the last restore job started.
                format: date-time
                type: string
              lastSuccess:
                description: LastSuccess gives us the time the last successful restore
                  finished.
                format: date-time
                type: string
              output:
                description: DEPRECATED - field may no longer be populated. Output
                  reports useful information from the backup process.
                type: string
              pod:
                description: DEPRECATED - field may no longer be populated. Pod tells
                  us which pod is running/ran last.
                type: string
              repo:
                description: Repo is where we are currently performing operations.
                type: string
              running:
                description: Running indicates whether a restore is currently being
                  performed.
                type: boolean
            required:
            - failed
            - running
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
