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

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstring (int64)The identifier for this backup run. Unique only for a specific Cloud SQL instance.
backupKindstringSpecifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
databaseVersionstringOutput only. The instance database version at the time this backup was made.
descriptionstringThe description of this run, only applicable to on-demand backups.
diskEncryptionConfigurationobjectEncryption configuration specific to a backup. (id: DiskEncryptionConfiguration)
diskEncryptionStatusobjectEncryption status specific to a backup. (id: DiskEncryptionStatus)
endTimestring (google-datetime)The time the backup operation completed in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
enqueuedTimestring (google-datetime)The time the run was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
errorobjectDatabase instance operation error. (id: OperationError)
instancestringName of the database instance.
kindstringThis is always sql#backupRun.
locationstringLocation of the backups.
maxChargeableBytesstring (int64)Output only. The maximum chargeable bytes for the backup.
selfLinkstringThe URI of this resource.
startTimestring (google-datetime)The 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.
windowStartTimestring (google-datetime)The 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

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, instance, idRetrieves a resource containing information about a backup run.
listselectproject, instancemaxResults, pageTokenLists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.
insertinsertproject, instanceCreates a new backup run on demand.
deletedeleteproject, instance, idDeletes the backup taken by a backup run.

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
idstring
instancestring
projectstring
maxResultsinteger (int32)
pageTokenstring

SELECT examples

Retrieves a resource containing information about a backup run.

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

INSERT examples

Creates a new backup run on demand.

INSERT INTO google.sqladmin.backup_runs (
data__kind,
data__status,
data__enqueuedTime,
data__id,
data__startTime,
data__endTime,
data__error,
data__type,
data__description,
data__windowStartTime,
data__instance,
data__selfLink,
data__location,
data__diskEncryptionConfiguration,
data__diskEncryptionStatus,
data__backupKind,
data__timeZone,
project,
instance
)
SELECT
'{{ kind }}',
'{{ status }}',
'{{ enqueuedTime }}',
'{{ id }}',
'{{ startTime }}',
'{{ endTime }}',
'{{ error }}',
'{{ type }}',
'{{ description }}',
'{{ windowStartTime }}',
'{{ instance }}',
'{{ selfLink }}',
'{{ location }}',
'{{ diskEncryptionConfiguration }}',
'{{ diskEncryptionStatus }}',
'{{ backupKind }}',
'{{ timeZone }}',
'{{ project }}',
'{{ instance }}'
RETURNING
name,
acquireSsrsLeaseContext,
apiWarning,
backupContext,
endTime,
error,
exportContext,
importContext,
insertTime,
kind,
operationType,
selfLink,
startTime,
status,
subOperationType,
targetId,
targetLink,
targetProject,
user
;

DELETE examples

Deletes the backup taken by a backup run.

DELETE FROM google.sqladmin.backup_runs
WHERE project = '{{ project }}' --required
AND instance = '{{ instance }}' --required
AND id = '{{ id }}' --required;