backup_runs
Creates, updates, deletes, gets or lists a backup_runs
resource.
Overview
Name | backup_runs |
Type | Resource |
Id | google.sqladmin.backup_runs |
Fields
Name | Datatype | Description |
---|---|---|
id | string | The identifier for this backup run. Unique only for a specific Cloud SQL instance. |
description | string | The description of this run, only applicable to on-demand backups. |
backupKind | string | Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. |
diskEncryptionConfiguration | object | Disk encryption configuration for an instance. |
diskEncryptionStatus | object | Disk encryption status for an instance. |
endTime | string | The time the backup operation completed in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z . |
enqueuedTime | string | 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. |
instance | string | Name of the database instance. |
kind | string | This is always sql#backupRun . |
location | string | Location of the backups. |
maxChargeableBytes | string | Output only. The maximum chargeable bytes for the backup. |
selfLink | string | The URI of this resource. |
startTime | string | 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 | 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
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | id, instance, project | Retrieves a resource containing information about a backup run. |
list | SELECT | instance, project | 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 | instance, project | Creates a new backup run on demand. |
delete | DELETE | id, instance, project | Deletes 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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: kind
value: string
- name: status
value: string
- name: enqueuedTime
value: string
- name: id
value: string
- name: startTime
value: string
- name: endTime
value: string
- name: error
value:
- name: kind
value: string
- name: code
value: string
- name: message
value: string
- name: type
value: string
- name: description
value: string
- name: windowStartTime
value: string
- name: instance
value: string
- name: selfLink
value: string
- name: location
value: string
- name: diskEncryptionConfiguration
value:
- name: kmsKeyName
value: string
- name: kind
value: string
- name: diskEncryptionStatus
value:
- name: kmsKeyVersionName
value: string
- name: kind
value: string
- name: backupKind
value: string
- name: timeZone
value: string
- name: maxChargeableBytes
value: string
DELETE
example
Deletes the specified backup_runs
resource.
/*+ delete */
DELETE FROM google.sqladmin.backup_runs
WHERE id = '{{ id }}'
AND instance = '{{ instance }}'
AND project = '{{ project }}';