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

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The full name of the RestorePlan resource. Format: projects/*/locations/*/restorePlans/*.
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/*
createTimestring (google-datetime)Output only. The timestamp when this RestorePlan resource was created.
descriptionstringOptional. User specified descriptive string for this RestorePlan.
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.
restoreChannelstringOutput 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/*
restoreConfigobjectRequired. Configuration of Restores created via this RestorePlan. (id: RestoreConfig)
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. This field is only meant for human readability and should not be used programmatically as this field is not guaranteed to be consistent.
uidstringOutput only. Server generated global unique identifier of UUID format.
updateTimestring (google-datetime)Output only. The timestamp when this RestorePlan resource was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, restorePlansIdRetrieve the details of a single RestorePlan.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists RestorePlans in a given location.
createinsertprojectsId, locationsIdrestorePlanIdCreates a new RestorePlan in a given location.
patchupdateprojectsId, locationsId, restorePlansIdupdateMaskUpdate a RestorePlan.
deletedeleteprojectsId, locationsId, restorePlansIdetag, forceDeletes an existing RestorePlan.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
restorePlansIdstring
etagstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
restorePlanIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Retrieve the details of a single RestorePlan.

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

INSERT examples

Creates a new RestorePlan in a given location.

INSERT INTO google.gkebackup.restore_plans (
data__description,
data__backupPlan,
data__cluster,
data__restoreConfig,
data__labels,
projectsId,
locationsId,
restorePlanId
)
SELECT
'{{ description }}',
'{{ backupPlan }}',
'{{ cluster }}',
'{{ restoreConfig }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ restorePlanId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update a RestorePlan.

UPDATE google.gkebackup.restore_plans
SET
data__description = '{{ description }}',
data__backupPlan = '{{ backupPlan }}',
data__cluster = '{{ cluster }}',
data__restoreConfig = '{{ restoreConfig }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND restorePlansId = '{{ restorePlansId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an existing RestorePlan.

DELETE FROM google.gkebackup.restore_plans
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND restorePlansId = '{{ restorePlansId }}' --required
AND etag = '{{ etag }}'
AND force = '{{ force }}';