module Google::Cloud

Public Class Methods

bigtable(project_id: nil, credentials: nil, scope: nil, timeout: nil) click to toggle source

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

@param project_id [String]

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

@param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel,

GRPC::Core::ChannelCredentials, Proc]
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.
`String` will be treated as the path to the keyfile to use to construct
credentials for this client.
`Hash` will be treated as the contents of a keyfile to use to construct
credentials for 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.

@param scope [Array<String>]

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](https://developers.google.com/identity/protocols/OAuth2).
The OAuth scopes for this service. This parameter is ignored if an
updater_proc is supplied.

@param timeout [Integer]

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

@return [Google::Cloud::Bigtable::Project]

@example

require "google/cloud/bigtable"

bigtable = Google::Cloud.bigtable
# File lib/google-cloud-bigtable.rb, line 114
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

Public Instance Methods

bigtable(scope: nil, timeout: nil, credentials: nil) click to toggle source

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

For more information on connecting to Google Cloud Platform, see the {file:AUTHENTICATION.md Authentication Guide}.

@param scope [Array<String>]

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](https://developers.google.com/identity/protocols/OAuth2).
The OAuth scopes for this service. This parameter is ignored if an
updater_proc is supplied.

@param timeout [Integer]

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

@param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel,

GRPC::Core::ChannelCredentials, Proc]
Provides 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.
`String` will be treated as the path to the keyfile to use to construct
credentials for this client.
`Hash` will be treated as the contents of a keyfile to use to construct
credentials for 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.

@return [Google::Cloud::Bigtable::Project]

@example

require "google/cloud/bigtable"

gcloud  = Google::Cloud.new

bigtable = gcloud.bigtable
# File lib/google-cloud-bigtable.rb, line 67
def bigtable scope: nil, timeout: nil, credentials: nil
  Google::Cloud.bigtable(
    project_id:  @project,
    credentials: (credentials || @keyfile),
    scope:       scope,
    timeout:     (timeout || @timeout)
  )
end