Class: Fog::Google::SQL::BackupRuns

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/google/models/sql/backup_runs.rb

Instance Method Summary collapse

Instance Method Details

#all(instance_id, backup_configuration_id) ⇒ Array<Fog::Google::SQL::BackupRun>

Lists all backup runs associated with a given instance and configuration

Parameters:

  • instance_id (String)

    Instance ID

  • backup_configuration_id (String)

    Backup Configuration ID

Returns:



16
17
18
19
# File 'lib/fog/google/models/sql/backup_runs.rb', line 16

def all(instance_id, backup_configuration_id)
  data = service.list_backup_runs(instance_id, backup_configuration_id).body['items'] || []
  load(data)
end

#get(instance_id, backup_configuration_id, due_time) ⇒ Fog::Google::SQL::BackupRun

Retrieves a resource containing information about a backup run

Parameters:

  • instance_id (String)

    Instance ID

  • backup_configuration_id (String)

    Backup Configuration ID

  • due_time (String)

    The time when this run is due to start in RFC 3339 format

Returns:



28
29
30
31
32
33
34
# File 'lib/fog/google/models/sql/backup_runs.rb', line 28

def get(instance_id, backup_configuration_id, due_time)
  if backup_run = service.get_backup_run(instance_id, backup_configuration_id, due_time).body
    new(backup_run)
  end
rescue Fog::Errors::NotFound
  nil
end