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

# POST /v1/{+parent}/restorePlans

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

Creates a new RestorePlan in a given location.

## Path parameters

- `parent` string, required

## Query parameters

- `restorePlanId` string

## Request body

- RestorePlan — The configuration of a potential series of Restore operations to be performed against Backups belong to a particular BackupPlan.
  - `description` string — Optional. User specified descriptive string for this RestorePlan.
  - `cluster` string — Required. Immutable. The target cluster into which Restores created via this RestorePlan will restore data. NOTE: the cluster's region must be the same as the RestorePlan. Valid formats: - `projects/*/locations/*/clusters/*` - `projects/*/zones/*/clusters/*`
  - `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.
  - `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 `GetRestorePlan`, and systems are expected to put that etag in the request to `UpdateRestorePlan` or `DeleteRestorePlan` to ensure that their change will be applied to the same version of the resource.
  - `backupPlan` string — Required. Immutable. A reference to the BackupPlan from which Backups may be used as the source for Restores created via this RestorePlan. Format: `projects/*/locations/*/backupPlans/*`.
  - `labels` object — Optional. A set of custom labels supplied by user.
  - `stateReason` string — Output only. Human-readable description of why RestorePlan 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.
  - `updateTime` string, google-datetime — Output only. The timestamp when this RestorePlan resource was last updated.
  - `uid` string — Output only. Server generated global unique identifier of [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.
  - `state` 'STATE_UNSPECIFIED' | 'CLUSTER_PENDING' | 'READY' | 'FAILED' | 'DELETING' — Output only. State of the RestorePlan. This State field reflects the various stages a RestorePlan can be in during the Create operation.
  - `name` string — Output only. Identifier. The full name of the RestorePlan resource. Format: `projects/*/locations/*/restorePlans/*`.
  - `createTime` string, google-datetime — Output only. The timestamp when this RestorePlan resource was created.
  - `restoreChannel` string — Output only. The fully qualified name of the RestoreChannel to be used to create a RestorePlan. This field is set only if the `backup_plan` is in a different project than the RestorePlan. Format: `projects/*/locations/*/restoreChannels/*`

## 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)
