{
  "description": "PerconaPGBackup is the CRD that defines a Percona PostgreSQL Backup",
  "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"
    },
    "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"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "options": {
          "description": "Command line options to include when running the pgBackRest backup command.\nhttps://pgbackrest.org/command.html#command-backup",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "pgCluster": {
          "type": "string"
        },
        "repoName": {
          "description": "The name of the pgBackRest repo to run the backup command against.",
          "pattern": "^repo[1-4]",
          "type": "string"
        }
      },
      "required": [
        "pgCluster",
        "repoName"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "properties": {
        "backupName": {
          "type": "string"
        },
        "backupType": {
          "type": "string"
        },
        "completed": {
          "format": "date-time",
          "type": "string"
        },
        "crVersion": {
          "type": "string"
        },
        "destination": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "image": {
          "type": "string"
        },
        "jobName": {
          "type": "string"
        },
        "latestRestorableTime": {
          "type": "string"
        },
        "repo": {
          "description": "PGBackRestRepo represents a pgBackRest repository.  Only one of its members may be specified.",
          "properties": {
            "azure": {
              "description": "Represents a pgBackRest repository that is created using Azure storage",
              "properties": {
                "container": {
                  "description": "The Azure container utilized for the repository",
                  "type": "string"
                }
              },
              "required": [
                "container"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "gcs": {
              "description": "Represents a pgBackRest repository that is created using Google Cloud Storage",
              "properties": {
                "bucket": {
                  "description": "The GCS bucket utilized for the repository",
                  "type": "string"
                }
              },
              "required": [
                "bucket"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "name": {
              "description": "The name of the repository",
              "pattern": "^repo[1-4]",
              "type": "string"
            },
            "s3": {
              "description": "RepoS3 represents a pgBackRest repository that is created using AWS S3 (or S3-compatible)\nstorage",
              "properties": {
                "bucket": {
                  "description": "The S3 bucket utilized for the repository",
                  "type": "string"
                },
                "endpoint": {
                  "description": "A valid endpoint corresponding to the specified region",
                  "type": "string"
                },
                "region": {
                  "description": "The region corresponding to the S3 bucket",
                  "type": "string"
                }
              },
              "required": [
                "bucket",
                "endpoint",
                "region"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "schedules": {
              "description": "Defines the schedules for the pgBackRest backups\nFull, Differential and Incremental backup types are supported:\nhttps://pgbackrest.org/user-guide.html#concept/backup",
              "properties": {
                "differential": {
                  "description": "Defines the Cron schedule for a differential pgBackRest backup.\nFollows the standard Cron schedule syntax:\nhttps://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax",
                  "minLength": 6,
                  "type": "string"
                },
                "full": {
                  "description": "Defines the Cron schedule for a full pgBackRest backup.\nFollows the standard Cron schedule syntax:\nhttps://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax",
                  "minLength": 6,
                  "type": "string"
                },
                "incremental": {
                  "description": "Defines the Cron schedule for an incremental pgBackRest backup.\nFollows the standard Cron schedule syntax:\nhttps://k8s.io/docs/concepts/workloads/controllers/cron-jobs/#cron-schedule-syntax",
                  "minLength": 6,
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "volume": {
              "description": "Represents a pgBackRest repository that is created using a PersistentVolumeClaim",
              "properties": {
                "volumeClaimSpec": {
                  "description": "Defines a PersistentVolumeClaim spec used to create and/or bind a volume",
                  "properties": {
                    "accessModes": {
                      "description": "accessModes contains the desired access modes the volume should have.\nMore info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1",
                      "items": {
                        "type": "string"
                      },
                      "type": "array",
                      "x-kubernetes-list-type": "atomic"
                    },
                    "dataSource": {
                      "description": "dataSource field can be used to specify either:\n* An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)\n* An existing PVC (PersistentVolumeClaim)\nIf the provisioner or an external controller can support the specified data source,\nit will create a new volume based on the contents of the specified data source.\nWhen the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef,\nand dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified.\nIf the namespace is specified, then dataSourceRef will not be copied to dataSource.",
                      "properties": {
                        "apiGroup": {
                          "description": "APIGroup is the group for the resource being referenced.\nIf APIGroup is not specified, the specified Kind must be in the core API group.\nFor 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",
                      "x-kubernetes-map-type": "atomic",
                      "additionalProperties": false
                    },
                    "dataSourceRef": {
                      "description": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty\nvolume is desired. This may be any object from a non-empty API group (non\ncore object) or a PersistentVolumeClaim object.\nWhen this field is specified, volume binding will only succeed if the type of\nthe specified object matches some installed volume populator or dynamic\nprovisioner.\nThis field will replace the functionality of the dataSource field and as such\nif both fields are non-empty, they must have the same value. For backwards\ncompatibility, when namespace isn't specified in dataSourceRef,\nboth fields (dataSource and dataSourceRef) will be set to the same\nvalue automatically if one of them is empty and the other is non-empty.\nWhen namespace is specified in dataSourceRef,\ndataSource isn't set to the same value and must be empty.\nThere are three important differences between dataSource and dataSourceRef:\n* While dataSource only allows two specific types of objects, dataSourceRef\n  allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n  preserves all values, and generates an error if a disallowed value is\n  specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n  in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.\n(Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.",
                      "properties": {
                        "apiGroup": {
                          "description": "APIGroup is the group for the resource being referenced.\nIf APIGroup is not specified, the specified Kind must be in the core API group.\nFor 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"
                        },
                        "namespace": {
                          "description": "Namespace is the namespace of resource being referenced\nNote that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n(Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "name"
                      ],
                      "type": "object",
                      "additionalProperties": false
                    },
                    "resources": {
                      "description": "resources represents the minimum resources the volume should have.\nIf RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements\nthat are lower than previous value but must still be higher than capacity recorded in the\nstatus field of the claim.\nMore info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources",
                      "properties": {
                        "limits": {
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "string"
                              }
                            ],
                            "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                            "x-kubernetes-int-or-string": true
                          },
                          "description": "Limits describes the maximum amount of compute resources allowed.\nMore info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/",
                          "type": "object"
                        },
                        "requests": {
                          "additionalProperties": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "string"
                              }
                            ],
                            "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                            "x-kubernetes-int-or-string": true
                          },
                          "description": "Requests describes the minimum amount of compute resources required.\nIf Requests is omitted for a container, it defaults to Limits if that is explicitly specified,\notherwise to an implementation-defined value. Requests cannot exceed Limits.\nMore info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/",
                          "type": "object"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "selector": {
                      "description": "selector is a label query over volumes to consider for binding.",
                      "properties": {
                        "matchExpressions": {
                          "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
                          "items": {
                            "description": "A label selector requirement is a selector that contains values, a key, and an operator that\nrelates the key and values.",
                            "properties": {
                              "key": {
                                "description": "key is the label key that the selector applies to.",
                                "type": "string"
                              },
                              "operator": {
                                "description": "operator represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists and DoesNotExist.",
                                "type": "string"
                              },
                              "values": {
                                "description": "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.",
                                "items": {
                                  "type": "string"
                                },
                                "type": "array",
                                "x-kubernetes-list-type": "atomic"
                              }
                            },
                            "required": [
                              "key",
                              "operator"
                            ],
                            "type": "object",
                            "additionalProperties": false
                          },
                          "type": "array",
                          "x-kubernetes-list-type": "atomic"
                        },
                        "matchLabels": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
                          "type": "object"
                        }
                      },
                      "type": "object",
                      "x-kubernetes-map-type": "atomic",
                      "additionalProperties": false
                    },
                    "storageClassName": {
                      "description": "storageClassName is the name of the StorageClass required by the claim.\nMore info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1",
                      "type": "string"
                    },
                    "volumeAttributesClassName": {
                      "description": "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.\nIf specified, the CSI driver will create or update the volume with the attributes defined\nin the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,\nit can be changed after the claim is created. An empty string value means that no VolumeAttributesClass\nwill be applied to the claim but it's not allowed to reset this field to empty string once it is set.\nIf unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass\nwill be set by the persistentvolume controller if it exists.\nIf the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be\nset to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource\nexists.\nMore info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/\n(Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).",
                      "type": "string"
                    },
                    "volumeMode": {
                      "description": "volumeMode defines what type of volume is required by the claim.\nValue of Filesystem is implied when not included in claim spec.",
                      "type": "string"
                    },
                    "volumeName": {
                      "description": "volumeName is the binding reference to the PersistentVolume backing this claim.",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "required": [
                "volumeClaimSpec"
              ],
              "type": "object",
              "additionalProperties": false
            }
          },
          "required": [
            "name"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "state": {
          "type": "string"
        },
        "storageType": {
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "metadata",
    "spec"
  ],
  "type": "object"
}
