Skip to main content

restore_plans

Creates, updates, deletes, gets or lists a restore_plans resource.

Overview

Namerestore_plans
TypeResource
Idgoogle.gkebackup.restore_plans

Fields

NameDatatypeDescription
namestringOutput only. The full name of the RestorePlan resource. Format: projects/*/locations/*/restorePlans/*.
descriptionstringOptional. User specified descriptive string for this RestorePlan.
backupPlanstringRequired. 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/*.
clusterstringRequired. 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/*
createTimestringOutput only. The timestamp when this RestorePlan resource was created.
etagstringOutput 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.
labelsobjectOptional. A set of custom labels supplied by user.
restoreConfigobjectConfiguration of a restore.
statestringOutput only. State of the RestorePlan. This State field reflects the various stages a RestorePlan can be in during the Create operation.
stateReasonstringOutput only. Human-readable description of why RestorePlan is in the current state
uidstringOutput only. Server generated global unique identifier of UUID format.
updateTimestringOutput only. The timestamp when this RestorePlan resource was last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, restorePlansIdRetrieve the details of a single RestorePlan.
listSELECTlocationsId, projectsIdLists RestorePlans in a given location.
createINSERTlocationsId, projectsIdCreates a new RestorePlan in a given location.
deleteDELETElocationsId, projectsId, restorePlansIdDeletes an existing RestorePlan.
patchUPDATElocationsId, projectsId, restorePlansIdUpdate a RestorePlan.

SELECT examples

Lists RestorePlans in a given location.

SELECT
name,
description,
backupPlan,
cluster,
createTime,
etag,
labels,
restoreConfig,
state,
stateReason,
uid,
updateTime
FROM google.gkebackup.restore_plans
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new restore_plans resource.

/*+ create */
INSERT INTO google.gkebackup.restore_plans (
locationsId,
projectsId,
description,
backupPlan,
cluster,
restoreConfig,
labels
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ description }}',
'{{ backupPlan }}',
'{{ cluster }}',
'{{ restoreConfig }}',
'{{ labels }}'
;

UPDATE example

Updates a restore_plans resource.

/*+ update */
UPDATE google.gkebackup.restore_plans
SET
description = '{{ description }}',
backupPlan = '{{ backupPlan }}',
cluster = '{{ cluster }}',
restoreConfig = '{{ restoreConfig }}',
labels = '{{ labels }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND restorePlansId = '{{ restorePlansId }}';

DELETE example

Deletes the specified restore_plans resource.

/*+ delete */
DELETE FROM google.gkebackup.restore_plans
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND restorePlansId = '{{ restorePlansId }}';