Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idgoogle.metastore.backups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringImmutable. Identifier. The relative resource name of the backup, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}
createTimestring (google-datetime)Output only. The time when the backup was started.
descriptionstringOptional. The description of the backup.
endTimestring (google-datetime)Output only. The time when the backup finished creating.
restoringServicesarrayOutput only. Services that are restoring from the backup.
serviceRevisionobjectOutput only. The revision of the service at the time of backup. (id: Service)
statestringOutput only. The current state of the backup. (STATE_UNSPECIFIED, CREATING, DELETING, ACTIVE, FAILED, RESTORING)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, servicesId, backupsIdGets details of a single backup.
listselectprojectsId, locationsId, servicesIdorderBy, pageToken, pageSize, filterLists backups in a service.
createinsertprojectsId, locationsId, servicesIdbackupId, requestIdCreates a new backup in a given project and location.
deletedeleteprojectsId, locationsId, servicesId, backupsIdrequestIdDeletes a single backup.

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
backupsIdstring
locationsIdstring
projectsIdstring
servicesIdstring
backupIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring

SELECT examples

Gets details of a single backup.

SELECT
name,
createTime,
description,
endTime,
restoringServices,
serviceRevision,
state
FROM google.metastore.backups
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND servicesId = '{{ servicesId }}' -- required
AND backupsId = '{{ backupsId }}' -- required
;

INSERT examples

Creates a new backup in a given project and location.

INSERT INTO google.metastore.backups (
data__name,
data__description,
projectsId,
locationsId,
servicesId,
backupId,
requestId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ servicesId }}',
'{{ backupId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes a single backup.

DELETE FROM google.metastore.backups
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND servicesId = '{{ servicesId }}' --required
AND backupsId = '{{ backupsId }}' --required
AND requestId = '{{ requestId }}'
;