google-cloud-bigtable 0.7.0 → 1.1.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/AUTHENTICATION.md +4 -26
- data/CHANGELOG.md +55 -0
- data/OVERVIEW.md +388 -19
- data/lib/google-cloud-bigtable.rb +0 -1
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_services_pb.rb +1 -1
- data/lib/google/bigtable/v2/bigtable_pb.rb +3 -0
- data/lib/google/bigtable/v2/bigtable_services_pb.rb +1 -1
- data/lib/google/cloud/bigtable/admin.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2/credentials.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_instance_admin.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_table_admin.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/instance.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/table.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/iam_policy.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/options.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/policy.rb +7 -6
- data/lib/google/cloud/bigtable/admin/v2/doc/google/longrunning/operations.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/any.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/duration.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/empty.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/field_mask.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/timestamp.rb +1 -1
- data/lib/google/cloud/bigtable/admin/v2/doc/google/rpc/status.rb +7 -55
- data/lib/google/cloud/bigtable/admin/v2/doc/google/type/expr.rb +1 -1
- data/lib/google/cloud/bigtable/app_profile.rb +13 -13
- data/lib/google/cloud/bigtable/app_profile/list.rb +7 -7
- data/lib/google/cloud/bigtable/chunk_processor.rb +1 -1
- data/lib/google/cloud/bigtable/cluster.rb +7 -7
- data/lib/google/cloud/bigtable/cluster/list.rb +2 -2
- data/lib/google/cloud/bigtable/column_family.rb +3 -9
- data/lib/google/cloud/bigtable/column_family_map.rb +8 -8
- data/lib/google/cloud/bigtable/column_range.rb +6 -6
- data/lib/google/cloud/bigtable/gc_rule.rb +8 -8
- data/lib/google/cloud/bigtable/instance.rb +78 -71
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +8 -6
- data/lib/google/cloud/bigtable/instance/job.rb +2 -2
- data/lib/google/cloud/bigtable/instance/list.rb +4 -4
- data/lib/google/cloud/bigtable/longrunning_job.rb +1 -1
- data/lib/google/cloud/bigtable/mutation_entry.rb +17 -16
- data/lib/google/cloud/bigtable/mutation_operations.rb +13 -49
- data/lib/google/cloud/bigtable/policy.rb +1 -1
- data/lib/google/cloud/bigtable/project.rb +28 -59
- data/lib/google/cloud/bigtable/read_modify_write_rule.rb +6 -6
- data/lib/google/cloud/bigtable/read_operations.rb +15 -19
- data/lib/google/cloud/bigtable/routing_policy.rb +3 -2
- data/lib/google/cloud/bigtable/row.rb +14 -14
- data/lib/google/cloud/bigtable/row_filter.rb +31 -15
- data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +49 -26
- data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +4 -1
- data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +44 -24
- data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +3 -3
- data/lib/google/cloud/bigtable/rows_mutator.rb +1 -5
- data/lib/google/cloud/bigtable/rows_reader.rb +5 -4
- data/lib/google/cloud/bigtable/sample_row_key.rb +1 -1
- data/lib/google/cloud/bigtable/service.rb +94 -14
- data/lib/google/cloud/bigtable/table.rb +130 -27
- data/lib/google/cloud/bigtable/table/cluster_state.rb +10 -5
- data/lib/google/cloud/bigtable/table/list.rb +2 -2
- data/lib/google/cloud/bigtable/v2.rb +2 -2
- data/lib/google/cloud/bigtable/v2/bigtable_client.rb +13 -13
- data/lib/google/cloud/bigtable/v2/credentials.rb +1 -1
- data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/bigtable.rb +17 -14
- data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/data.rb +1 -1
- data/lib/google/cloud/bigtable/v2/doc/google/protobuf/any.rb +1 -1
- data/lib/google/cloud/bigtable/v2/doc/google/protobuf/wrappers.rb +1 -1
- data/lib/google/cloud/bigtable/v2/doc/google/rpc/status.rb +7 -55
- data/lib/google/cloud/bigtable/value_range.rb +14 -13
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +42 -2
|
@@ -56,7 +56,7 @@ module Google
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
##
|
|
59
|
-
# The unique identifier for the project.
|
|
59
|
+
# The unique identifier for the project to which the cluster belongs.
|
|
60
60
|
#
|
|
61
61
|
# @return [String]
|
|
62
62
|
#
|
|
@@ -65,7 +65,7 @@ module Google
|
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
##
|
|
68
|
-
# The unique identifier for the instance.
|
|
68
|
+
# The unique identifier for the instance to which the cluster belongs.
|
|
69
69
|
#
|
|
70
70
|
# @return [String]
|
|
71
71
|
#
|
|
@@ -93,7 +93,7 @@ module Google
|
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
##
|
|
96
|
-
# The current
|
|
96
|
+
# The current state of the cluster.
|
|
97
97
|
# Possible values are
|
|
98
98
|
# `:CREATING`, `:READY`, `:STATE_NOT_KNOWN`, `:RESIZING`, `:DISABLED`.
|
|
99
99
|
#
|
|
@@ -113,7 +113,7 @@ module Google
|
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
##
|
|
116
|
-
# The
|
|
116
|
+
# The cluster is currently being created, and may be destroyed if the
|
|
117
117
|
# creation process encounters an error.
|
|
118
118
|
#
|
|
119
119
|
# @return [Boolean]
|
|
@@ -197,9 +197,9 @@ module Google
|
|
|
197
197
|
end
|
|
198
198
|
|
|
199
199
|
##
|
|
200
|
-
#
|
|
200
|
+
# Updates the cluster.
|
|
201
201
|
#
|
|
202
|
-
# `serve_nodes` is the only updatable field
|
|
202
|
+
# `serve_nodes` is the only updatable field.
|
|
203
203
|
#
|
|
204
204
|
# @return [Google::Cloud::Bigtable::Cluster::Job]
|
|
205
205
|
# The job representing the long-running, asynchronous processing of
|
|
@@ -235,7 +235,7 @@ module Google
|
|
|
235
235
|
alias update save
|
|
236
236
|
|
|
237
237
|
##
|
|
238
|
-
# Reloads cluster
|
|
238
|
+
# Reloads cluster data.
|
|
239
239
|
#
|
|
240
240
|
# @return [Google::Cloud::Bigtable::Cluster]
|
|
241
241
|
#
|
|
@@ -53,7 +53,7 @@ module Google
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
##
|
|
56
|
-
# Whether there is a next page of
|
|
56
|
+
# Whether there is a next page of clusters.
|
|
57
57
|
#
|
|
58
58
|
# @return [Boolean]
|
|
59
59
|
#
|
|
@@ -126,7 +126,7 @@ module Google
|
|
|
126
126
|
# bigtable = Google::Cloud::Bigtable.new
|
|
127
127
|
#
|
|
128
128
|
# all_cluster_ids = bigtable.clusters.all.map do |cluster|
|
|
129
|
-
# puts cluster.
|
|
129
|
+
# puts cluster.cluster_id
|
|
130
130
|
# end
|
|
131
131
|
#
|
|
132
132
|
def all
|
|
@@ -37,10 +37,12 @@ module Google
|
|
|
37
37
|
# puts column_family.gc_rule
|
|
38
38
|
#
|
|
39
39
|
class ColumnFamily
|
|
40
|
-
|
|
40
|
+
##
|
|
41
|
+
# Name of the column family.
|
|
41
42
|
# @return [String]
|
|
42
43
|
attr_reader :name
|
|
43
44
|
|
|
45
|
+
##
|
|
44
46
|
# The garbage collection rule to be used for the column family.
|
|
45
47
|
# Optional. The service default value will be used when not specified.
|
|
46
48
|
# @return [Google::Cloud::Bigtable::GcRule, nil]
|
|
@@ -52,14 +54,6 @@ module Google
|
|
|
52
54
|
@gc_rule = gc_rule
|
|
53
55
|
end
|
|
54
56
|
|
|
55
|
-
# @private
|
|
56
|
-
# @return [Google::Bigtable::Admin::V2::ColumnFamily]
|
|
57
|
-
def to_grpc
|
|
58
|
-
grpc = Google::Bigtable::Admin::V2::ColumnFamily.new
|
|
59
|
-
grpc.gc_rule = gc_rule.to_grpc if gc_rule
|
|
60
|
-
grpc
|
|
61
|
-
end
|
|
62
|
-
|
|
63
57
|
# @private
|
|
64
58
|
#
|
|
65
59
|
# Create a new ColumnFamily instance from a {Google::Bigtable::Admin::V2::ColumnFamily}.
|
|
@@ -79,7 +79,7 @@ module Google
|
|
|
79
79
|
include Enumerable
|
|
80
80
|
|
|
81
81
|
##
|
|
82
|
-
#
|
|
82
|
+
# Creates a new ColumnFamilyMap object.
|
|
83
83
|
#
|
|
84
84
|
# @example
|
|
85
85
|
# require "google/cloud/bigtable"
|
|
@@ -108,14 +108,14 @@ module Google
|
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
##
|
|
111
|
-
# Calls block once for each column family in the map, passing
|
|
111
|
+
# Calls the block once for each column family in the map, passing
|
|
112
112
|
# the name and column family pair as parameters.
|
|
113
113
|
#
|
|
114
114
|
# If no block is given, an enumerator is returned instead.
|
|
115
115
|
#
|
|
116
|
-
# @yield [name, column_family] The name and column family pair
|
|
117
|
-
# @yieldparam [String] name the column family name
|
|
118
|
-
# @yieldparam [ColumnFamily] column_family the column family object
|
|
116
|
+
# @yield [name, column_family] The name and column family pair.
|
|
117
|
+
# @yieldparam [String] name the column family name.
|
|
118
|
+
# @yieldparam [ColumnFamily] column_family the column family object.
|
|
119
119
|
#
|
|
120
120
|
# @return [Enumerator]
|
|
121
121
|
#
|
|
@@ -183,7 +183,7 @@ module Google
|
|
|
183
183
|
# Adds a new column family to the table.
|
|
184
184
|
#
|
|
185
185
|
# @overload add(name, gc_rule: nil)
|
|
186
|
-
# @param name [String] Column family name
|
|
186
|
+
# @param name [String] Column family name.
|
|
187
187
|
# @param gc_rule [Google::Cloud::Bigtable::GcRule] The garbage
|
|
188
188
|
# collection rule to be used for the column family. Optional. The
|
|
189
189
|
# service default value will be used when not specified.
|
|
@@ -222,7 +222,7 @@ module Google
|
|
|
222
222
|
##
|
|
223
223
|
# Updates an existing column family in the table.
|
|
224
224
|
#
|
|
225
|
-
# @param name [String] Column family name
|
|
225
|
+
# @param name [String] Column family name.
|
|
226
226
|
# @param gc_rule [Google::Cloud::Bigtable::GcRule] The new garbage
|
|
227
227
|
# collection rule to be used for the column family. Optional. The
|
|
228
228
|
# service default value will be used when not specified.
|
|
@@ -258,7 +258,7 @@ module Google
|
|
|
258
258
|
##
|
|
259
259
|
# Deletes the named column family from the table.
|
|
260
260
|
#
|
|
261
|
-
# @param name [String] Column family name
|
|
261
|
+
# @param name [String] Column family name.
|
|
262
262
|
#
|
|
263
263
|
# @raise [ArgumentError] if the column family name does not exist.
|
|
264
264
|
# @raise [FrozenError] if the column family map is frozen.
|
|
@@ -60,7 +60,7 @@ module Google
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
##
|
|
63
|
-
#
|
|
63
|
+
# Gets the column family name.
|
|
64
64
|
#
|
|
65
65
|
# @return [String]
|
|
66
66
|
#
|
|
@@ -69,7 +69,7 @@ module Google
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
##
|
|
72
|
-
#
|
|
72
|
+
# Sets the column family name.
|
|
73
73
|
#
|
|
74
74
|
# @param name [String] Column family name
|
|
75
75
|
#
|
|
@@ -78,7 +78,7 @@ module Google
|
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
##
|
|
81
|
-
#
|
|
81
|
+
# Sets the column range with the lower bound.
|
|
82
82
|
#
|
|
83
83
|
# @param qualifier [String] Column qualifier name. Required
|
|
84
84
|
# @param inclusive [String] Lower bound flag. Inclusive/Exclusive.
|
|
@@ -111,7 +111,7 @@ module Google
|
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
##
|
|
114
|
-
#
|
|
114
|
+
# Sets the column range with the upper bound.
|
|
115
115
|
#
|
|
116
116
|
# @param qualifier [String] Column qualifier name. Required.
|
|
117
117
|
# @param inclusive [String] Upper bound flag. Inclusive/Exclusive.
|
|
@@ -144,7 +144,7 @@ module Google
|
|
|
144
144
|
end
|
|
145
145
|
|
|
146
146
|
##
|
|
147
|
-
#
|
|
147
|
+
# Sets the column range with the inclusive upper and lower bound.
|
|
148
148
|
#
|
|
149
149
|
# @param from_qualifier [String] Inclusive from qualifier. Required.
|
|
150
150
|
# @param to_qualifier [String] Inclusive to qualifier. Required.
|
|
@@ -163,7 +163,7 @@ module Google
|
|
|
163
163
|
end
|
|
164
164
|
|
|
165
165
|
##
|
|
166
|
-
#
|
|
166
|
+
# Sets the column range with the inclusive upper and the exclusive lower bound.
|
|
167
167
|
#
|
|
168
168
|
# @param from_qualifier [String] Inclusive from qualifier
|
|
169
169
|
# @param to_qualifier [String] Exclusive to qualifier
|
|
@@ -219,12 +219,12 @@ module Google
|
|
|
219
219
|
end
|
|
220
220
|
|
|
221
221
|
##
|
|
222
|
-
#
|
|
222
|
+
# Creates a GcRule instance with max number of versions.
|
|
223
223
|
#
|
|
224
224
|
# @param versions [Integer] Max number of versions
|
|
225
225
|
# @return [Google::Cloud::Bigtable::GcRule]
|
|
226
226
|
#
|
|
227
|
-
# @example
|
|
227
|
+
# @example
|
|
228
228
|
# require "google/cloud/bigtable"
|
|
229
229
|
#
|
|
230
230
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -240,12 +240,12 @@ module Google
|
|
|
240
240
|
end
|
|
241
241
|
|
|
242
242
|
##
|
|
243
|
-
#
|
|
243
|
+
# Creates a GcRule instance with max age.
|
|
244
244
|
#
|
|
245
245
|
# @param age [Integer] Max age in seconds.
|
|
246
246
|
# @return [Google::Cloud::Bigtable::GcRule]
|
|
247
247
|
#
|
|
248
|
-
# @example
|
|
248
|
+
# @example
|
|
249
249
|
# require "google/cloud/bigtable"
|
|
250
250
|
#
|
|
251
251
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -261,13 +261,13 @@ module Google
|
|
|
261
261
|
end
|
|
262
262
|
|
|
263
263
|
##
|
|
264
|
-
#
|
|
264
|
+
# Creates a union GcRule instance.
|
|
265
265
|
#
|
|
266
266
|
# @param rules [Google::Cloud::Bigtable::GcRule, Array<Google::Cloud::Bigtable::GcRule>]
|
|
267
267
|
# List of GcRule with nested rules.
|
|
268
268
|
# @return [Google::Cloud::Bigtable::GcRule]
|
|
269
269
|
#
|
|
270
|
-
# @example
|
|
270
|
+
# @example
|
|
271
271
|
# require "google/cloud/bigtable"
|
|
272
272
|
#
|
|
273
273
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -287,13 +287,13 @@ module Google
|
|
|
287
287
|
end
|
|
288
288
|
|
|
289
289
|
##
|
|
290
|
-
#
|
|
290
|
+
# Creates a intersection GCRule instance.
|
|
291
291
|
#
|
|
292
292
|
# @param rules [Google::Cloud::Bigtable::GcRule, Array<Google::Cloud::Bigtable::GcRule>]
|
|
293
293
|
# List of GcRule with nested rules.
|
|
294
294
|
# @return [Google::Cloud::Bigtable::GcRule]
|
|
295
295
|
#
|
|
296
|
-
# @example
|
|
296
|
+
# @example
|
|
297
297
|
# require "google/cloud/bigtable"
|
|
298
298
|
#
|
|
299
299
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -29,7 +29,7 @@ module Google
|
|
|
29
29
|
# # Instance
|
|
30
30
|
#
|
|
31
31
|
# Represents a Bigtable instance. Instances are dedicated Bigtable
|
|
32
|
-
# storage resources that Bigtable tables.
|
|
32
|
+
# storage resources that contain Bigtable tables.
|
|
33
33
|
#
|
|
34
34
|
# See {Google::Cloud::Bigtable::Project#instances},
|
|
35
35
|
# {Google::Cloud::Bigtable::Project#instance}, and
|
|
@@ -46,7 +46,7 @@ module Google
|
|
|
46
46
|
# type: :DEVELOPMENT,
|
|
47
47
|
# labels: { "env" => "dev"}
|
|
48
48
|
# ) do |clusters|
|
|
49
|
-
# clusters.add("test-cluster", "us-east1-b"
|
|
49
|
+
# clusters.add("test-cluster", "us-east1-b") # nodes not allowed
|
|
50
50
|
# end
|
|
51
51
|
#
|
|
52
52
|
# job.done? #=> false
|
|
@@ -75,7 +75,7 @@ module Google
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
##
|
|
78
|
-
# The unique identifier for the project.
|
|
78
|
+
# The unique identifier for the project to which the instance belongs.
|
|
79
79
|
#
|
|
80
80
|
# @return [String]
|
|
81
81
|
#
|
|
@@ -93,7 +93,7 @@ module Google
|
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
##
|
|
96
|
-
# The descriptive name for
|
|
96
|
+
# The descriptive name for the instance as it appears in UIs. Must be
|
|
97
97
|
# unique per project and between 4 and 30 characters long.
|
|
98
98
|
#
|
|
99
99
|
# @return [String]
|
|
@@ -103,11 +103,11 @@ module Google
|
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
##
|
|
106
|
-
# Updates the descriptive name for
|
|
106
|
+
# Updates the descriptive name for the instance as it appears in UIs.
|
|
107
107
|
# Can be changed at any time, but should be kept globally unique
|
|
108
108
|
# to avoid confusion.
|
|
109
109
|
#
|
|
110
|
-
# @param value [String] The descriptive name for
|
|
110
|
+
# @param value [String] The descriptive name for the instance.
|
|
111
111
|
#
|
|
112
112
|
def display_name= value
|
|
113
113
|
@grpc.display_name = value
|
|
@@ -154,8 +154,7 @@ module Google
|
|
|
154
154
|
end
|
|
155
155
|
|
|
156
156
|
##
|
|
157
|
-
# Instance type. Possible values
|
|
158
|
-
# `:TYPE_UNSPECIFIED`
|
|
157
|
+
# Instance type. Possible values include `:DEVELOPMENT` and `:PRODUCTION`.
|
|
159
158
|
#
|
|
160
159
|
# @return [Symbol]
|
|
161
160
|
#
|
|
@@ -167,10 +166,10 @@ module Google
|
|
|
167
166
|
# The instance is meant for development and testing purposes only; it has
|
|
168
167
|
# no performance or uptime guarantees and is not covered by SLA.
|
|
169
168
|
# After a development instance is created, it can be upgraded by
|
|
170
|
-
# updating the instance to type
|
|
169
|
+
# updating the instance to type `:PRODUCTION`. An instance created
|
|
171
170
|
# as a production instance cannot be changed to a development instance.
|
|
172
|
-
# When creating a development instance, `
|
|
173
|
-
# not be set.
|
|
171
|
+
# When creating a development instance, `nodes` on the cluster must
|
|
172
|
+
# not be set. (See {#create_cluster}.)
|
|
174
173
|
#
|
|
175
174
|
# @return [Boolean]
|
|
176
175
|
#
|
|
@@ -179,8 +178,8 @@ module Google
|
|
|
179
178
|
end
|
|
180
179
|
|
|
181
180
|
##
|
|
182
|
-
# An instance meant for production use. `
|
|
183
|
-
# on the cluster.
|
|
181
|
+
# An instance meant for production use. Requires that `nodes` must be set
|
|
182
|
+
# on the cluster. (See {#create_cluster}.)
|
|
184
183
|
#
|
|
185
184
|
# @return [Boolean]
|
|
186
185
|
#
|
|
@@ -189,22 +188,34 @@ module Google
|
|
|
189
188
|
end
|
|
190
189
|
|
|
191
190
|
##
|
|
192
|
-
#
|
|
191
|
+
# Sets the instance type.
|
|
193
192
|
#
|
|
194
|
-
# Valid values are `:DEVELOPMENT
|
|
193
|
+
# Valid values are `:DEVELOPMENT` and `:PRODUCTION`.
|
|
195
194
|
# After a development instance is created, it can be upgraded
|
|
196
|
-
# by updating the instance to type
|
|
195
|
+
# by updating the instance to type `:PRODUCTION`.
|
|
197
196
|
# An instance created as a production instance cannot be changed to a
|
|
198
197
|
# development instance.
|
|
199
198
|
#
|
|
200
199
|
# @param instance_type [Symbol]
|
|
201
200
|
#
|
|
201
|
+
# @example
|
|
202
|
+
# require "google/cloud/bigtable"
|
|
203
|
+
#
|
|
204
|
+
# bigtable = Google::Cloud::Bigtable.new
|
|
205
|
+
#
|
|
206
|
+
# instance = bigtable.instance("my-instance")
|
|
207
|
+
#
|
|
208
|
+
# instance.development? # true
|
|
209
|
+
# instance.type = :PRODUCTION
|
|
210
|
+
# instance.development? # false
|
|
211
|
+
# instance.production? # true
|
|
212
|
+
#
|
|
202
213
|
def type= instance_type
|
|
203
214
|
@grpc.type = instance_type
|
|
204
215
|
end
|
|
205
216
|
|
|
206
217
|
##
|
|
207
|
-
#
|
|
218
|
+
# Gets the Cloud Labels for the instance.
|
|
208
219
|
#
|
|
209
220
|
# Cloud Labels are a flexible and lightweight mechanism for organizing
|
|
210
221
|
# cloud resources into groups that reflect a customer's organizational
|
|
@@ -226,7 +237,7 @@ module Google
|
|
|
226
237
|
end
|
|
227
238
|
|
|
228
239
|
##
|
|
229
|
-
#
|
|
240
|
+
# Sets the Cloud Labels for the instance.
|
|
230
241
|
#
|
|
231
242
|
# @param labels [Hash{String=>String}] The Cloud Labels.
|
|
232
243
|
#
|
|
@@ -239,10 +250,10 @@ module Google
|
|
|
239
250
|
end
|
|
240
251
|
|
|
241
252
|
##
|
|
242
|
-
#
|
|
253
|
+
# Updates the instance.
|
|
243
254
|
#
|
|
244
|
-
# Updatable attributes are
|
|
245
|
-
# * `display_name` - The descriptive name for
|
|
255
|
+
# Updatable attributes are:
|
|
256
|
+
# * `display_name` - The descriptive name for the instance.
|
|
246
257
|
# * `type` - `:DEVELOPMENT` type instance can be upgraded to `:PRODUCTION` instance.
|
|
247
258
|
# An instance created as a production instance cannot be changed to a development instance.
|
|
248
259
|
# * `labels` - Cloud Labels are a flexible and lightweight mechanism for organizing cloud resources.
|
|
@@ -250,6 +261,7 @@ module Google
|
|
|
250
261
|
# @return [Google::Cloud::Bigtable::Instance::Job]
|
|
251
262
|
# The job representing the long-running, asynchronous processing of
|
|
252
263
|
# an instance update operation.
|
|
264
|
+
#
|
|
253
265
|
# @example
|
|
254
266
|
# require "google/cloud/bigtable"
|
|
255
267
|
#
|
|
@@ -283,7 +295,7 @@ module Google
|
|
|
283
295
|
alias update save
|
|
284
296
|
|
|
285
297
|
##
|
|
286
|
-
#
|
|
298
|
+
# Reloads instance data.
|
|
287
299
|
#
|
|
288
300
|
# @return [Google::Cloud::Bigtable::Instance]
|
|
289
301
|
#
|
|
@@ -293,7 +305,7 @@ module Google
|
|
|
293
305
|
end
|
|
294
306
|
|
|
295
307
|
##
|
|
296
|
-
# Permanently deletes the instance from
|
|
308
|
+
# Permanently deletes the instance from the project.
|
|
297
309
|
#
|
|
298
310
|
# @return [Boolean] Returns `true` if the instance was deleted.
|
|
299
311
|
#
|
|
@@ -312,16 +324,16 @@ module Google
|
|
|
312
324
|
end
|
|
313
325
|
|
|
314
326
|
##
|
|
315
|
-
# Lists
|
|
327
|
+
# Lists the clusters in the instance.
|
|
316
328
|
#
|
|
317
|
-
#
|
|
318
|
-
#
|
|
329
|
+
# See {Google::Cloud::Bigtable::Cluster#delete} and
|
|
330
|
+
# {Google::Cloud::Bigtable::Cluster#save}.
|
|
319
331
|
#
|
|
320
332
|
# @param token [String] The `token` value returned by the last call to
|
|
321
333
|
# `clusters`; indicates that this is a continuation of a call
|
|
322
334
|
# and that the system should return the next page of data.
|
|
323
335
|
# @return [Array<Google::Cloud::Bigtable::Cluster>]
|
|
324
|
-
#
|
|
336
|
+
# See({Google::Cloud::Bigtable::Cluster::List})
|
|
325
337
|
#
|
|
326
338
|
# @example
|
|
327
339
|
# require "google/cloud/bigtable"
|
|
@@ -341,10 +353,10 @@ module Google
|
|
|
341
353
|
end
|
|
342
354
|
|
|
343
355
|
##
|
|
344
|
-
# Gets cluster
|
|
356
|
+
# Gets a cluster in the instance.
|
|
345
357
|
#
|
|
346
|
-
#
|
|
347
|
-
#
|
|
358
|
+
# See {Google::Cloud::Bigtable::Cluster#delete} and
|
|
359
|
+
# {Google::Cloud::Bigtable::Cluster#save}.
|
|
348
360
|
#
|
|
349
361
|
# @param cluster_id [String] The unique ID of the requested cluster.
|
|
350
362
|
# @return [Google::Cloud::Bigtable::Cluster, nil]
|
|
@@ -368,11 +380,10 @@ module Google
|
|
|
368
380
|
end
|
|
369
381
|
|
|
370
382
|
##
|
|
371
|
-
# Creates a cluster
|
|
383
|
+
# Creates a cluster in the instance.
|
|
372
384
|
#
|
|
373
385
|
# @param cluster_id [String]
|
|
374
|
-
# The ID to be used when referring to the new cluster within its instance
|
|
375
|
-
# e.g., just `mycluster`
|
|
386
|
+
# The ID to be used when referring to the new cluster within its instance.
|
|
376
387
|
# @param location [String]
|
|
377
388
|
# The location where this cluster's nodes and storage reside. For best
|
|
378
389
|
# performance, clients should be located as close as possible to this
|
|
@@ -426,10 +437,10 @@ module Google
|
|
|
426
437
|
end
|
|
427
438
|
|
|
428
439
|
##
|
|
429
|
-
#
|
|
440
|
+
# Lists all tables in the instance.
|
|
430
441
|
#
|
|
431
|
-
# See
|
|
432
|
-
#
|
|
442
|
+
# See {Google::Cloud::Bigtable::Table#delete} and
|
|
443
|
+
# {Google::Cloud::Bigtable::Table#save}.
|
|
433
444
|
#
|
|
434
445
|
# @return [Array<Google::Cloud::Bigtable::Table>]
|
|
435
446
|
# (See {Google::Cloud::Bigtable::Table::List})
|
|
@@ -453,10 +464,10 @@ module Google
|
|
|
453
464
|
end
|
|
454
465
|
|
|
455
466
|
##
|
|
456
|
-
#
|
|
467
|
+
# Gets metadata information of a table in the instance.
|
|
457
468
|
#
|
|
458
469
|
# @param view [Symbol]
|
|
459
|
-
# The view to be applied to the returned tables' fields
|
|
470
|
+
# The view to be applied to the returned tables' fields.
|
|
460
471
|
# Defaults to `SCHEMA_VIEW` if unspecified.
|
|
461
472
|
# Valid view types are.
|
|
462
473
|
# * `:NAME_ONLY` - Only populates `name`
|
|
@@ -481,7 +492,6 @@ module Google
|
|
|
481
492
|
#
|
|
482
493
|
# instance = bigtable.instance("my-instance")
|
|
483
494
|
#
|
|
484
|
-
# # Default view is full view
|
|
485
495
|
# table = instance.table("my-table", perform_lookup: true)
|
|
486
496
|
# puts table.name
|
|
487
497
|
# puts table.column_families
|
|
@@ -490,7 +500,7 @@ module Google
|
|
|
490
500
|
# table = instance.table("my-table", view: :NAME_ONLY, perform_lookup: true)
|
|
491
501
|
# puts table.name
|
|
492
502
|
#
|
|
493
|
-
# @example Mutate rows
|
|
503
|
+
# @example Mutate rows.
|
|
494
504
|
# require "google/cloud/bigtable"
|
|
495
505
|
#
|
|
496
506
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -524,14 +534,14 @@ module Google
|
|
|
524
534
|
end
|
|
525
535
|
|
|
526
536
|
##
|
|
527
|
-
# Creates a new table.
|
|
537
|
+
# Creates a new table in the instance.
|
|
528
538
|
#
|
|
529
539
|
# The table can be created with a full set of initial column families,
|
|
530
540
|
# specified in the request.
|
|
531
541
|
#
|
|
532
542
|
# @param name [String]
|
|
533
543
|
# The name by which the new table should be referred to within the parent
|
|
534
|
-
# instance
|
|
544
|
+
# instance.
|
|
535
545
|
# @param column_families [Google::Cloud::Bigtable::ColumnFamilyMap]
|
|
536
546
|
# An object containing the column families for the table, mapped by
|
|
537
547
|
# column family name.
|
|
@@ -610,11 +620,11 @@ module Google
|
|
|
610
620
|
end
|
|
611
621
|
|
|
612
622
|
##
|
|
613
|
-
#
|
|
614
|
-
# Only one routing policy can applied to app profile. The policy can be
|
|
623
|
+
# Creates an app profile for the instance with a routing policy.
|
|
624
|
+
# Only one routing policy can applied to the app profile. The policy can be
|
|
615
625
|
# multi-cluster routing or single cluster routing.
|
|
616
626
|
#
|
|
617
|
-
# @param name [String] Unique
|
|
627
|
+
# @param name [String] Unique ID of the app profile.
|
|
618
628
|
# @param routing_policy [Google::Cloud::Bigtable::RoutingPolicy]
|
|
619
629
|
# The routing policy for all read/write requests that use this app
|
|
620
630
|
# profile. A value must be explicitly set.
|
|
@@ -630,7 +640,7 @@ module Google
|
|
|
630
640
|
# preserves read-your-writes consistency but does not improve
|
|
631
641
|
# availability. Value contains `cluster_id` and optional field
|
|
632
642
|
# `allow_transactional_writes`.
|
|
633
|
-
# @param description [String] Description of the use case for this app profile
|
|
643
|
+
# @param description [String] Description of the use case for this app profile.
|
|
634
644
|
# @param etag [String]
|
|
635
645
|
# Strongly validated etag for optimistic concurrency control. Preserve the
|
|
636
646
|
# value returned from `GetAppProfile` when calling `UpdateAppProfile` to
|
|
@@ -641,10 +651,10 @@ module Google
|
|
|
641
651
|
# [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more details.
|
|
642
652
|
# @param ignore_warnings [Boolean]
|
|
643
653
|
# If true, ignore safety checks when creating the app profile.
|
|
644
|
-
# Default value is `false
|
|
654
|
+
# Default value is `false`.
|
|
645
655
|
# @return [Google::Cloud::Bigtable::AppProfile]
|
|
646
656
|
#
|
|
647
|
-
# @example Create an app profile with a single cluster routing policy
|
|
657
|
+
# @example Create an app profile with a single cluster routing policy.
|
|
648
658
|
# require "google/cloud/bigtable"
|
|
649
659
|
#
|
|
650
660
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -663,7 +673,7 @@ module Google
|
|
|
663
673
|
# )
|
|
664
674
|
# puts app_profile.name
|
|
665
675
|
#
|
|
666
|
-
# @example Create an app profile with multi-cluster routing policy
|
|
676
|
+
# @example Create an app profile with multi-cluster routing policy.
|
|
667
677
|
# require "google/cloud/bigtable"
|
|
668
678
|
#
|
|
669
679
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -722,10 +732,10 @@ module Google
|
|
|
722
732
|
end
|
|
723
733
|
|
|
724
734
|
##
|
|
725
|
-
#
|
|
735
|
+
# Gets an app profile in the instance.
|
|
726
736
|
#
|
|
727
|
-
#
|
|
728
|
-
#
|
|
737
|
+
# See {Google::Cloud::Bigtable::AppProfile#delete} and
|
|
738
|
+
# {Google::Cloud::Bigtable::AppProfile#save}.
|
|
729
739
|
#
|
|
730
740
|
# @param app_profile_id [String] The unique name of the requested app profile.
|
|
731
741
|
# @return [Google::Cloud::Bigtable::AppProfile, nil]
|
|
@@ -752,13 +762,13 @@ module Google
|
|
|
752
762
|
end
|
|
753
763
|
|
|
754
764
|
##
|
|
755
|
-
#
|
|
765
|
+
# Lists all app profiles in the instance.
|
|
756
766
|
#
|
|
757
|
-
#
|
|
758
|
-
#
|
|
767
|
+
# See {Google::Cloud::Bigtable::AppProfile#delete} and
|
|
768
|
+
# {Google::Cloud::Bigtable::AppProfile#save}.
|
|
759
769
|
#
|
|
760
770
|
# @return [Array<Google::Cloud::Bigtable::AppProfile>]
|
|
761
|
-
#
|
|
771
|
+
# (See {Google::Cloud::Bigtable::AppProfile::List})
|
|
762
772
|
#
|
|
763
773
|
# @example
|
|
764
774
|
# require "google/cloud/bigtable"
|
|
@@ -779,7 +789,7 @@ module Google
|
|
|
779
789
|
|
|
780
790
|
##
|
|
781
791
|
# Gets the [Cloud IAM](https://cloud.google.com/iam/) access control
|
|
782
|
-
# policy for
|
|
792
|
+
# policy for the instance.
|
|
783
793
|
#
|
|
784
794
|
# @see https://cloud.google.com/bigtable/docs/access-control
|
|
785
795
|
#
|
|
@@ -788,9 +798,9 @@ module Google
|
|
|
788
798
|
# the block completes, the modified policy will be written to the
|
|
789
799
|
# service.
|
|
790
800
|
# @yieldparam [Policy] policy the current Cloud IAM Policy for this
|
|
791
|
-
# instance
|
|
801
|
+
# instance.
|
|
792
802
|
#
|
|
793
|
-
# @return [Policy] The current Cloud IAM Policy for
|
|
803
|
+
# @return [Policy] The current Cloud IAM Policy for the instance.
|
|
794
804
|
#
|
|
795
805
|
# @example
|
|
796
806
|
# require "google/cloud/bigtable"
|
|
@@ -800,7 +810,7 @@ module Google
|
|
|
800
810
|
# instance = bigtable.instance("my-instance")
|
|
801
811
|
# policy = instance.policy
|
|
802
812
|
#
|
|
803
|
-
# @example Update the policy by passing a block
|
|
813
|
+
# @example Update the policy by passing a block.
|
|
804
814
|
# require "google/cloud/bigtable"
|
|
805
815
|
#
|
|
806
816
|
# bigtable = Google::Cloud::Bigtable.new
|
|
@@ -821,7 +831,7 @@ module Google
|
|
|
821
831
|
|
|
822
832
|
##
|
|
823
833
|
# Updates the [Cloud IAM](https://cloud.google.com/iam/) access control
|
|
824
|
-
# policy for
|
|
834
|
+
# policy for the instance. The policy should be read from {#policy}.
|
|
825
835
|
# See {Google::Cloud::Bigtable::Policy} for an explanation of the policy
|
|
826
836
|
# `etag` property and how to modify policies.
|
|
827
837
|
#
|
|
@@ -844,7 +854,7 @@ module Google
|
|
|
844
854
|
# policy.add("roles/owner", "user:owner@example.com")
|
|
845
855
|
# updated_policy = instance.update_policy(policy)
|
|
846
856
|
#
|
|
847
|
-
# puts
|
|
857
|
+
# puts updated_policy.roles
|
|
848
858
|
#
|
|
849
859
|
def update_policy new_policy
|
|
850
860
|
ensure_service!
|
|
@@ -857,13 +867,13 @@ module Google
|
|
|
857
867
|
# Tests the specified permissions against the [Cloud
|
|
858
868
|
# IAM](https://cloud.google.com/iam/) access control policy.
|
|
859
869
|
#
|
|
860
|
-
# @see https://cloud.google.com/iam/docs/managing-policies Managing
|
|
861
|
-
#
|
|
870
|
+
# @see https://cloud.google.com/iam/docs/managing-policies Managing Policies
|
|
871
|
+
# @see https://cloud.google.com/bigtable/docs/access-control Access Control
|
|
862
872
|
#
|
|
863
873
|
# @param permissions [String, Array<String>] permissions The set of permissions to
|
|
864
874
|
# check access for. Permissions with wildcards (such as `*` or
|
|
865
875
|
# `bigtable.*`) are not allowed.
|
|
866
|
-
# See (https://cloud.google.com/bigtable/docs/access-control)
|
|
876
|
+
# See [Access Control](https://cloud.google.com/bigtable/docs/access-control).
|
|
867
877
|
#
|
|
868
878
|
# Some of the permissions that can be checked on a instance are:
|
|
869
879
|
# * bigtable.instances.create
|
|
@@ -874,7 +884,7 @@ module Google
|
|
|
874
884
|
# * bigtable.tables.get
|
|
875
885
|
# * bigtable.tables.list
|
|
876
886
|
#
|
|
877
|
-
# @return [Array<
|
|
887
|
+
# @return [Array<String>] The permissions that are configured for the policy.
|
|
878
888
|
#
|
|
879
889
|
# @example
|
|
880
890
|
# require "google/cloud/bigtable"
|
|
@@ -892,11 +902,8 @@ module Google
|
|
|
892
902
|
#
|
|
893
903
|
def test_iam_permissions *permissions
|
|
894
904
|
ensure_service!
|
|
895
|
-
grpc = service.test_instance_permissions
|
|
896
|
-
|
|
897
|
-
Array(permissions).flatten
|
|
898
|
-
)
|
|
899
|
-
grpc.permissions
|
|
905
|
+
grpc = service.test_instance_permissions instance_id, permissions.flatten
|
|
906
|
+
grpc.permissions.to_a
|
|
900
907
|
end
|
|
901
908
|
|
|
902
909
|
# @private
|