Skip to main content

backup_runs

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

Overview

Namebackup_runs
TypeResource
Idgoogle.sqladmin.backup_runs

Fields

NameDatatypeDescription
idstringThe identifier for this backup run. Unique only for a specific Cloud SQL instance.
descriptionstringThe description of this run, only applicable to on-demand backups.
backupKindstringSpecifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
diskEncryptionConfigurationobjectDisk encryption configuration for an instance.
diskEncryptionStatusobjectDisk encryption status for an instance.
endTimestringThe time the backup operation completed in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
enqueuedTimestringThe time the run was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
errorobjectDatabase instance operation error.
instancestringName of the database instance.
kindstringThis is always sql#backupRun.
locationstringLocation of the backups.
maxChargeableBytesstringOutput only. The maximum chargeable bytes for the backup.
selfLinkstringThe URI of this resource.
startTimestringThe time the backup operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
statusstringThe status of this run.
timeZonestringBackup time zone to prevent restores to an instance with a different time zone. Now relevant only for SQL Server.
typestringThe type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL". This field defaults to "ON_DEMAND" and is ignored, when specified for insert requests.
windowStartTimestringThe start time of the backup window during which this the backup was attempted in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.

Methods

NameAccessible byRequired ParamsDescription
getSELECTid, instance, projectRetrieves a resource containing information about a backup run.
listSELECTinstance, projectLists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.
insertINSERTinstance, projectCreates a new backup run on demand.
deleteDELETEid, instance, projectDeletes the backup taken by a backup run.

SELECT examples

Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.

SELECT
id,
description,
backupKind,
diskEncryptionConfiguration,
diskEncryptionStatus,
endTime,
enqueuedTime,
error,
instance,
kind,
location,
maxChargeableBytes,
selfLink,
startTime,
status,
timeZone,
type,
windowStartTime
FROM google.sqladmin.backup_runs
WHERE instance = '{{ instance }}'
AND project = '{{ project }}';

INSERT example

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

/*+ create */
INSERT INTO google.sqladmin.backup_runs (
instance,
project,
status,
enqueuedTime,
startTime,
endTime,
error,
type,
description,
windowStartTime,
instance,
location,
diskEncryptionConfiguration,
diskEncryptionStatus,
backupKind,
timeZone
)
SELECT
'{{ instance }}',
'{{ project }}',
'{{ status }}',
'{{ enqueuedTime }}',
'{{ startTime }}',
'{{ endTime }}',
'{{ error }}',
'{{ type }}',
'{{ description }}',
'{{ windowStartTime }}',
'{{ instance }}',
'{{ location }}',
'{{ diskEncryptionConfiguration }}',
'{{ diskEncryptionStatus }}',
'{{ backupKind }}',
'{{ timeZone }}'
;

DELETE example

Deletes the specified backup_runs resource.

/*+ delete */
DELETE FROM google.sqladmin.backup_runs
WHERE id = '{{ id }}'
AND instance = '{{ instance }}'
AND project = '{{ project }}';