Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idgoogle.metastore.backups

Fields

NameDatatypeDescription
namestringImmutable. The relative resource name of the backup, in the following form:projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}
descriptionstringThe description of the backup.
createTimestringOutput only. The time when the backup was started.
endTimestringOutput only. The time when the backup finished creating.
restoringServicesarrayOutput only. Services that are restoring from the backup.
serviceRevisionobjectA managed metastore service that serves metadata queries.
statestringOutput only. The current state of the backup.

Methods

NameAccessible byRequired ParamsDescription
getSELECTbackupsId, locationsId, projectsId, servicesIdGets details of a single backup.
listSELECTlocationsId, projectsId, servicesIdLists backups in a service.
createINSERTlocationsId, projectsId, servicesIdCreates a new backup in a given project and location.
deleteDELETEbackupsId, locationsId, projectsId, servicesIdDeletes a single backup.

SELECT examples

Lists backups in a service.

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

INSERT example

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

/*+ create */
INSERT INTO google.metastore.backups (
locationsId,
projectsId,
servicesId,
name,
description
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ servicesId }}',
'{{ name }}',
'{{ description }}'
;

DELETE example

Deletes the specified backups resource.

/*+ delete */
DELETE FROM google.metastore.backups
WHERE backupsId = '{{ backupsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND servicesId = '{{ servicesId }}';