{
  "description": "ZFSRestore describes a cstor restore resource created as a custom resource",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "description": "ZFSRestoreSpec is the spec for a ZFSRestore resource",
      "properties": {
        "ownerNodeID": {
          "description": "owner node name where restore volume is present",
          "minLength": 1,
          "type": "string"
        },
        "restoreSrc": {
          "description": "it can be ip:port in case of restore from remote or volumeName in case of local restore",
          "minLength": 1,
          "pattern": "^([0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+)$",
          "type": "string"
        },
        "volumeName": {
          "description": "volume name to where restore has to be performed",
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "ownerNodeID",
        "restoreSrc",
        "volumeName"
      ],
      "type": "object"
    },
    "status": {
      "description": "ZFSRestoreStatus is to hold result of action.",
      "enum": [
        "Init",
        "Done",
        "Failed",
        "Pending",
        "InProgress",
        "Invalid"
      ],
      "type": "string"
    },
    "volSpec": {
      "additionalProperties": false,
      "description": "VolumeInfo defines ZFS volume parameters for all modes in which\nZFS volumes can be created like - ZFS volume with filesystem,\nZFS Volume exposed as zfs or ZFS volume exposed as raw block device.\nSome of the parameters can be only set during creation time\n(as specified in the details of the parameter), and a few are editable.\nIn case of Cloned volumes, the parameters are assigned the same values\nas the source volume.",
      "properties": {
        "capacity": {
          "description": "Capacity of the volume",
          "minLength": 1,
          "type": "string"
        },
        "compression": {
          "description": "Compression specifies the block-level compression algorithm to be applied to the ZFS Volume.\nThe value \"on\" indicates ZFS to use the default compression algorithm. The default compression\nalgorithm used by ZFS will be either lzjb or, if the lz4_compress feature is enabled, lz4.\nCompression property can be edited after the volume has been created. The change will only\nbe applied to the newly-written data. For instance, if the Volume was created with \"off\" and\nthe next day the compression was modified to \"on\", the data written prior to setting \"on\" will\nnot be compressed.\nDefault Value: off.",
          "pattern": "^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$",
          "type": [
            "string",
            "null"
          ]
        },
        "dedup": {
          "description": "Deduplication is the process for removing redundant data at the block level,\nreducing the total amount of data stored. If a file system has the dedup property\nenabled, duplicate data blocks are removed synchronously.\nThe result is that only unique data is stored and common components are shared among files.\nDeduplication can consume significant processing power (CPU) and memory as well as generate additional disk IO.\nBefore creating a pool with deduplication enabled, ensure that you have planned your hardware\nrequirements appropriately and implemented appropriate recovery practices, such as regular backups.\nAs an alternative to deduplication consider using compression=lz4, as a less resource-intensive alternative.\nshould be enabled on the zvol.\nDedup property can be edited after the volume has been created.\nDefault Value: off.",
          "enum": [
            "on",
            "off"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "encryption": {
          "description": "Enabling the encryption feature allows for the creation of\nencrypted filesystems and volumes. ZFS will encrypt file and zvol data,\nfile attributes, ACLs, permission bits, directory listings, FUID mappings,\nand userused / groupused data. ZFS will not encrypt metadata related to the\npool structure, including dataset and snapshot names, dataset hierarchy,\nproperties, file size, file holes, and deduplication tables\n(though the deduplicated data itself is encrypted).\nDefault Value: off.",
          "pattern": "^(on|off|aes-128-[c,g]cm|aes-192-[c,g]cm|aes-256-[c,g]cm)$",
          "type": [
            "string",
            "null"
          ]
        },
        "fsType": {
          "description": "FsType specifies filesystem type for the zfs volume/dataset.\nIf FsType is provided as \"zfs\", then the driver will create a\nZFS dataset, formatting is not required as underlying filesystem is ZFS anyway.\nIf FsType is ext2, ext3, ext4 or xfs, then the driver will create a ZVOL and\nformat the volume accordingly.\nFsType can not be modified once volume has been provisioned.\nDefault Value: ext4.",
          "type": [
            "string",
            "null"
          ]
        },
        "keyformat": {
          "description": "KeyFormat specifies format of the encryption key\nThe supported KeyFormats are passphrase, raw, hex.",
          "enum": [
            "passphrase",
            "raw",
            "hex"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "keylocation": {
          "description": "KeyLocation is the location of key for the encryption",
          "type": [
            "string",
            "null"
          ]
        },
        "ownerNodeID": {
          "description": "OwnerNodeID is the Node ID where the ZPOOL is running which is where\nthe volume has been provisioned.\nOwnerNodeID can not be edited after the volume has been provisioned.",
          "minLength": 1,
          "type": "string"
        },
        "poolName": {
          "description": "poolName specifies the name of the pool where the volume has been created.\nPoolName can not be edited after the volume has been provisioned.",
          "minLength": 1,
          "type": "string"
        },
        "quotaType": {
          "description": "quotaType determines whether the dataset volume quota type is of type \"quota\" or \"refquota\".\nQuotaType can not be modified once volume has been provisioned.\nDefault Value: quota.",
          "enum": [
            "quota",
            "refquota"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "recordsize": {
          "description": "Specifies a suggested block size for files in the file system.\nThe size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.\nRecordSize property can be edited after the volume has been created.\nChanging the file system's recordsize affects only files created afterward; existing files are unaffected.\nDefault Value: 128k.",
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "shared": {
          "description": "Shared specifies whether the volume can be shared among multiple pods.\nIf it is not set to \"yes\", then the ZFS-LocalPV Driver will not allow\nthe volumes to be mounted by more than one pods.",
          "enum": [
            "yes",
            "no"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "snapname": {
          "description": "SnapName specifies the name of the snapshot where the volume has been cloned from.\nSnapname can not be edited after the volume has been provisioned.",
          "type": [
            "string",
            "null"
          ]
        },
        "thinProvision": {
          "description": "ThinProvision describes whether space reservation for the source volume is required or not.\nThe value \"yes\" indicates that volume should be thin provisioned and \"no\" means thick provisioning of the volume.\nIf thinProvision is set to \"yes\" then volume can be provisioned even if the ZPOOL does not\nhave the enough capacity.\nIf thinProvision is set to \"no\" then volume can be provisioned only if the ZPOOL has enough\ncapacity and capacity required by volume can be reserved.\nThinProvision can not be modified once volume has been provisioned.\nDefault Value: no.",
          "enum": [
            "yes",
            "no"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "volblocksize": {
          "description": "VolBlockSize specifies the block size for the zvol.\nThe volsize can only be set to a multiple of volblocksize, and cannot be zero.\nVolBlockSize can not be edited after the volume has been provisioned.\nDefault Value: 8k.",
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "volumeType": {
          "description": "volumeType determines whether the volume is of type \"DATASET\" or \"ZVOL\".\nIf fstype provided in the storageclass is \"zfs\", a volume of type dataset will be created.\nIf \"ext4\", \"ext3\", \"ext2\" or \"xfs\" is mentioned as fstype\nin the storageclass, then a volume of type zvol will be created, which will be\nfurther formatted as the fstype provided in the storageclass.\nVolumeType can not be modified once volume has been provisioned.",
          "enum": [
            "ZVOL",
            "DATASET"
          ],
          "type": "string"
        }
      },
      "required": [
        "capacity",
        "ownerNodeID",
        "poolName",
        "volumeType"
      ],
      "type": [
        "object",
        "null"
      ]
    }
  },
  "required": [
    "spec",
    "status"
  ],
  "type": "object"
}