{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-kubernetes-engine/json-schema/google-kubernetes-engine-backup-schema.json",
  "title": "Backup",
  "description": "Represents a request to perform a single point-in-time capture of some portion of the state of a GKE cluster, the record of the backup operation itself, and an anchor for the underlying artifacts that comprise the Backup (the config backup and VolumeBackups).",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-kubernetes-engine-gkebackup-projects-api-openapi.yml#/components/schemas/Backup",
  "properties": {
    "containsVolumeData": {
      "readOnly": true,
      "description": "Output only. Whether or not the Backup contains volume data. Controlled by the parent BackupPlan's include_volume_data value.",
      "type": "boolean"
    },
    "deleteLockDays": {
      "format": "int32",
      "type": "integer",
      "description": "Optional. Minimum age for this Backup (in days). If this field is set to a non-zero value, the Backup will be \"locked\" against deletion (either manual or automatic deletion) for the number of days provided (measured from the creation time of the Backup). MUST be an integer value between 0-90 (inclusive). Defaults to parent BackupPlan's backup_delete_lock_days setting and may only be increased (either at creation time or in a subsequent update)."
    },
    "permissiveMode": {
      "readOnly": true,
      "description": "Output only. If false, Backup will fail when Backup for GKE detects Kubernetes configuration that is non-standard or requires additional setup to restore. Inherited from the parent BackupPlan's permissive_mode value.",
      "type": "boolean"
    },
    "containsSecrets": {
      "readOnly": true,
      "description": "Output only. Whether or not the Backup contains Kubernetes Secrets. Controlled by the parent BackupPlan's include_secrets value.",
      "type": "boolean"
    },
    "selectedNamespaceLabels": {
      "$ref": "#/$defs/ResourceLabels",
      "description": "Output only. If set, the list of labels whose constituent namespaces were included in the Backup."
    },
    "state": {
      "type": "string",
      "enum": [
        "STATE_UNSPECIFIED",
        "CREATING",
        "IN_PROGRESS",
        "SUCCEEDED",
        "FAILED",
        "DELETING"
      ],
      "readOnly": true,
      "description": "Output only. Current state of the Backup"
    },
    "clusterMetadata": {
      "$ref": "#/$defs/ClusterMetadata",
      "description": "Output only. Information about the GKE cluster from which this Backup was created."
    },
    "completeTime": {
      "type": "string",
      "format": "google-datetime",
      "readOnly": true,
      "description": "Output only. Completion time of the Backup"
    },
    "namespaceCount": {
      "description": "Output only. The total number of user managed namespaces contained in the Backup.",
      "readOnly": true,
      "type": "integer",
      "format": "int32"
    },
    "manual": {
      "readOnly": true,
      "description": "Output only. This flag indicates whether this Backup resource was created manually by a user or via a schedule in the BackupPlan. A value of True means that the Backup was created manually.",
      "type": "boolean"
    },
    "troubleshootingInfo": {
      "$ref": "#/$defs/TroubleshootingInfo",
      "description": "Output only. Information about the troubleshooting steps which will provide debugging information to the end users."
    },
    "resourceCount": {
      "readOnly": true,
      "type": "integer",
      "description": "Output only. The total number of Kubernetes resources included in the Backup.",
      "format": "int32"
    },
    "selectedApplications": {
      "$ref": "#/$defs/NamespacedNames",
      "description": "Output only. If set, the list of ProtectedApplications whose resources were included in the Backup."
    },
    "uid": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. Server generated global unique identifier of [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier)"
    },
    "sizeBytes": {
      "format": "int64",
      "readOnly": true,
      "description": "Output only. The total size of the Backup in bytes = config backup size + sum(volume backup sizes)",
      "type": "string"
    },
    "createTime": {
      "type": "string",
      "description": "Output only. The timestamp when this Backup resource was created.",
      "format": "google-datetime",
      "readOnly": true
    },
    "configBackupSizeBytes": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. The size of the config backup in bytes.",
      "format": "int64"
    },
    "labels": {
      "type": "object",
      "description": "Optional. A set of custom labels supplied by user.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "satisfiesPzs": {
      "description": "Output only. [Output Only] Reserved for future use.",
      "type": "boolean",
      "readOnly": true
    },
    "encryptionKey": {
      "$ref": "#/$defs/EncryptionKey",
      "description": "Output only. The customer managed encryption key that was used to encrypt the Backup's artifacts. Inherited from the parent BackupPlan's encryption_key value."
    },
    "updateTime": {
      "format": "google-datetime",
      "type": "string",
      "readOnly": true,
      "description": "Output only. The timestamp when this Backup resource was last updated."
    },
    "description": {
      "description": "Optional. User specified descriptive string for this Backup.",
      "type": "string"
    },
    "etag": {
      "description": "Output only. `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a backup from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform backup updates in order to avoid race conditions: An `etag` is returned in the response to `GetBackup`, and systems are expected to put that etag in the request to `UpdateBackup` or `DeleteBackup` to ensure that their change will be applied to the same version of the resource.",
      "readOnly": true,
      "type": "string"
    },
    "satisfiesPzi": {
      "description": "Output only. [Output Only] Reserved for future use.",
      "readOnly": true,
      "type": "boolean"
    },
    "deleteLockExpireTime": {
      "description": "Output only. The time at which an existing delete lock will expire for this backup (calculated from create_time + delete_lock_days).",
      "readOnly": true,
      "type": "string",
      "format": "google-datetime"
    },
    "selectedNamespaces": {
      "$ref": "#/$defs/Namespaces",
      "description": "Output only. If set, the list of namespaces that were included in the Backup."
    },
    "volumeCount": {
      "type": "integer",
      "format": "int32",
      "description": "Output only. The total number of volume backups contained in the Backup.",
      "readOnly": true
    },
    "name": {
      "description": "Output only. Identifier. The fully qualified name of the Backup. `projects/*/locations/*/backupPlans/*/backups/*`",
      "type": "string",
      "readOnly": true
    },
    "retainDays": {
      "description": "Optional. The age (in days) after which this Backup will be automatically deleted. Must be an integer value >= 0: - If 0, no automatic deletion will occur for this Backup. - If not 0, this must be >= delete_lock_days and <= 365. Once a Backup is created, this value may only be increased. Defaults to the parent BackupPlan's backup_retain_days value.",
      "format": "int32",
      "type": "integer"
    },
    "stateReason": {
      "type": "string",
      "readOnly": true,
      "description": "Output only. Human-readable description of why the backup is in the current `state`. This field is only meant for human readability and should not be used programmatically as this field is not guaranteed to be consistent."
    },
    "allNamespaces": {
      "description": "Output only. If True, all namespaces were included in the Backup.",
      "type": "boolean",
      "readOnly": true
    },
    "podCount": {
      "format": "int32",
      "type": "integer",
      "readOnly": true,
      "description": "Output only. The total number of Kubernetes Pods contained in the Backup."
    },
    "retainExpireTime": {
      "readOnly": true,
      "description": "Output only. The time at which this Backup will be automatically deleted (calculated from create_time + retain_days).",
      "type": "string",
      "format": "google-datetime"
    }
  },
  "type": "object",
  "$defs": {
    "ClusterMetadata": {
      "properties": {
        "gkeVersion": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. GKE version"
        },
        "cluster": {
          "description": "Output only. The source cluster from which this Backup was created. Valid formats: - `projects/*/locations/*/clusters/*` - `projects/*/zones/*/clusters/*` This is inherited from the parent BackupPlan's cluster field.",
          "type": "string",
          "readOnly": true
        },
        "anthosVersion": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. Anthos version"
        },
        "k8sVersion": {
          "readOnly": true,
          "description": "Output only. The Kubernetes server version of the source cluster.",
          "type": "string"
        },
        "backupCrdVersions": {
          "type": "object",
          "description": "Output only. A list of the Backup for GKE CRD versions found in the cluster.",
          "additionalProperties": {
            "type": "string"
          },
          "readOnly": true
        }
      },
      "type": "object",
      "description": "Information about the GKE cluster from which this Backup was created."
    },
    "EncryptionKey": {
      "description": "Defined a customer managed encryption key that will be used to encrypt Backup artifacts.",
      "type": "object",
      "properties": {
        "gcpKmsEncryptionKey": {
          "type": "string",
          "description": "Optional. Google Cloud KMS encryption key. Format: `projects/*/locations/*/keyRings/*/cryptoKeys/*`"
        }
      }
    },
    "Label": {
      "properties": {
        "key": {
          "type": "string",
          "description": "Optional. The key/name of the label."
        },
        "value": {
          "description": "Optional. The value of the label.",
          "type": "string"
        }
      },
      "description": "A single Kubernetes label-value pair.",
      "type": "object"
    },
    "NamespacedName": {
      "description": "A reference to a namespaced resource in Kubernetes.",
      "type": "object",
      "properties": {
        "namespace": {
          "type": "string",
          "description": "Optional. The Namespace of the Kubernetes resource."
        },
        "name": {
          "description": "Optional. The name of the Kubernetes resource.",
          "type": "string"
        }
      }
    },
    "NamespacedNames": {
      "properties": {
        "namespacedNames": {
          "items": {
            "$ref": "#/$defs/NamespacedName"
          },
          "description": "Optional. A list of namespaced Kubernetes resources.",
          "type": "array"
        }
      },
      "description": "A list of namespaced Kubernetes resources.",
      "type": "object"
    },
    "Namespaces": {
      "type": "object",
      "properties": {
        "namespaces": {
          "description": "Optional. A list of Kubernetes Namespaces.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "description": "A list of Kubernetes Namespaces."
    },
    "ResourceLabels": {
      "properties": {
        "resourceLabels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Label"
          },
          "description": "Optional. A list of Kubernetes label-value pairs."
        }
      },
      "description": "A list of Kubernetes labels.",
      "type": "object"
    },
    "TroubleshootingInfo": {
      "description": "Stores information about troubleshooting doc for debugging a particular state of an operation (eg - backup/restore). This will be used by the end user to debug their operation failure scenario easily.",
      "type": "object",
      "properties": {
        "stateReasonUri": {
          "description": "Output only. URL for the troubleshooting doc which will help the user fix the failing backup/restore operation.",
          "type": "string",
          "readOnly": true
        },
        "stateReasonCode": {
          "description": "Output only. Unique code for each backup/restore operation failure message which helps user identify the failure.",
          "type": "string",
          "readOnly": true
        }
      }
    }
  }
}