class Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client

Client for the BigtableTableAdmin service.

Service for creating, configuring, and deleting Cloud Bigtable tables.

Provides access to the table schemas only, not the data stored within the tables.

Attributes

bigtable_table_admin_stub[R]

@private

operations_client[R]

Get the associated client for long-running operations.

@return [::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Operations]

Public Class Methods

configure() { |configure| ... } click to toggle source

Configure the BigtableTableAdmin Client class.

See {::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client::Configuration} for a description of the configuration fields.

@example

# Modify the configuration for all BigtableTableAdmin clients
::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.configure do |config|
  config.timeout = 10.0
end

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 61
def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Bigtable", "Admin", "V2"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.create_table.timeout = 300.0

    default_config.rpcs.list_tables.timeout = 60.0
    default_config.rpcs.list_tables.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.get_table.timeout = 60.0
    default_config.rpcs.get_table.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.delete_table.timeout = 60.0

    default_config.rpcs.modify_column_families.timeout = 300.0

    default_config.rpcs.drop_row_range.timeout = 3600.0

    default_config.rpcs.generate_consistency_token.timeout = 60.0
    default_config.rpcs.generate_consistency_token.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.check_consistency.timeout = 60.0
    default_config.rpcs.check_consistency.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.get_snapshot.timeout = 60.0
    default_config.rpcs.get_snapshot.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.list_snapshots.timeout = 60.0
    default_config.rpcs.list_snapshots.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.delete_snapshot.timeout = 60.0

    default_config.rpcs.create_backup.timeout = 60.0

    default_config.rpcs.get_backup.timeout = 60.0
    default_config.rpcs.get_backup.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.update_backup.timeout = 60.0

    default_config.rpcs.delete_backup.timeout = 60.0

    default_config.rpcs.list_backups.timeout = 60.0
    default_config.rpcs.list_backups.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.restore_table.timeout = 60.0

    default_config.rpcs.get_iam_policy.timeout = 60.0
    default_config.rpcs.get_iam_policy.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.set_iam_policy.timeout = 60.0

    default_config.rpcs.test_iam_permissions.timeout = 60.0
    default_config.rpcs.test_iam_permissions.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end
new() { |config| ... } click to toggle source

Create a new BigtableTableAdmin client object.

@example

# Create a client using the default configuration
client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new do |config|
  config.timeout = 10.0
end

@yield [config] Configure the BigtableTableAdmin client. @yieldparam config [Client::Configuration]

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 184
def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/bigtable/admin/v2/bigtable_table_admin_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.endpoint = @config.endpoint
  end

  @bigtable_table_admin_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Public Instance Methods

check_consistency(request, options = nil) { |response, operation| ... } click to toggle source

Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request.

@overload check_consistency(request, options = nil)

Pass arguments to `check_consistency` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload check_consistency(name: nil, consistency_token: nil)

Pass arguments to `check_consistency` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the Table for which to check replication consistency.
  Values are of the form
  `projects/{project}/instances/{instance}/tables/{table}`.
@param consistency_token [::String]
  Required. The token created using GenerateConsistencyToken for the Table.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 904
def check_consistency request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.check_consistency.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.check_consistency.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.check_consistency.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :check_consistency, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
configure() { |config| ... } click to toggle source

Configure the BigtableTableAdmin Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on {Client.configure}.

See {::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client::Configuration} for a description of the configuration fields.

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 163
def configure
  yield @config if block_given?
  @config
end
create_backup(request, options = nil) { |response, operation| ... } click to toggle source

