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

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb

Overview

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.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#backup_path, #cluster_path, #crypto_key_version_path, #instance_path, #snapshot_path, #table_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new BigtableTableAdmin client object.

Examples:


# 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

Yields:

  • (config)

    Configure the BigtableTableAdmin client.

Yield Parameters:



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 196

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.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_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.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

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

Instance Attribute Details

#operations_client::Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Operations (readonly)

Get the associated client for long-running operations.



248
249
250
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 248

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the BigtableTableAdmin Client class.

See Configuration for a description of the configuration fields.

Examples:


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

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 64

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

Instance Method Details

#check_consistency(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The token created using GenerateConsistencyToken for the Table.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1288

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
   = @config.rpcs.check_consistency..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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| ... } ⇒ 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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



166
167
168
169
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 166

def configure
  yield @config if block_given?
  @config
end

#copy_backup(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 2461

def copy_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

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

  # 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
   = @config.rpcs.copy_backup..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

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

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

  @bigtable_table_admin_stub.call_rpc :copy_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_backup(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1807

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
   = @config.rpcs.create_backup..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Table #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The Table to create.

    • initial_splits (::Array<::Google::Cloud::Bigtable::Admin::V2::CreateTableRequest::Split, ::Hash>) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 322

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
   = @config.rpcs.create_table..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Gapic::Operation #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 430

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
   = @config.rpcs.create_table_from_snapshot..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Protobuf::Empty #delete_backup(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a pending or completed Cloud Bigtable backup.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 2077

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
   = @config.rpcs.delete_backup..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Protobuf::Empty #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1697

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
   = @config.rpcs.delete_snapshot..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Protobuf::Empty #delete_table(name: nil) ⇒ ::Google::Protobuf::Empty

Permanently deletes a specified table and all of its data.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 821

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
   = @config.rpcs.delete_table..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Protobuf::Empty #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Delete all rows that start with this row key prefix. Prefix cannot be zero length.

    • delete_all_data_from_table (::Boolean) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1107

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
   = @config.rpcs.drop_row_range..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1197

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
   = @config.rpcs.generate_consistency_token..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Backup #get_backup(name: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Backup

Gets metadata on a pending or completed Cloud Bigtable Backup.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1895

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
   = @config.rpcs.get_backup..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Iam::V1::Policy #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 2553

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
   = @config.rpcs.get_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Snapshot #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1499

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
   = @config.rpcs.get_snapshot..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Table #get_table(name: nil, view: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Table

Gets metadata information about the specified table.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 627

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
   = @config.rpcs.get_table..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Backup> #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 2236

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
   = @config.rpcs.list_backups..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Snapshot> #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The maximum number of snapshots to return per page. CURRENTLY UNIMPLEMENTED AND IGNORED.

    • page_token (::String) (defaults to: nil)

      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.



1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1603

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
   = @config.rpcs.list_snapshots..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::Table> #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The view to be applied to the returned tables' fields. NAME_ONLY view (default) and REPLICATION_VIEW are supported.

    • page_size (::Integer) (defaults to: nil)

      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) (defaults to: nil)

      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.



536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 536

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
   = @config.rpcs.list_tables..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Table #modify_column_families(name: nil, modifications: nil, ignore_warnings: 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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #modify_column_families(name: nil, modifications: nil, ignore_warnings: 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) (defaults to: nil)

      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>) (defaults to: nil)

      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).

    • ignore_warnings (::Boolean) (defaults to: nil)

      Optional. If true, ignore safety checks when modifying the column families.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1013

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
   = @config.rpcs.modify_column_families..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Gapic::Operation #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 2344

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
   = @config.rpcs.restore_table..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Iam::V1::Policy #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 2651

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
   = @config.rpcs.set_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Gapic::Operation #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1405

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
   = @config.rpcs.snapshot_table..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

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

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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>) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 2743

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
   = @config.rpcs.test_iam_permissions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#undelete_table(request, options = nil) ⇒ ::Gapic::Operation #undelete_table(name: nil) ⇒ ::Gapic::Operation

Restores a specified table which was accidentally deleted.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      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.



915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 915

def undelete_table request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

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

  # 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
   = @config.rpcs.undelete_table..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

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

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

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

  @bigtable_table_admin_stub.call_rpc :undelete_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

#universe_domainString

The effective universe domain

Returns:

  • (String)


176
177
178
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 176

def universe_domain
  @bigtable_table_admin_stub.universe_domain
end

#update_backup(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Backup #update_backup(backup: nil, update_mask: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Backup

Updates a pending or completed Cloud Bigtable Backup.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 1990

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
   = @config.rpcs.update_backup..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.backup&.name
    header_params["backup.name"] = request.backup.name
  end

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#update_table(request, options = nil) ⇒ ::Gapic::Operation #update_table(table: nil, update_mask: nil) ⇒ ::Gapic::Operation

Updates a specified table.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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) (defaults to: nil)

      Required. The table to update. The table's name field is used to identify the table to update.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.



733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb', line 733

def update_table request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

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

  # 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
   = @config.rpcs.update_table..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.table&.name
    header_params["table.name"] = request.table.name
  end

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

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

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

  @bigtable_table_admin_stub.call_rpc :update_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