Class: Google::Cloud::Bigtable::Backup::Job

Inherits:
LongrunningJob show all
Defined in:
lib/google/cloud/bigtable/backup/job.rb

Overview

Job

A resource representing the long-running, asynchronous processing of an backup create operation. The job can be refreshed to retrieve the backup object once the operation has been completed.

See Cluster#create_backup.

Examples:

require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new
instance = bigtable.instance("my-instance")
cluster = instance.cluster("my-cluster")
table = instance.table("my-table")

expire_time = Time.now + 60 * 60 * 7
job = cluster.create_backup(table, "my-backup", expire_time)

job.wait_until_done!
job.done? #=> true

if job.error?
  status = job.error
else
  backup = job.backup
end

See Also:

Instance Method Summary collapse

Instance Method Details

#backupGoogle::Cloud::Bigtable::Backup?

Get the backup object from operation results.

Examples:

require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new
instance = bigtable.instance("my-instance")
cluster = instance.cluster("my-cluster")
table = instance.table("my-table")

expire_time = Time.now + 60 * 60 * 7
job = cluster.create_backup(table, "my-backup", expire_time)

job.wait_until_done!
job.done? #=> true

if job.error?
  status = job.error
else
  backup = job.backup
end

Returns:



80
81
82
# File 'lib/google/cloud/bigtable/backup/job.rb', line 80

def backup
  Backup.from_grpc results, service if results
end