Starts creating a new Cloud Bigtable Backup. The returned backup {::Google::Longrunning::Operation long-running operation} can be used to track creation of the backup. The {::Google::Longrunning::Operation#metadata metadata} field type is {::Google::Cloud::Bigtable::Admin::V2::CreateBackupMetadata CreateBackupMetadata}. The {::Google::Longrunning::Operation#response response} field type is {::Google::Cloud::Bigtable::Admin::V2::Backup Backup}, if successful. Cancelling the returned operation will stop the creation and delete the backup.

@overload create_backup(request, options = nil)

Pass arguments to `create_backup` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::CreateBackupRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::CreateBackupRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_backup(parent: nil, backup_id: nil, backup: nil)

Pass arguments to `create_backup` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. This must be one of the clusters in the instance in which this
  table is located. The backup will be stored in this cluster. Values are
  of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
@param backup_id [::String]
  Required. The id of the backup to be created. The `backup_id` along with
  the parent `parent` are combined as \\{parent}/backups/\\{backup_id} to create
  the full backup name, of the form:
  `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
  This string must be between 1 and 50 characters in length and match the
  regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
@param backup [::Google::Cloud::Bigtable::Admin::V2::Backup, ::Hash]
  Required. The backup to create.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1320
def create_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_backup.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_backup.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :create_backup, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_table(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request.

@overload create_table(request, options = nil)

Pass arguments to `create_table` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::CreateTableRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::CreateTableRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_table(parent: nil, table_id: nil, table: nil, initial_splits: nil)

Pass arguments to `create_table` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. The unique name of the instance in which to create the table.
  Values are of the form `projects/{project}/instances/{instance}`.
@param table_id [::String]
  Required. The name by which the new table should be referred to within the parent
  instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
  Maximum 50 characters.
@param table [::Google::Cloud::Bigtable::Admin::V2::Table, ::Hash]
  Required. The Table to create.
@param initial_splits [::Array<::Google::Cloud::Bigtable::Admin::V2::CreateTableRequest::Split, ::Hash>]
  The optional list of row keys that will be used to initially split the
  table into several tablets (tablets are similar to HBase regions).
  Given two split keys, `s1` and `s2`, three tablets will be created,
  spanning the key ranges: `[, s1), [s1, s2), [s2, )`.

  Example:

  * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",`
                 `"other", "zz"]`
  * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]`
  * Key assignment:
      - Tablet 1 `[, apple)                => {"a"}.`
      - Tablet 2 `[apple, customer_1)      => {"apple", "custom"}.`
      - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.`
      - Tablet 4 `[customer_2, other)      => {"customer_2"}.`
      - Tablet 5 `[other, )                => {"other", "zz"}.`

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Table] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Table]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 289
def create_table request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateTableRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_table.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_table.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_table.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :create_table, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_table_from_snapshot(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new table from the specified snapshot. The target table must not exist. The snapshot and the table must be in the same instance.

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

@overload create_table_from_snapshot(request, options = nil)

Pass arguments to `create_table_from_snapshot` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::CreateTableFromSnapshotRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::CreateTableFromSnapshotRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_table_from_snapshot(parent: nil, table_id: nil, source_snapshot: nil)

Pass arguments to `create_table_from_snapshot` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. The unique name of the instance in which to create the table.
  Values are of the form `projects/{project}/instances/{instance}`.
@param table_id [::String]
  Required. The name by which the new table should be referred to within the parent
  instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
@param source_snapshot [::String]
  Required. The unique name of the snapshot from which to restore the table. The
  snapshot and the table must be in the same instance.
  Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 373
def create_table_from_snapshot request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateTableFromSnapshotRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.create_table_from_snapshot.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_table_from_snapshot.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_table_from_snapshot.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :create_table_from_snapshot, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_backup(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a pending or completed Cloud Bigtable backup.

@overload delete_backup(request, options = nil)

Pass arguments to `delete_backup` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::DeleteBackupRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::DeleteBackupRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_backup(name: nil)

Pass arguments to `delete_backup` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. Name of the backup to delete.
  Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1538
def delete_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_backup.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_backup.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :delete_backup, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_snapshot(request, options = nil) { |response, operation| ... } click to toggle source

Permanently deletes the specified snapshot.

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

@overload delete_snapshot(request, options = nil)

Pass arguments to `delete_snapshot` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::DeleteSnapshotRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::DeleteSnapshotRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_snapshot(name: nil)

Pass arguments to `delete_snapshot` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the snapshot to be deleted.
  Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1234
def delete_snapshot request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteSnapshotRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_snapshot.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_snapshot.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_snapshot.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :delete_snapshot, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_table(request, options = nil) { |response, operation| ... } click to toggle source

Permanently deletes a specified table and all of its data.

@overload delete_table(request, options = nil)

Pass arguments to `delete_table` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::DeleteTableRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::DeleteTableRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_table(name: nil)

Pass arguments to `delete_table` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the table to be deleted.
  Values are of the form
  `projects/{project}/instances/{instance}/tables/{table}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 602
def delete_table request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteTableRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.delete_table.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_table.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_table.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :delete_table, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
drop_row_range(request, options = nil) { |response, operation| ... } click to toggle source

Permanently drop/delete a row range from a specified table. The request can specify whether to delete all rows in a table, or only those that match a particular prefix.

@overload drop_row_range(request, options = nil)

Pass arguments to `drop_row_range` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::DropRowRangeRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::DropRowRangeRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload drop_row_range(name: nil, row_key_prefix: nil, delete_all_data_from_table: nil)

Pass arguments to `drop_row_range` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the table on which to drop a range of rows.
  Values are of the form
  `projects/{project}/instances/{instance}/tables/{table}`.
@param row_key_prefix [::String]
  Delete all rows that start with this row key prefix. Prefix cannot be
  zero length.
@param delete_all_data_from_table [::Boolean]
  Delete all rows in the table. Setting this to false is a no-op.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 757
def drop_row_range request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DropRowRangeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.drop_row_range.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.drop_row_range.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.drop_row_range.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :drop_row_range, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
generate_consistency_token(request, options = nil) { |response, operation| ... } click to toggle source

Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. The tokens will be available for 90 days.

@overload generate_consistency_token(request, options = nil)

Pass arguments to `generate_consistency_token` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload generate_consistency_token(name: nil)

Pass arguments to `generate_consistency_token` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the Table for which to create a consistency token.
  Values are of the form
  `projects/{project}/instances/{instance}/tables/{table}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 830
def generate_consistency_token request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.generate_consistency_token.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.generate_consistency_token.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.generate_consistency_token.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :generate_consistency_token, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_backup(request, options = nil) { |response, operation| ... } click to toggle source

Gets metadata on a pending or completed Cloud Bigtable Backup.

@overload get_backup(request, options = nil)

Pass arguments to `get_backup` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::GetBackupRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::GetBackupRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_backup(name: nil)

Pass arguments to `get_backup` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. Name of the backup.
  Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Backup] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Backup]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1391
