backup_runs
Creates, updates, deletes, gets or lists a backup_runs
resource.
Overview
Name | backup_runs |
Type | Resource |
Id | google.sqladmin.backup_runs |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
id | string (int64) | The identifier for this backup run. Unique only for a specific Cloud SQL instance. |
backupKind | string | Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. |
databaseVersion | string | Output only. The instance database version at the time this backup was made. |
description | string | The description of this run, only applicable to on-demand backups. |
diskEncryptionConfiguration | object | Encryption configuration specific to a backup. (id: DiskEncryptionConfiguration) |
diskEncryptionStatus | object | Encryption status specific to a backup. (id: DiskEncryptionStatus) |
endTime | string (google-datetime) | The time the backup operation completed in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . |
enqueuedTime | string (google-datetime) | The time the run was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . |
error | object | Database instance operation error. (id: OperationError) |
instance | string | Name of the database instance. |
kind | string | This is always sql#backupRun . |
location | string | Location of the backups. |
maxChargeableBytes | string (int64) | Output only. The maximum chargeable bytes for the backup. |
selfLink | string | The URI of this resource. |
startTime | string (google-datetime) | The time the backup operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . |
status | string | The status of this run. |
timeZone | string | Backup time zone to prevent restores to an instance with a different time zone. Now relevant only for SQL Server. |
type | string | The 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. |
windowStartTime | string (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 . |
Successful response
Name | Datatype | Description |
---|---|---|
id | string (int64) | The identifier for this backup run. Unique only for a specific Cloud SQL instance. |
backupKind | string | Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. |
databaseVersion | string | Output only. The instance database version at the time this backup was made. |
description | string | The description of this run, only applicable to on-demand backups. |
diskEncryptionConfiguration | object | Encryption configuration specific to a backup. (id: DiskEncryptionConfiguration) |
diskEncryptionStatus | object | Encryption status specific to a backup. (id: DiskEncryptionStatus) |
endTime | string (google-datetime) | The time the backup operation completed in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . |
enqueuedTime | string (google-datetime) | The time the run was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . |
error | object | Database instance operation error. (id: OperationError) |
instance | string | Name of the database instance. |
kind | string | This is always sql#backupRun . |
location | string | Location of the backups. |
maxChargeableBytes | string (int64) | Output only. The maximum chargeable bytes for the backup. |
selfLink | string | The URI of this resource. |
startTime | string (google-datetime) | The time the backup operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . |
status | string | The status of this run. |
timeZone | string | Backup time zone to prevent restores to an instance with a different time zone. Now relevant only for SQL Server. |
type | string | The 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. |
windowStartTime | string (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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | project , instance , id | Retrieves a resource containing information about a backup run. | |
list | select | project , instance | maxResults , pageToken | Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time. |
insert | insert | project , instance | Creates a new backup run on demand. | |
delete | delete | project , instance , id | Deletes 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.
Name | Datatype | Description |
---|---|---|
id | string | |
instance | string | |
project | string | |
maxResults | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
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;
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,
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 maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- insert
- Manifest
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
;
# Description fields are for documentation purposes
- name: backup_runs
props:
- name: project
value: string
description: Required parameter for the backup_runs resource.
- name: instance
value: string
description: Required parameter for the backup_runs resource.
- name: kind
value: string
description: >
This is always `sql#backupRun`.
- name: status
value: string
description: >
The status of this run.
valid_values: ['SQL_BACKUP_RUN_STATUS_UNSPECIFIED', 'ENQUEUED', 'OVERDUE', 'RUNNING', 'FAILED', 'SUCCESSFUL', 'SKIPPED', 'DELETION_PENDING', 'DELETION_FAILED', 'DELETED']
- name: enqueuedTime
value: string
description: >
The time the run was enqueued in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
- name: id
value: string
description: >
The identifier for this backup run. Unique only for a specific Cloud SQL instance.
- name: startTime
value: string
description: >
The time the backup operation actually started in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
- name: endTime
value: string
description: >
The time the backup operation completed in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
- name: error
value: object
description: >
Database instance operation error.
- name: type
value: string
description: >
The 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.
valid_values: ['SQL_BACKUP_RUN_TYPE_UNSPECIFIED', 'AUTOMATED', 'ON_DEMAND']
- name: description
value: string
description: >
The description of this run, only applicable to on-demand backups.
- name: windowStartTime
value: string
description: >
The start time of the backup window during which this the backup was attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example `2012-11-15T16:19:00.094Z`.
- name: instance
value: string
description: >
Name of the database instance.
- name: selfLink
value: string
description: >
The URI of this resource.
- name: location
value: string
description: >
Location of the backups.
- name: diskEncryptionConfiguration
value: object
description: >
Encryption configuration specific to a backup.
- name: diskEncryptionStatus
value: object
description: >
Encryption status specific to a backup.
- name: backupKind
value: string
description: >
Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
valid_values: ['SQL_BACKUP_KIND_UNSPECIFIED', 'SNAPSHOT', 'PHYSICAL']
- name: timeZone
value: string
description: >
Backup time zone to prevent restores to an instance with a different time zone. Now relevant only for SQL Server.
DELETE
examples
- delete
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;