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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/google/cloud/bigtable/backup.rb +33 -3
- data/lib/google/cloud/bigtable/service.rb +6 -3
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4349eaa8149e90524a1966a96fcdb6e1c1faee050c25487e594ee6aa87318681
|
4
|
+
data.tar.gz: 0f34a5bee198253cf893e5209dd3230276663a494f94d16734de89e366e2c322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf6355506c1a29fe2a2a149a36cce4b1e80c9713f317c76ea707353a7828f1a299cb6fc2daeb7beea537cc7ae792e7ffed9ccacc0dd22fc49eedb03a63ee26a0
|
7
|
+
data.tar.gz: bbded4a5e2d126580c68df77aa1171d6d8c9f222237dc5fc9a8fe8dafbb13e9c110b65800ea67018e902e3250ea23b9a2cf3ba29bf64653052be16b4c782b7b7
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
381
|
-
|
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
|
-
|
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
|
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.
|
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-
|
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.
|
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
|