apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    kubevirt.io/generation: "1"
    kubevirt.io/install-strategy-identifier: c51bc47ef3eccba54f764552d24801eb8388b36e
    kubevirt.io/install-strategy-registry: quay.io/kubevirt
    kubevirt.io/install-strategy-version: v1.0.1
  generation: 1
  labels:
    app.kubernetes.io/component: kubevirt
    app.kubernetes.io/managed-by: virt-operator
    kubevirt.io: ""
  name: virtualmachinerestores.snapshot.kubevirt.io
spec:
  conversion:
    strategy: None
  group: snapshot.kubevirt.io
  names:
    categories:
      - all
    kind: VirtualMachineRestore
    listKind: VirtualMachineRestoreList
    plural: virtualmachinerestores
    shortNames:
      - vmrestore
      - vmrestores
    singular: virtualmachinerestore
  scope: Namespaced
  versions:
    - additionalPrinterColumns:
        - jsonPath: .spec.target.kind
          name: TargetKind
          type: string
        - jsonPath: .spec.target.name
          name: TargetName
          type: string
        - jsonPath: .status.complete
          name: Complete
          type: boolean
        - jsonPath: .status.restoreTime
          name: RestoreTime
          type: date
        - jsonPath: .status.error.message
          name: Error
          type: string
      name: v1alpha1
      schema:
        openAPIV3Schema:
          description: VirtualMachineRestore defines the operation of restoring a VM
          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: VirtualMachineRestoreSpec is the spec for a VirtualMachineRestoreresource
              properties:
                patches:
                  description: "If the target for the restore does not exist, it will be created. Patches holds JSON patches that would be applied to the target manifest before it's created. Patches should fit the target's Kind. \n Example for a patch: {\"op\": \"replace\", \"path\": \"/metadata/name\", \"value\": \"new-vm-name\"}"
                  items:
                    type: string
                  type: array
                  x-kubernetes-list-type: atomic
                target:
                  description: initially only VirtualMachine type supported
                  properties:
                    apiGroup:
                      description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
                      type: string
                    kind:
                      description: Kind is the type of resource being referenced
                      type: string
                    name:
                      description: Name is the name of resource being referenced
                      type: string
                  required:
                    - kind
                    - name
                  type: object
                virtualMachineSnapshotName:
                  type: string
              required:
                - target
                - virtualMachineSnapshotName
              type: object
            status:
              description: VirtualMachineRestoreStatus is the spec for a VirtualMachineRestoreresource
              properties:
                complete:
                  type: boolean
                conditions:
                  items:
                    description: Condition defines conditions
                    properties:
                      lastProbeTime:
                        format: date-time
                        nullable: true
                        type: string
                      lastTransitionTime:
                        format: date-time
                        nullable: true
                        type: string
                      message:
                        type: string
                      reason:
                        type: string
                      status:
                        type: string
                      type:
                        description: ConditionType is the const type for Conditions
                        type: string
                    required:
                      - status
                      - type
                    type: object
                  type: array
                deletedDataVolumes:
                  items:
                    type: string
                  type: array
                restoreTime:
                  format: date-time
                  type: string
                restores:
                  items:
                    description: VolumeRestore contains the data neeed to restore a PVC
                    properties:
                      dataVolumeName:
                        type: string
                      persistentVolumeClaim:
                        type: string
                      volumeName:
                        type: string
                      volumeSnapshotName:
                        type: string
                    required:
                      - persistentVolumeClaim
                      - volumeName
                      - volumeSnapshotName
                    type: object
                  type: array
              type: object
          required:
            - spec
          type: object
      served: true
      storage: true