google-cloud-bigtable-v2 0.3.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/README.md +1 -1
- data/lib/google/bigtable/v2/bigtable_pb.rb +11 -2
- data/lib/google/bigtable/v2/bigtable_services_pb.rb +5 -2
- data/lib/google/cloud/bigtable/v2/bigtable/client.rb +263 -41
- data/lib/google/cloud/bigtable/v2/bigtable/paths.rb +17 -0
- data/lib/google/cloud/bigtable/v2/version.rb +1 -1
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/api/routing.rb +459 -0
- data/proto_docs/google/bigtable/v2/bigtable.rb +23 -2
- data/proto_docs/google/bigtable/v2/data.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9fa234bc4b468a542653487a866f84e3783cbc4f779b295aca972fcc1e78506
|
4
|
+
data.tar.gz: db085ca8f0130e79c75021b9474d12dcedf0e1f9e72bb199ce54f3828f1fd334
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d5443bce3015996a3dc2a2aafdbefe524b0870806cb3da9b35ce3fa1c3c28bf42c35448f980fca94f0914e2c1f502af9c16babcf60a708714d8ec9223298b5a
|
7
|
+
data.tar.gz: f346ca810c1d682b34ca9ea4540a3973e3c45f0a836a6e81ab5e7d0ad828ad77f19d6c03acec78d364b02f9023d1145dd2479cf76cbeddf05f50f26dafe0255a
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
121
121
|
*should* only be used during development.
|
122
122
|
|
123
|
-
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
124
|
-
[dev-console]: https://console.cloud.google.com/project
|
125
|
-
|
126
|
-
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
127
|
-
|
128
|
-
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
129
|
-
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
130
|
-
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
131
|
-
|
132
123
|
## Creating a Service Account
|
133
124
|
|
134
125
|
Google Cloud requires **Service Account Credentials** to
|
@@ -139,31 +130,22 @@ If you are not running this client within
|
|
139
130
|
[Google Cloud Platform environments](#google-cloud-platform-environments), you
|
140
131
|
need a Google Developers service account.
|
141
132
|
|
142
|
-
1. Visit the [Google
|
133
|
+
1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
|
143
134
|
2. Create a new project or click on an existing project.
|
144
|
-
3. Activate the
|
135
|
+
3. Activate the menu in the upper left and select **APIs & Services**. From
|
145
136
|
here, you will enable the APIs that your application requires.
|
146
137
|
|
147
|
-
![Enable the APIs that your application requires][enable-apis]
|
148
|
-
|
149
138
|
*Note: You may need to enable billing in order to use these services.*
|
150
139
|
|
151
140
|
4. Select **Credentials** from the side navigation.
|
152
141
|
|
153
|
-
|
154
|
-
|
155
|
-
![Create a new service account][create-new-service-account]
|
156
|
-
|
157
|
-
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
158
|
-
|
159
|
-
Find the "Add credentials" drop down and select "Service account" to be
|
160
|
-
guided through downloading a new JSON key file.
|
142
|
+
Find the "Create credentials" drop down near the top of the page, and select
|
143
|
+
"Service account" to be guided through downloading a new JSON key file.
|
161
144
|
|
162
145
|
If you want to re-use an existing service account, you can easily generate a
|
163
|
-
new key file. Just select the account you wish to re-use,
|
164
|
-
|
165
|
-
|
166
|
-
![Re-use an existing service account][reuse-service-account]
|
146
|
+
new key file. Just select the account you wish to re-use, click the pencil
|
147
|
+
tool on the right side to edit the service account, select the **Keys** tab,
|
148
|
+
and then select **Add Key**.
|
167
149
|
|
168
150
|
The key file you download will be used by this library to authenticate API
|
169
151
|
requests and should be stored in a secure location.
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Bigtable::V2::ReadRowsRequest.new # (request fields a
|
|
37
37
|
response = client.read_rows request
|
38
38
|
```
|
39
39
|
|
40
|
-
View the [Client Library Documentation](https://
|
40
|
+
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-bigtable-v2/latest)
|
41
41
|
for class and method documentation.
|
42
42
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/bigtable)
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/bigtable/v2/bigtable.proto
|
3
3
|
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/annotations_pb'
|
7
5
|
require 'google/api/client_pb'
|
8
6
|
require 'google/api/field_behavior_pb'
|
9
7
|
require 'google/api/resource_pb'
|
8
|
+
require 'google/api/routing_pb'
|
10
9
|
require 'google/bigtable/v2/data_pb'
|
11
10
|
require 'google/protobuf/wrappers_pb'
|
12
11
|
require 'google/rpc/status_pb'
|
12
|
+
require 'google/protobuf'
|
13
|
+
|
13
14
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
15
|
add_file("google/bigtable/v2/bigtable.proto", :syntax => :proto3) do
|
15
16
|
add_message "google.bigtable.v2.ReadRowsRequest" do
|
@@ -79,6 +80,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
79
80
|
add_message "google.bigtable.v2.CheckAndMutateRowResponse" do
|
80
81
|
optional :predicate_matched, :bool, 1
|
81
82
|
end
|
83
|
+
add_message "google.bigtable.v2.PingAndWarmRequest" do
|
84
|
+
optional :name, :string, 1
|
85
|
+
optional :app_profile_id, :string, 2
|
86
|
+
end
|
87
|
+
add_message "google.bigtable.v2.PingAndWarmResponse" do
|
88
|
+
end
|
82
89
|
add_message "google.bigtable.v2.ReadModifyWriteRowRequest" do
|
83
90
|
optional :table_name, :string, 1
|
84
91
|
optional :app_profile_id, :string, 4
|
@@ -108,6 +115,8 @@ module Google
|
|
108
115
|
MutateRowsResponse::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsResponse.Entry").msgclass
|
109
116
|
CheckAndMutateRowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.CheckAndMutateRowRequest").msgclass
|
110
117
|
CheckAndMutateRowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.CheckAndMutateRowResponse").msgclass
|
118
|
+
PingAndWarmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.PingAndWarmRequest").msgclass
|
119
|
+
PingAndWarmResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.PingAndWarmResponse").msgclass
|
111
120
|
ReadModifyWriteRowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadModifyWriteRowRequest").msgclass
|
112
121
|
ReadModifyWriteRowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadModifyWriteRowResponse").msgclass
|
113
122
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/bigtable/v2/bigtable.proto for package 'Google.Cloud.Bigtable.V2'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright 2019 Google LLC
|
4
|
+
# Copyright 2019 Google LLC
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
# Service for reading from and writing to existing Bigtable tables.
|
28
28
|
class Service
|
29
29
|
|
30
|
-
include GRPC::GenericService
|
30
|
+
include ::GRPC::GenericService
|
31
31
|
|
32
32
|
self.marshal_class_method = :encode
|
33
33
|
self.unmarshal_class_method = :decode
|
@@ -53,6 +53,9 @@ module Google
|
|
53
53
|
rpc :MutateRows, ::Google::Cloud::Bigtable::V2::MutateRowsRequest, stream(::Google::Cloud::Bigtable::V2::MutateRowsResponse)
|
54
54
|
# Mutates a row atomically based on the output of a predicate Reader filter.
|
55
55
|
rpc :CheckAndMutateRow, ::Google::Cloud::Bigtable::V2::CheckAndMutateRowRequest, ::Google::Cloud::Bigtable::V2::CheckAndMutateRowResponse
|
56
|
+
# Warm up associated instance metadata for this connection.
|
57
|
+
# This call is not required but may be useful for connection keep-alive.
|
58
|
+
rpc :PingAndWarm, ::Google::Cloud::Bigtable::V2::PingAndWarmRequest, ::Google::Cloud::Bigtable::V2::PingAndWarmResponse
|
56
59
|
# Modifies a row atomically on the server. The method reads the latest
|
57
60
|
# existing timestamp and value from the specified columns and writes a new
|
58
61
|
# entry based on pre-defined read/modify/write rules. The new value for the
|
@@ -65,14 +65,8 @@ module Google
|
|
65
65
|
default_config = Client::Configuration.new parent_config
|
66
66
|
|
67
67
|
default_config.rpcs.read_rows.timeout = 43_200.0
|
68
|
-
default_config.rpcs.read_rows.retry_policy = {
|
69
|
-
initial_delay: 0.01, max_delay: 60.0, multiplier: 2, retry_codes: []
|
70
|
-
}
|
71
68
|
|
72
69
|
default_config.rpcs.sample_row_keys.timeout = 60.0
|
73
|
-
default_config.rpcs.sample_row_keys.retry_policy = {
|
74
|
-
initial_delay: 0.01, max_delay: 60.0, multiplier: 2, retry_codes: []
|
75
|
-
}
|
76
70
|
|
77
71
|
default_config.rpcs.mutate_row.timeout = 60.0
|
78
72
|
default_config.rpcs.mutate_row.retry_policy = {
|
@@ -80,19 +74,10 @@ module Google
|
|
80
74
|
}
|
81
75
|
|
82
76
|
default_config.rpcs.mutate_rows.timeout = 600.0
|
83
|
-
default_config.rpcs.mutate_rows.retry_policy = {
|
84
|
-
initial_delay: 0.01, max_delay: 60.0, multiplier: 2, retry_codes: []
|
85
|
-
}
|
86
77
|
|
87
78
|
default_config.rpcs.check_and_mutate_row.timeout = 20.0
|
88
|
-
default_config.rpcs.check_and_mutate_row.retry_policy = {
|
89
|
-
initial_delay: 0.01, max_delay: 60.0, multiplier: 2, retry_codes: []
|
90
|
-
}
|
91
79
|
|
92
80
|
default_config.rpcs.read_modify_write_row.timeout = 20.0
|
93
|
-
default_config.rpcs.read_modify_write_row.retry_policy = {
|
94
|
-
initial_delay: 0.01, max_delay: 60.0, multiplier: 2, retry_codes: []
|
95
|
-
}
|
96
81
|
|
97
82
|
default_config
|
98
83
|
end
|
@@ -204,12 +189,13 @@ module Google
|
|
204
189
|
# This value specifies routing for replication. If not specified, the
|
205
190
|
# "default" application profile will be used.
|
206
191
|
# @param rows [::Google::Cloud::Bigtable::V2::RowSet, ::Hash]
|
207
|
-
# The row keys and/or ranges to read. If not specified, reads
|
192
|
+
# The row keys and/or ranges to read sequentially. If not specified, reads
|
193
|
+
# from all rows.
|
208
194
|
# @param filter [::Google::Cloud::Bigtable::V2::RowFilter, ::Hash]
|
209
195
|
# The filter to apply to the contents of the specified row(s). If unset,
|
210
196
|
# reads the entirety of each row.
|
211
197
|
# @param rows_limit [::Integer]
|
212
|
-
# The read will
|
198
|
+
# The read will stop after committing to N rows' worth of results. The
|
213
199
|
# default (zero) is to return all results.
|
214
200
|
#
|
215
201
|
# @yield [response, operation] Access the result along with the RPC operation
|
@@ -220,6 +206,24 @@ module Google
|
|
220
206
|
#
|
221
207
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
222
208
|
#
|
209
|
+
# @example Basic example
|
210
|
+
# require "google/cloud/bigtable/v2"
|
211
|
+
#
|
212
|
+
# # Create a client object. The client can be reused for multiple calls.
|
213
|
+
# client = Google::Cloud::Bigtable::V2::Bigtable::Client.new
|
214
|
+
#
|
215
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
216
|
+
# request = Google::Cloud::Bigtable::V2::ReadRowsRequest.new
|
217
|
+
#
|
218
|
+
# # Call the read_rows method.
|
219
|
+
# result = client.read_rows request
|
220
|
+
#
|
221
|
+
# # The returned object is a streamed enumerable yielding elements of
|
222
|
+
# # type ::Google::Cloud::Bigtable::V2::ReadRowsResponse.
|
223
|
+
# result.each do |response|
|
224
|
+
# p response
|
225
|
+
# end
|
226
|
+
#
|
223
227
|
def read_rows request, options = nil
|
224
228
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
225
229
|
|
@@ -237,10 +241,16 @@ module Google
|
|
237
241
|
gapic_version: ::Google::Cloud::Bigtable::V2::VERSION
|
238
242
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
239
243
|
|
240
|
-
header_params = {
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
+
header_params = {}
|
245
|
+
if request.table_name &&
|
246
|
+
%r{^projects/[^/]+/instances/[^/]+/tables/[^/]+/?$}.match?(request.table_name)
|
247
|
+
header_params["table_name"] = request.table_name
|
248
|
+
end
|
249
|
+
if request.app_profile_id && !request.app_profile_id.empty?
|
250
|
+
header_params["app_profile_id"] = request.app_profile_id
|
251
|
+
end
|
252
|
+
|
253
|
+
request_params_header = URI.encode_www_form header_params
|
244
254
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
245
255
|
|
246
256
|
options.apply_defaults timeout: @config.rpcs.read_rows.timeout,
|
@@ -296,6 +306,24 @@ module Google
|
|
296
306
|
#
|
297
307
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
298
308
|
#
|
309
|
+
# @example Basic example
|
310
|
+
# require "google/cloud/bigtable/v2"
|
311
|
+
#
|
312
|
+
# # Create a client object. The client can be reused for multiple calls.
|
313
|
+
# client = Google::Cloud::Bigtable::V2::Bigtable::Client.new
|
314
|
+
#
|
315
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
316
|
+
# request = Google::Cloud::Bigtable::V2::SampleRowKeysRequest.new
|
317
|
+
#
|
318
|
+
# # Call the sample_row_keys method.
|
319
|
+
# result = client.sample_row_keys request
|
320
|
+
#
|
321
|
+
# # The returned object is a streamed enumerable yielding elements of
|
322
|
+
# # type ::Google::Cloud::Bigtable::V2::SampleRowKeysResponse.
|
323
|
+
# result.each do |response|
|
324
|
+
# p response
|
325
|
+
# end
|
326
|
+
#
|
299
327
|
def sample_row_keys request, options = nil
|
300
328
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
301
329
|
|
@@ -313,10 +341,16 @@ module Google
|
|
313
341
|
gapic_version: ::Google::Cloud::Bigtable::V2::VERSION
|
314
342
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
315
343
|
|
316
|
-
header_params = {
|
317
|
-
|
318
|
-
|
319
|
-
|
344
|
+
header_params = {}
|
345
|
+
if request.table_name &&
|
346
|
+
%r{^projects/[^/]+/instances/[^/]+/tables/[^/]+/?$}.match?(request.table_name)
|
347
|
+
header_params["table_name"] = request.table_name
|
348
|
+
end
|
349
|
+
if request.app_profile_id && !request.app_profile_id.empty?
|
350
|
+
header_params["app_profile_id"] = request.app_profile_id
|
351
|
+
end
|
352
|
+
|
353
|
+
request_params_header = URI.encode_www_form header_params
|
320
354
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
321
355
|
|
322
356
|
options.apply_defaults timeout: @config.rpcs.sample_row_keys.timeout,
|
@@ -376,6 +410,21 @@ module Google
|
|
376
410
|
#
|
377
411
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
378
412
|
#
|
413
|
+
# @example Basic example
|
414
|
+
# require "google/cloud/bigtable/v2"
|
415
|
+
#
|
416
|
+
# # Create a client object. The client can be reused for multiple calls.
|
417
|
+
# client = Google::Cloud::Bigtable::V2::Bigtable::Client.new
|
418
|
+
#
|
419
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
420
|
+
# request = Google::Cloud::Bigtable::V2::MutateRowRequest.new
|
421
|
+
#
|
422
|
+
# # Call the mutate_row method.
|
423
|
+
# result = client.mutate_row request
|
424
|
+
#
|
425
|
+
# # The returned object is of type Google::Cloud::Bigtable::V2::MutateRowResponse.
|
426
|
+
# p result
|
427
|
+
#
|
379
428
|
def mutate_row request, options = nil
|
380
429
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
381
430
|
|
@@ -393,10 +442,16 @@ module Google
|
|
393
442
|
gapic_version: ::Google::Cloud::Bigtable::V2::VERSION
|
394
443
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
395
444
|
|
396
|
-
header_params = {
|
397
|
-
|
398
|
-
|
399
|
-
|
445
|
+
header_params = {}
|
446
|
+
if request.table_name &&
|
447
|
+
%r{^projects/[^/]+/instances/[^/]+/tables/[^/]+/?$}.match?(request.table_name)
|
448
|
+
header_params["table_name"] = request.table_name
|
449
|
+
end
|
450
|
+
if request.app_profile_id && !request.app_profile_id.empty?
|
451
|
+
header_params["app_profile_id"] = request.app_profile_id
|
452
|
+
end
|
453
|
+
|
454
|
+
request_params_header = URI.encode_www_form header_params
|
400
455
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
401
456
|
|
402
457
|
options.apply_defaults timeout: @config.rpcs.mutate_row.timeout,
|
@@ -455,6 +510,24 @@ module Google
|
|
455
510
|
#
|
456
511
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
457
512
|
#
|
513
|
+
# @example Basic example
|
514
|
+
# require "google/cloud/bigtable/v2"
|
515
|
+
#
|
516
|
+
# # Create a client object. The client can be reused for multiple calls.
|
517
|
+
# client = Google::Cloud::Bigtable::V2::Bigtable::Client.new
|
518
|
+
#
|
519
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
520
|
+
# request = Google::Cloud::Bigtable::V2::MutateRowsRequest.new
|
521
|
+
#
|
522
|
+
# # Call the mutate_rows method.
|
523
|
+
# result = client.mutate_rows request
|
524
|
+
#
|
525
|
+
# # The returned object is a streamed enumerable yielding elements of
|
526
|
+
# # type ::Google::Cloud::Bigtable::V2::MutateRowsResponse.
|
527
|
+
# result.each do |response|
|
528
|
+
# p response
|
529
|
+
# end
|
530
|
+
#
|
458
531
|
def mutate_rows request, options = nil
|
459
532
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
460
533
|
|
@@ -472,10 +545,16 @@ module Google
|
|
472
545
|
gapic_version: ::Google::Cloud::Bigtable::V2::VERSION
|
473
546
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
474
547
|
|
475
|
-
header_params = {
|
476
|
-
|
477
|
-
|
478
|
-
|
548
|
+
header_params = {}
|
549
|
+
if request.table_name &&
|
550
|
+
%r{^projects/[^/]+/instances/[^/]+/tables/[^/]+/?$}.match?(request.table_name)
|
551
|
+
header_params["table_name"] = request.table_name
|
552
|
+
end
|
553
|
+
if request.app_profile_id && !request.app_profile_id.empty?
|
554
|
+
header_params["app_profile_id"] = request.app_profile_id
|
555
|
+
end
|
556
|
+
|
557
|
+
request_params_header = URI.encode_www_form header_params
|
479
558
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
480
559
|
|
481
560
|
options.apply_defaults timeout: @config.rpcs.mutate_rows.timeout,
|
@@ -548,6 +627,21 @@ module Google
|
|
548
627
|
#
|
549
628
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
550
629
|
#
|
630
|
+
# @example Basic example
|
631
|
+
# require "google/cloud/bigtable/v2"
|
632
|
+
#
|
633
|
+
# # Create a client object. The client can be reused for multiple calls.
|
634
|
+
# client = Google::Cloud::Bigtable::V2::Bigtable::Client.new
|
635
|
+
#
|
636
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
637
|
+
# request = Google::Cloud::Bigtable::V2::CheckAndMutateRowRequest.new
|
638
|
+
#
|
639
|
+
# # Call the check_and_mutate_row method.
|
640
|
+
# result = client.check_and_mutate_row request
|
641
|
+
#
|
642
|
+
# # The returned object is of type Google::Cloud::Bigtable::V2::CheckAndMutateRowResponse.
|
643
|
+
# p result
|
644
|
+
#
|
551
645
|
def check_and_mutate_row request, options = nil
|
552
646
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
553
647
|
|
@@ -565,10 +659,16 @@ module Google
|
|
565
659
|
gapic_version: ::Google::Cloud::Bigtable::V2::VERSION
|
566
660
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
567
661
|
|
568
|
-
header_params = {
|
569
|
-
|
570
|
-
|
571
|
-
|
662
|
+
header_params = {}
|
663
|
+
if request.table_name &&
|
664
|
+
%r{^projects/[^/]+/instances/[^/]+/tables/[^/]+/?$}.match?(request.table_name)
|
665
|
+
header_params["table_name"] = request.table_name
|
666
|
+
end
|
667
|
+
if request.app_profile_id && !request.app_profile_id.empty?
|
668
|
+
header_params["app_profile_id"] = request.app_profile_id
|
669
|
+
end
|
670
|
+
|
671
|
+
request_params_header = URI.encode_www_form header_params
|
572
672
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
573
673
|
|
574
674
|
options.apply_defaults timeout: @config.rpcs.check_and_mutate_row.timeout,
|
@@ -587,6 +687,100 @@ module Google
|
|
587
687
|
raise ::Google::Cloud::Error.from_error(e)
|
588
688
|
end
|
589
689
|
|
690
|
+
##
|
691
|
+
# Warm up associated instance metadata for this connection.
|
692
|
+
# This call is not required but may be useful for connection keep-alive.
|
693
|
+
#
|
694
|
+
# @overload ping_and_warm(request, options = nil)
|
695
|
+
# Pass arguments to `ping_and_warm` via a request object, either of type
|
696
|
+
# {::Google::Cloud::Bigtable::V2::PingAndWarmRequest} or an equivalent Hash.
|
697
|
+
#
|
698
|
+
# @param request [::Google::Cloud::Bigtable::V2::PingAndWarmRequest, ::Hash]
|
699
|
+
# A request object representing the call parameters. Required. To specify no
|
700
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
701
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
702
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
703
|
+
#
|
704
|
+
# @overload ping_and_warm(name: nil, app_profile_id: nil)
|
705
|
+
# Pass arguments to `ping_and_warm` via keyword arguments. Note that at
|
706
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
707
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
708
|
+
#
|
709
|
+
# @param name [::String]
|
710
|
+
# Required. The unique name of the instance to check permissions for as well as
|
711
|
+
# respond. Values are of the form `projects/<project>/instances/<instance>`.
|
712
|
+
# @param app_profile_id [::String]
|
713
|
+
# This value specifies routing for replication. If not specified, the
|
714
|
+
# "default" application profile will be used.
|
715
|
+
#
|
716
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
717
|
+
# @yieldparam response [::Google::Cloud::Bigtable::V2::PingAndWarmResponse]
|
718
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
719
|
+
#
|
720
|
+
# @return [::Google::Cloud::Bigtable::V2::PingAndWarmResponse]
|
721
|
+
#
|
722
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
723
|
+
#
|
724
|
+
# @example Basic example
|
725
|
+
# require "google/cloud/bigtable/v2"
|
726
|
+
#
|
727
|
+
# # Create a client object. The client can be reused for multiple calls.
|
728
|
+
# client = Google::Cloud::Bigtable::V2::Bigtable::Client.new
|
729
|
+
#
|
730
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
731
|
+
# request = Google::Cloud::Bigtable::V2::PingAndWarmRequest.new
|
732
|
+
#
|
733
|
+
# # Call the ping_and_warm method.
|
734
|
+
# result = client.ping_and_warm request
|
735
|
+
#
|
736
|
+
# # The returned object is of type Google::Cloud::Bigtable::V2::PingAndWarmResponse.
|
737
|
+
# p result
|
738
|
+
#
|
739
|
+
def ping_and_warm request, options = nil
|
740
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
741
|
+
|
742
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::PingAndWarmRequest
|
743
|
+
|
744
|
+
# Converts hash and nil to an options object
|
745
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
746
|
+
|
747
|
+
# Customize the options with defaults
|
748
|
+
metadata = @config.rpcs.ping_and_warm.metadata.to_h
|
749
|
+
|
750
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
751
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
752
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
753
|
+
gapic_version: ::Google::Cloud::Bigtable::V2::VERSION
|
754
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
755
|
+
|
756
|
+
header_params = {}
|
757
|
+
if request.name &&
|
758
|
+
%r{^projects/[^/]+/instances/[^/]+/?$}.match?(request.name)
|
759
|
+
header_params["name"] = request.name
|
760
|
+
end
|
761
|
+
if request.app_profile_id && !request.app_profile_id.empty?
|
762
|
+
header_params["app_profile_id"] = request.app_profile_id
|
763
|
+
end
|
764
|
+
|
765
|
+
request_params_header = URI.encode_www_form header_params
|
766
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
767
|
+
|
768
|
+
options.apply_defaults timeout: @config.rpcs.ping_and_warm.timeout,
|
769
|
+
metadata: metadata,
|
770
|
+
retry_policy: @config.rpcs.ping_and_warm.retry_policy
|
771
|
+
|
772
|
+
options.apply_defaults timeout: @config.timeout,
|
773
|
+
metadata: @config.metadata,
|
774
|
+
retry_policy: @config.retry_policy
|
775
|
+
|
776
|
+
@bigtable_stub.call_rpc :ping_and_warm, request, options: options do |response, operation|
|
777
|
+
yield response, operation if block_given?
|
778
|
+
return response
|
779
|
+
end
|
780
|
+
rescue ::GRPC::BadStatus => e
|
781
|
+
raise ::Google::Cloud::Error.from_error(e)
|
782
|
+
end
|
783
|
+
|
590
784
|
##
|
591
785
|
# Modifies a row atomically on the server. The method reads the latest
|
592
786
|
# existing timestamp and value from the specified columns and writes a new
|
@@ -632,6 +826,21 @@ module Google
|
|
632
826
|
#
|
633
827
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
634
828
|
#
|
829
|
+
# @example Basic example
|
830
|
+
# require "google/cloud/bigtable/v2"
|
831
|
+
#
|
832
|
+
# # Create a client object. The client can be reused for multiple calls.
|
833
|
+
# client = Google::Cloud::Bigtable::V2::Bigtable::Client.new
|
834
|
+
#
|
835
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
836
|
+
# request = Google::Cloud::Bigtable::V2::ReadModifyWriteRowRequest.new
|
837
|
+
#
|
838
|
+
# # Call the read_modify_write_row method.
|
839
|
+
# result = client.read_modify_write_row request
|
840
|
+
#
|
841
|
+
# # The returned object is of type Google::Cloud::Bigtable::V2::ReadModifyWriteRowResponse.
|
842
|
+
# p result
|
843
|
+
#
|
635
844
|
def read_modify_write_row request, options = nil
|
636
845
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
637
846
|
|
@@ -649,10 +858,16 @@ module Google
|
|
649
858
|
gapic_version: ::Google::Cloud::Bigtable::V2::VERSION
|
650
859
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
651
860
|
|
652
|
-
header_params = {
|
653
|
-
|
654
|
-
|
655
|
-
|
861
|
+
header_params = {}
|
862
|
+
if request.table_name &&
|
863
|
+
%r{^projects/[^/]+/instances/[^/]+/tables/[^/]+/?$}.match?(request.table_name)
|
864
|
+
header_params["table_name"] = request.table_name
|
865
|
+
end
|
866
|
+
if request.app_profile_id && !request.app_profile_id.empty?
|
867
|
+
header_params["app_profile_id"] = request.app_profile_id
|
868
|
+
end
|
869
|
+
|
870
|
+
request_params_header = URI.encode_www_form header_params
|
656
871
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
657
872
|
|
658
873
|
options.apply_defaults timeout: @config.rpcs.read_modify_write_row.timeout,
|
@@ -832,6 +1047,11 @@ module Google
|
|
832
1047
|
#
|
833
1048
|
attr_reader :check_and_mutate_row
|
834
1049
|
##
|
1050
|
+
# RPC-specific configuration for `ping_and_warm`
|
1051
|
+
# @return [::Gapic::Config::Method]
|
1052
|
+
#
|
1053
|
+
attr_reader :ping_and_warm
|
1054
|
+
##
|
835
1055
|
# RPC-specific configuration for `read_modify_write_row`
|
836
1056
|
# @return [::Gapic::Config::Method]
|
837
1057
|
#
|
@@ -849,6 +1069,8 @@ module Google
|
|
849
1069
|
@mutate_rows = ::Gapic::Config::Method.new mutate_rows_config
|
850
1070
|
check_and_mutate_row_config = parent_rpcs.check_and_mutate_row if parent_rpcs.respond_to? :check_and_mutate_row
|
851
1071
|
@check_and_mutate_row = ::Gapic::Config::Method.new check_and_mutate_row_config
|
1072
|
+
ping_and_warm_config = parent_rpcs.ping_and_warm if parent_rpcs.respond_to? :ping_and_warm
|
1073
|
+
@ping_and_warm = ::Gapic::Config::Method.new ping_and_warm_config
|
852
1074
|
read_modify_write_row_config = parent_rpcs.read_modify_write_row if parent_rpcs.respond_to? :read_modify_write_row
|
853
1075
|
@read_modify_write_row = ::Gapic::Config::Method.new read_modify_write_row_config
|
854
1076
|
|
@@ -24,6 +24,23 @@ module Google
|
|
24
24
|
module Bigtable
|
25
25
|
# Path helper methods for the Bigtable API.
|
26
26
|
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Instance resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/instances/{instance}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param instance [String]
|
36
|
+
#
|
37
|
+
# @return [::String]
|
38
|
+
def instance_path project:, instance:
|
39
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
40
|
+
|
41
|
+
"projects/#{project}/instances/#{instance}"
|
42
|
+
end
|
43
|
+
|
27
44
|
##
|
28
45
|
# Create a fully-qualified Table resource string.
|
29
46
|
#
|
@@ -33,11 +33,7 @@ module Google
|
|
33
33
|
# // For Kubernetes resources, the format is {api group}/{kind}.
|
34
34
|
# option (google.api.resource) = {
|
35
35
|
# type: "pubsub.googleapis.com/Topic"
|
36
|
-
#
|
37
|
-
# pattern: "projects/{project}/topics/{topic}"
|
38
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
39
|
-
# parent_name_extractor: "projects/{project}"
|
40
|
-
# }
|
36
|
+
# pattern: "projects/{project}/topics/{topic}"
|
41
37
|
# };
|
42
38
|
# }
|
43
39
|
#
|
@@ -45,10 +41,7 @@ module Google
|
|
45
41
|
#
|
46
42
|
# resources:
|
47
43
|
# - type: "pubsub.googleapis.com/Topic"
|
48
|
-
#
|
49
|
-
# - pattern: "projects/{project}/topics/{topic}"
|
50
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
51
|
-
# parent_name_extractor: "projects/{project}"
|
44
|
+
# pattern: "projects/{project}/topics/{topic}"
|
52
45
|
#
|
53
46
|
# Sometimes, resources have multiple patterns, typically because they can
|
54
47
|
# live under multiple parents.
|
@@ -58,26 +51,10 @@ module Google
|
|
58
51
|
# message LogEntry {
|
59
52
|
# option (google.api.resource) = {
|
60
53
|
# type: "logging.googleapis.com/LogEntry"
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# }
|
66
|
-
# name_descriptor: {
|
67
|
-
# pattern: "folders/{folder}/logs/{log}"
|
68
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
69
|
-
# parent_name_extractor: "folders/{folder}"
|
70
|
-
# }
|
71
|
-
# name_descriptor: {
|
72
|
-
# pattern: "organizations/{organization}/logs/{log}"
|
73
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
74
|
-
# parent_name_extractor: "organizations/{organization}"
|
75
|
-
# }
|
76
|
-
# name_descriptor: {
|
77
|
-
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
78
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
79
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
80
|
-
# }
|
54
|
+
# pattern: "projects/{project}/logs/{log}"
|
55
|
+
# pattern: "folders/{folder}/logs/{log}"
|
56
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
57
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
81
58
|
# };
|
82
59
|
# }
|
83
60
|
#
|
@@ -85,48 +62,10 @@ module Google
|
|
85
62
|
#
|
86
63
|
# resources:
|
87
64
|
# - type: 'logging.googleapis.com/LogEntry'
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
# - pattern: "folders/{folder}/logs/{log}"
|
93
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
94
|
-
# parent_name_extractor: "folders/{folder}"
|
95
|
-
# - pattern: "organizations/{organization}/logs/{log}"
|
96
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
97
|
-
# parent_name_extractor: "organizations/{organization}"
|
98
|
-
# - pattern: "billingAccounts/{billing_account}/logs/{log}"
|
99
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
100
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
101
|
-
#
|
102
|
-
# For flexible resources, the resource name doesn't contain parent names, but
|
103
|
-
# the resource itself has parents for policy evaluation.
|
104
|
-
#
|
105
|
-
# Example:
|
106
|
-
#
|
107
|
-
# message Shelf {
|
108
|
-
# option (google.api.resource) = {
|
109
|
-
# type: "library.googleapis.com/Shelf"
|
110
|
-
# name_descriptor: {
|
111
|
-
# pattern: "shelves/{shelf}"
|
112
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
113
|
-
# }
|
114
|
-
# name_descriptor: {
|
115
|
-
# pattern: "shelves/{shelf}"
|
116
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
117
|
-
# }
|
118
|
-
# };
|
119
|
-
# }
|
120
|
-
#
|
121
|
-
# The ResourceDescriptor Yaml config will look like:
|
122
|
-
#
|
123
|
-
# resources:
|
124
|
-
# - type: 'library.googleapis.com/Shelf'
|
125
|
-
# name_descriptor:
|
126
|
-
# - pattern: "shelves/{shelf}"
|
127
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
128
|
-
# - pattern: "shelves/{shelf}"
|
129
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
65
|
+
# pattern: "projects/{project}/logs/{log}"
|
66
|
+
# pattern: "folders/{folder}/logs/{log}"
|
67
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
68
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
130
69
|
# @!attribute [rw] type
|
131
70
|
# @return [::String]
|
132
71
|
# The resource type. It must be in the format of
|
@@ -0,0 +1,459 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Api
|
22
|
+
# Specifies the routing information that should be sent along with the request
|
23
|
+
# in the form of routing header.
|
24
|
+
# **NOTE:** All service configuration rules follow the "last one wins" order.
|
25
|
+
#
|
26
|
+
# The examples below will apply to an RPC which has the following request type:
|
27
|
+
#
|
28
|
+
# Message Definition:
|
29
|
+
#
|
30
|
+
# message Request {
|
31
|
+
# // The name of the Table
|
32
|
+
# // Values can be of the following formats:
|
33
|
+
# // - `projects/<project>/tables/<table>`
|
34
|
+
# // - `projects/<project>/instances/<instance>/tables/<table>`
|
35
|
+
# // - `region/<region>/zones/<zone>/tables/<table>`
|
36
|
+
# string table_name = 1;
|
37
|
+
#
|
38
|
+
# // This value specifies routing for replication.
|
39
|
+
# // It can be in the following formats:
|
40
|
+
# // - `profiles/<profile_id>`
|
41
|
+
# // - a legacy `profile_id` that can be any string
|
42
|
+
# string app_profile_id = 2;
|
43
|
+
# }
|
44
|
+
#
|
45
|
+
# Example message:
|
46
|
+
#
|
47
|
+
# {
|
48
|
+
# table_name: projects/proj_foo/instances/instance_bar/table/table_baz,
|
49
|
+
# app_profile_id: profiles/prof_qux
|
50
|
+
# }
|
51
|
+
#
|
52
|
+
# The routing header consists of one or multiple key-value pairs. Every key
|
53
|
+
# and value must be percent-encoded, and joined together in the format of
|
54
|
+
# `key1=value1&key2=value2`.
|
55
|
+
# In the examples below I am skipping the percent-encoding for readablity.
|
56
|
+
#
|
57
|
+
# Example 1
|
58
|
+
#
|
59
|
+
# Extracting a field from the request to put into the routing header
|
60
|
+
# unchanged, with the key equal to the field name.
|
61
|
+
#
|
62
|
+
# annotation:
|
63
|
+
#
|
64
|
+
# option (google.api.routing) = {
|
65
|
+
# // Take the `app_profile_id`.
|
66
|
+
# routing_parameters {
|
67
|
+
# field: "app_profile_id"
|
68
|
+
# }
|
69
|
+
# };
|
70
|
+
#
|
71
|
+
# result:
|
72
|
+
#
|
73
|
+
# x-goog-request-params: app_profile_id=profiles/prof_qux
|
74
|
+
#
|
75
|
+
# Example 2
|
76
|
+
#
|
77
|
+
# Extracting a field from the request to put into the routing header
|
78
|
+
# unchanged, with the key different from the field name.
|
79
|
+
#
|
80
|
+
# annotation:
|
81
|
+
#
|
82
|
+
# option (google.api.routing) = {
|
83
|
+
# // Take the `app_profile_id`, but name it `routing_id` in the header.
|
84
|
+
# routing_parameters {
|
85
|
+
# field: "app_profile_id"
|
86
|
+
# path_template: "{routing_id=**}"
|
87
|
+
# }
|
88
|
+
# };
|
89
|
+
#
|
90
|
+
# result:
|
91
|
+
#
|
92
|
+
# x-goog-request-params: routing_id=profiles/prof_qux
|
93
|
+
#
|
94
|
+
# Example 3
|
95
|
+
#
|
96
|
+
# Extracting a field from the request to put into the routing
|
97
|
+
# header, while matching a path template syntax on the field's value.
|
98
|
+
#
|
99
|
+
# NB: it is more useful to send nothing than to send garbage for the purpose
|
100
|
+
# of dynamic routing, since garbage pollutes cache. Thus the matching.
|
101
|
+
#
|
102
|
+
# Sub-example 3a
|
103
|
+
#
|
104
|
+
# The field matches the template.
|
105
|
+
#
|
106
|
+
# annotation:
|
107
|
+
#
|
108
|
+
# option (google.api.routing) = {
|
109
|
+
# // Take the `table_name`, if it's well-formed (with project-based
|
110
|
+
# // syntax).
|
111
|
+
# routing_parameters {
|
112
|
+
# field: "table_name"
|
113
|
+
# path_template: "{table_name=projects/*/instances/*/**}"
|
114
|
+
# }
|
115
|
+
# };
|
116
|
+
#
|
117
|
+
# result:
|
118
|
+
#
|
119
|
+
# x-goog-request-params:
|
120
|
+
# table_name=projects/proj_foo/instances/instance_bar/table/table_baz
|
121
|
+
#
|
122
|
+
# Sub-example 3b
|
123
|
+
#
|
124
|
+
# The field does not match the template.
|
125
|
+
#
|
126
|
+
# annotation:
|
127
|
+
#
|
128
|
+
# option (google.api.routing) = {
|
129
|
+
# // Take the `table_name`, if it's well-formed (with region-based
|
130
|
+
# // syntax).
|
131
|
+
# routing_parameters {
|
132
|
+
# field: "table_name"
|
133
|
+
# path_template: "{table_name=regions/*/zones/*/**}"
|
134
|
+
# }
|
135
|
+
# };
|
136
|
+
#
|
137
|
+
# result:
|
138
|
+
#
|
139
|
+
# <no routing header will be sent>
|
140
|
+
#
|
141
|
+
# Sub-example 3c
|
142
|
+
#
|
143
|
+
# Multiple alternative conflictingly named path templates are
|
144
|
+
# specified. The one that matches is used to construct the header.
|
145
|
+
#
|
146
|
+
# annotation:
|
147
|
+
#
|
148
|
+
# option (google.api.routing) = {
|
149
|
+
# // Take the `table_name`, if it's well-formed, whether
|
150
|
+
# // using the region- or projects-based syntax.
|
151
|
+
#
|
152
|
+
# routing_parameters {
|
153
|
+
# field: "table_name"
|
154
|
+
# path_template: "{table_name=regions/*/zones/*/**}"
|
155
|
+
# }
|
156
|
+
# routing_parameters {
|
157
|
+
# field: "table_name"
|
158
|
+
# path_template: "{table_name=projects/*/instances/*/**}"
|
159
|
+
# }
|
160
|
+
# };
|
161
|
+
#
|
162
|
+
# result:
|
163
|
+
#
|
164
|
+
# x-goog-request-params:
|
165
|
+
# table_name=projects/proj_foo/instances/instance_bar/table/table_baz
|
166
|
+
#
|
167
|
+
# Example 4
|
168
|
+
#
|
169
|
+
# Extracting a single routing header key-value pair by matching a
|
170
|
+
# template syntax on (a part of) a single request field.
|
171
|
+
#
|
172
|
+
# annotation:
|
173
|
+
#
|
174
|
+
# option (google.api.routing) = {
|
175
|
+
# // Take just the project id from the `table_name` field.
|
176
|
+
# routing_parameters {
|
177
|
+
# field: "table_name"
|
178
|
+
# path_template: "{routing_id=projects/*}/**"
|
179
|
+
# }
|
180
|
+
# };
|
181
|
+
#
|
182
|
+
# result:
|
183
|
+
#
|
184
|
+
# x-goog-request-params: routing_id=projects/proj_foo
|
185
|
+
#
|
186
|
+
# Example 5
|
187
|
+
#
|
188
|
+
# Extracting a single routing header key-value pair by matching
|
189
|
+
# several conflictingly named path templates on (parts of) a single request
|
190
|
+
# field. The last template to match "wins" the conflict.
|
191
|
+
#
|
192
|
+
# annotation:
|
193
|
+
#
|
194
|
+
# option (google.api.routing) = {
|
195
|
+
# // If the `table_name` does not have instances information,
|
196
|
+
# // take just the project id for routing.
|
197
|
+
# // Otherwise take project + instance.
|
198
|
+
#
|
199
|
+
# routing_parameters {
|
200
|
+
# field: "table_name"
|
201
|
+
# path_template: "{routing_id=projects/*}/**"
|
202
|
+
# }
|
203
|
+
# routing_parameters {
|
204
|
+
# field: "table_name"
|
205
|
+
# path_template: "{routing_id=projects/*/instances/*}/**"
|
206
|
+
# }
|
207
|
+
# };
|
208
|
+
#
|
209
|
+
# result:
|
210
|
+
#
|
211
|
+
# x-goog-request-params:
|
212
|
+
# routing_id=projects/proj_foo/instances/instance_bar
|
213
|
+
#
|
214
|
+
# Example 6
|
215
|
+
#
|
216
|
+
# Extracting multiple routing header key-value pairs by matching
|
217
|
+
# several non-conflicting path templates on (parts of) a single request field.
|
218
|
+
#
|
219
|
+
# Sub-example 6a
|
220
|
+
#
|
221
|
+
# Make the templates strict, so that if the `table_name` does not
|
222
|
+
# have an instance information, nothing is sent.
|
223
|
+
#
|
224
|
+
# annotation:
|
225
|
+
#
|
226
|
+
# option (google.api.routing) = {
|
227
|
+
# // The routing code needs two keys instead of one composite
|
228
|
+
# // but works only for the tables with the "project-instance" name
|
229
|
+
# // syntax.
|
230
|
+
#
|
231
|
+
# routing_parameters {
|
232
|
+
# field: "table_name"
|
233
|
+
# path_template: "{project_id=projects/*}/instances/*/**"
|
234
|
+
# }
|
235
|
+
# routing_parameters {
|
236
|
+
# field: "table_name"
|
237
|
+
# path_template: "projects/*/{instance_id=instances/*}/**"
|
238
|
+
# }
|
239
|
+
# };
|
240
|
+
#
|
241
|
+
# result:
|
242
|
+
#
|
243
|
+
# x-goog-request-params:
|
244
|
+
# project_id=projects/proj_foo&instance_id=instances/instance_bar
|
245
|
+
#
|
246
|
+
# Sub-example 6b
|
247
|
+
#
|
248
|
+
# Make the templates loose, so that if the `table_name` does not
|
249
|
+
# have an instance information, just the project id part is sent.
|
250
|
+
#
|
251
|
+
# annotation:
|
252
|
+
#
|
253
|
+
# option (google.api.routing) = {
|
254
|
+
# // The routing code wants two keys instead of one composite
|
255
|
+
# // but will work with just the `project_id` for tables without
|
256
|
+
# // an instance in the `table_name`.
|
257
|
+
#
|
258
|
+
# routing_parameters {
|
259
|
+
# field: "table_name"
|
260
|
+
# path_template: "{project_id=projects/*}/**"
|
261
|
+
# }
|
262
|
+
# routing_parameters {
|
263
|
+
# field: "table_name"
|
264
|
+
# path_template: "projects/*/{instance_id=instances/*}/**"
|
265
|
+
# }
|
266
|
+
# };
|
267
|
+
#
|
268
|
+
# result (is the same as 6a for our example message because it has the instance
|
269
|
+
# information):
|
270
|
+
#
|
271
|
+
# x-goog-request-params:
|
272
|
+
# project_id=projects/proj_foo&instance_id=instances/instance_bar
|
273
|
+
#
|
274
|
+
# Example 7
|
275
|
+
#
|
276
|
+
# Extracting multiple routing header key-value pairs by matching
|
277
|
+
# several path templates on multiple request fields.
|
278
|
+
#
|
279
|
+
# NB: note that here there is no way to specify sending nothing if one of the
|
280
|
+
# fields does not match its template. E.g. if the `table_name` is in the wrong
|
281
|
+
# format, the `project_id` will not be sent, but the `routing_id` will be.
|
282
|
+
# The backend routing code has to be aware of that and be prepared to not
|
283
|
+
# receive a full complement of keys if it expects multiple.
|
284
|
+
#
|
285
|
+
# annotation:
|
286
|
+
#
|
287
|
+
# option (google.api.routing) = {
|
288
|
+
# // The routing needs both `project_id` and `routing_id`
|
289
|
+
# // (from the `app_profile_id` field) for routing.
|
290
|
+
#
|
291
|
+
# routing_parameters {
|
292
|
+
# field: "table_name"
|
293
|
+
# path_template: "{project_id=projects/*}/**"
|
294
|
+
# }
|
295
|
+
# routing_parameters {
|
296
|
+
# field: "app_profile_id"
|
297
|
+
# path_template: "{routing_id=**}"
|
298
|
+
# }
|
299
|
+
# };
|
300
|
+
#
|
301
|
+
# result:
|
302
|
+
#
|
303
|
+
# x-goog-request-params:
|
304
|
+
# project_id=projects/proj_foo&routing_id=profiles/prof_qux
|
305
|
+
#
|
306
|
+
# Example 8
|
307
|
+
#
|
308
|
+
# Extracting a single routing header key-value pair by matching
|
309
|
+
# several conflictingly named path templates on several request fields. The
|
310
|
+
# last template to match "wins" the conflict.
|
311
|
+
#
|
312
|
+
# annotation:
|
313
|
+
#
|
314
|
+
# option (google.api.routing) = {
|
315
|
+
# // The `routing_id` can be a project id or a region id depending on
|
316
|
+
# // the table name format, but only if the `app_profile_id` is not set.
|
317
|
+
# // If `app_profile_id` is set it should be used instead.
|
318
|
+
#
|
319
|
+
# routing_parameters {
|
320
|
+
# field: "table_name"
|
321
|
+
# path_template: "{routing_id=projects/*}/**"
|
322
|
+
# }
|
323
|
+
# routing_parameters {
|
324
|
+
# field: "table_name"
|
325
|
+
# path_template: "{routing_id=regions/*}/**"
|
326
|
+
# }
|
327
|
+
# routing_parameters {
|
328
|
+
# field: "app_profile_id"
|
329
|
+
# path_template: "{routing_id=**}"
|
330
|
+
# }
|
331
|
+
# };
|
332
|
+
#
|
333
|
+
# result:
|
334
|
+
#
|
335
|
+
# x-goog-request-params: routing_id=profiles/prof_qux
|
336
|
+
#
|
337
|
+
# Example 9
|
338
|
+
#
|
339
|
+
# Bringing it all together.
|
340
|
+
#
|
341
|
+
# annotation:
|
342
|
+
#
|
343
|
+
# option (google.api.routing) = {
|
344
|
+
# // For routing both `table_location` and a `routing_id` are needed.
|
345
|
+
# //
|
346
|
+
# // table_location can be either an instance id or a region+zone id.
|
347
|
+
# //
|
348
|
+
# // For `routing_id`, take the value of `app_profile_id`
|
349
|
+
# // - If it's in the format `profiles/<profile_id>`, send
|
350
|
+
# // just the `<profile_id>` part.
|
351
|
+
# // - If it's any other literal, send it as is.
|
352
|
+
# // If the `app_profile_id` is empty, and the `table_name` starts with
|
353
|
+
# // the project_id, send that instead.
|
354
|
+
#
|
355
|
+
# routing_parameters {
|
356
|
+
# field: "table_name"
|
357
|
+
# path_template: "projects/*/{table_location=instances/*}/tables/*"
|
358
|
+
# }
|
359
|
+
# routing_parameters {
|
360
|
+
# field: "table_name"
|
361
|
+
# path_template: "{table_location=regions/*/zones/*}/tables/*"
|
362
|
+
# }
|
363
|
+
# routing_parameters {
|
364
|
+
# field: "table_name"
|
365
|
+
# path_template: "{routing_id=projects/*}/**"
|
366
|
+
# }
|
367
|
+
# routing_parameters {
|
368
|
+
# field: "app_profile_id"
|
369
|
+
# path_template: "{routing_id=**}"
|
370
|
+
# }
|
371
|
+
# routing_parameters {
|
372
|
+
# field: "app_profile_id"
|
373
|
+
# path_template: "profiles/{routing_id=*}"
|
374
|
+
# }
|
375
|
+
# };
|
376
|
+
#
|
377
|
+
# result:
|
378
|
+
#
|
379
|
+
# x-goog-request-params:
|
380
|
+
# table_location=instances/instance_bar&routing_id=prof_qux
|
381
|
+
# @!attribute [rw] routing_parameters
|
382
|
+
# @return [::Array<::Google::Api::RoutingParameter>]
|
383
|
+
# A collection of Routing Parameter specifications.
|
384
|
+
# **NOTE:** If multiple Routing Parameters describe the same key
|
385
|
+
# (via the `path_template` field or via the `field` field when
|
386
|
+
# `path_template` is not provided), "last one wins" rule
|
387
|
+
# determines which Parameter gets used.
|
388
|
+
# See the examples for more details.
|
389
|
+
class RoutingRule
|
390
|
+
include ::Google::Protobuf::MessageExts
|
391
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
392
|
+
end
|
393
|
+
|
394
|
+
# A projection from an input message to the GRPC or REST header.
|
395
|
+
# @!attribute [rw] field
|
396
|
+
# @return [::String]
|
397
|
+
# A request field to extract the header key-value pair from.
|
398
|
+
# @!attribute [rw] path_template
|
399
|
+
# @return [::String]
|
400
|
+
# A pattern matching the key-value field. Optional.
|
401
|
+
# If not specified, the whole field specified in the `field` field will be
|
402
|
+
# taken as value, and its name used as key. If specified, it MUST contain
|
403
|
+
# exactly one named segment (along with any number of unnamed segments) The
|
404
|
+
# pattern will be matched over the field specified in the `field` field, then
|
405
|
+
# if the match is successful:
|
406
|
+
# - the name of the single named segment will be used as a header name,
|
407
|
+
# - the match value of the segment will be used as a header value;
|
408
|
+
# if the match is NOT successful, nothing will be sent.
|
409
|
+
#
|
410
|
+
# Example:
|
411
|
+
#
|
412
|
+
# -- This is a field in the request message
|
413
|
+
# | that the header value will be extracted from.
|
414
|
+
# |
|
415
|
+
# | -- This is the key name in the
|
416
|
+
# | | routing header.
|
417
|
+
# V |
|
418
|
+
# field: "table_name" v
|
419
|
+
# path_template: "projects/*/{table_location=instances/*}/tables/*"
|
420
|
+
# ^ ^
|
421
|
+
# | |
|
422
|
+
# In the {} brackets is the pattern that -- |
|
423
|
+
# specifies what to extract from the |
|
424
|
+
# field as a value to be sent. |
|
425
|
+
# |
|
426
|
+
# The string in the field must match the whole pattern --
|
427
|
+
# before brackets, inside brackets, after brackets.
|
428
|
+
#
|
429
|
+
# When looking at this specific example, we can see that:
|
430
|
+
# - A key-value pair with the key `table_location`
|
431
|
+
# and the value matching `instances/*` should be added
|
432
|
+
# to the x-goog-request-params routing header.
|
433
|
+
# - The value is extracted from the request message's `table_name` field
|
434
|
+
# if it matches the full pattern specified:
|
435
|
+
# `projects/*/instances/*/tables/*`.
|
436
|
+
#
|
437
|
+
# **NB:** If the `path_template` field is not provided, the key name is
|
438
|
+
# equal to the field name, and the whole field should be sent as a value.
|
439
|
+
# This makes the pattern for the field and the value functionally equivalent
|
440
|
+
# to `**`, and the configuration
|
441
|
+
#
|
442
|
+
# {
|
443
|
+
# field: "table_name"
|
444
|
+
# }
|
445
|
+
#
|
446
|
+
# is a functionally equivalent shorthand to:
|
447
|
+
#
|
448
|
+
# {
|
449
|
+
# field: "table_name"
|
450
|
+
# path_template: "{table_name=**}"
|
451
|
+
# }
|
452
|
+
#
|
453
|
+
# See Example 1 for more details.
|
454
|
+
class RoutingParameter
|
455
|
+
include ::Google::Protobuf::MessageExts
|
456
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
457
|
+
end
|
458
|
+
end
|
459
|
+
end
|
@@ -33,14 +33,15 @@ module Google
|
|
33
33
|
# "default" application profile will be used.
|
34
34
|
# @!attribute [rw] rows
|
35
35
|
# @return [::Google::Cloud::Bigtable::V2::RowSet]
|
36
|
-
# The row keys and/or ranges to read. If not specified, reads
|
36
|
+
# The row keys and/or ranges to read sequentially. If not specified, reads
|
37
|
+
# from all rows.
|
37
38
|
# @!attribute [rw] filter
|
38
39
|
# @return [::Google::Cloud::Bigtable::V2::RowFilter]
|
39
40
|
# The filter to apply to the contents of the specified row(s). If unset,
|
40
41
|
# reads the entirety of each row.
|
41
42
|
# @!attribute [rw] rows_limit
|
42
43
|
# @return [::Integer]
|
43
|
-
# The read will
|
44
|
+
# The read will stop after committing to N rows' worth of results. The
|
44
45
|
# default (zero) is to return all results.
|
45
46
|
class ReadRowsRequest
|
46
47
|
include ::Google::Protobuf::MessageExts
|
@@ -303,6 +304,26 @@ module Google
|
|
303
304
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
304
305
|
end
|
305
306
|
|
307
|
+
# Request message for client connection keep-alive and warming.
|
308
|
+
# @!attribute [rw] name
|
309
|
+
# @return [::String]
|
310
|
+
# Required. The unique name of the instance to check permissions for as well as
|
311
|
+
# respond. Values are of the form `projects/<project>/instances/<instance>`.
|
312
|
+
# @!attribute [rw] app_profile_id
|
313
|
+
# @return [::String]
|
314
|
+
# This value specifies routing for replication. If not specified, the
|
315
|
+
# "default" application profile will be used.
|
316
|
+
class PingAndWarmRequest
|
317
|
+
include ::Google::Protobuf::MessageExts
|
318
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
319
|
+
end
|
320
|
+
|
321
|
+
# Response message for Bigtable.PingAndWarm connection keepalive and warming.
|
322
|
+
class PingAndWarmResponse
|
323
|
+
include ::Google::Protobuf::MessageExts
|
324
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
325
|
+
end
|
326
|
+
|
306
327
|
# Request message for Bigtable.ReadModifyWriteRow.
|
307
328
|
# @!attribute [rw] table_name
|
308
329
|
# @return [::String]
|
@@ -209,7 +209,7 @@ module Google
|
|
209
209
|
# RowFilter.Chain and RowFilter.Interleave documentation.
|
210
210
|
#
|
211
211
|
# The total serialized size of a RowFilter message must not
|
212
|
-
# exceed
|
212
|
+
# exceed 20480 bytes, and RowFilters may not be nested within each other
|
213
213
|
# (in Chains or Interleaves) to a depth of more than 20.
|
214
214
|
# @!attribute [rw] chain
|
215
215
|
# @return [::Google::Cloud::Bigtable::V2::RowFilter::Chain]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-bigtable-v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.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:
|
11
|
+
date: 2022-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- proto_docs/README.md
|
184
184
|
- proto_docs/google/api/field_behavior.rb
|
185
185
|
- proto_docs/google/api/resource.rb
|
186
|
+
- proto_docs/google/api/routing.rb
|
186
187
|
- proto_docs/google/bigtable/v2/bigtable.rb
|
187
188
|
- proto_docs/google/bigtable/v2/data.rb
|
188
189
|
- proto_docs/google/protobuf/any.rb
|
@@ -207,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
208
|
- !ruby/object:Gem::Version
|
208
209
|
version: '0'
|
209
210
|
requirements: []
|
210
|
-
rubygems_version: 3.
|
211
|
+
rubygems_version: 3.3.5
|
211
212
|
signing_key:
|
212
213
|
specification_version: 4
|
213
214
|
summary: API Client library for the Cloud Bigtable V2 API
|