def get_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_backup.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_backup.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :get_backup, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_iam_policy(request, options = nil) { |response, operation| ... } click to toggle source

Gets the access control policy for a Table or Backup resource. Returns an empty policy if the resource exists but does not have a policy set.

@overload get_iam_policy(request, options = nil)

Pass arguments to `get_iam_policy` via a request object, either of type
{::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.

@param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_iam_policy(resource: nil, options: nil)

Pass arguments to `get_iam_policy` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param resource [::String]
  REQUIRED: The resource for which the policy is being requested.
  See the operation documentation for the appropriate value for this field.
@param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
  OPTIONAL: A `GetPolicyOptions` object for specifying options to
  `GetIamPolicy`. This field is only used by Cloud IAM.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Iam::V1::Policy] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Iam::V1::Policy]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1833
def get_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_iam_policy.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "resource" => request.resource
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_iam_policy.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_snapshot(request, options = nil) { |response, operation| ... } click to toggle source

Gets metadata information about the specified snapshot.

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

@overload get_snapshot(request, options = nil)

Pass arguments to `get_snapshot` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::GetSnapshotRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::GetSnapshotRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_snapshot(name: nil)

Pass arguments to `get_snapshot` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the requested snapshot.
  Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Snapshot] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Snapshot]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1074
def get_snapshot request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetSnapshotRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_snapshot.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_snapshot.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_snapshot.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :get_snapshot, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_table(request, options = nil) { |response, operation| ... } click to toggle source

Gets metadata information about the specified table.

@overload get_table(request, options = nil)

Pass arguments to `get_table` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::GetTableRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::GetTableRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_table(name: nil, view: nil)

Pass arguments to `get_table` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the requested table.
  Values are of the form
  `projects/{project}/instances/{instance}/tables/{table}`.
