Class: Google::Cloud::Spanner::Instance::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/spanner/instance/config.rb,
lib/google/cloud/spanner/instance/config/list.rb

Overview

Instance Config

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

See Project#instance_configs and Project#instance_config.

Examples:

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

Defined Under Namespace

Classes: List

Instance Method Summary collapse

Instance Method Details

#instance_config_idString

A unique identifier for the instance configuration.

Returns:

  • (String)


59
60
61
62
# File 'lib/google/cloud/spanner/instance/config.rb', line 59

def instance_config_id
  Admin::Instance::V1::InstanceAdminClient
    .match_instance_config_from_instance_config_name @grpc.name
end

#nameString Also known as: display_name

The name of this instance configuration as it appears in UIs.

Returns:

  • (String)


75
76
77
# File 'lib/google/cloud/spanner/instance/config.rb', line 75

def name
  @grpc.display_name
end

#pathString

The full path for the instance config resource. Values are of the form projects/<project_id>/instanceConfigs/<instance_config_id>.

Returns:

  • (String)


68
69
70
# File 'lib/google/cloud/spanner/instance/config.rb', line 68

def path
  @grpc.name
end

#project_idString

The unique identifier for the project.

Returns:

  • (String)


51
52
53
54
# File 'lib/google/cloud/spanner/instance/config.rb', line 51

def project_id
  Admin::Instance::V1::InstanceAdminClient
    .match_project_from_instance_config_name @grpc.name
end