google-cloud-bigtable - Class Google::Cloud::Bigtable::Cluster::Job (v2.6.5)

Reference documentation and code samples for the google-cloud-bigtable class Google::Cloud::Bigtable::Cluster::Job.

Job

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

See Instance#create_cluster and #save.

Example

require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new

instance = bigtable.instance "my-instance"
job = instance.create_cluster(
  "my-new-cluster",
  "us-east-1b",
  nodes: 3,
  storage_type: :SSD
)

job.done? #=> false
job.reload! # API call
job.done? #=> true

# OR wail until  complete
job.wait_until_done!

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

Methods

#cluster

def cluster() -> Google::Cloud::Bigtable::Cluster, nil

Gets the cluster object from job results

Returns
Example
require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new

instance = bigtable.instance "my-instance"
job = instance.create_cluster(
  "my-new-cluster",
  "us-east-1b",
  nodes: 3,
  storage_type: :SSD
)

job.wait_until_done!
cluster = job.cluster