---
title: "POST /v1/{+parent}/restores"
method: POST
path: "/v1/{+parent}/restores"
tags: ["projects"]
---

# POST /v1/{+parent}/restores

`POST /v1/{+parent}/restores`

Creates a new Restore for the given RestorePlan.

## Path parameters

- `parent` string, required

## Query parameters

- `restoreId` string

## Request body

- Restore — Represents both a request to Restore some portion of a Backup into a target GKE cluster and a record of the restore operation itself.
  - `resourcesFailedCount` integer — Output only. Number of resources that failed to be restored during the restore execution.
  - `filter` Filter — 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.
    - `inclusionFilters` ResourceSelector[] — 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`.
      - `namespace` string — 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` object — 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.
      - `groupKind` GroupKind — 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.
        - `resourceGroup` string — 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` string — Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. "CustomResourceDefinition", "StorageClass", etc.
      - `name` string — Optional. Selects resources using their resource names. If specified, only resources with the provided name will be selected.
    - `exclusionFilters` ResourceSelector[] — Optional. Excludes resources from restoration. If specified, a resource will not be restored if it matches any `ResourceSelector` of the `exclusion_filters`.
      - `namespace` string — 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` object — 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.
      - `groupKind` GroupKind — 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.
        - `resourceGroup` string — 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` string — Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. "CustomResourceDefinition", "StorageClass", etc.
      - `name` string — Optional. Selects resources using their resource names. If specified, only resources with the provided name will be selected.
  - `state` 'STATE_UNSPECIFIED' | 'CREATING' | 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'DELETING' | 'VALIDATING' — Output only. The current state of the Restore.
  - `resourcesExcludedCount` integer — Output only. Number of resources excluded during the restore execution.
  - `name` string — Output only. Identifier. The full name of the Restore resource. Format: `projects/*/locations/*/restorePlans/*/restores/*`
  - `createTime` string, google-datetime — Output only. The timestamp when this Restore resource was created.
  - `updateTime` string, google-datetime — Output only. The timestamp when this Restore resource was last updated.
  - `stateReason` string — 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.
  - `uid` string — Output only. Server generated global unique identifier of [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
  - `backup` string — 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/*`.
  - `labels` object — A set of custom labels supplied by user.
  - `etag` string — 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.
  - `restoreConfig` RestoreConfig — Configuration of a restore.
    - `transformationRules` TransformationRule[] — 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.
      - `resourceFilter` ResourceFilter — 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.
        - `namespaces` string[] — 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).
        - `groupKinds` GroupKind[] — 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).
          - `resourceGroup` string — 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` string — Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. "CustomResourceDefinition", "StorageClass", etc.
        - `jsonPath` string — 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).
      - `description` string — Optional. The description is a user specified string description of the transformation rule.
      - `fieldActions` TransformationRuleAction[] — 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.
        - `op` 'OP_UNSPECIFIED' | 'REMOVE' | 'MOVE' | 'COPY' | 'ADD' | 'TEST' | 'REPLACE' — Required. op specifies the operation to perform.
        - `value` string — Optional. A string that specifies the desired value in string format to use for transformation.
        - `fromPath` string — Optional. A string containing a JSON Pointer value that references the location in the target document to move the value from.
        - `path` string — Optional. A string containing a JSON-Pointer value that references a location within the target document where the operation is performed.
    - `volumeDataRestorePolicyBindings` VolumeDataRestorePolicyBinding[] — 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.
      - `policy` 'VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED' | 'RESTORE_VOLUME_DATA_FROM_BACKUP' | 'REUSE_VOLUME_HANDLE_FROM_BACKUP' | 'NO_VOLUME_DATA_RESTORATION' — Required. The VolumeDataRestorePolicy to apply when restoring volumes in scope.
      - `volumeType` 'VOLUME_TYPE_UNSPECIFIED' | 'GCE_PERSISTENT_DISK' — The volume type, as determined by the PVC's bound PV, to apply the policy to.
    - `namespacedResourceRestoreMode` 'NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED' | 'DELETE_AND_RESTORE' | 'FAIL_ON_CONFLICT' | 'MERGE_SKIP_ON_CONFLICT' | 'MERGE_REPLACE_VOLUME_ON_CONFLICT' | 'MERGE_REPLACE_ON_CONFLICT' — 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.
    - `noNamespaces` boolean — Do not restore any namespaced resources if set to "True". Specifying this field to "False" is not allowed.
    - `substitutionRules` SubstitutionRule[] — 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.
      - `targetNamespaces` string[] — 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.
      - `originalValuePattern` string — 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.
      - `targetGroupKinds` GroupKind[] — 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).
        - `resourceGroup` string — 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` string — Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. "CustomResourceDefinition", "StorageClass", etc.
      - `targetJsonPath` string — 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).
      - `newValue` string — 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 ("").
    - `volumeDataRestorePolicy` 'VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED' | 'RESTORE_VOLUME_DATA_FROM_BACKUP' | 'REUSE_VOLUME_HANDLE_FROM_BACKUP' | 'NO_VOLUME_DATA_RESTORATION' — 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).
    - `clusterResourceConflictPolicy` 'CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED' | 'USE_EXISTING_VERSION' | 'USE_BACKUP_VERSION' — 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.
    - `restoreOrder` RestoreOrder — Allows customers to specify dependencies between resources that Backup for GKE can use to compute a resasonable restore order.
      - `groupKindDependencies` GroupKindDependency[] — 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.
        - `satisfying` GroupKind — 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.
          - `resourceGroup` string — 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` string — Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. "CustomResourceDefinition", "StorageClass", etc.
        - `requiring` GroupKind — 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.
          - `resourceGroup` string — 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` string — Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. "CustomResourceDefinition", "StorageClass", etc.
    - `selectedNamespaces` Namespaces — A list of Kubernetes Namespaces.
      - `namespaces` string[] — Optional. A list of Kubernetes Namespaces.
    - `allNamespaces` boolean — Restore all namespaced resources in the Backup if set to "True". Specifying this field to "False" is an error.
    - `clusterResourceRestoreScope` ClusterResourceRestoreScope — 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
      - `allGroupKinds` boolean — Optional. If True, all valid cluster-scoped resources will be restored. Mutually exclusive to any other field in the message.
      - `selectedGroupKinds` GroupKind[] — 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.
        - `resourceGroup` string — 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` string — Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. "CustomResourceDefinition", "StorageClass", etc.
      - `excludedGroupKinds` GroupKind[] — 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.
        - `resourceGroup` string — 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` string — Optional. Kind of a Kubernetes resource, must be in UpperCamelCase (PascalCase) and singular form. E.g. "CustomResourceDefinition", "StorageClass", etc.
      - `noGroupKinds` boolean — 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.
    - `selectedApplications` NamespacedNames — A list of namespaced Kubernetes resources.
      - `namespacedNames` NamespacedName[] — Optional. A list of namespaced Kubernetes resources.
        - `name` string — Optional. The name of the Kubernetes resource.
        - `namespace` string — Optional. The Namespace of the Kubernetes resource.
    - `excludedNamespaces` Namespaces — A list of Kubernetes Namespaces.
      - `namespaces` string[] — Optional. A list of Kubernetes Namespaces.
  - `volumeDataRestorePolicyOverrides` VolumeDataRestorePolicyOverride[] — Optional. Immutable. Overrides the volume data restore policies selected in the Restore Config for override-scoped resources.
    - `policy` 'VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED' | 'RESTORE_VOLUME_DATA_FROM_BACKUP' | 'REUSE_VOLUME_HANDLE_FROM_BACKUP' | 'NO_VOLUME_DATA_RESTORATION' — Required. The VolumeDataRestorePolicy to apply when restoring volumes in scope.
    - `selectedPvcs` NamespacedNames — A list of namespaced Kubernetes resources.
      - `namespacedNames` NamespacedName[] — Optional. A list of namespaced Kubernetes resources.
        - `name` string — Optional. The name of the Kubernetes resource.
        - `namespace` string — Optional. The Namespace of the Kubernetes resource.
  - `description` string — Optional. User specified descriptive string for this Restore.
  - `troubleshootingInfo` TroubleshootingInfo — 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.
    - `stateReasonUri` string — Output only. URL for the troubleshooting doc which will help the user fix the failing backup/restore operation.
    - `stateReasonCode` string — Output only. Unique code for each backup/restore operation failure message which helps user identify the failure.
  - `resourcesRestoredCount` integer — Output only. Number of resources restored during the restore execution.
  - `cluster` string — 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.
  - `completeTime` string, google-datetime — Output only. Timestamp of when the restore operation completed.
  - `volumesRestoredCount` integer — Output only. Number of volumes restored during the restore execution.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/gkebackup.md) · [All operations](https://skmtc.dev/google/apis/gkebackup/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/gkebackup/revisions/b07f418446fd/schema)