@param view [::Google::Cloud::Bigtable::Admin::V2::Table::View]
  The view to be applied to the returned table's fields.
  Defaults to `SCHEMA_VIEW` if unspecified.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Table] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Table]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 532
def get_table request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetTableRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.get_table.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_table.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_table.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :get_table, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_backups(request, options = nil) { |response, operation| ... } click to toggle source

Lists Cloud Bigtable backups. Returns both completed and pending backups.

@overload list_backups(request, options = nil)

Pass arguments to `list_backups` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::ListBackupsRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::ListBackupsRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_backups(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil)

Pass arguments to `list_backups` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. The cluster to list backups from.  Values are of the
  form `projects/{project}/instances/{instance}/clusters/{cluster}`.
  Use `{cluster} = '-'` to list backups for all clusters in an instance,
  e.g., `projects/{project}/instances/{instance}/clusters/-`.
@param filter [::String]
  A filter expression that filters backups listed in the response.
  The expression must specify the field name, a comparison operator,
  and the value that you want to use for filtering. The value must be a
  string, a number, or a boolean. The comparison operator must be
  <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is
  roughly synonymous with equality. Filter rules are case insensitive.

  The fields eligible for filtering are:
    * `name`
    * `source_table`
    * `state`
    * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
    * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
    * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
    * `size_bytes`

  To filter on multiple expressions, provide each separate expression within
  parentheses. By default, each expression is an AND expression. However,
  you can include AND, OR, and NOT expressions explicitly.

  Some examples of using filters are:

    * `name:"exact"` --> The backup's name is the string "exact".
    * `name:howl` --> The backup's name contains the string "howl".
    * `source_table:prod`
           --> The source_table's name contains the string "prod".
    * `state:CREATING` --> The backup is pending creation.
    * `state:READY` --> The backup is fully created and ready for use.
    * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
           --> The backup name contains the string "howl" and start_time
               of the backup is before 2018-03-28T14:50:00Z.
    * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
@param order_by [::String]
  An expression for specifying the sort order of the results of the request.
  The string value should specify one or more fields in {::Google::Cloud::Bigtable::Admin::V2::Backup Backup}. The full
  syntax is described at https://aip.dev/132#ordering.

  Fields supported are:
     * name
     * source_table
     * expire_time
     * start_time
     * end_time
     * size_bytes
     * state

  For example, "start_time". The default sorting order is ascending.
  To specify descending order for the field, a suffix " desc" should
  be appended to the field name. For example, "start_time desc".
  Redundant space characters in the syntax are insigificant.

  If order_by is empty, results will be sorted by `start_time` in descending
  order starting from the most recently created backup.
@param page_size [::Integer]
  Number of backups to be returned in the response. If 0 or
  less, defaults to the server's maximum allowed page size.
