google-cloud-bigtable 2.6.0 → 2.10.1
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/AUTHENTICATION.md +10 -27
- data/CHANGELOG.md +72 -0
- data/CONTRIBUTING.md +328 -115
- data/EMULATOR.md +1 -1
- data/LOGGING.md +1 -1
- data/OVERVIEW.md +1 -1
- data/lib/google/cloud/bigtable/app_profile/job.rb +4 -4
- data/lib/google/cloud/bigtable/app_profile/list.rb +5 -7
- data/lib/google/cloud/bigtable/app_profile.rb +20 -21
- data/lib/google/cloud/bigtable/backup/job.rb +8 -8
- data/lib/google/cloud/bigtable/backup/list.rb +9 -11
- data/lib/google/cloud/bigtable/backup.rb +103 -36
- data/lib/google/cloud/bigtable/chunk_processor.rb +5 -5
- data/lib/google/cloud/bigtable/cluster/job.rb +2 -2
- data/lib/google/cloud/bigtable/cluster.rb +15 -15
- data/lib/google/cloud/bigtable/column_family.rb +2 -2
- data/lib/google/cloud/bigtable/column_family_map.rb +18 -21
- data/lib/google/cloud/bigtable/column_range.rb +7 -7
- data/lib/google/cloud/bigtable/convert.rb +34 -0
- data/lib/google/cloud/bigtable/encryption_info.rb +4 -4
- data/lib/google/cloud/bigtable/gc_rule.rb +20 -20
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +7 -7
- data/lib/google/cloud/bigtable/instance/job.rb +4 -4
- data/lib/google/cloud/bigtable/instance.rb +49 -52
- data/lib/google/cloud/bigtable/mutation_entry.rb +21 -21
- data/lib/google/cloud/bigtable/mutation_operations.rb +34 -34
- data/lib/google/cloud/bigtable/policy.rb +4 -4
- data/lib/google/cloud/bigtable/project.rb +84 -26
- data/lib/google/cloud/bigtable/read_operations.rb +40 -33
- data/lib/google/cloud/bigtable/routing_policy.rb +6 -6
- data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +30 -29
- data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +6 -6
- data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +27 -26
- data/lib/google/cloud/bigtable/row_filter.rb +28 -28
- data/lib/google/cloud/bigtable/row_range.rb +18 -18
- data/lib/google/cloud/bigtable/rows_reader.rb +77 -32
- data/lib/google/cloud/bigtable/sample_row_key.rb +1 -1
- data/lib/google/cloud/bigtable/service.rb +69 -29
- data/lib/google/cloud/bigtable/status.rb +2 -2
- data/lib/google/cloud/bigtable/table/cluster_state.rb +1 -1
- data/lib/google/cloud/bigtable/table/list.rb +2 -2
- data/lib/google/cloud/bigtable/table/restore_job.rb +12 -12
- data/lib/google/cloud/bigtable/table.rb +42 -40
- data/lib/google/cloud/bigtable/value_range.rb +18 -18
- data/lib/google/cloud/bigtable/version.rb +1 -1
- data/lib/google/cloud/bigtable.rb +28 -7
- data/lib/google-cloud-bigtable.rb +6 -2
- metadata +15 -113
|
@@ -33,9 +33,9 @@ module Google
|
|
|
33
33
|
#
|
|
34
34
|
# bigtable = Google::Cloud::Bigtable.new
|
|
35
35
|
#
|
|
36
|
-
# instance = bigtable.instance
|
|
36
|
+
# instance = bigtable.instance "my-instance"
|
|
37
37
|
#
|
|
38
|
-
# app_profile = instance.app_profile
|
|
38
|
+
# app_profile = instance.app_profile "my-app-profile"
|
|
39
39
|
#
|
|
40
40
|
# # Update
|
|
41
41
|
# app_profile.description = "User data instance app profile"
|
|
@@ -172,8 +172,8 @@ module Google
|
|
|
172
172
|
# require "google/cloud/bigtable"
|
|
173
173
|
#
|
|
174
174
|
# bigtable = Google::Cloud::Bigtable.new
|
|
175
|
-
# instance = bigtable.instance
|
|
176
|
-
# app_profile = instance.app_profile
|
|
175
|
+
# instance = bigtable.instance "my-instance"
|
|
176
|
+
# app_profile = instance.app_profile "my-app-profile"
|
|
177
177
|
#
|
|
178
178
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.multi_cluster_routing
|
|
179
179
|
# app_profile.routing_policy = routing_policy
|
|
@@ -182,11 +182,11 @@ module Google
|
|
|
182
182
|
# require "google/cloud/bigtable"
|
|
183
183
|
#
|
|
184
184
|
# bigtable = Google::Cloud::Bigtable.new
|
|
185
|
-
# instance = bigtable.instance
|
|
186
|
-
# app_profile = instance.app_profile
|
|
185
|
+
# instance = bigtable.instance "my-instance"
|
|
186
|
+
# app_profile = instance.app_profile "my-app-profile"
|
|
187
187
|
#
|
|
188
188
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.single_cluster_routing(
|
|
189
|
-
# "my-
|
|
189
|
+
# "my-cluster",
|
|
190
190
|
# allow_transactional_writes: true
|
|
191
191
|
# )
|
|
192
192
|
# app_profile.routing_policy = routing_policy
|
|
@@ -225,7 +225,7 @@ module Google
|
|
|
225
225
|
#
|
|
226
226
|
# bigtable = Google::Cloud::Bigtable.new
|
|
227
227
|
#
|
|
228
|
-
# instance = bigtable.instance
|
|
228
|
+
# instance = bigtable.instance "my-instance"
|
|
229
229
|
#
|
|
230
230
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.multi_cluster_routing
|
|
231
231
|
#
|
|
@@ -253,11 +253,11 @@ module Google
|
|
|
253
253
|
#
|
|
254
254
|
# bigtable = Google::Cloud::Bigtable.new
|
|
255
255
|
#
|
|
256
|
-
# instance = bigtable.instance
|
|
256
|
+
# instance = bigtable.instance "my-instance"
|
|
257
257
|
#
|
|
258
|
-
# app_profile = instance.app_profile
|
|
258
|
+
# app_profile = instance.app_profile "my-app-profile"
|
|
259
259
|
#
|
|
260
|
-
# app_profile.delete
|
|
260
|
+
# app_profile.delete ignore_warnings: true # Ignore warnings.
|
|
261
261
|
#
|
|
262
262
|
# # OR : Not ignoring warnings
|
|
263
263
|
# app_profile.delete
|
|
@@ -281,20 +281,19 @@ module Google
|
|
|
281
281
|
#
|
|
282
282
|
# bigtable = Google::Cloud::Bigtable.new
|
|
283
283
|
#
|
|
284
|
-
# instance = bigtable.instance
|
|
284
|
+
# instance = bigtable.instance "my-instance"
|
|
285
285
|
#
|
|
286
|
-
# app_profile = instance.app_profile
|
|
286
|
+
# app_profile = instance.app_profile "my-app-profile"
|
|
287
287
|
#
|
|
288
288
|
# app_profile.description = "User data instance app profile"
|
|
289
|
-
# app_profile.routing_policy =
|
|
290
|
-
# Google::Cloud::Bigtable::AppProfile.multi_cluster_routing
|
|
289
|
+
# app_profile.routing_policy = Google::Cloud::Bigtable::AppProfile.multi_cluster_routing
|
|
291
290
|
#
|
|
292
291
|
# job = app_profile.save
|
|
293
292
|
# job.wait_until_done!
|
|
294
293
|
# if job.error?
|
|
295
294
|
# puts job.error
|
|
296
295
|
# else
|
|
297
|
-
# puts "App profile successfully
|
|
296
|
+
# puts "App profile successfully updated."
|
|
298
297
|
# app_profile = job.app_profile
|
|
299
298
|
# end
|
|
300
299
|
#
|
|
@@ -303,8 +302,8 @@ module Google
|
|
|
303
302
|
#
|
|
304
303
|
# bigtable = Google::Cloud::Bigtable.new
|
|
305
304
|
#
|
|
306
|
-
# instance = bigtable.instance
|
|
307
|
-
# app_profile = instance.app_profile
|
|
305
|
+
# instance = bigtable.instance "my-instance"
|
|
306
|
+
# app_profile = instance.app_profile "my-app-profile"
|
|
308
307
|
#
|
|
309
308
|
# app_profile.description = "User data instance app profile"
|
|
310
309
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.single_cluster_routing(
|
|
@@ -360,7 +359,7 @@ module Google
|
|
|
360
359
|
#
|
|
361
360
|
# bigtable = Google::Cloud::Bigtable.new
|
|
362
361
|
#
|
|
363
|
-
# instance = bigtable.instance
|
|
362
|
+
# instance = bigtable.instance "my-instance"
|
|
364
363
|
#
|
|
365
364
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.multi_cluster_routing
|
|
366
365
|
#
|
|
@@ -396,10 +395,10 @@ module Google
|
|
|
396
395
|
#
|
|
397
396
|
# bigtable = Google::Cloud::Bigtable.new
|
|
398
397
|
#
|
|
399
|
-
# instance = bigtable.instance
|
|
398
|
+
# instance = bigtable.instance "my-instance"
|
|
400
399
|
#
|
|
401
400
|
# routing_policy = Google::Cloud::Bigtable::AppProfile.single_cluster_routing(
|
|
402
|
-
# "my-
|
|
401
|
+
# "my-cluster",
|
|
403
402
|
# allow_transactional_writes: true
|
|
404
403
|
# )
|
|
405
404
|
#
|
|
@@ -34,12 +34,12 @@ module Google
|
|
|
34
34
|
# require "google/cloud/bigtable"
|
|
35
35
|
#
|
|
36
36
|
# bigtable = Google::Cloud::Bigtable.new
|
|
37
|
-
# instance = bigtable.instance
|
|
38
|
-
# cluster = instance.cluster
|
|
39
|
-
# table = instance.table
|
|
37
|
+
# instance = bigtable.instance "my-instance"
|
|
38
|
+
# cluster = instance.cluster "my-cluster"
|
|
39
|
+
# table = instance.table "my-table"
|
|
40
40
|
#
|
|
41
41
|
# expire_time = Time.now + 60 * 60 * 7
|
|
42
|
-
# job = cluster.create_backup
|
|
42
|
+
# job = cluster.create_backup table, "my-backup", expire_time
|
|
43
43
|
#
|
|
44
44
|
# job.wait_until_done!
|
|
45
45
|
# job.done? #=> true
|
|
@@ -61,12 +61,12 @@ module Google
|
|
|
61
61
|
# require "google/cloud/bigtable"
|
|
62
62
|
#
|
|
63
63
|
# bigtable = Google::Cloud::Bigtable.new
|
|
64
|
-
# instance = bigtable.instance
|
|
65
|
-
# cluster = instance.cluster
|
|
66
|
-
# table = instance.table
|
|
64
|
+
# instance = bigtable.instance "my-instance"
|
|
65
|
+
# cluster = instance.cluster "my-cluster"
|
|
66
|
+
# table = instance.table "my-table"
|
|
67
67
|
#
|
|
68
68
|
# expire_time = Time.now + 60 * 60 * 7
|
|
69
|
-
# job = cluster.create_backup
|
|
69
|
+
# job = cluster.create_backup table, "my-backup", expire_time
|
|
70
70
|
#
|
|
71
71
|
# job.wait_until_done!
|
|
72
72
|
# job.done? #=> true
|
|
@@ -46,8 +46,8 @@ module Google
|
|
|
46
46
|
#
|
|
47
47
|
# bigtable = Google::Cloud::Bigtable.new
|
|
48
48
|
#
|
|
49
|
-
# instance = bigtable.instance
|
|
50
|
-
# cluster = instance.cluster
|
|
49
|
+
# instance = bigtable.instance "my-instance"
|
|
50
|
+
# cluster = instance.cluster "my-cluster"
|
|
51
51
|
#
|
|
52
52
|
# backups = cluster.backups
|
|
53
53
|
#
|
|
@@ -69,8 +69,8 @@ module Google
|
|
|
69
69
|
#
|
|
70
70
|
# bigtable = Google::Cloud::Bigtable.new
|
|
71
71
|
#
|
|
72
|
-
# instance = bigtable.instance
|
|
73
|
-
# cluster = instance.cluster
|
|
72
|
+
# instance = bigtable.instance "my-instance"
|
|
73
|
+
# cluster = instance.cluster "my-cluster"
|
|
74
74
|
#
|
|
75
75
|
# backups = cluster.backups
|
|
76
76
|
#
|
|
@@ -105,8 +105,8 @@ module Google
|
|
|
105
105
|
#
|
|
106
106
|
# bigtable = Google::Cloud::Bigtable.new
|
|
107
107
|
#
|
|
108
|
-
# instance = bigtable.instance
|
|
109
|
-
# cluster = instance.cluster
|
|
108
|
+
# instance = bigtable.instance "my-instance"
|
|
109
|
+
# cluster = instance.cluster "my-cluster"
|
|
110
110
|
#
|
|
111
111
|
# cluster.backups.all do |backup|
|
|
112
112
|
# puts backup.backup_id
|
|
@@ -117,12 +117,10 @@ module Google
|
|
|
117
117
|
#
|
|
118
118
|
# bigtable = Google::Cloud::Bigtable.new
|
|
119
119
|
#
|
|
120
|
-
# instance = bigtable.instance
|
|
121
|
-
# cluster = instance.cluster
|
|
120
|
+
# instance = bigtable.instance "my-instance"
|
|
121
|
+
# cluster = instance.cluster "my-cluster"
|
|
122
122
|
#
|
|
123
|
-
# all_backup_ids = cluster.backups.all.map
|
|
124
|
-
# backup.backup_id
|
|
125
|
-
# end
|
|
123
|
+
# all_backup_ids = cluster.backups.all.map(&:backup_id)
|
|
126
124
|
#
|
|
127
125
|
def all &block
|
|
128
126
|
return enum_for :all unless block_given?
|
|
@@ -34,10 +34,10 @@ module Google
|
|
|
34
34
|
# require "google/cloud/bigtable"
|
|
35
35
|
#
|
|
36
36
|
# bigtable = Google::Cloud::Bigtable.new
|
|
37
|
-
# instance = bigtable.instance
|
|
38
|
-
# cluster = instance.cluster
|
|
37
|
+
# instance = bigtable.instance "my-instance"
|
|
38
|
+
# cluster = instance.cluster "my-cluster"
|
|
39
39
|
#
|
|
40
|
-
# backup = cluster.backup
|
|
40
|
+
# backup = cluster.backup "my-backup"
|
|
41
41
|
#
|
|
42
42
|
# # Update
|
|
43
43
|
# backup.expire_time = Time.now + 60 * 60 * 7
|
|
@@ -109,6 +109,18 @@ module Google
|
|
|
109
109
|
@grpc.name
|
|
110
110
|
end
|
|
111
111
|
|
|
112
|
+
##
|
|
113
|
+
# The name of the backup from which this backup is copied.
|
|
114
|
+
# Value will be empty if its not a copied backup and of the form -
|
|
115
|
+
# `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<source_backup>`
|
|
116
|
+
# if this is a copied backup.
|
|
117
|
+
#
|
|
118
|
+
# @return [String]
|
|
119
|
+
#
|
|
120
|
+
def source_backup
|
|
121
|
+
@grpc.source_backup
|
|
122
|
+
end
|
|
123
|
+
|
|
112
124
|
##
|
|
113
125
|
# The table from which this backup was created.
|
|
114
126
|
#
|
|
@@ -216,10 +228,10 @@ module Google
|
|
|
216
228
|
# require "google/cloud/bigtable"
|
|
217
229
|
#
|
|
218
230
|
# bigtable = Google::Cloud::Bigtable.new
|
|
219
|
-
# instance = bigtable.instance
|
|
220
|
-
# cluster = instance.cluster
|
|
231
|
+
# instance = bigtable.instance "my-instance"
|
|
232
|
+
# cluster = instance.cluster "my-cluster"
|
|
221
233
|
#
|
|
222
|
-
# backup = cluster.backup
|
|
234
|
+
# backup = cluster.backup "my-backup"
|
|
223
235
|
#
|
|
224
236
|
# encryption_info = backup.encryption_info
|
|
225
237
|
# encryption_info.encryption_type #=> :GOOGLE_DEFAULT_ENCRYPTION
|
|
@@ -247,10 +259,10 @@ module Google
|
|
|
247
259
|
# require "google/cloud/bigtable"
|
|
248
260
|
#
|
|
249
261
|
# bigtable = Google::Cloud::Bigtable.new
|
|
250
|
-
# instance = bigtable.instance
|
|
251
|
-
# cluster = instance.cluster
|
|
262
|
+
# instance = bigtable.instance "my-instance"
|
|
263
|
+
# cluster = instance.cluster "my-cluster"
|
|
252
264
|
#
|
|
253
|
-
# backup = cluster.backup
|
|
265
|
+
# backup = cluster.backup "my-backup"
|
|
254
266
|
#
|
|
255
267
|
# policy = backup.policy
|
|
256
268
|
#
|
|
@@ -258,13 +270,13 @@ module Google
|
|
|
258
270
|
# require "google/cloud/bigtable"
|
|
259
271
|
#
|
|
260
272
|
# bigtable = Google::Cloud::Bigtable.new
|
|
261
|
-
# instance = bigtable.instance
|
|
262
|
-
# cluster = instance.cluster
|
|
273
|
+
# instance = bigtable.instance "my-instance"
|
|
274
|
+
# cluster = instance.cluster "my-cluster"
|
|
263
275
|
#
|
|
264
|
-
# backup = cluster.backup
|
|
276
|
+
# backup = cluster.backup "my-backup"
|
|
265
277
|
#
|
|
266
278
|
# backup.policy do |p|
|
|
267
|
-
# p.add
|
|
279
|
+
# p.add "roles/owner", "user:owner@example.com"
|
|
268
280
|
# end # 2 API calls
|
|
269
281
|
#
|
|
270
282
|
def policy
|
|
@@ -294,14 +306,14 @@ module Google
|
|
|
294
306
|
# require "google/cloud/bigtable"
|
|
295
307
|
#
|
|
296
308
|
# bigtable = Google::Cloud::Bigtable.new
|
|
297
|
-
# instance = bigtable.instance
|
|
298
|
-
# cluster = instance.cluster
|
|
309
|
+
# instance = bigtable.instance "my-instance"
|
|
310
|
+
# cluster = instance.cluster "my-cluster"
|
|
299
311
|
#
|
|
300
|
-
# backup = cluster.backup
|
|
312
|
+
# backup = cluster.backup "my-backup"
|
|
301
313
|
#
|
|
302
314
|
# policy = backup.policy
|
|
303
|
-
# policy.add
|
|
304
|
-
# updated_policy = backup.update_policy
|
|
315
|
+
# policy.add "roles/owner", "user:owner@example.com"
|
|
316
|
+
# updated_policy = backup.update_policy policy
|
|
305
317
|
#
|
|
306
318
|
# puts updated_policy.roles
|
|
307
319
|
#
|
|
@@ -330,10 +342,10 @@ module Google
|
|
|
330
342
|
# require "google/cloud/bigtable"
|
|
331
343
|
#
|
|
332
344
|
# bigtable = Google::Cloud::Bigtable.new
|
|
333
|
-
# instance = bigtable.instance
|
|
334
|
-
# cluster = instance.cluster
|
|
345
|
+
# instance = bigtable.instance "my-instance"
|
|
346
|
+
# cluster = instance.cluster "my-cluster"
|
|
335
347
|
#
|
|
336
|
-
# backup = cluster.backup
|
|
348
|
+
# backup = cluster.backup "my-backup"
|
|
337
349
|
#
|
|
338
350
|
# permissions = backup.test_iam_permissions(
|
|
339
351
|
# "bigtable.backups.delete",
|
|
@@ -363,12 +375,12 @@ module Google
|
|
|
363
375
|
# require "google/cloud/bigtable"
|
|
364
376
|
#
|
|
365
377
|
# bigtable = Google::Cloud::Bigtable.new
|
|
366
|
-
# instance = bigtable.instance
|
|
367
|
-
# cluster = instance.cluster
|
|
378
|
+
# instance = bigtable.instance "my-instance"
|
|
379
|
+
# cluster = instance.cluster "my-cluster"
|
|
368
380
|
#
|
|
369
|
-
# backup = cluster.backup
|
|
381
|
+
# backup = cluster.backup "my-backup"
|
|
370
382
|
#
|
|
371
|
-
# job = backup.restore
|
|
383
|
+
# job = backup.restore "my-new-table"
|
|
372
384
|
#
|
|
373
385
|
# job.wait_until_done!
|
|
374
386
|
# job.done? #=> true
|
|
@@ -384,13 +396,13 @@ module Google
|
|
|
384
396
|
# require "google/cloud/bigtable"
|
|
385
397
|
#
|
|
386
398
|
# bigtable = Google::Cloud::Bigtable.new
|
|
387
|
-
# instance = bigtable.instance
|
|
388
|
-
# cluster = instance.cluster
|
|
399
|
+
# instance = bigtable.instance "my-instance"
|
|
400
|
+
# cluster = instance.cluster "my-cluster"
|
|
389
401
|
#
|
|
390
|
-
# backup = cluster.backup
|
|
402
|
+
# backup = cluster.backup "my-backup"
|
|
391
403
|
#
|
|
392
|
-
# table_instance = bigtable.instance
|
|
393
|
-
# job = backup.restore
|
|
404
|
+
# table_instance = bigtable.instance "my-other-instance"
|
|
405
|
+
# job = backup.restore "my-new-table", instance: table_instance
|
|
394
406
|
#
|
|
395
407
|
# job.wait_until_done!
|
|
396
408
|
# job.done? #=> true
|
|
@@ -412,6 +424,61 @@ module Google
|
|
|
412
424
|
Table::RestoreJob.from_grpc grpc, service
|
|
413
425
|
end
|
|
414
426
|
|
|
427
|
+
##
|
|
428
|
+
# Creates a copy of the backup at the desired location. Copy of the backup won't be created
|
|
429
|
+
# if the backup is already a copied one.
|
|
430
|
+
#
|
|
431
|
+
# @param dest_project_id [String] Existing project ID. Copy of the backup
|
|
432
|
+
# will be created in this project. Required.
|
|
433
|
+
# @param dest_instance_id [Instance, String] Existing instance ID. Copy
|
|
434
|
+
# of the backup will be created in this instance. Required.
|
|
435
|
+
# @param dest_cluster_id [String] Existing cluster ID. Copy of the backup
|
|
436
|
+
# will be created in this cluster. Required.
|
|
437
|
+
# @param new_backup_id [String] The id of the copy of the backup to be created. This string must
|
|
438
|
+
# be between 1 and 50 characters in length and match the regex
|
|
439
|
+
# `[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. Required.
|
|
440
|
+
# @param expire_time [Time] The expiration time of the copy of the backup, with microseconds
|
|
441
|
+
# granularity that must be at least 6 hours and at most 30 days from the time the request
|
|
442
|
+
# is received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup
|
|
443
|
+
# and free the resources used by the backup. Required.
|
|
444
|
+
#
|
|
445
|
+
# @return [Google::Cloud::Bigtable::Backup::Job] The job representing the long-running, asynchronous
|
|
446
|
+
# processing of a copy backup operation.
|
|
447
|
+
#
|
|
448
|
+
# @example Create a copy of the backup at a specific location
|
|
449
|
+
# require "google/cloud/bigtable"
|
|
450
|
+
#
|
|
451
|
+
# bigtable = Google::Cloud::Bigtable.new
|
|
452
|
+
# instance = bigtable.instance "my-instance"
|
|
453
|
+
# cluster = instance.cluster "my-cluster"
|
|
454
|
+
#
|
|
455
|
+
# backup = cluster.backup "my-backup"
|
|
456
|
+
#
|
|
457
|
+
# job = backup.copy dest_project_id:"my-project-2",
|
|
458
|
+
# dest_instance_id:"my-instance-2",
|
|
459
|
+
# dest_cluster_id:"my-cluster-2",
|
|
460
|
+
# new_backup_id:"my-backup-2",
|
|
461
|
+
# expire_time: Time.now + 60 * 60 * 7
|
|
462
|
+
#
|
|
463
|
+
# job.wait_until_done!
|
|
464
|
+
# job.done? #=> true
|
|
465
|
+
#
|
|
466
|
+
# if job.error?
|
|
467
|
+
# status = job.error
|
|
468
|
+
# else
|
|
469
|
+
# backup = job.backup
|
|
470
|
+
# end
|
|
471
|
+
#
|
|
472
|
+
def copy dest_project_id:, dest_instance_id:, dest_cluster_id:, new_backup_id:, expire_time:
|
|
473
|
+
grpc = service.copy_backup project_id: dest_project_id,
|
|
474
|
+
instance_id: dest_instance_id,
|
|
475
|
+
cluster_id: dest_cluster_id,
|
|
476
|
+
backup_id: new_backup_id,
|
|
477
|
+
source_backup: service.backup_path(instance_id, cluster_id, backup_id),
|
|
478
|
+
expire_time: expire_time
|
|
479
|
+
Backup::Job.from_grpc grpc, service
|
|
480
|
+
end
|
|
481
|
+
|
|
415
482
|
##
|
|
416
483
|
# Updates the backup.
|
|
417
484
|
#
|
|
@@ -423,10 +490,10 @@ module Google
|
|
|
423
490
|
# require "google/cloud/bigtable"
|
|
424
491
|
#
|
|
425
492
|
# bigtable = Google::Cloud::Bigtable.new
|
|
426
|
-
# instance = bigtable.instance
|
|
427
|
-
# cluster = instance.cluster
|
|
493
|
+
# instance = bigtable.instance "my-instance"
|
|
494
|
+
# cluster = instance.cluster "my-cluster"
|
|
428
495
|
#
|
|
429
|
-
# backup = cluster.backup
|
|
496
|
+
# backup = cluster.backup "my-backup"
|
|
430
497
|
#
|
|
431
498
|
# # Update
|
|
432
499
|
# backup.expire_time = Time.now + 60 * 60 * 7
|
|
@@ -458,10 +525,10 @@ module Google
|
|
|
458
525
|
# require "google/cloud/bigtable"
|
|
459
526
|
#
|
|
460
527
|
# bigtable = Google::Cloud::Bigtable.new
|
|
461
|
-
# instance = bigtable.instance
|
|
462
|
-
# cluster = instance.cluster
|
|
528
|
+
# instance = bigtable.instance "my-instance"
|
|
529
|
+
# cluster = instance.cluster "my-cluster"
|
|
463
530
|
#
|
|
464
|
-
# backup = cluster.backup
|
|
531
|
+
# backup = cluster.backup "my-backup"
|
|
465
532
|
#
|
|
466
533
|
# backup.delete
|
|
467
534
|
#
|
|
@@ -76,11 +76,11 @@ module Google
|
|
|
76
76
|
def validate_reset_row
|
|
77
77
|
return unless chunk.reset_row
|
|
78
78
|
|
|
79
|
-
value =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
value = !chunk.row_key.empty? ||
|
|
80
|
+
chunk.family_name ||
|
|
81
|
+
chunk.qualifier ||
|
|
82
|
+
!chunk.value.empty? ||
|
|
83
|
+
chunk.timestamp_micros.positive?
|
|
84
84
|
|
|
85
85
|
raise_if value, "A reset should have no data"
|
|
86
86
|
end
|
|
@@ -34,7 +34,7 @@ module Google
|
|
|
34
34
|
#
|
|
35
35
|
# bigtable = Google::Cloud::Bigtable.new
|
|
36
36
|
#
|
|
37
|
-
# instance = bigtable.instance
|
|
37
|
+
# instance = bigtable.instance "my-instance"
|
|
38
38
|
# job = instance.create_cluster(
|
|
39
39
|
# "my-new-cluster",
|
|
40
40
|
# "us-east-1b",
|
|
@@ -67,7 +67,7 @@ module Google
|
|
|
67
67
|
#
|
|
68
68
|
# bigtable = Google::Cloud::Bigtable.new
|
|
69
69
|
#
|
|
70
|
-
# instance = bigtable.instance
|
|
70
|
+
# instance = bigtable.instance "my-instance"
|
|
71
71
|
# job = instance.create_cluster(
|
|
72
72
|
# "my-new-cluster",
|
|
73
73
|
# "us-east-1b",
|
|
@@ -33,8 +33,8 @@ module Google
|
|
|
33
33
|
#
|
|
34
34
|
# bigtable = Google::Cloud::Bigtable.new
|
|
35
35
|
#
|
|
36
|
-
# instance = bigtable.instance
|
|
37
|
-
# cluster = instance.cluster
|
|
36
|
+
# instance = bigtable.instance "my-instance"
|
|
37
|
+
# cluster = instance.cluster "my-cluster"
|
|
38
38
|
#
|
|
39
39
|
# # Update
|
|
40
40
|
# cluster.nodes = 3
|
|
@@ -239,12 +239,12 @@ module Google
|
|
|
239
239
|
# require "google/cloud/bigtable"
|
|
240
240
|
#
|
|
241
241
|
# bigtable = Google::Cloud::Bigtable.new
|
|
242
|
-
# instance = bigtable.instance
|
|
243
|
-
# cluster = instance.cluster
|
|
244
|
-
# table = instance.table
|
|
242
|
+
# instance = bigtable.instance "my-instance"
|
|
243
|
+
# cluster = instance.cluster "my-cluster"
|
|
244
|
+
# table = instance.table "my-table"
|
|
245
245
|
#
|
|
246
246
|
# expire_time = Time.now + 60 * 60 * 7
|
|
247
|
-
# job = cluster.create_backup
|
|
247
|
+
# job = cluster.create_backup table, "my-backup", expire_time
|
|
248
248
|
#
|
|
249
249
|
# job.wait_until_done!
|
|
250
250
|
# job.done? #=> true
|
|
@@ -277,10 +277,10 @@ module Google
|
|
|
277
277
|
#
|
|
278
278
|
# bigtable = Google::Cloud::Bigtable.new
|
|
279
279
|
#
|
|
280
|
-
# instance = bigtable.instance
|
|
281
|
-
# cluster = instance.cluster
|
|
280
|
+
# instance = bigtable.instance "my-instance"
|
|
281
|
+
# cluster = instance.cluster "my-cluster"
|
|
282
282
|
#
|
|
283
|
-
# backup = cluster.backup
|
|
283
|
+
# backup = cluster.backup "my-backup"
|
|
284
284
|
#
|
|
285
285
|
# if backup
|
|
286
286
|
# puts backup.backup_id
|
|
@@ -303,8 +303,8 @@ module Google
|
|
|
303
303
|
#
|
|
304
304
|
# bigtable = Google::Cloud::Bigtable.new
|
|
305
305
|
#
|
|
306
|
-
# instance = bigtable.instance
|
|
307
|
-
# cluster = instance.cluster
|
|
306
|
+
# instance = bigtable.instance "my-instance"
|
|
307
|
+
# cluster = instance.cluster "my-cluster"
|
|
308
308
|
#
|
|
309
309
|
# cluster.backups.all do |backup|
|
|
310
310
|
# puts backup.backup_id
|
|
@@ -329,8 +329,8 @@ module Google
|
|
|
329
329
|
#
|
|
330
330
|
# bigtable = Google::Cloud::Bigtable.new
|
|
331
331
|
#
|
|
332
|
-
# instance = bigtable.instance
|
|
333
|
-
# cluster = instance.cluster
|
|
332
|
+
# instance = bigtable.instance "my-instance"
|
|
333
|
+
# cluster = instance.cluster "my-cluster"
|
|
334
334
|
# cluster.nodes = 3
|
|
335
335
|
# job = cluster.save
|
|
336
336
|
#
|
|
@@ -373,8 +373,8 @@ module Google
|
|
|
373
373
|
#
|
|
374
374
|
# bigtable = Google::Cloud::Bigtable.new
|
|
375
375
|
#
|
|
376
|
-
# instance = bigtable.instance
|
|
377
|
-
# cluster = instance.cluster
|
|
376
|
+
# instance = bigtable.instance "my-instance"
|
|
377
|
+
# cluster = instance.cluster "my-cluster"
|
|
378
378
|
# cluster.delete
|
|
379
379
|
#
|
|
380
380
|
def delete
|
|
@@ -30,8 +30,8 @@ module Google
|
|
|
30
30
|
#
|
|
31
31
|
# bigtable = Google::Cloud::Bigtable.new
|
|
32
32
|
#
|
|
33
|
-
# instance = bigtable.instance
|
|
34
|
-
# table = instance.table
|
|
33
|
+
# instance = bigtable.instance "my-instance"
|
|
34
|
+
# table = instance.table "my-table"
|
|
35
35
|
#
|
|
36
36
|
# column_family = table.column_families["cf2"]
|
|
37
37
|
# puts column_family.gc_rule
|