Cloud Bigtable Admin V2 API - Class Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client (v0.17.0)

Reference documentation and code samples for the Cloud Bigtable Admin V2 API 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.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the BigtableTableAdmin Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all BigtableTableAdmin clients
::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.configure do |config|
  config.timeout = 10.0
end

#check_consistency

def check_consistency(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse
def check_consistency(name: nil, consistency_token: nil) -> ::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse

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.

Overloads
def check_consistency(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse
Pass arguments to check_consistency via a request object, either of type CheckConsistencyRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def check_consistency(name: nil, consistency_token: nil) -> ::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse
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).
Parameters
  • 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}.
  • consistency_token (::String) — Required. The token created using GenerateConsistencyToken for the Table.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::CheckConsistencyRequest.new

# Call the check_consistency method.
result = client.check_consistency request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse.
p result

#configure

def configure() { |config| ... } -> Client::Configuration

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 Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#copy_backup

def copy_backup(request, options = nil) -> ::Gapic::Operation
def copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil) -> ::Gapic::Operation

Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the destination instance and project.

Overloads
def copy_backup(request, options = nil) -> ::Gapic::Operation
Pass arguments to copy_backup via a request object, either of type CopyBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigtable::Admin::V2::CopyBackupRequest, ::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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil) -> ::Gapic::Operation
Pass arguments to copy_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).
Parameters
  • parent (::String) — Required. The name of the destination cluster that will contain the backup copy. The cluster must already exists. Values are of the form: projects/{project}/instances/{instance}/clusters/{cluster}.
  • backup_id (::String) — Required. The id of the new backup. The backup_id along with 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]*.
  • source_backup (::String) — Required. The source backup to be copied from. The source backup needs to be in READY state for it to be copied. Copying a copied backup is not allowed. Once CopyBackup is in progress, the source backup cannot be deleted or cleaned up on expiration until CopyBackup is finished. Values are of the form: projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>.
  • expire_time (::Google::Protobuf::Timestamp, ::Hash) — Required. Required. The expiration time of the copied backup with microsecond granularity that must be at least 6 hours and at most 30 days from the time the request is received. Once the expire_time has passed, Cloud Bigtable will delete the backup and free the resources used by the backup.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::CopyBackupRequest.new

# Call the copy_backup method.
result = client.copy_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_backup

def create_backup(request, options = nil) -> ::Gapic::Operation
def create_backup(parent: nil, backup_id: nil, backup: nil) -> ::Gapic::Operation

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

Overloads
def create_backup(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_backup via a request object, either of type CreateBackupRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_backup(parent: nil, backup_id: nil, backup: nil) -> ::Gapic::Operation
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).
Parameters
  • 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}.
  • 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]*.
  • backup (::Google::Cloud::Bigtable::Admin::V2::Backup, ::Hash) — Required. The backup to create.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::CreateBackupRequest.new

# Call the create_backup method.
result = client.create_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_table

