google-cloud-bigtable 2.4.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +2 -1
- data/CHANGELOG.md +32 -0
- data/CONTRIBUTING.md +2 -3
- data/OVERVIEW.md +1 -1
- data/lib/google/cloud/bigtable/app_profile.rb +20 -21
- 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/backup.rb +83 -32
- 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/cluster.rb +37 -17
- data/lib/google/cloud/bigtable/cluster/job.rb +2 -2
- data/lib/google/cloud/bigtable/column_family.rb +2 -2
- data/lib/google/cloud/bigtable/column_family_map.rb +14 -14
- data/lib/google/cloud/bigtable/column_range.rb +7 -7
- data/lib/google/cloud/bigtable/encryption_info.rb +118 -0
- data/lib/google/cloud/bigtable/gc_rule.rb +20 -20
- data/lib/google/cloud/bigtable/instance.rb +40 -40
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +61 -21
- data/lib/google/cloud/bigtable/instance/job.rb +4 -4
- 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 +15 -15
- data/lib/google/cloud/bigtable/read_operations.rb +31 -31
- data/lib/google/cloud/bigtable/routing_policy.rb +6 -6
- data/lib/google/cloud/bigtable/row_filter.rb +28 -28
- 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_range.rb +18 -18
- data/lib/google/cloud/bigtable/sample_row_key.rb +1 -1
- data/lib/google/cloud/bigtable/service.rb +6 -3
- data/lib/google/cloud/bigtable/status.rb +2 -2
- data/lib/google/cloud/bigtable/table.rb +66 -43
- data/lib/google/cloud/bigtable/table/cluster_state.rb +43 -9
- 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/value_range.rb +18 -18
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +4 -3
@@ -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?
|
@@ -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
|
@@ -168,8 +168,10 @@ module Google
|
|
168
168
|
##
|
169
169
|
# The type of storage used by this cluster to serve its
|
170
170
|
# parent instance's tables, unless explicitly overridden.
|
171
|
-
# Valid values are
|
172
|
-
#
|
171
|
+
# Valid values are:
|
172
|
+
#
|
173
|
+
# * `:SSD` - Flash (SSD) storage should be used.
|
174
|
+
# * `:HDD` - Magnetic drive (HDD) storage should be used.
|
173
175
|
#
|
174
176
|
# @return [Symbol]
|
175
177
|
#
|
@@ -197,6 +199,24 @@ module Google
|
|
197
199
|
@grpc.location
|
198
200
|
end
|
199
201
|
|
202
|
+
##
|
203
|
+
# The full name of the Cloud KMS encryption key for the cluster, if it is CMEK-protected, in the format
|
204
|
+
# `projects/{key_project_id}/locations/{location}/keyRings/{ring_name}/cryptoKeys/{key_name}`.
|
205
|
+
#
|
206
|
+
# The requirements for this key are:
|
207
|
+
#
|
208
|
+
# 1. The Cloud Bigtable service account associated with the project that contains this cluster must be granted
|
209
|
+
# the `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
|
210
|
+
# 2. Only regional keys can be used and the region of the CMEK key must match the region of the cluster.
|
211
|
+
# 3. All clusters within an instance must use the same CMEK key.
|
212
|
+
#
|
213
|
+
# @return [String, nil] The full name of the Cloud KMS encryption key, or `nil` if the cluster is not
|
214
|
+
# CMEK-protected.
|
215
|
+
#
|
216
|
+
def kms_key
|
217
|
+
@grpc.encryption_config&.kms_key_name
|
218
|
+
end
|
219
|
+
|
200
220
|
##
|
201
221
|
# Creates a new Cloud Bigtable Backup.
|
202
222
|
#
|
@@ -219,12 +239,12 @@ module Google
|
|
219
239
|
# require "google/cloud/bigtable"
|
220
240
|
#
|
221
241
|
# bigtable = Google::Cloud::Bigtable.new
|
222
|
-
# instance = bigtable.instance
|
223
|
-
# cluster = instance.cluster
|
224
|
-
# table = instance.table
|
242
|
+
# instance = bigtable.instance "my-instance"
|
243
|
+
# cluster = instance.cluster "my-cluster"
|
244
|
+
# table = instance.table "my-table"
|
225
245
|
#
|
226
246
|
# expire_time = Time.now + 60 * 60 * 7
|
227
|
-
# job = cluster.create_backup
|
247
|
+
# job = cluster.create_backup table, "my-backup", expire_time
|
228
248
|
#
|
229
249
|
# job.wait_until_done!
|
230
250
|
# job.done? #=> true
|
@@ -257,10 +277,10 @@ module Google
|
|
257
277
|
#
|
258
278
|
# bigtable = Google::Cloud::Bigtable.new
|
259
279
|
#
|
260
|
-
# instance = bigtable.instance
|
261
|
-
# cluster = instance.cluster
|
280
|
+
# instance = bigtable.instance "my-instance"
|
281
|
+
# cluster = instance.cluster "my-cluster"
|
262
282
|
#
|
263
|
-
# backup = cluster.backup
|
283
|
+
# backup = cluster.backup "my-backup"
|
264
284
|
#
|
265
285
|
# if backup
|
266
286
|
# puts backup.backup_id
|
@@ -283,8 +303,8 @@ module Google
|
|
283
303
|
#
|
284
304
|
# bigtable = Google::Cloud::Bigtable.new
|
285
305
|
#
|
286
|
-
# instance = bigtable.instance
|
287
|
-
# cluster = instance.cluster
|
306
|
+
# instance = bigtable.instance "my-instance"
|
307
|
+
# cluster = instance.cluster "my-cluster"
|
288
308
|
#
|
289
309
|
# cluster.backups.all do |backup|
|
290
310
|
# puts backup.backup_id
|
@@ -309,8 +329,8 @@ module Google
|
|
309
329
|
#
|
310
330
|
# bigtable = Google::Cloud::Bigtable.new
|
311
331
|
#
|
312
|
-
# instance = bigtable.instance
|
313
|
-
# cluster = instance.cluster
|
332
|
+
# instance = bigtable.instance "my-instance"
|
333
|
+
# cluster = instance.cluster "my-cluster"
|
314
334
|
# cluster.nodes = 3
|
315
335
|
# job = cluster.save
|
316
336
|
#
|
@@ -353,8 +373,8 @@ module Google
|
|
353
373
|
#
|
354
374
|
# bigtable = Google::Cloud::Bigtable.new
|
355
375
|
#
|
356
|
-
# instance = bigtable.instance
|
357
|
-
# cluster = instance.cluster
|
376
|
+
# instance = bigtable.instance "my-instance"
|
377
|
+
# cluster = instance.cluster "my-cluster"
|
358
378
|
# cluster.delete
|
359
379
|
#
|
360
380
|
def delete
|
@@ -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",
|
@@ -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
|
@@ -41,15 +41,15 @@ module Google
|
|
41
41
|
#
|
42
42
|
# bigtable = Google::Cloud::Bigtable.new
|
43
43
|
#
|
44
|
-
# table = bigtable.create_table
|
45
|
-
# cfm.add
|
46
|
-
# cfm.add
|
44
|
+
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
|
45
|
+
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
|
46
|
+
# cfm.add "cf2", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
47
47
|
#
|
48
48
|
# gc_rule = Google::Cloud::Bigtable::GcRule.union(
|
49
49
|
# Google::Cloud::Bigtable::GcRule.max_age(1800),
|
50
50
|
# Google::Cloud::Bigtable::GcRule.max_versions(3)
|
51
51
|
# )
|
52
|
-
# cfm.add
|
52
|
+
# cfm.add "cf3", gc_rule: gc_rule
|
53
53
|
# end
|
54
54
|
#
|
55
55
|
# puts table.column_families
|
@@ -59,15 +59,15 @@ module Google
|
|
59
59
|
#
|
60
60
|
# bigtable = Google::Cloud::Bigtable.new
|
61
61
|
#
|
62
|
-
# table = bigtable.table
|
62
|
+
# table = bigtable.table "my-instance", "my-table", perform_lookup: true
|
63
63
|
#
|
64
64
|
# table.column_families do |cfm|
|
65
65
|
# cfm.add "cf4", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
66
66
|
# cfm.add "cf5", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
|
67
67
|
#
|
68
|
-
# rule_1 = Google::Cloud::Bigtable::GcRule.max_versions
|
69
|
-
# rule_2 = Google::Cloud::Bigtable::GcRule.max_age
|
70
|
-
# rule_union = Google::Cloud::Bigtable::GcRule.union
|
68
|
+
# rule_1 = Google::Cloud::Bigtable::GcRule.max_versions 3
|
69
|
+
# rule_2 = Google::Cloud::Bigtable::GcRule.max_age 600
|
70
|
+
# rule_union = Google::Cloud::Bigtable::GcRule.union rule_1, rule_2
|
71
71
|
# cfm.update "cf2", gc_rule: rule_union
|
72
72
|
#
|
73
73
|
# cfm.delete "cf3"
|
@@ -196,7 +196,7 @@ module Google
|
|
196
196
|
#
|
197
197
|
# bigtable = Google::Cloud::Bigtable.new
|
198
198
|
#
|
199
|
-
# table = bigtable.table
|
199
|
+
# table = bigtable.table "my-instance", "my-table", perform_lookup: true
|
200
200
|
#
|
201
201
|
# table.column_families do |column_families|
|
202
202
|
# column_families.add "cf4", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
|
@@ -237,12 +237,12 @@ module Google
|
|
237
237
|
#
|
238
238
|
# bigtable = Google::Cloud::Bigtable.new
|
239
239
|
#
|
240
|
-
# table = bigtable.table
|
240
|
+
# table = bigtable.table "my-instance", "my-table", perform_lookup: true
|
241
241
|
#
|
242
242
|
# table.column_families do |column_families|
|
243
|
-
# rule_1 = Google::Cloud::Bigtable::GcRule.max_versions
|
244
|
-
# rule_2 = Google::Cloud::Bigtable::GcRule.max_age
|
245
|
-
# rule_union = Google::Cloud::Bigtable::GcRule.union
|
243
|
+
# rule_1 = Google::Cloud::Bigtable::GcRule.max_versions 3
|
244
|
+
# rule_2 = Google::Cloud::Bigtable::GcRule.max_age 600
|
245
|
+
# rule_union = Google::Cloud::Bigtable::GcRule.union rule_1, rule_2
|
246
246
|
#
|
247
247
|
# column_families.update "cf2", gc_rule: rule_union
|
248
248
|
# end
|
@@ -270,7 +270,7 @@ module Google
|
|
270
270
|
#
|
271
271
|
# bigtable = Google::Cloud::Bigtable.new
|
272
272
|
#
|
273
|
-
# table = bigtable.table
|
273
|
+
# table = bigtable.table "my-instance", "my-table", perform_lookup: true
|
274
274
|
#
|
275
275
|
# table.column_families do |column_families|
|
276
276
|
# column_families.delete "cf3"
|
@@ -32,7 +32,7 @@ module Google
|
|
32
32
|
# require "google/cloud/bigtable"
|
33
33
|
#
|
34
34
|
# bigtable = Google::Cloud::Bigtable.new
|
35
|
-
# table = bigtable.table
|
35
|
+
# table = bigtable.table "my-instance", "my-table"
|
36
36
|
#
|
37
37
|
# # Range that includes all qualifiers including "user-001" up until "user-010"
|
38
38
|
# table.new_column_range("cf").from("user-001").to("user-010")
|
@@ -89,7 +89,7 @@ module Google
|
|
89
89
|
# require "google/cloud/bigtable"
|
90
90
|
#
|
91
91
|
# bigtable = Google::Cloud::Bigtable.new
|
92
|
-
# table = bigtable.table
|
92
|
+
# table = bigtable.table "my-instance", "my-table"
|
93
93
|
#
|
94
94
|
# table.new_column_range("cf").from("qualifier-1")
|
95
95
|
#
|
@@ -97,7 +97,7 @@ module Google
|
|
97
97
|
# require "google/cloud/bigtable"
|
98
98
|
#
|
99
99
|
# bigtable = Google::Cloud::Bigtable.new
|
100
|
-
# table = bigtable.table
|
100
|
+
# table = bigtable.table "my-instance", "my-table"
|
101
101
|
#
|
102
102
|
# table.new_column_range("cf").from("qualifier-1", inclusive: false)
|
103
103
|
#
|
@@ -122,7 +122,7 @@ module Google
|
|
122
122
|
# require "google/cloud/bigtable"
|
123
123
|
#
|
124
124
|
# bigtable = Google::Cloud::Bigtable.new
|
125
|
-
# table = bigtable.table
|
125
|
+
# table = bigtable.table "my-instance", "my-table"
|
126
126
|
#
|
127
127
|
# table.new_column_range("cf").to("qualifier-10", inclusive: true)
|
128
128
|
#
|
@@ -130,7 +130,7 @@ module Google
|
|
130
130
|
# require "google/cloud/bigtable"
|
131
131
|
#
|
132
132
|
# bigtable = Google::Cloud::Bigtable.new
|
133
|
-
# table = bigtable.table
|
133
|
+
# table = bigtable.table "my-instance", "my-table"
|
134
134
|
#
|
135
135
|
# table.new_column_range("cf").to("qualifier-10")
|
136
136
|
#
|
@@ -154,7 +154,7 @@ module Google
|
|
154
154
|
# require "google/cloud/bigtable"
|
155
155
|
#
|
156
156
|
# bigtable = Google::Cloud::Bigtable.new
|
157
|
-
# table = bigtable.table
|
157
|
+
# table = bigtable.table "my-instance", "my-table"
|
158
158
|
#
|
159
159
|
# table.new_column_range("cf").between("qualifier-1", "qualifier-10")
|
160
160
|
#
|
@@ -173,7 +173,7 @@ module Google
|
|
173
173
|
# require "google/cloud/bigtable"
|
174
174
|
#
|
175
175
|
# bigtable = Google::Cloud::Bigtable.new
|
176
|
-
# table = bigtable.table
|
176
|
+
# table = bigtable.table "my-instance", "my-table"
|
177
177
|
#
|
178
178
|
# table.new_column_range("cf").of("qualifier-1", "qualifier-10")
|
179
179
|
#
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
|
18
|
+
require "google/cloud/bigtable/status"
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Bigtable
|
23
|
+
##
|
24
|
+
# # EncryptionInfo
|
25
|
+
#
|
26
|
+
# Encryption information for a given resource.
|
27
|
+
#
|
28
|
+
# See {Backup#encryption_info} and {Table::ClusterState#encryption_infos}.
|
29
|
+
#
|
30
|
+
# @example
|
31
|
+
# require "google/cloud/bigtable"
|
32
|
+
#
|
33
|
+
# bigtable = Google::Cloud::Bigtable.new
|
34
|
+
# instance = bigtable.instance "my-instance"
|
35
|
+
# cluster = instance.cluster "my-cluster"
|
36
|
+
#
|
37
|
+
# backup = cluster.backup "my-backup"
|
38
|
+
#
|
39
|
+
# encryption_info = backup.encryption_info
|
40
|
+
# encryption_info.encryption_type #=> :GOOGLE_DEFAULT_ENCRYPTION
|
41
|
+
#
|
42
|
+
# @example Retrieve a table with cluster states containing encryption info.
|
43
|
+
# require "google/cloud/bigtable"
|
44
|
+
#
|
45
|
+
# bigtable = Google::Cloud::Bigtable.new
|
46
|
+
#
|
47
|
+
# table = bigtable.table "my-instance", "my-table", view: :ENCRYPTION_VIEW, perform_lookup: true
|
48
|
+
#
|
49
|
+
# table.cluster_states.each do |cs|
|
50
|
+
# puts cs.cluster_name
|
51
|
+
# puts cs.encryption_infos.first.encryption_type
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
class EncryptionInfo
|
55
|
+
# @private
|
56
|
+
#
|
57
|
+
# Creates a new EncryptionInfo instance.
|
58
|
+
def initialize grpc
|
59
|
+
@grpc = grpc
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# The type of encryption used to protect the resource. Possible values:
|
64
|
+
#
|
65
|
+
# * `ENCRYPTION_TYPE_UNSPECIFIED` - Encryption type was not specified, though data at rest remains encrypted.
|
66
|
+
# * `GOOGLE_DEFAULT_ENCRYPTION` - The data backing the resource is encrypted at rest with a key that is
|
67
|
+
# fully managed by Google. No key version or status will be populated. This is the default state.
|
68
|
+
# * `CUSTOMER_MANAGED_ENCRYPTION` - The data backing the resource is encrypted at rest with a key that is
|
69
|
+
# managed by the customer. The in-use version of the key and its status are populated for CMEK-protected
|
70
|
+
# tables. CMEK-protected backups are pinned to the key version that was in use at the time the backup was
|
71
|
+
# taken. This key version is populated but its status is not tracked and is reported as `UNKNOWN`.
|
72
|
+
#
|
73
|
+
# See also {#encryption_status}, {#kms_key_version} and {Instance::ClusterMap#add}.
|
74
|
+
#
|
75
|
+
# @return [Symbol] The encryption type code as an uppercase symbol.
|
76
|
+
#
|
77
|
+
def encryption_type
|
78
|
+
@grpc.encryption_type
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# The status of encrypt/decrypt calls on underlying data for the resource. Regardless of status, the existing
|
83
|
+
# data is always encrypted at rest.
|
84
|
+
#
|
85
|
+
# See also {#encryption_type}, {#kms_key_version} and {Instance::ClusterMap#add}.
|
86
|
+
#
|
87
|
+
# @return [Google::Cloud::Bigtable::Status, nil] The encryption status object, or `nil` if not present.
|
88
|
+
#
|
89
|
+
def encryption_status
|
90
|
+
status_grpc = @grpc.encryption_status
|
91
|
+
Status.from_grpc status_grpc if status_grpc
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# The version of the Cloud KMS key specified in the parent cluster that is in use for the data underlying the
|
96
|
+
# table.
|
97
|
+
#
|
98
|
+
# See also {#encryption_type}, {#encryption_status} and {Instance::ClusterMap#add}.
|
99
|
+
#
|
100
|
+
# @return [String, nil] The Cloud KMS key version, or `nil` if not present.
|
101
|
+
#
|
102
|
+
def kms_key_version
|
103
|
+
@grpc.kms_key_version unless @grpc.kms_key_version.empty?
|
104
|
+
end
|
105
|
+
|
106
|
+
# @private
|
107
|
+
#
|
108
|
+
# Creates a new EncryptionInfo instance from a Google::Cloud::Bigtable::Admin::V2::EncryptionInfo.
|
109
|
+
#
|
110
|
+
# @param grpc [Google::Cloud::Bigtable::Admin::V2::EncryptionInfo]
|
111
|
+
# @return [Google::Cloud::Bigtable::EncryptionInfo]
|
112
|
+
def self.from_grpc grpc
|
113
|
+
new grpc
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|