Cloud Bigtable API - Class Google::Cloud::Bigtable::Cluster::List (v2.7.1)

Reference documentation and code samples for the Cloud Bigtable API class Google::Cloud::Bigtable::Cluster::List.

Cluster::List is a special case Array with additional values.

Inherits

  • Array

Methods

#all

def all(&block) { |cluster| ... } -> Enumerator, nil

Retrieves remaining results by repeatedly invoking #next until #next? returns false. Calls the given block once for each result, which is passed as the argument to the block.

An enumerator is returned if no block is given.

This method will make repeated API calls until all remaining results are retrieved (unlike #each, for example, which merely iterates over the results returned by a single API call). Use with caution.

Yields
  • (cluster) — The block for accessing each cluster.
Yield Parameter
  • cluster (Cluster) — The cluster object.
Returns
  • (Enumerator, nil) — An enumerator is returned if no block is given, otherwise nil.
Examples

Iterating each cluster by passing a block:

require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new

bigtable.clusters.all do |cluster|
  puts cluster.cluster_id
end

Using the enumerator by not passing a block:

require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new

all_cluster_ids = bigtable.clusters.all.map do |cluster|
  puts cluster.cluster_id
end

#failed_locations

def failed_locations()

Locations from which cluster information could not be retrieved, due to an outage or some other transient condition. Clusters from these locations may be missing from clusters or may only have partial information returned.

#failed_locations=

def failed_locations=(value)

Locations from which cluster information could not be retrieved, due to an outage or some other transient condition. Clusters from these locations may be missing from clusters or may only have partial information returned.

#next

def next() -> Cluster::List

Retrieve the next page of clusters.

Returns
Example
require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new

clusters = bigtable.clusters
if clusters.next?
  next_clusters = clusters.next
end

#next?

def next?() -> Boolean

Whether there is a next page of clusters.

Returns
  • (Boolean)
Example
require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new

clusters = bigtable.clusters
if clusters.next?
  next_clusters = clusters.next
end

#token

def token()

If not empty, indicates that there are more records that match the request and this value should be passed to continue.

#token=

def token=(value)

If not empty, indicates that there are more records that match the request and this value should be passed to continue.