def create_table(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
def create_table(parent: nil, table_id: nil, table: nil, initial_splits: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table

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.

Overloads
def create_table(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
Pass arguments to create_table via a request object, either of type CreateTableRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_table(parent: nil, table_id: nil, table: nil, initial_splits: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
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).
Parameters
  • parent (::String) — Required. The unique name of the instance in which to create the table. Values are of the form projects/{project}/instances/{instance}.
  • 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.
  • table (::Google::Cloud::Bigtable::Admin::V2::Table, ::Hash) — Required. The Table to create.
  • 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"}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::CreateTableRequest.new

# Call the create_table method.
result = client.create_table request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table.
p result

#create_table_from_snapshot

def create_table_from_snapshot(request, options = nil) -> ::Gapic::Operation
def create_table_from_snapshot(parent: nil, table_id: nil, source_snapshot: nil) -> ::Gapic::Operation

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.

Overloads
def create_table_from_snapshot(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_table_from_snapshot via a request object, either of type CreateTableFromSnapshotRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_table_from_snapshot(parent: nil, table_id: nil, source_snapshot: nil) -> ::Gapic::Operation
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).
Parameters
  • parent (::String) — Required. The unique name of the instance in which to create the table. Values are of the form projects/{project}/instances/{instance}.
  • 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.
  • 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}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::CreateTableFromSnapshotRequest.new

# Call the create_table_from_snapshot method.
result = client.create_table_from_snapshot request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_backup

def delete_backup(request, options = nil) -> ::Google::Protobuf::Empty
def delete_backup(name: nil) -> ::Google::Protobuf::Empty

Deletes a pending or completed Cloud Bigtable backup.

Overloads
def delete_backup(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_backup via a request object, either of type DeleteBackupRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_backup(name: nil) -> ::Google::Protobuf::Empty
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).
Parameter
  • name (::String) — Required. Name of the backup to delete. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::DeleteBackupRequest.new

# Call the delete_backup method.
result = client.delete_backup request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_snapshot

def delete_snapshot(request, options = nil) -> ::Google::Protobuf::Empty
def delete_snapshot(name: nil) -> ::Google::Protobuf::Empty

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.

Overloads
def delete_snapshot(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_snapshot via a request object, either of type DeleteSnapshotRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_snapshot(name: nil) -> ::Google::Protobuf::Empty
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).
Parameter
  • 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}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::DeleteSnapshotRequest.new

# Call the delete_snapshot method.
result = client.delete_snapshot request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_table

def delete_table(request, options = nil) -> ::Google::Protobuf::Empty
def delete_table(name: nil) -> ::Google::Protobuf::Empty

Permanently deletes a specified table and all of its data.

Overloads
def delete_table(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_table via a request object, either of type DeleteTableRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_table(name: nil) -> ::Google::Protobuf::Empty
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).
Parameter
  • name (::String) — Required. The unique name of the table to be deleted. Values are of the form projects/{project}/instances/{instance}/tables/{table}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::DeleteTableRequest.new

# Call the delete_table method.
result = client.delete_table request

# The returned object is of type Google::Protobuf::Empty.
p result

#drop_row_range

def drop_row_range(request, options = nil) -> ::Google::Protobuf::Empty
def drop_row_range(name: nil, row_key_prefix: nil, delete_all_data_from_table: nil) -> ::Google::Protobuf::Empty

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.

Overloads
def drop_row_range(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to drop_row_range via a request object, either of type DropRowRangeRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def drop_row_range(name: nil, row_key_prefix: nil, delete_all_data_from_table: nil) -> ::Google::Protobuf::Empty
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).
Parameters
  • 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}.
  • row_key_prefix (::String) — Delete all rows that start with this row key prefix. Prefix cannot be zero length.
  • delete_all_data_from_table (::Boolean) — Delete all rows in the table. Setting this to false is a no-op.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::DropRowRangeRequest.new

# Call the drop_row_range method.
result = client.drop_row_range request

# The returned object is of type Google::Protobuf::Empty.
p result

#generate_consistency_token

def generate_consistency_token(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse
def generate_consistency_token(name: nil) -> ::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse

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.

Overloads
def generate_consistency_token(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse
Pass arguments to generate_consistency_token via a request object, either of type GenerateConsistencyTokenRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def generate_consistency_token(name: nil) -> ::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse
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).
Parameter
  • 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}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenRequest.new

# Call the generate_consistency_token method.
result = client.generate_consistency_token request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse.
p result

#get_backup

