{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-kubernetes-engine/json-schema/google-kubernetes-engine-restore-schema.json",
  "title": "Restore",
  "description": "Represents both a request to Restore some portion of a Backup into a target GKE cluster and a record of the restore operation itself.",
  "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/Restore",
  "properties": {
    "state": {
      "readOnly": true,
      "enum": [
        "STATE_UNSPECIFIED",
        "CREATING",
        "IN_PROGRESS",
        "SUCCEEDED",
        "FAILED",
        "DELETING",
        "VALIDATING"
      ],
      "description": "Output only. The current state of the Restore.",
      "type": "string"
    },
    "stateReason": {
      "type": "string",
      "description": "Output only. Human-readable description of why the Restore is in its 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.",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "description": "Output only. Identifier. The full name of the Restore resource. Format: `projects/*/locations/*/restorePlans/*/restores/*`",
      "readOnly": true
    },
    "labels": {
      "type": "object",
      "description": "A set of custom labels supplied by user.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "troubleshootingInfo": {
      "$ref": "#/$defs/TroubleshootingInfo",
      "description": "Output only. Information about the troubleshooting steps which will provide debugging information to the end users."
    },
    "completeTime": {
      "type": "string",
      "description": "Output only. Timestamp of when the restore operation completed.",
      "readOnly": true,
      "format": "google-datetime"
    },
    "resourcesRestoredCount": {
      "format": "int32",
      "description": "Output only. Number of resources restored during the restore execution.",
      "readOnly": true,
      "type": "integer"
    },
    "resourcesExcludedCount": {
      "format": "int32",
      "type": "integer",
      "description": "Output only. Number of resources excluded during the restore execution.",
      "readOnly": true
    },
    "createTime": {
      "description": "Output only. The timestamp when this Restore resource was created.",
      "readOnly": true,
      "format": "google-datetime",
      "type": "string"
    },
    "volumesRestoredCount": {
      "format": "int32",
      "type": "integer",
      "readOnly": true,
      "description": "Output only. Number of volumes restored during the restore execution."
    },
    "uid": {
      "description": "Output only. Server generated global unique identifier of [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.",
      "type": "string",
      "readOnly": true
    },
    "updateTime": {
      "description": "Output only. The timestamp when this Restore resource was last updated.",
      "format": "google-datetime",
      "readOnly": true,
      "type": "string"
    },
    "description": {
      "description": "Optional. User specified descriptive string for this Restore.",
      "type": "string"
    },
    "backup": {
      "description": "Required. Immutable. A reference to the Backup used as the source from which this Restore will restore. Note that this Backup must be a sub-resource of the RestorePlan's backup_plan. Format: `projects/*/locations/*/backupPlans/*/backups/*`.",
      "type": "string"
    },
    "cluster": {
      "type": "string",
      "description": "Output only. The target cluster into which this Restore will restore data. Valid formats: - `projects/*/locations/*/clusters/*` - `projects/*/zones/*/clusters/*` Inherited from parent RestorePlan's cluster value.",
      "readOnly": true
    },
    "volumeDataRestorePolicyOverrides": {
      "items": {
        "$ref": "#/$defs/VolumeDataRestorePolicyOverride"
      },
      "description": "Optional. Immutable. Overrides the volume data restore policies selected in the Restore Config for override-scoped resources.",
      "type": "array"
    },
    "restoreConfig": {
      "$ref": "#/$defs/RestoreConfig",
      "description": "Output only. Configuration of the Restore. Inherited from parent RestorePlan's restore_config."
    },
    "resourcesFailedCount": {
      "type": "integer",
      "format": "int32",
      "readOnly": true,
      "description": "Output only. Number of resources that failed to be restored during the restore execution."
    },
    "etag": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a restore from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform restore updates in order to avoid race conditions: An `etag` is returned in the response to `GetRestore`, and systems are expected to put that etag in the request to `UpdateRestore` or `DeleteRestore` to ensure that their change will be applied to the same version of the resource."
    },
    "filter": {
      "$ref": "#/$defs/Filter",
      "description": "Optional. Immutable. Filters resources for `Restore`. If not specified, the scope of the restore will remain the same as defined in the `RestorePlan`. If this is specified and no resources are matched by the `inclusion_filters` or everything is excluded by the `exclusion_filters`, nothing will be restored. This filter can only be specified if the value of namespaced_resource_restore_mode is set to `MERGE_SKIP_ON_CONFLICT`, `MERGE_REPLACE_VOLUME_ON_CONFLICT` or `MERGE_REPLACE_ON_CONFLICT`."
    }
  },
  "type": "object",
  "$defs": {
    "ClusterResourceRestoreScope": {
      "properties": {
        "selectedGroupKinds": {
          "description": "Optional. A list of cluster-scoped resource group kinds to restore from the backup. If specified, only the selected resources will be restored. Mutually exclusive to any other field in the message.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/GroupKind"
          }
        },
        "noGroupKinds": {
          "description": "Optional. If True, no cluster-scoped resources will be restored. This has the same restore scope as if the message is not defined. Mutually exclusive to any other field in the message.",
          "type": "boolean"
        },
        "allGroupKinds": {
          "type": "boolean",
          "description": "Optional. If True, all valid cluster-scoped resources will be restored. Mutually exclusive to any other field in the message."
        },
        "excludedGroupKinds": {
          "items": {
            "$ref": "#/$defs/GroupKind"
          },
          "type": "array",
          "description": "Optional. A list of cluster-scoped resource group kinds to NOT restore from the backup. If specified, all valid cluster-scoped resources will be restored except for those specified in the list. Mutually exclusive to any other field in the message."
        }
      },
      "type": "object",
      "description": "Defines the scope of cluster-scoped resources to restore. Some group kinds are not reasonable choices for a restore, and will cause an error if selected here. Any scope selection that would restore \"all valid\" resources automatically excludes these group kinds. - Node - ComponentStatus - gkebackup.gke.io/BackupJob - gkebackup.gke.io/RestoreJob - metrics.k8s.io/NodeMetrics - migration.k8s.io/StorageState - migration.k8s.io/StorageVersionMigration - snapshot.storage.k8s.io/VolumeSnapshotContent - storage.k8s.io/CSINode - storage.k8s.io/VolumeAttachment Some group kinds are driven by restore configuration elsewhere, and will cause an error if selected here. - Namespace - PersistentVolume"
    },
    "Filter": {
      "properties": {
        "exclusionFilters": {
          "items": {
            "$ref": "#/$defs/ResourceSelector"
          },
          "type": "array",
          "description": "Optional. Excludes resources from restoration. If specified, a resource will not be restored if it matches any `ResourceSelector` of the `exclusion_filters`."
        },
        "inclusionFilters": {
          "items": {
            "$ref": "#/$defs/ResourceSelector"
          },
          "type": "array",
          "description": "Optional. Selects resources for restoration. If specified, only resources which match `inclusion_filters` will be selected for restoration. A resource will be selected if it matches any `ResourceSelector` of the `inclusion_filters`."
        }
      },
      "type": "object",
      "description": "Defines the filter for `Restore`. This filter can be used to further refine the resource selection of the `Restore` beyond the coarse-grained scope defined in the `RestorePlan`. `exclusion_filters` take precedence over `inclusion_filters`. If a resource matches both `inclusion_filters` and `exclusion_filters`, it will not be restored."
    },
    "GroupKind": {
      "description": "This is a direct map to the Kubernetes GroupKind type [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind) and is used for identifying specific \"types\" of resources to restore.",
      "properties": {
        "resourceGroup": {
          "type": "string",
          "description": "Optional. API group string of a Kubernetes resource, e.g. \"apiextensions.k8s.io\", \"storage.k8s.io\", etc. Note: use empty string for core API group."
        },
        "resourceKind": {
          "type": "string",
          "description": "Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. \"CustomResourceDefinition\", \"StorageClass\", etc."
        }
      },
      "type": "object"
    },
    "GroupKindDependency": {
      "properties": {
        "requiring": {
          "$ref": "#/$defs/GroupKind",
          "description": "Required. The requiring group kind requires that the other group kind be restored first."
        },
        "satisfying": {
          "$ref": "#/$defs/GroupKind",
          "description": "Required. The satisfying group kind must be restored first in order to satisfy the dependency."
        }
      },
      "type": "object",
      "description": "Defines a dependency between two group kinds."
    },
    "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."
    },
    "ResourceFilter": {
      "properties": {
        "jsonPath": {
          "description": "Optional. This is a [JSONPath] (https://github.com/json-path/JsonPath/blob/master/README.md) expression that matches specific fields of candidate resources and it operates as a filtering parameter (resources that are not matched with this expression will not be candidates for transformation).",
          "type": "string"
        },
        "namespaces": {
          "items": {
            "type": "string"
          },
          "description": "Optional. (Filtering parameter) Any resource subject to transformation must be contained within one of the listed Kubernetes Namespace in the Backup. If this field is not provided, no namespace filtering will be performed (all resources in all Namespaces, including all cluster-scoped resources, will be candidates for transformation).",
          "type": "array"
        },
        "groupKinds": {
          "items": {
            "$ref": "#/$defs/GroupKind"
          },
          "description": "Optional. (Filtering parameter) Any resource subject to transformation must belong to one of the listed \"types\". If this field is not provided, no type filtering will be performed (all resources of all types matching previous filtering parameters will be candidates for transformation).",
          "type": "array"
        }
      },
      "type": "object",
      "description": "ResourceFilter specifies matching criteria to limit the scope of a change to a specific set of kubernetes resources that are selected for restoration from a backup."
    },
    "ResourceSelector": {
      "description": "Defines a selector to identify a single or a group of resources. Conditions in the selector are optional, but at least one field should be set to a non-empty value. If a condition is not specified, no restrictions will be applied on that dimension. If more than one condition is specified, a resource will be selected if and only if all conditions are met.",
      "type": "object",
      "properties": {
        "groupKind": {
          "$ref": "#/$defs/GroupKind",
          "description": "Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected."
        },
        "namespace": {
          "type": "string",
          "description": "Optional. Selects resources using their namespaces. This only applies to namespace scoped resources and cannot be used for selecting cluster scoped resources. If specified, only resources in the provided namespace will be selected. If not specified, the filter will apply to both cluster scoped and namespace scoped resources (e.g. name or label). The [Namespace](https://pkg.go.dev/k8s.io/api/core/v1#Namespace) resource itself will be restored if and only if any resources within the namespace are restored."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Optional. Selects resources using Kubernetes [labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/). If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match."
        },
        "name": {
          "description": "Optional. Selects resources using their resource names. If specified, only resources with the provided name will be selected.",
          "type": "string"
        }
      }
    },
    "RestoreConfig": {
      "type": "object",
      "description": "Configuration of a restore.",
      "properties": {
        "allNamespaces": {
          "type": "boolean",
          "description": "Restore all namespaced resources in the Backup if set to \"True\". Specifying this field to \"False\" is an error."
        },
        "excludedNamespaces": {
          "$ref": "#/$defs/Namespaces",
          "description": "A list of selected namespaces excluded from restoration. All namespaces except those in this list will be restored."
        },
        "noNamespaces": {
          "description": "Do not restore any namespaced resources if set to \"True\". Specifying this field to \"False\" is not allowed.",
          "type": "boolean"
        },
        "clusterResourceConflictPolicy": {
          "enum": [
            "CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED",
            "USE_EXISTING_VERSION",
            "USE_BACKUP_VERSION"
          ],
          "type": "string",
          "description": "Optional. Defines the behavior for handling the situation where cluster-scoped resources being restored already exist in the target cluster. This MUST be set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if cluster_resource_restore_scope is not empty."
        },
        "transformationRules": {
          "description": "Optional. A list of transformation rules to be applied against Kubernetes resources as they are selected for restoration from a Backup. Rules are executed in order defined - this order matters, as changes made by a rule may impact the filtering logic of subsequent rules. An empty list means no transformation will occur.",
          "items": {
            "$ref": "#/$defs/TransformationRule"
          },
          "type": "array"
        },
        "clusterResourceRestoreScope": {
          "$ref": "#/$defs/ClusterResourceRestoreScope",
          "description": "Optional. Identifies the cluster-scoped resources to restore from the Backup. Not specifying it means NO cluster resource will be restored."
        },
        "restoreOrder": {
          "$ref": "#/$defs/RestoreOrder",
          "description": "Optional. RestoreOrder contains custom ordering to use on a Restore."
        },
        "selectedApplications": {
          "$ref": "#/$defs/NamespacedNames",
          "description": "A list of selected ProtectedApplications to restore. The listed ProtectedApplications and all the resources to which they refer will be restored."
        },
        "substitutionRules": {
          "items": {
            "$ref": "#/$defs/SubstitutionRule"
          },
          "type": "array",
          "description": "Optional. A list of transformation rules to be applied against Kubernetes resources as they are selected for restoration from a Backup. Rules are executed in order defined - this order matters, as changes made by a rule may impact the filtering logic of subsequent rules. An empty list means no substitution will occur."
        },
        "selectedNamespaces": {
          "$ref": "#/$defs/Namespaces",
          "description": "A list of selected Namespaces to restore from the Backup. The listed Namespaces and all resources contained in them will be restored."
        },
        "volumeDataRestorePolicy": {
          "enum": [
            "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED",
            "RESTORE_VOLUME_DATA_FROM_BACKUP",
            "REUSE_VOLUME_HANDLE_FROM_BACKUP",
            "NO_VOLUME_DATA_RESTORATION"
          ],
          "type": "string",
          "description": "Optional. Specifies the mechanism to be used to restore volume data. Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as NO_VOLUME_DATA_RESTORATION)."
        },
        "namespacedResourceRestoreMode": {
          "enum": [
            "NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED",
            "DELETE_AND_RESTORE",
            "FAIL_ON_CONFLICT",
            "MERGE_SKIP_ON_CONFLICT",
            "MERGE_REPLACE_VOLUME_ON_CONFLICT",
            "MERGE_REPLACE_ON_CONFLICT"
          ],
          "type": "string",
          "description": "Optional. Defines the behavior for handling the situation where sets of namespaced resources being restored already exist in the target cluster. This MUST be set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED."
        },
        "volumeDataRestorePolicyBindings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/VolumeDataRestorePolicyBinding"
          },
          "description": "Optional. A table that binds volumes by their scope to a restore policy. Bindings must have a unique scope. Any volumes not scoped in the bindings are subject to the policy defined in volume_data_restore_policy."
        }
      }
    },
    "RestoreOrder": {
      "properties": {
        "groupKindDependencies": {
          "type": "array",
          "description": "Optional. Contains a list of group kind dependency pairs provided by the customer, that is used by Backup for GKE to generate a group kind restore order.",
          "items": {
            "$ref": "#/$defs/GroupKindDependency"
          }
        }
      },
      "type": "object",
      "description": "Allows customers to specify dependencies between resources that Backup for GKE can use to compute a resasonable restore order."
    },
    "SubstitutionRule": {
      "description": "A transformation rule to be applied against Kubernetes resources as they are selected for restoration from a Backup. A rule contains both filtering logic (which resources are subject to substitution) and substitution logic.",
      "type": "object",
      "properties": {
        "targetGroupKinds": {
          "items": {
            "$ref": "#/$defs/GroupKind"
          },
          "type": "array",
          "description": "Optional. (Filtering parameter) Any resource subject to substitution must belong to one of the listed \"types\". If this field is not provided, no type filtering will be performed (all resources of all types matching previous filtering parameters will be candidates for substitution)."
        },
        "originalValuePattern": {
          "type": "string",
          "description": "Optional. (Filtering parameter) This is a [regular expression] (https://en.wikipedia.org/wiki/Regular_expression) that is compared against the fields matched by the target_json_path expression (and must also have passed the previous filters). Substitution will not be performed against fields whose value does not match this expression. If this field is NOT specified, then ALL fields matched by the target_json_path expression will undergo substitution. Note that an empty (e.g., \"\", rather than unspecified) value for this field will only match empty fields."
        },
        "targetNamespaces": {
          "items": {
            "type": "string"
          },
          "description": "Optional. (Filtering parameter) Any resource subject to substitution must be contained within one of the listed Kubernetes Namespace in the Backup. If this field is not provided, no namespace filtering will be performed (all resources in all Namespaces, including all cluster-scoped resources, will be candidates for substitution). To mix cluster-scoped and namespaced resources in the same rule, use an empty string (\"\") as one of the target namespaces.",
          "type": "array"
        },
        "newValue": {
          "type": "string",
          "description": "Optional. This is the new value to set for any fields that pass the filtering and selection criteria. To remove a value from a Kubernetes resource, either leave this field unspecified, or set it to the empty string (\"\")."
        },
        "targetJsonPath": {
          "type": "string",
          "description": "Required. This is a [JSONPath] (https://kubernetes.io/docs/reference/kubectl/jsonpath/) expression that matches specific fields of candidate resources and it operates as both a filtering parameter (resources that are not matched with this expression will not be candidates for substitution) as well as a field identifier (identifies exactly which fields out of the candidate resources will be modified)."
        }
      }
    },
    "TransformationRule": {
      "type": "object",
      "properties": {
        "resourceFilter": {
          "$ref": "#/$defs/ResourceFilter",
          "description": "Optional. This field is used to specify a set of fields that should be used to determine which resources in backup should be acted upon by the supplied transformation rule actions, and this will ensure that only specific resources are affected by transformation rule actions."
        },
        "description": {
          "description": "Optional. The description is a user specified string description of the transformation rule.",
          "type": "string"
        },
        "fieldActions": {
          "items": {
            "$ref": "#/$defs/TransformationRuleAction"
          },
          "type": "array",
          "description": "Required. A list of transformation rule actions to take against candidate resources. Actions are executed in order defined - this order matters, as they could potentially interfere with each other and the first operation could affect the outcome of the second operation."
        }
      },
      "description": "A transformation rule to be applied against Kubernetes resources as they are selected for restoration from a Backup. A rule contains both filtering logic (which resources are subject to transform) and transformation logic."
    },
    "TransformationRuleAction": {
      "description": "TransformationRuleAction defines a TransformationRule action based on the JSON Patch RFC (https://www.rfc-editor.org/rfc/rfc6902)",
      "properties": {
        "value": {
          "type": "string",
          "description": "Optional. A string that specifies the desired value in string format to use for transformation."
        },
        "path": {
          "type": "string",
          "description": "Optional. A string containing a JSON-Pointer value that references a location within the target document where the operation is performed."
        },
        "op": {
          "description": "Required. op specifies the operation to perform.",
          "type": "string",
          "enum": [
            "OP_UNSPECIFIED",
            "REMOVE",
            "MOVE",
            "COPY",
            "ADD",
            "TEST",
            "REPLACE"
          ]
        },
        "fromPath": {
          "description": "Optional. A string containing a JSON Pointer value that references the location in the target document to move the value from.",
          "type": "string"
        }
      },
      "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
        }
      }
    },
    "VolumeDataRestorePolicyBinding": {
      "type": "object",
      "description": "Binds resources in the scope to the given VolumeDataRestorePolicy.",
      "properties": {
        "policy": {
          "description": "Required. The VolumeDataRestorePolicy to apply when restoring volumes in scope.",
          "type": "string",
          "enum": [
            "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED",
            "RESTORE_VOLUME_DATA_FROM_BACKUP",
            "REUSE_VOLUME_HANDLE_FROM_BACKUP",
            "NO_VOLUME_DATA_RESTORATION"
          ]
        },
        "volumeType": {
          "type": "string",
          "enum": [
            "VOLUME_TYPE_UNSPECIFIED",
            "GCE_PERSISTENT_DISK"
          ],
          "description": "The volume type, as determined by the PVC's bound PV, to apply the policy to."
        }
      }
    },
    "VolumeDataRestorePolicyOverride": {
      "properties": {
        "policy": {
          "type": "string",
          "description": "Required. The VolumeDataRestorePolicy to apply when restoring volumes in scope.",
          "enum": [
            "VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED",
            "RESTORE_VOLUME_DATA_FROM_BACKUP",
            "REUSE_VOLUME_HANDLE_FROM_BACKUP",
            "NO_VOLUME_DATA_RESTORATION"
          ]
        },
        "selectedPvcs": {
          "$ref": "#/$defs/NamespacedNames",
          "description": "A list of PVCs to apply the policy override to."
        }
      },
      "description": "Defines an override to apply a VolumeDataRestorePolicy for scoped resources.",
      "type": "object"
    }
  }
}