#
#  Copyright (c) 2019-2021 Red Hat, Inc.
#    This program and the accompanying materials are made
#    available under the terms of the Eclipse Public License 2.0
#    which is available at https://www.eclipse.org/legal/epl-2.0/
#
#  SPDX-License-Identifier: EPL-2.0
#
#  Contributors:
#    Red Hat, Inc. - initial API and implementation
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: checlusterrestores.org.eclipse.che
spec:
  group: org.eclipse.che
  names:
    kind: CheClusterRestore
    listKind: CheClusterRestoreList
    plural: checlusterrestores
    singular: checlusterrestore
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: The `CheClusterRestore` custom resource allows defining and managing
          Eclipse Che restore
        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: CheClusterRestoreSpec defines the desired state of CheClusterRestore
            properties:
              backupServerConfigRef:
                description: Name of custom resource with a backup server configuration
                  to use for this restore. Can be omitted if only one server configuration
                  object exists within the namespace.
                type: string
              snapshotId:
                description: Snapshot ID to restore from. If omitted, latest snapshot
                  will be used.
                type: string
            type: object
          status:
            description: CheClusterRestoreStatus defines the observed state of CheClusterRestore
            properties:
              message:
                description: Restore result or error message
                type: string
              stage:
                description: Describes phase of restore progress
                type: string
              state:
                description: 'Restore progress state: InProgress, Failed, Succeeded'
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
