class Google::Cloud::Spanner::Instance::Config

# Instance Config

Represents a Cloud Spanner instance configuration. Instance configurations define the geographic placement of nodes and their replication.

See {Google::Cloud::Spanner::Project#instance_configs} and {Google::Cloud::Spanner::Project#instance_config}.

@example

require "google/cloud/spanner"

spanner = Google::Cloud::Spanner.new

instance_configs = spanner.instance_configs
instance_configs.each do |config|
  puts config.instance_config_id
end

Public Class Methods

from_grpc(grpc) click to toggle source

@private Creates a new Instance::Config instance from a `Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig`.

# File lib/google/cloud/spanner/instance/config.rb, line 81
def self.from_grpc grpc
  new grpc
end
new(grpc) click to toggle source

@private Creates a new Instance::Config instance.

# File lib/google/cloud/spanner/instance/config.rb, line 45
def initialize grpc
  @grpc = grpc
end

Public Instance Methods

display_name()
Alias for: name
instance_config_id() click to toggle source

A unique identifier for the instance configuration. @return [String]

# File lib/google/cloud/spanner/instance/config.rb, line 58
def instance_config_id
  @grpc.name.split("/")[3]
end
name() click to toggle source

The name of this instance configuration as it appears in UIs. @return [String]

# File lib/google/cloud/spanner/instance/config.rb, line 73
def name
  @grpc.display_name
end
Also aliased as: display_name
path() click to toggle source

The full path for the instance config resource. Values are of the form `projects/<project_id>/instanceConfigs/<instance_config_id>`. @return [String]

# File lib/google/cloud/spanner/instance/config.rb, line 66
def path
  @grpc.name
end
project_id() click to toggle source

The unique identifier for the project. @return [String]

# File lib/google/cloud/spanner/instance/config.rb, line 51
def project_id
  @grpc.name.split("/")[1]
end

Protected Instance Methods

ensure_service!() click to toggle source

@private Raise an error unless an active connection to the service is available.

# File lib/google/cloud/spanner/instance/config.rb, line 90
def ensure_service!
  raise "Must have active connection to service" unless service
end