def get_backup(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Backup
def get_backup(name: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Backup

Gets metadata on a pending or completed Cloud Bigtable Backup.

Overloads
def get_backup(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Backup
Pass arguments to get_backup via a request object, either of type GetBackupRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_backup(name: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Backup
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).
Parameter
  • name (::String) — Required. Name of the backup. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::GetBackupRequest.new

# Call the get_backup method.
result = client.get_backup request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Backup.
p result

#get_iam_policy

def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy

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.

Overloads
def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
Pass arguments to get_iam_policy via a request object, either of type Iam::V1::GetIamPolicyRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy
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).
Parameters
  • resource (::String) — REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
  • options (::Google::Iam::V1::GetPolicyOptions, ::Hash) — OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

#get_snapshot

def get_snapshot(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Snapshot
def get_snapshot(name: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Snapshot

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.

Overloads
def get_snapshot(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Snapshot
Pass arguments to get_snapshot via a request object, either of type GetSnapshotRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_snapshot(name: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Snapshot
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).
Parameter
  • name (::String) — Required. The unique name of the requested snapshot. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::GetSnapshotRequest.new

# Call the get_snapshot method.
result = client.get_snapshot request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Snapshot.
p result

#get_table

def get_table(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
def get_table(name: nil, view: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table

Gets metadata information about the specified table.

Overloads
def get_table(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
Pass arguments to get_table via a request object, either of type GetTableRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_table(name: nil, view: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
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).
Parameters
  • name (::String) — Required. The unique name of the requested table. Values are of the form projects/{project}/instances/{instance}/tables/{table}.
  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::GetTableRequest.new

# Call the get_table method.
result = client.get_table request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new BigtableTableAdmin client object.

Yields
  • (config) — Configure the BigtableTableAdmin client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
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

#list_backups

def list_backups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Backup>
def list_backups(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Backup>

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

Overloads
def list_backups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Backup>
Pass arguments to list_backups via a request object, either of type ListBackupsRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_backups(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Backup>
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).
Parameters
  • 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/-.
  • 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
  • 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 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.

  • 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.
  • page_token (::String) — If non-empty, page_token should contain a next_page_token from a previous ListBackupsResponse to the same parent and with the same filter.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::ListBackupsRequest.new

# Call the list_backups method.
result = client.list_backups request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Backup.
  p item
end

#list_snapshots

def list_snapshots(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Snapshot>
def list_snapshots(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Snapshot>

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.

Overloads
def list_snapshots(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Snapshot>
Pass arguments to list_snapshots via a request object, either of type ListSnapshotsRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_snapshots(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Snapshot>
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).
Parameters
  • 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/-.
  • page_size (::Integer) — The maximum number of snapshots to return per page. CURRENTLY UNIMPLEMENTED AND IGNORED.
  • page_token (::String) — The value of next_page_token returned by a previous call.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::ListSnapshotsRequest.new

# Call the list_snapshots method.
result = client.list_snapshots request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Snapshot.
  p item
end

#list_tables

def list_tables(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Table>
def list_tables(parent: nil, view: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Table>

Lists all tables served from a specified instance.

Overloads
def list_tables(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Table>
Pass arguments to list_tables via a request object, either of type ListTablesRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_tables(parent: nil, view: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Table>
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).
Parameters
  • parent (::String) — Required. The unique name of the instance for which tables should be listed. Values are of the form projects/{project}/instances/{instance}.
  • view (::Google::Cloud::Bigtable::Admin::V2::Table::View) — The view to be applied to the returned tables' fields. NAME_ONLY view (default) and REPLICATION_VIEW are supported.
  • 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.

  • page_token (::String) — The value of next_page_token returned by a previous call.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::ListTablesRequest.new

# Call the list_tables method.
result = client.list_tables request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Table.
  p item
end

#modify_column_families

def modify_column_families(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
def modify_column_families(name: nil, modifications: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table

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.

Overloads
def modify_column_families(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
Pass arguments to modify_column_families via a request object, either of type ModifyColumnFamiliesRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def modify_column_families(name: nil, modifications: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Table
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).
Parameters
  • 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}.
  • 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).
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest.new

# Call the modify_column_families method.
result = client.modify_column_families request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table.
p result

#operations_client

def operations_client() -> ::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Operations

Get the associated client for long-running operations.

#restore_table

def restore_table(request, options = nil) -> ::Gapic::Operation
def restore_table(parent: nil, table_id: nil, backup: nil) -> ::Gapic::Operation

Create a new table by restoring from a completed backup. The returned table long-running operation can be used to track the progress of the operation, and to cancel it. The metadata field type is [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The response type is Table, if successful.

Overloads
def restore_table(request, options = nil) -> ::Gapic::Operation
Pass arguments to restore_table via a request object, either of type RestoreTableRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def restore_table(parent: nil, table_id: nil, backup: nil) -> ::Gapic::Operation
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).
Parameters
  • parent (::String) — Required. The name of the instance in which to create the restored table. Values are of the form projects/<project>/instances/<instance>.
  • 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>.
  • backup (::String) — Name of the backup from which to restore. Values are of the form projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::RestoreTableRequest.new

# Call the restore_table method.
result = client.restore_table request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#set_iam_policy

def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy

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

Overloads
def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
Pass arguments to set_iam_policy via a request object, either of type Iam::V1::SetIamPolicyRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy
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).
Parameters
  • resource (::String) — REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
  • 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.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:

    paths: "bindings, etag"

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

#snapshot_table

def snapshot_table(request, options = nil) -> ::Gapic::Operation
def snapshot_table(name: nil, cluster: nil, snapshot_id: nil, ttl: nil, description: nil) -> ::Gapic::Operation

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.

Overloads
def snapshot_table(request, options = nil) -> ::Gapic::Operation
Pass arguments to snapshot_table via a request object, either of type SnapshotTableRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def snapshot_table(name: nil, cluster: nil, snapshot_id: nil, ttl: nil, description: nil) -> ::Gapic::Operation
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).
Parameters
  • 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}.
  • 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}.
  • 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.
  • 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.
  • description (::String) — Description of the snapshot.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::SnapshotTableRequest.new

# Call the snapshot_table method.
result = client.snapshot_table request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#test_iam_permissions

def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse

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

Overloads
def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
Pass arguments to test_iam_permissions via a request object, either of type Iam::V1::TestIamPermissionsRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
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).
Parameters
  • resource (::String) — REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result

#undelete_table

def undelete_table(request, options = nil) -> ::Gapic::Operation
def undelete_table(name: nil) -> ::Gapic::Operation

Restores a specified table which was accidentally deleted.

Overloads
def undelete_table(request, options = nil) -> ::Gapic::Operation
Pass arguments to undelete_table via a request object, either of type UndeleteTableRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigtable::Admin::V2::UndeleteTableRequest, ::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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def undelete_table(name: nil) -> ::Gapic::Operation
Pass arguments to undelete_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).
Parameter
  • name (::String) — Required. The unique name of the table to be restored. Values are of the form projects/{project}/instances/{instance}/tables/{table}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::UndeleteTableRequest.new

# Call the undelete_table method.
result = client.undelete_table request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#update_backup

def update_backup(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Backup
def update_backup(backup: nil, update_mask: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Backup

Updates a pending or completed Cloud Bigtable Backup.

Overloads
def update_backup(request, options = nil) -> ::Google::Cloud::Bigtable::Admin::V2::Backup
Pass arguments to update_backup via a request object, either of type UpdateBackupRequest or an equivalent Hash.
Parameters
  • 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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_backup(backup: nil, update_mask: nil) -> ::Google::Cloud::Bigtable::Admin::V2::Backup
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).
Parameters
  • 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.
  • 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::UpdateBackupRequest.new

# Call the update_backup method.
result = client.update_backup request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Backup.
p result

#update_table

def update_table(request, options = nil) -> ::Gapic::Operation
def update_table(table: nil, update_mask: nil) -> ::Gapic::Operation

Updates a specified table.

Overloads
def update_table(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_table via a request object, either of type UpdateTableRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigtable::Admin::V2::UpdateTableRequest, ::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.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_table(table: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_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).
Parameters
  • table (::Google::Cloud::Bigtable::Admin::V2::Table, ::Hash) — Required. The table to update. The table's name field is used to identify the table to update.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The list of fields to update. A mask specifying which fields (e.g. change_stream_config) in the table field should be updated. This mask is relative to the table field, not to the request message. The wildcard (*) path is currently not supported. Currently UpdateTable is only supported for the following fields:

    • change_stream_config
    • change_stream_config.retention_period
    • deletion_protection

    If column_families is set in update_mask, it will return an UNIMPLEMENTED error.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::UpdateTableRequest.new

# Call the update_table method.
result = client.update_table request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end