Module: Google::Cloud

Defined in:
lib/google-cloud-bigtable.rb,
lib/google/cloud/bigtable.rb,
lib/google/cloud/bigtable/row.rb,
lib/google/cloud/bigtable/table.rb,
lib/google/cloud/bigtable/backup.rb,
lib/google/cloud/bigtable/errors.rb,
lib/google/cloud/bigtable/policy.rb,
lib/google/cloud/bigtable/status.rb,
lib/google/cloud/bigtable/cluster.rb,
lib/google/cloud/bigtable/convert.rb,
lib/google/cloud/bigtable/gc_rule.rb,
lib/google/cloud/bigtable/project.rb,
lib/google/cloud/bigtable/service.rb,
lib/google/cloud/bigtable/version.rb,
lib/google/cloud/bigtable/instance.rb,
lib/google/cloud/bigtable/row_range.rb,
lib/google/cloud/bigtable/backup/job.rb,
lib/google/cloud/bigtable/row_filter.rb,
lib/google/cloud/bigtable/table/list.rb,
lib/google/cloud/bigtable/app_profile.rb,
lib/google/cloud/bigtable/backup/list.rb,
lib/google/cloud/bigtable/cluster/job.rb,
lib/google/cloud/bigtable/credentials.rb,
lib/google/cloud/bigtable/rows_reader.rb,
lib/google/cloud/bigtable/value_range.rb,
lib/google/cloud/bigtable/cluster/list.rb,
lib/google/cloud/bigtable/column_range.rb,
lib/google/cloud/bigtable/instance/job.rb,
lib/google/cloud/bigtable/rows_mutator.rb,
lib/google/cloud/bigtable/column_family.rb,
lib/google/cloud/bigtable/instance/list.rb,
lib/google/cloud/bigtable/mutation_entry.rb,
lib/google/cloud/bigtable/routing_policy.rb,
lib/google/cloud/bigtable/sample_row_key.rb,
lib/google/cloud/bigtable/app_profile/job.rb,
lib/google/cloud/bigtable/chunk_processor.rb,
lib/google/cloud/bigtable/encryption_info.rb,
lib/google/cloud/bigtable/longrunning_job.rb,
lib/google/cloud/bigtable/read_operations.rb,
lib/google/cloud/bigtable/app_profile/list.rb,
lib/google/cloud/bigtable/column_family_map.rb,
lib/google/cloud/bigtable/table/restore_job.rb,
lib/google/cloud/bigtable/mutation_operations.rb,
lib/google/cloud/bigtable/table/cluster_state.rb,
lib/google/cloud/bigtable/instance/cluster_map.rb,
lib/google/cloud/bigtable/read_modify_write_rule.rb,
lib/google/cloud/bigtable/row_filter/chain_filter.rb,
lib/google/cloud/bigtable/row_filter/simple_filter.rb,
lib/google/cloud/bigtable/row_filter/condition_filter.rb,
lib/google/cloud/bigtable/row_filter/interleave_filter.rb

Defined Under Namespace

Modules: Bigtable

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.bigtable(project_id: nil, credentials: nil, scope: nil, timeout: nil) ⇒ Google::Cloud::Bigtable::Project

Creates a Cloud Bigtable client instance for data, table admin and instance admin operations.

Examples:

require "google/cloud/bigtable"

bigtable = Google::Cloud.bigtable

Parameters:

  • project_id (String) (defaults to: nil)

    Project identifier for the Bigtable service you are connecting to. If not present, the default project for the credentials is used.

  • credentials (Google::Auth::Credentials, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc) (defaults to: nil)

    The means for authenticating requests made by the client. This parameter can be one of the following types. Google::Auth::Credentials uses the properties of its represented keyfile for authenticating requests made by this client. GRPC::Core::Channel will be used to make calls through. GRPC::Core::ChannelCredentials will be used to set up the gRPC client. The channel credentials should already be composed with a GRPC::Core::CallCredentials object. Proc will be used as an updater_proc for the gRPC channel. The proc transforms the metadata for requests, generally, to give OAuth credentials. @note Warning: Passing a String to a keyfile path or a Hash of credentials is deprecated. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data.

    @example

    # The recommended way to provide credentials is to use the make_creds method # on the appropriate credentials class for your environment.

    credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( json_key_io: ::File.open("/path/to/keyfile.json") )

    client = Google::Cloud.bigtable credentials: credentials

  • scope (Array<String>) (defaults to: nil)

    The OAuth 2.0 scopes controlling the set of resources and operations that the connection can access. See Using OAuth 2.0 to Access Google APIs. The OAuth scopes for this service. This parameter is ignored if an updater_proc is supplied.

  • timeout (Integer) (defaults to: nil)

    The default timeout, in seconds, for calls made through this client.

Returns:



131
132
133
134
135
136
137
138
139
# File 'lib/google-cloud-bigtable.rb', line 131

def self.bigtable project_id: nil, credentials: nil, scope: nil, timeout: nil
  require "google/cloud/bigtable"
  Google::Cloud::Bigtable.new(
    project_id:  project_id,
    credentials: credentials,
    scope:       scope,
    timeout:     timeout
  )
end

Instance Method Details

#bigtable(scope: nil, timeout: nil, credentials: nil) ⇒ Object

Creates a new object for connecting to the Cloud Bigtable service.

For more information on connecting to Google Cloud Platform, see the Authentication Guide.

Parameters:

  • scope (Array<String>) (defaults to: nil)

    The OAuth 2.0 scopes controlling the set of resources and operations that the connection can access. See Using OAuth 2.0 to Access Google APIs. The OAuth scopes for this service. This parameter is ignored if an updater_proc is supplied.

  • timeout (Integer) (defaults to: nil)

    The default timeout, in seconds, for calls made through this client.

  • credentials (Google::Auth::Credentials, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc) (defaults to: nil)

    The means for authenticating requests made by the client. This parameter can be one of the following types. Google::Auth::Credentials uses the properties of its represented keyfile for authenticating requests made by this client. GRPC::Core::Channel will be used to make calls through. GRPC::Core::ChannelCredentials will be used to set up the gRPC client. The channel credentials should already be composed with a GRPC::Core::CallCredentials object. Proc will be used as an updater_proc for the gRPC channel. The proc transforms the metadata for requests, generally, to give OAuth credentials. @note Warning: Passing a String to a keyfile path or a Hash of credentials is deprecated. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data.

    @example

    # The recommended way to provide credentials is to use the make_creds method # on the appropriate credentials class for your environment.

    credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( json_key_io: ::File.open("/path/to/keyfile.json") )

    gcloud = Google::Cloud.new

    bigtable = gcloud.bigtable credentials: credentials



71
72
73
74
75
76
77
78
79
80
# File 'lib/google-cloud-bigtable.rb', line 71

def bigtable scope: nil, timeout: nil, credentials: nil
  credentials ||= @keyfile
  timeout ||= @timeout
  Google::Cloud.bigtable(
    project_id:  @project,
    credentials: credentials,
    scope:       scope,
    timeout:     timeout
  )
end