@param page_token [::String]
  If non-empty, `page_token` should contain a
  {::Google::Cloud::Bigtable::Admin::V2::ListBackupsResponse#next_page_token next_page_token} from a
  previous {::Google::Cloud::Bigtable::Admin::V2::ListBackupsResponse ListBackupsResponse} to the same `parent` and with the same
  `filter`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Backup>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Backup>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1672
def list_backups request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListBackupsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_backups.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_backups.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_backups.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :list_backups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @bigtable_table_admin_stub, :list_backups, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_snapshots(request, options = nil) { |response, operation| ... } click to toggle source

Lists all snapshots associated with the specified cluster.

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

@overload list_snapshots(request, options = nil)

Pass arguments to `list_snapshots` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::ListSnapshotsRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::ListSnapshotsRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_snapshots(parent: nil, page_size: nil, page_token: nil)

Pass arguments to `list_snapshots` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. The unique name of the cluster for which snapshots should be listed.
  Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}`.
  Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
  e.g., `projects/{project}/instances/{instance}/clusters/-`.
@param page_size [::Integer]
  The maximum number of snapshots to return per page.
  CURRENTLY UNIMPLEMENTED AND IGNORED.
@param page_token [::String]
  The value of `next_page_token` returned by a previous call.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Snapshot>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Snapshot>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1157
def list_snapshots request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListSnapshotsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_snapshots.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_snapshots.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_snapshots.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :list_snapshots, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @bigtable_table_admin_stub, :list_snapshots, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_tables(request, options = nil) { |response, operation| ... } click to toggle source

Lists all tables served from a specified instance.

@overload list_tables(request, options = nil)

Pass arguments to `list_tables` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::ListTablesRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::ListTablesRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_tables(parent: nil, view: nil, page_size: nil, page_token: nil)

Pass arguments to `list_tables` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. The unique name of the instance for which tables should be listed.
  Values are of the form `projects/{project}/instances/{instance}`.
@param view [::Google::Cloud::Bigtable::Admin::V2::Table::View]
  The view to be applied to the returned tables' fields.
  Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
@param page_size [::Integer]
  Maximum number of results per page.

  A page_size of zero lets the server choose the number of items to return.
  A page_size which is strictly positive will return at most that many items.
  A negative page_size will cause an error.

  Following the first request, subsequent paginated calls are not required
  to pass a page_size. If a page_size is set in subsequent calls, it must
  match the page_size given in the first request.
@param page_token [::String]
  The value of `next_page_token` returned by a previous call.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Table>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Table>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 458
def list_tables request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListTablesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.list_tables.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_tables.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_tables.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :list_tables, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @bigtable_table_admin_stub, :list_tables, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
modify_column_families(request, options = nil) { |response, operation| ... } click to toggle source

Performs a series of column family modifications on the specified table. Either all or none of the modifications will occur before this method returns, but data requests received prior to that point may see a table where only some modifications have taken effect.

@overload modify_column_families(request, options = nil)

Pass arguments to `modify_column_families` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload modify_column_families(name: nil, modifications: nil)

Pass arguments to `modify_column_families` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the table whose families should be modified.
  Values are of the form
  `projects/{project}/instances/{instance}/tables/{table}`.
@param modifications [::Array<::Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification, ::Hash>]
  Required. Modifications to be atomically applied to the specified table's families.
  Entries are applied in order, meaning that earlier modifications can be
  masked by later ones (in the case of repeated updates to the same family,
  for example).

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Table] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Table]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 680
def modify_column_families request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.modify_column_families.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.modify_column_families.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.modify_column_families.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :modify_column_families, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
restore_table(request, options = nil) { |response, operation| ... } click to toggle source

Create a new table by restoring from a completed backup. The new table must be in the same project as the instance containing the backup. The returned table {::Google::Longrunning::Operation long-running operation} can be used to track the progress of the operation, and to cancel it. The {::Google::Longrunning::Operation#metadata metadata} field type is [RestoreTableMetadata]. The {::Google::Longrunning::Operation#response response} type is {::Google::Cloud::Bigtable::Admin::V2::Table Table}, if successful.

@overload restore_table(request, options = nil)

Pass arguments to `restore_table` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::RestoreTableRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::RestoreTableRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload restore_table(parent: nil, table_id: nil, backup: nil)

Pass arguments to `restore_table` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param parent [::String]
  Required. The name of the instance in which to create the restored
  table. This instance must be in the same project as the source backup.
  Values are of the form `projects/<project>/instances/<instance>`.
@param table_id [::String]
  Required. The id of the table to create and restore to. This
  table must not already exist. The `table_id` appended to
  `parent` forms the full table name of the form
  `projects/<project>/instances/<instance>/tables/<table_id>`.
@param backup [::String]
  Name of the backup from which to restore.  Values are of the form
  `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1758
def restore_table request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::RestoreTableRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.restore_table.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "parent" => request.parent
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.restore_table.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.restore_table.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :restore_table, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
set_iam_policy(request, options = nil) { |response, operation| ... } click to toggle source

Sets the access control policy on a Table or Backup resource. Replaces any existing policy.

@overload set_iam_policy(request, options = nil)

Pass arguments to `set_iam_policy` via a request object, either of type
{::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.

@param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload set_iam_policy(resource: nil, policy: nil)

Pass arguments to `set_iam_policy` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param resource [::String]
  REQUIRED: The resource for which the policy is being specified.
  See the operation documentation for the appropriate value for this field.
@param policy [::Google::Iam::V1::Policy, ::Hash]
  REQUIRED: The complete policy to be applied to the `resource`. The size of
  the policy is limited to a few 10s of KB. An empty policy is a
  valid policy but certain Cloud Platform services (such as Projects)
  might reject them.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Iam::V1::Policy] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Iam::V1::Policy]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1908
