Class: Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient
- Inherits:
-
Object
- Object
- Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient
- Defined in:
- lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb
Overview
Service for creating, configuring, and deleting Cloud Bigtable tables.
Provides access to the table schemas only, not the data stored within the tables.
Constant Summary collapse
- SERVICE_ADDRESS =
The default address of the service.
"bigtableadmin.googleapis.com".freeze
- DEFAULT_SERVICE_PORT =
The default port of the service.
443
- GRPC_INTERCEPTORS =
The default set of gRPC interceptors.
[]
- DEFAULT_TIMEOUT =
30
- ALL_SCOPES =
The scopes needed to make gRPC calls to all of the methods defined in this service.
[ "https://www.googleapis.com/auth/bigtable.admin", "https://www.googleapis.com/auth/bigtable.admin.cluster", "https://www.googleapis.com/auth/bigtable.admin.instance", "https://www.googleapis.com/auth/bigtable.admin.table", "https://www.googleapis.com/auth/cloud-bigtable.admin", "https://www.googleapis.com/auth/cloud-bigtable.admin.cluster", "https://www.googleapis.com/auth/cloud-bigtable.admin.table", "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/cloud-platform.read-only" ].freeze
Class Method Summary collapse
-
.backup_path(project, instance, cluster, backup) ⇒ String
Returns a fully-qualified backup resource name string.
-
.cluster_path(project, instance, cluster) ⇒ String
Returns a fully-qualified cluster resource name string.
-
.instance_path(project, instance) ⇒ String
Returns a fully-qualified instance resource name string.
-
.snapshot_path(project, instance, cluster, snapshot) ⇒ String
Returns a fully-qualified snapshot resource name string.
-
.table_path(project, instance, table) ⇒ String
Returns a fully-qualified table resource name string.
Instance Method Summary collapse
-
#check_consistency(name, consistency_token, options: nil) {|result, operation| ... } ⇒ Google::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.
-
#create_backup(parent, backup_id, backup, options: nil) ⇒ Google::Gax::Operation
Starts creating a new Cloud Bigtable Backup.
-
#create_table(parent, table_id, table, initial_splits: nil, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Table
Creates a new table in the specified instance.
-
#create_table_from_snapshot(parent, table_id, source_snapshot, options: nil) ⇒ Google::Gax::Operation
Creates a new table from the specified snapshot.
-
#delete_backup(name, options: nil) {|result, operation| ... } ⇒ Object
Deletes a pending or completed Cloud Bigtable backup.
-
#delete_snapshot(name, options: nil) {|result, operation| ... } ⇒ Object
Permanently deletes the specified snapshot.
-
#delete_table(name, options: nil) {|result, operation| ... } ⇒ Object
Permanently deletes a specified table and all of its data.
-
#drop_row_range(name, row_key_prefix: nil, delete_all_data_from_table: nil, options: nil) {|result, operation| ... } ⇒ Object
Permanently drop/delete a row range from a specified table.
-
#generate_consistency_token(name, options: nil) {|result, operation| ... } ⇒ Google::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.
-
#get_backup(name, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Backup
Gets metadata on a pending or completed Cloud Bigtable Backup.
-
#get_iam_policy(resource, options_: nil, options: nil) {|result, operation| ... } ⇒ Google::Iam::V1::Policy
Gets the access control policy for a resource.
-
#get_snapshot(name, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Snapshot
Gets metadata information about the specified snapshot.
-
#get_table(name, view: nil, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Table
Gets metadata information about the specified table.
-
#initialize(credentials: nil, scopes: ALL_SCOPES, client_config: {}, timeout: DEFAULT_TIMEOUT, metadata: nil, service_address: nil, service_port: nil, exception_transformer: nil, lib_name: nil, lib_version: "") ⇒ BigtableTableAdminClient
constructor
A new instance of BigtableTableAdminClient.
-
#list_backups(parent, filter: nil, order_by: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Backup>
Lists Cloud Bigtable backups.
-
#list_snapshots(parent, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Snapshot>
Lists all snapshots associated with the specified cluster.
-
#list_tables(parent, view: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Table>
Lists all tables served from a specified instance.
-
#modify_column_families(name, modifications, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Table
Performs a series of column family modifications on the specified table.
-
#restore_table(parent, table_id: nil, backup: nil, options: nil) ⇒ Google::Gax::Operation
Create a new table by restoring from a completed backup.
-
#set_iam_policy(resource, policy, options: nil) {|result, operation| ... } ⇒ Google::Iam::V1::Policy
Sets the access control policy on a Table or Backup resource.
-
#snapshot_table(name, cluster, snapshot_id, description, ttl: nil, options: nil) ⇒ Google::Gax::Operation
Creates a new snapshot in the specified cluster from the specified source table.
-
#test_iam_permissions(resource, permissions, options: nil) {|result, operation| ... } ⇒ Google::Iam::V1::TestIamPermissionsResponse
Returns permissions that the caller has on the specified table resource.
-
#update_backup(backup, update_mask, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Backup
Updates a pending or completed Cloud Bigtable Backup.
Constructor Details
#initialize(credentials: nil, scopes: ALL_SCOPES, client_config: {}, timeout: DEFAULT_TIMEOUT, metadata: nil, service_address: nil, service_port: nil, exception_transformer: nil, lib_name: nil, lib_version: "") ⇒ BigtableTableAdminClient
Returns a new instance of BigtableTableAdminClient.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 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 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 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 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 229 def initialize \ credentials: nil, scopes: ALL_SCOPES, client_config: {}, timeout: DEFAULT_TIMEOUT, metadata: nil, service_address: nil, service_port: nil, exception_transformer: nil, lib_name: nil, lib_version: "" # 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 "google/gax/grpc" require "google/bigtable/admin/v2/bigtable_table_admin_services_pb" credentials ||= Google::Cloud::Bigtable::Admin::V2::Credentials.default @operations_client = OperationsClient.new( credentials: credentials, scopes: scopes, client_config: client_config, timeout: timeout, lib_name: lib_name, service_address: service_address, service_port: service_port, lib_version: lib_version, metadata: , ) if credentials.is_a?(String) || credentials.is_a?(Hash) updater_proc = Google::Cloud::Bigtable::Admin::V2::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials end if credentials.is_a?(GRPC::Core::ChannelCredentials) chan_creds = credentials end if credentials.is_a?(Proc) updater_proc = credentials end if credentials.is_a?(Google::Auth::Credentials) updater_proc = credentials.updater_proc end package_version = Google::Cloud::Bigtable::VERSION google_api_client = "gl-ruby/#{RUBY_VERSION}" google_api_client << " #{lib_name}/#{lib_version}" if lib_name google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}" google_api_client << " grpc/#{GRPC::VERSION}" google_api_client.freeze headers = { :"x-goog-api-client" => google_api_client } if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id headers[:"x-goog-user-project"] = credentials.quota_project_id end headers.merge!() unless .nil? client_config_file = Pathname.new(__dir__).join( "bigtable_table_admin_client_config.json" ) defaults = client_config_file.open do |f| Google::Gax.construct_settings( "google.bigtable.admin.v2.BigtableTableAdmin", JSON.parse(f.read), client_config, Google::Gax::Grpc::STATUS_CODE_NAMES, timeout, page_descriptors: PAGE_DESCRIPTORS, errors: Google::Gax::Grpc::API_ERRORS, metadata: headers ) end # Allow overriding the service path/port in subclasses. service_path = service_address || self.class::SERVICE_ADDRESS port = service_port || self.class::DEFAULT_SERVICE_PORT interceptors = self.class::GRPC_INTERCEPTORS @bigtable_table_admin_stub = Google::Gax::Grpc.create_stub( service_path, port, chan_creds: chan_creds, channel: channel, updater_proc: updater_proc, scopes: scopes, interceptors: interceptors, &Google::Bigtable::Admin::V2::BigtableTableAdmin::Stub.method(:new) ) @create_table = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:create_table), defaults["create_table"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @create_table_from_snapshot = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:create_table_from_snapshot), defaults["create_table_from_snapshot"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @list_tables = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:list_tables), defaults["list_tables"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @get_table = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:get_table), defaults["get_table"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @delete_table = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:delete_table), defaults["delete_table"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @modify_column_families = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:modify_column_families), defaults["modify_column_families"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @drop_row_range = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:drop_row_range), defaults["drop_row_range"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @generate_consistency_token = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:generate_consistency_token), defaults["generate_consistency_token"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @check_consistency = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:check_consistency), defaults["check_consistency"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @get_iam_policy = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:get_iam_policy), defaults["get_iam_policy"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'resource' => request.resource} end ) @set_iam_policy = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:set_iam_policy), defaults["set_iam_policy"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'resource' => request.resource} end ) @test_iam_permissions = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:test_iam_permissions), defaults["test_iam_permissions"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'resource' => request.resource} end ) @snapshot_table = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:snapshot_table), defaults["snapshot_table"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @get_snapshot = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:get_snapshot), defaults["get_snapshot"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @list_snapshots = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:list_snapshots), defaults["list_snapshots"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @delete_snapshot = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:delete_snapshot), defaults["delete_snapshot"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @create_backup = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:create_backup), defaults["create_backup"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @get_backup = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:get_backup), defaults["get_backup"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @list_backups = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:list_backups), defaults["list_backups"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @update_backup = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:update_backup), defaults["update_backup"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'backup.name' => request.backup.name} end ) @delete_backup = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:delete_backup), defaults["delete_backup"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @restore_table = Google::Gax.create_api_call( @bigtable_table_admin_stub.method(:restore_table), defaults["restore_table"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) end |
Class Method Details
.backup_path(project, instance, cluster, backup) ⇒ String
Returns a fully-qualified backup resource name string.
135 136 137 138 139 140 141 142 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 135 def self.backup_path project, instance, cluster, backup BACKUP_PATH_TEMPLATE.render( :"project" => project, :"instance" => instance, :"cluster" => cluster, :"backup" => backup ) end |
.cluster_path(project, instance, cluster) ⇒ String
Returns a fully-qualified cluster resource name string.
149 150 151 152 153 154 155 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 149 def self.cluster_path project, instance, cluster CLUSTER_PATH_TEMPLATE.render( :"project" => project, :"instance" => instance, :"cluster" => cluster ) end |
.instance_path(project, instance) ⇒ String
Returns a fully-qualified instance resource name string.
161 162 163 164 165 166 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 161 def self.instance_path project, instance INSTANCE_PATH_TEMPLATE.render( :"project" => project, :"instance" => instance ) end |
.snapshot_path(project, instance, cluster, snapshot) ⇒ String
Returns a fully-qualified snapshot resource name string.
174 175 176 177 178 179 180 181 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 174 def self.snapshot_path project, instance, cluster, snapshot SNAPSHOT_PATH_TEMPLATE.render( :"project" => project, :"instance" => instance, :"cluster" => cluster, :"snapshot" => snapshot ) end |
.table_path(project, instance, table) ⇒ String
Returns a fully-qualified table resource name string.
188 189 190 191 192 193 194 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 188 def self.table_path project, instance, table TABLE_PATH_TEMPLATE.render( :"project" => project, :"instance" => instance, :"table" => table ) end |
Instance Method Details
#check_consistency(name, consistency_token, options: nil) {|result, operation| ... } ⇒ Google::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.
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 944 def check_consistency \ name, consistency_token, options: nil, &block req = { name: name, consistency_token: consistency_token }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::CheckConsistencyRequest) @check_consistency.call(req, , &block) end |
#create_backup(parent, backup_id, backup, options: nil) ⇒ Google::Gax::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.
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1394 def create_backup \ parent, backup_id, backup, options: nil req = { parent: parent, backup_id: backup_id, backup: backup }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::CreateBackupRequest) operation = Google::Gax::Operation.new( @create_backup.call(req, ), @operations_client, Google::Bigtable::Admin::V2::Backup, Google::Bigtable::Admin::V2::CreateBackupMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#create_table(parent, table_id, table, initial_splits: nil, options: nil) {|result, operation| ... } ⇒ Google::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.
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 555 def create_table \ parent, table_id, table, initial_splits: nil, options: nil, &block req = { parent: parent, table_id: table_id, table: table, initial_splits: initial_splits }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::CreateTableRequest) @create_table.call(req, , &block) end |
#create_table_from_snapshot(parent, table_id, source_snapshot, options: nil) ⇒ Google::Gax::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.
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 636 def create_table_from_snapshot \ parent, table_id, source_snapshot, options: nil req = { parent: parent, table_id: table_id, source_snapshot: source_snapshot }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::CreateTableFromSnapshotRequest) operation = Google::Gax::Operation.new( @create_table_from_snapshot.call(req, ), @operations_client, Google::Bigtable::Admin::V2::Table, Google::Bigtable::Admin::V2::CreateTableFromSnapshotMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#delete_backup(name, options: nil) {|result, operation| ... } ⇒ Object
Deletes a pending or completed Cloud Bigtable backup.
1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1635 def delete_backup \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::DeleteBackupRequest) @delete_backup.call(req, , &block) nil end |
#delete_snapshot(name, options: nil) {|result, operation| ... } ⇒ Object
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.
1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1314 def delete_snapshot \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::DeleteSnapshotRequest) @delete_snapshot.call(req, , &block) nil end |
#delete_table(name, options: nil) {|result, operation| ... } ⇒ Object
Permanently deletes a specified table and all of its data.
779 780 781 782 783 784 785 786 787 788 789 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 779 def delete_table \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::DeleteTableRequest) @delete_table.call(req, , &block) nil end |
#drop_row_range(name, row_key_prefix: nil, delete_all_data_from_table: nil, options: nil) {|result, operation| ... } ⇒ Object
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.
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 865 def drop_row_range \ name, row_key_prefix: nil, delete_all_data_from_table: nil, options: nil, &block req = { name: name, row_key_prefix: row_key_prefix, delete_all_data_from_table: delete_all_data_from_table }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::DropRowRangeRequest) @drop_row_range.call(req, , &block) nil end |
#generate_consistency_token(name, options: nil) {|result, operation| ... } ⇒ Google::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.
905 906 907 908 909 910 911 912 913 914 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 905 def generate_consistency_token \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::GenerateConsistencyTokenRequest) @generate_consistency_token.call(req, , &block) end |
#get_backup(name, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Backup
Gets metadata on a pending or completed Cloud Bigtable Backup.
1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1437 def get_backup \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::GetBackupRequest) @get_backup.call(req, , &block) end |
#get_iam_policy(resource, options_: nil, options: nil) {|result, operation| ... } ⇒ Google::Iam::V1::Policy
Gets the access control policy for a resource. Returns an empty policy if the resource exists but does not have a policy set.
984 985 986 987 988 989 990 991 992 993 994 995 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 984 def get_iam_policy \ resource, options_: nil, options: nil, &block req = { resource: resource, options: }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Iam::V1::GetIamPolicyRequest) @get_iam_policy.call(req, , &block) end |
#get_snapshot(name, options: nil) {|result, operation| ... } ⇒ Google::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.
1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1213 def get_snapshot \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::GetSnapshotRequest) @get_snapshot.call(req, , &block) end |
#get_table(name, view: nil, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Table
Gets metadata information about the specified table.
746 747 748 749 750 751 752 753 754 755 756 757 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 746 def get_table \ name, view: nil, options: nil, &block req = { name: name, view: view }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::GetTableRequest) @get_table.call(req, , &block) end |
#list_backups(parent, filter: nil, order_by: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Backup>
Lists Cloud Bigtable backups. Returns both completed and pending backups.
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1548 def list_backups \ parent, filter: nil, order_by: nil, page_size: nil, options: nil, &block req = { parent: parent, filter: filter, order_by: order_by, page_size: page_size }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::ListBackupsRequest) @list_backups.call(req, , &block) end |
#list_snapshots(parent, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::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.
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1275 def list_snapshots \ parent, page_size: nil, options: nil, &block req = { parent: parent, page_size: page_size }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::ListSnapshotsRequest) @list_snapshots.call(req, , &block) end |
#list_tables(parent, view: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Table>
Lists all tables served from a specified instance.
707 708 709 710 711 712 713 714 715 716 717 718 719 720 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 707 def list_tables \ parent, view: nil, page_size: nil, options: nil, &block req = { parent: parent, view: view, page_size: page_size }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::ListTablesRequest) @list_tables.call(req, , &block) end |
#modify_column_families(name, modifications, options: nil) {|result, operation| ... } ⇒ Google::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.
825 826 827 828 829 830 831 832 833 834 835 836 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 825 def modify_column_families \ name, modifications, options: nil, &block req = { name: name, modifications: modifications }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest) @modify_column_families.call(req, , &block) end |
#restore_table(parent, table_id: nil, backup: nil, options: nil) ⇒ Google::Gax::Operation
Create a new table by restoring from a completed backup. The new table must be in the same instance as the instance containing the 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. The response type is Table, if successful.
1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1708 def restore_table \ parent, table_id: nil, backup: nil, options: nil req = { parent: parent, table_id: table_id, backup: backup }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::RestoreTableRequest) operation = Google::Gax::Operation.new( @restore_table.call(req, ), @operations_client, Google::Bigtable::Admin::V2::Table, Google::Bigtable::Admin::V2::RestoreTableMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#set_iam_policy(resource, policy, options: nil) {|result, operation| ... } ⇒ Google::Iam::V1::Policy
Sets the access control policy on a Table or Backup resource. Replaces any existing policy.
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1028 def set_iam_policy \ resource, policy, options: nil, &block req = { resource: resource, policy: policy }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Iam::V1::SetIamPolicyRequest) @set_iam_policy.call(req, , &block) end |
#snapshot_table(name, cluster, snapshot_id, description, ttl: nil, options: nil) ⇒ Google::Gax::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.
1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1160 def snapshot_table \ name, cluster, snapshot_id, description, ttl: nil, options: nil req = { name: name, cluster: cluster, snapshot_id: snapshot_id, description: description, ttl: ttl }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::SnapshotTableRequest) operation = Google::Gax::Operation.new( @snapshot_table.call(req, ), @operations_client, Google::Bigtable::Admin::V2::Snapshot, Google::Bigtable::Admin::V2::SnapshotTableMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#test_iam_permissions(resource, permissions, options: nil) {|result, operation| ... } ⇒ Google::Iam::V1::TestIamPermissionsResponse
Returns permissions that the caller has on the specified table resource.
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1069 def \ resource, , options: nil, &block req = { resource: resource, permissions: }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Iam::V1::TestIamPermissionsRequest) @test_iam_permissions.call(req, , &block) end |
#update_backup(backup, update_mask, options: nil) {|result, operation| ... } ⇒ Google::Bigtable::Admin::V2::Backup
Updates a pending or completed Cloud Bigtable Backup.
1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 |
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb', line 1602 def update_backup \ backup, update_mask, options: nil, &block req = { backup: backup, update_mask: update_mask }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::UpdateBackupRequest) @update_backup.call(req, , &block) end |