google-cloud-bigtable 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87e7128a687d06d1e5dc3e74f2b529ab43b3c9ea28717d738c433ea86fb297ad
4
- data.tar.gz: a04ca13f900445078568a3a1cf64ef84d57686a494f3a652cc6ec461af41712e
3
+ metadata.gz: 4349eaa8149e90524a1966a96fcdb6e1c1faee050c25487e594ee6aa87318681
4
+ data.tar.gz: 0f34a5bee198253cf893e5209dd3230276663a494f94d16734de89e366e2c322
5
5
  SHA512:
6
- metadata.gz: dc329bd4e9f0d1ed5c5376c40da2924a41f83681df93803aafcadd9ed846bdd2119b913661054b95cfc70cbbfada891b58563b3146396acd872ae2fa79cbff2b
7
- data.tar.gz: af466ef435035adae503c5368b0e7c899e84424151044d49efb51f2920e121854ca8af51708c9fce7181e1116410408c635a040442b8b004df45d76b5184c721
6
+ metadata.gz: bf6355506c1a29fe2a2a149a36cce4b1e80c9713f317c76ea707353a7828f1a299cb6fc2daeb7beea537cc7ae792e7ffed9ccacc0dd22fc49eedb03a63ee26a0
7
+ data.tar.gz: bbded4a5e2d126580c68df77aa1171d6d8c9f222237dc5fc9a8fe8dafbb13e9c110b65800ea67018e902e3250ea23b9a2cf3ba29bf64653052be16b4c782b7b7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Release History
2
2
 
3
+ ### 2.6.0 / 2021-05-03
4
+
5
+ #### Features
6
+
7
+ * Add support for Backup restore to different Instance
8
+ * Add instance to Backup#restore
9
+
3
10
  ### 2.5.0 / 2021-04-20
4
11
 
5
12
  #### Features
@@ -349,9 +349,12 @@ module Google
349
349
  end
350
350
 
351
351
  ##
352
- # Creates a new table by restoring from a completed backup.
352
+ # Creates a new table by restoring data from a completed backup. The new table may be created in an instance
353
+ # different than that of the backup.
353
354
  #
354
355
  # @param table_id [String] The table ID for the new table. This table must not yet exist. Required.
356
+ # @param instance [Instance, String] The instance or the ID of the instance for the new table, if different from
357
+ # the instance of the backup. Optional.
355
358
  #
356
359
  # @return [Google::Cloud::Bigtable::Table::RestoreJob] The job representing the long-running, asynchronous
357
360
  # processing of a backup restore table operation.
@@ -377,8 +380,35 @@ module Google
377
380
  # optimized = job.optimize_table_operation_name
378
381
  # end
379
382
  #
380
- def restore table_id
381
- grpc = service.restore_table table_id, instance_id, cluster_id, backup_id
383
+ # @example Create the table in a different instance.
384
+ # require "google/cloud/bigtable"
385
+ #
386
+ # bigtable = Google::Cloud::Bigtable.new
387
+ # instance = bigtable.instance("my-instance")
388
+ # cluster = instance.cluster("my-cluster")
389
+ #
390
+ # backup = cluster.backup("my-backup")
391
+ #
392
+ # table_instance = bigtable.instance("my-other-instance")
393
+ # job = backup.restore("my-new-table", instance: table_instance)
394
+ #
395
+ # job.wait_until_done!
396
+ # job.done? #=> true
397
+ #
398
+ # if job.error?
399
+ # status = job.error
400
+ # else
401
+ # table = job.table
402
+ # optimized = job.optimize_table_operation_name
403
+ # end
404
+ #
405
+ def restore table_id, instance: nil
406
+ table_instance_id = instance.respond_to?(:instance_id) ? instance.instance_id : instance
407
+ grpc = service.restore_table table_id,
408
+ instance_id,
409
+ cluster_id,
410
+ backup_id,
411
+ table_instance_id: table_instance_id
382
412
  Table::RestoreJob.from_grpc grpc, service
383
413
  end
384
414
 
@@ -752,17 +752,20 @@ module Google
752
752
  # Create a new table by restoring from a completed backup.
753
753
  #
754
754
  # @param table_id [String] The table ID for the new table. This table must not yet exist.
755
- # @param instance_id [String] The instance ID for the source backup. The table will be created in this instance.
755
+ # @param instance_id [String] The instance ID for the source backup. The table will be created in this instance
756
+ # if table_instance_id is not provided.
756
757
  # @param cluster_id [String] The cluster ID for the source backup.
757
758
  # @param backup_id [String] The backup ID for the source backup.
759
+ # @param table_instance_id [String] The instance ID for the table, if different from instance_id. Optional.
758
760
  #
759
761
  # @return [Gapic::Operation] The {Google::Longrunning::Operation#metadata metadata} field type is
760
762
  # {Google::Cloud::Bigtable::Admin::RestoreTableMetadata RestoreTableMetadata}. The
761
763
  # {Google::Longrunning::Operation#response response} type is
762
764
  # {Google::Cloud::Bigtable::Admin::V2::Table Table}, if successful.
763
765
  #
764
- def restore_table table_id, instance_id, cluster_id, backup_id
765
- tables.restore_table parent: instance_path(instance_id),
766
+ def restore_table table_id, instance_id, cluster_id, backup_id, table_instance_id: nil
767
+ table_instance_id ||= instance_id
768
+ tables.restore_table parent: instance_path(table_instance_id),
766
769
  table_id: table_id,
767
770
  backup: backup_path(instance_id, cluster_id, backup_id)
768
771
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigtable
19
- VERSION = "2.5.0".freeze
19
+ VERSION = "2.6.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-bigtable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-20 00:00:00.000000000 Z
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-bigtable-admin-v2
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
251
  requirements: []
252
- rubygems_version: 3.2.13
252
+ rubygems_version: 3.2.16
253
253
  signing_key:
254
254
  specification_version: 4
255
255
  summary: API Client library for Cloud Bigtable API