def set_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.set_iam_policy.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "resource" => request.resource
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.set_iam_policy.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.set_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
snapshot_table(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new snapshot in the specified cluster from the specified source table. The cluster and the table must be in the same instance.

Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

@overload snapshot_table(request, options = nil)

Pass arguments to `snapshot_table` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::SnapshotTableRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::SnapshotTableRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload snapshot_table(name: nil, cluster: nil, snapshot_id: nil, ttl: nil, description: nil)

Pass arguments to `snapshot_table` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param name [::String]
  Required. The unique name of the table to have the snapshot taken.
  Values are of the form
  `projects/{project}/instances/{instance}/tables/{table}`.
@param cluster [::String]
  Required. The name of the cluster where the snapshot will be created in.
  Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}`.
@param snapshot_id [::String]
  Required. The ID by which the new snapshot should be referred to within the parent
  cluster, e.g., `mysnapshot` of the form: `[_a-zA-Z0-9][-_.a-zA-Z0-9]*`
  rather than
  `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
@param ttl [::Google::Protobuf::Duration, ::Hash]
  The amount of time that the new snapshot can stay active after it is
  created. Once 'ttl' expires, the snapshot will get deleted. The maximum
  amount of time a snapshot can stay active is 7 days. If 'ttl' is not
  specified, the default value of 24 hours will be used.
@param description [::String]
  Description of the snapshot.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 997
def snapshot_table request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::SnapshotTableRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.snapshot_table.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "name" => request.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.snapshot_table.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.snapshot_table.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :snapshot_table, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
test_iam_permissions(request, options = nil) { |response, operation| ... } click to toggle source

Returns permissions that the caller has on the specified Table or Backup resource.

@overload test_iam_permissions(request, options = nil)

Pass arguments to `test_iam_permissions` via a request object, either of type
{::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.

@param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload test_iam_permissions(resource: nil, permissions: nil)

Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param resource [::String]
  REQUIRED: The resource for which the policy detail is being requested.
  See the operation documentation for the appropriate value for this field.
@param permissions [::Array<::String>]
  The set of permissions to check for the `resource`. Permissions with
  wildcards (such as '*' or 'storage.*') are not allowed. For more
  information see
  [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Iam::V1::TestIamPermissionsResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1982
def test_iam_permissions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.test_iam_permissions.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "resource" => request.resource
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.test_iam_permissions.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.test_iam_permissions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_backup(request, options = nil) { |response, operation| ... } click to toggle source

Updates a pending or completed Cloud Bigtable Backup.

@overload update_backup(request, options = nil)

Pass arguments to `update_backup` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::UpdateBackupRequest} or an equivalent Hash.

@param request [::Google::Cloud::Bigtable::Admin::V2::UpdateBackupRequest, ::Hash]
  A request object representing the call parameters. Required. To specify no
  parameters, or to keep all the default parameter values, pass an empty Hash.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_backup(backup: nil, update_mask: nil)

Pass arguments to `update_backup` via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).

@param backup [::Google::Cloud::Bigtable::Admin::V2::Backup, ::Hash]
  Required. The backup to update. `backup.name`, and the fields to be updated
  as specified by `update_mask` are required. Other fields are ignored.
  Update is only supported for the following fields:
   * `backup.expire_time`.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. A mask specifying which fields (e.g. `expire_time`) in the
  Backup resource should be updated. This mask is relative to the Backup
  resource, not to the request message. The field mask must always be
  specified; this prevents any future fields from being erased accidentally
  by clients that do not know about them.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Backup] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Backup]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb, line 1468
def update_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::UpdateBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
  metadata = @config.rpcs.update_backup.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {
    "backup.name" => request.backup.name
  }
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_backup.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         retry_policy: @config.retry_policy

  @bigtable_table_admin_stub.call_rpc :update_backup, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end