Class: Google::Cloud::Spanner::Admin::Database::Configuration

Inherits:
Object
  • Object
show all
Extended by:
Gapic::Config
Defined in:
lib/google/cloud/spanner/admin/database.rb

Overview

Configuration class for the Spanner Admin Database.

This class provides control over timeouts, retry behavior, query options, and other low-level controls.

Instance Attribute Summary collapse

Instance Attribute Details

#credentials::Object

Credentials to send with calls. You may provide any of the following types:

  • (String) The path to a service account key file in JSON format
  • (Hash) A service account key as a Hash
  • (Google::Auth::Credentials) A googleauth credentials object (see the googleauth docs)
  • (Signet::OAuth2::Client) A signet oauth2 client object (see the signet docs)
  • (GRPC::Core::Channel) a gRPC channel with included credentials
  • (GRPC::Core::ChannelCredentials) a gRPC credentails object
  • (nil) indicating no credentials

Returns:

  • (::Object)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#endpoint::String

The hostname or hostname:port of the service endpoint. Defaults to "spanner.googleapis.com".

Returns:

  • (::String)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#interceptors::Array<::GRPC::ClientInterceptor>

An array of interceptors that are run before calls are executed.

Returns:

  • (::Array<::GRPC::ClientInterceptor>)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#lib_name::String

The library name as recorded in instrumentation and logging

Returns:

  • (::String)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#lib_version::String

The library version as recorded in instrumentation and logging

Returns:

  • (::String)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#metadata::Hash{::Symbol=>::String}

Additional gRPC headers to be sent with the call.

Returns:

  • (::Hash{::Symbol=>::String})


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#quota_project::String

A separate project against which to charge quota.

Returns:

  • (::String)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#retry_policy::Hash

The retry policy. The value is a hash with the following keys:

  • :initial_delay (type: Numeric) - The initial delay in seconds.
  • :max_delay (type: Numeric) - The max delay in seconds.
  • :multiplier (type: Numeric) - The incremental backoff multiplier.
  • :retry_codes (type: Array<String>) - The error codes that should trigger a retry.

Returns:

  • (::Hash)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#scope::Array<::String>

The OAuth scopes

Returns:

  • (::Array<::String>)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end

#timeout::Numeric

The call timeout in seconds.

Returns:

  • (::Numeric)


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/google/cloud/spanner/admin/database.rb', line 290

class Configuration
  extend ::Gapic::Config

  config_attr :endpoint,      "spanner.googleapis.com", ::String
  config_attr :credentials,   nil do |value|
    allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
    allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
    allowed.any? { |klass| klass === value }
  end
  config_attr :project_id,    nil, ::String, nil
  config_attr :scope,         nil, ::String, ::Array, nil
  config_attr :lib_name,      nil, ::String,  nil
  config_attr :lib_version,   nil, ::String,  nil
  config_attr :interceptors,  nil, ::Array,   nil
  config_attr :timeout,       nil, ::Numeric, nil
  config_attr :quota_project, nil, ::String,  nil
  config_attr :emulator_host, nil, ::String,  nil
  config_attr :query_options, nil, ::Hash,    nil
  config_attr :metadata,      nil, ::Hash,    nil
  config_attr :retry_policy,  nil, ::Hash,    nil

  # @private
  def initialize parent_config = nil
    @parent_config = parent_config unless parent_config.nil?

    yield self if block_given?
  end
end