Class: Google::Apis::SqlV1beta4::ReplicaConfiguration

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

Overview

Read-replica configuration for connecting to the master.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ ReplicaConfiguration

Returns a new instance of ReplicaConfiguration



2054
2055
2056
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 2054

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

Instance Attribute Details

#failover_targetBoolean Also known as: failover_target?

Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance.

Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance. Corresponds to the JSON property failoverTarget

Returns:

  • (Boolean)


2041
2042
2043
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 2041

def failover_target
  @failover_target
end

#kindString

This is always sql#replicaConfiguration. Corresponds to the JSON property kind

Returns:

  • (String)


2047
2048
2049
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 2047

def kind
  @kind
end

#mysql_replica_configurationGoogle::Apis::SqlV1beta4::MySqlReplicaConfiguration

Read-replica configuration specific to MySQL databases. Corresponds to the JSON property mysqlReplicaConfiguration



2052
2053
2054
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 2052

def mysql_replica_configuration
  @mysql_replica_configuration
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2059
2060
2061
2062
2063
# File 'generated/google/apis/sql_v1beta4/classes.rb', line 2059

def update!(**args)
  @failover_target = args[:failover_target] if args.key?(:failover_target)
  @kind = args[:kind] if args.key?(:kind)
  @mysql_replica_configuration = args[:mysql_replica_configuration] if args.key?(:mysql_replica_configuration)
end