Class: Google::Apis::SpannerV1::ReplicaSelection

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/spanner_v1/classes.rb,
lib/google/apis/spanner_v1/representations.rb,
lib/google/apis/spanner_v1/representations.rb

Overview

The directed read replica selector. Callers must provide one or more of the following fields for replica selection: * location - The location must be one of the regions within the multi-region configuration of your database. * type - The type of the replica. Some examples of using replica_selectors are:

  • location:us-east1 --> The "us-east1" replica(s) of any available type will be used to process the request. * type:READ_ONLY --> The "READ_ONLY" type replica(s) in nearest available location will be used to process the request. * location:us-east1 type:READ_ONLY --> The "READ_ONLY" type replica(s) in location "us-east1" will be used to process the request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ReplicaSelection

Returns a new instance of ReplicaSelection.



5455
5456
5457
# File 'lib/google/apis/spanner_v1/classes.rb', line 5455

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#locationString

The location or region of the serving requests, e.g. "us-east1". Corresponds to the JSON property location

Returns:

  • (String)


5448
5449
5450
# File 'lib/google/apis/spanner_v1/classes.rb', line 5448

def location
  @location
end

#typeString

The type of replica. Corresponds to the JSON property type

Returns:

  • (String)


5453
5454
5455
# File 'lib/google/apis/spanner_v1/classes.rb', line 5453

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5460
5461
5462
5463
# File 'lib/google/apis/spanner_v1/classes.rb', line 5460

def update!(**args)
  @location = args[:location] if args.key?(:location)
  @type = args[:type] if args.key?(:type)
end