google-cloud-bigtable-admin-v2 0.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 +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +75 -0
- data/lib/google-cloud-bigtable-admin-v2.rb +21 -0
- data/lib/google/bigtable/admin/v2/bigtable_instance_admin_pb.rb +148 -0
- data/lib/google/bigtable/admin/v2/bigtable_instance_admin_services_pb.rb +91 -0
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_pb.rb +211 -0
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_services_pb.rb +155 -0
- data/lib/google/bigtable/admin/v2/common_pb.rb +33 -0
- data/lib/google/bigtable/admin/v2/instance_pb.rb +77 -0
- data/lib/google/bigtable/admin/v2/table_pb.rb +130 -0
- data/lib/google/cloud/bigtable/admin/v2.rb +38 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin.rb +54 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb +1940 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/credentials.rb +59 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/operations.rb +572 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/paths.rb +121 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin.rb +56 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/client.rb +2293 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/credentials.rb +58 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/operations.rb +572 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/paths.rb +132 -0
- data/lib/google/cloud/bigtable/admin/v2/version.rb +30 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/bigtable/admin/v2/bigtable_instance_admin.rb +378 -0
- data/proto_docs/google/bigtable/admin/v2/bigtable_table_admin.rb +686 -0
- data/proto_docs/google/bigtable/admin/v2/common.rb +58 -0
- data/proto_docs/google/bigtable/admin/v2/instance.rb +223 -0
- data/proto_docs/google/bigtable/admin/v2/table.rb +357 -0
- data/proto_docs/google/iam/v1/iam_policy.rb +80 -0
- data/proto_docs/google/iam/v1/options.rb +40 -0
- data/proto_docs/google/iam/v1/policy.rb +248 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/expr.rb +52 -0
- metadata +246 -0
@@ -0,0 +1,1940 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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
|
+
require "google/cloud/errors"
|
20
|
+
require "google/bigtable/admin/v2/bigtable_instance_admin_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Bigtable
|
25
|
+
module Admin
|
26
|
+
module V2
|
27
|
+
module BigtableInstanceAdmin
|
28
|
+
##
|
29
|
+
# Client for the BigtableInstanceAdmin service.
|
30
|
+
#
|
31
|
+
# Service for creating, configuring, and deleting Cloud Bigtable Instances and
|
32
|
+
# Clusters. Provides access to the Instance and Cluster schemas only, not the
|
33
|
+
# tables' metadata or data stored in those tables.
|
34
|
+
#
|
35
|
+
class Client
|
36
|
+
include Paths
|
37
|
+
|
38
|
+
# @private
|
39
|
+
attr_reader :bigtable_instance_admin_stub
|
40
|
+
|
41
|
+
##
|
42
|
+
# Configure the BigtableInstanceAdmin Client class.
|
43
|
+
#
|
44
|
+
# See {::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client::Configuration}
|
45
|
+
# for a description of the configuration fields.
|
46
|
+
#
|
47
|
+
# ## Example
|
48
|
+
#
|
49
|
+
# To modify the configuration for all BigtableInstanceAdmin clients:
|
50
|
+
#
|
51
|
+
# ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.configure do |config|
|
52
|
+
# config.timeout = 10.0
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# @yield [config] Configure the Client client.
|
56
|
+
# @yieldparam config [Client::Configuration]
|
57
|
+
#
|
58
|
+
# @return [Client::Configuration]
|
59
|
+
#
|
60
|
+
def self.configure
|
61
|
+
@configure ||= begin
|
62
|
+
namespace = ["Google", "Cloud", "Bigtable", "Admin", "V2"]
|
63
|
+
parent_config = while namespace.any?
|
64
|
+
parent_name = namespace.join "::"
|
65
|
+
parent_const = const_get parent_name
|
66
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
67
|
+
namespace.pop
|
68
|
+
end
|
69
|
+
default_config = Client::Configuration.new parent_config
|
70
|
+
|
71
|
+
default_config.rpcs.create_instance.timeout = 300.0
|
72
|
+
|
73
|
+
default_config.rpcs.get_instance.timeout = 60.0
|
74
|
+
default_config.rpcs.get_instance.retry_policy = {
|
75
|
+
initial_delay: 1.0,
|
76
|
+
max_delay: 60.0,
|
77
|
+
multiplier: 2,
|
78
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
79
|
+
}
|
80
|
+
|
81
|
+
default_config.rpcs.list_instances.timeout = 60.0
|
82
|
+
default_config.rpcs.list_instances.retry_policy = {
|
83
|
+
initial_delay: 1.0,
|
84
|
+
max_delay: 60.0,
|
85
|
+
multiplier: 2,
|
86
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
87
|
+
}
|
88
|
+
|
89
|
+
default_config.rpcs.update_instance.timeout = 60.0
|
90
|
+
default_config.rpcs.update_instance.retry_policy = {
|
91
|
+
initial_delay: 1.0,
|
92
|
+
max_delay: 60.0,
|
93
|
+
multiplier: 2,
|
94
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
95
|
+
}
|
96
|
+
|
97
|
+
default_config.rpcs.partial_update_instance.timeout = 60.0
|
98
|
+
default_config.rpcs.partial_update_instance.retry_policy = {
|
99
|
+
initial_delay: 1.0,
|
100
|
+
max_delay: 60.0,
|
101
|
+
multiplier: 2,
|
102
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
103
|
+
}
|
104
|
+
|
105
|
+
default_config.rpcs.delete_instance.timeout = 60.0
|
106
|
+
|
107
|
+
default_config.rpcs.create_cluster.timeout = 60.0
|
108
|
+
|
109
|
+
default_config.rpcs.get_cluster.timeout = 60.0
|
110
|
+
default_config.rpcs.get_cluster.retry_policy = {
|
111
|
+
initial_delay: 1.0,
|
112
|
+
max_delay: 60.0,
|
113
|
+
multiplier: 2,
|
114
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
115
|
+
}
|
116
|
+
|
117
|
+
default_config.rpcs.list_clusters.timeout = 60.0
|
118
|
+
default_config.rpcs.list_clusters.retry_policy = {
|
119
|
+
initial_delay: 1.0,
|
120
|
+
max_delay: 60.0,
|
121
|
+
multiplier: 2,
|
122
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
123
|
+
}
|
124
|
+
|
125
|
+
default_config.rpcs.update_cluster.timeout = 60.0
|
126
|
+
default_config.rpcs.update_cluster.retry_policy = {
|
127
|
+
initial_delay: 1.0,
|
128
|
+
max_delay: 60.0,
|
129
|
+
multiplier: 2,
|
130
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
131
|
+
}
|
132
|
+
|
133
|
+
default_config.rpcs.delete_cluster.timeout = 60.0
|
134
|
+
|
135
|
+
default_config.rpcs.create_app_profile.timeout = 60.0
|
136
|
+
|
137
|
+
default_config.rpcs.get_app_profile.timeout = 60.0
|
138
|
+
default_config.rpcs.get_app_profile.retry_policy = {
|
139
|
+
initial_delay: 1.0,
|
140
|
+
max_delay: 60.0,
|
141
|
+
multiplier: 2,
|
142
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
143
|
+
}
|
144
|
+
|
145
|
+
default_config.rpcs.list_app_profiles.timeout = 60.0
|
146
|
+
default_config.rpcs.list_app_profiles.retry_policy = {
|
147
|
+
initial_delay: 1.0,
|
148
|
+
max_delay: 60.0,
|
149
|
+
multiplier: 2,
|
150
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
151
|
+
}
|
152
|
+
|
153
|
+
default_config.rpcs.update_app_profile.timeout = 60.0
|
154
|
+
default_config.rpcs.update_app_profile.retry_policy = {
|
155
|
+
initial_delay: 1.0,
|
156
|
+
max_delay: 60.0,
|
157
|
+
multiplier: 2,
|
158
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
159
|
+
}
|
160
|
+
|
161
|
+
default_config.rpcs.delete_app_profile.timeout = 60.0
|
162
|
+
|
163
|
+
default_config.rpcs.get_iam_policy.timeout = 60.0
|
164
|
+
default_config.rpcs.get_iam_policy.retry_policy = {
|
165
|
+
initial_delay: 1.0,
|
166
|
+
max_delay: 60.0,
|
167
|
+
multiplier: 2,
|
168
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
169
|
+
}
|
170
|
+
|
171
|
+
default_config.rpcs.set_iam_policy.timeout = 60.0
|
172
|
+
|
173
|
+
default_config.rpcs.test_iam_permissions.timeout = 60.0
|
174
|
+
default_config.rpcs.test_iam_permissions.retry_policy = {
|
175
|
+
initial_delay: 1.0,
|
176
|
+
max_delay: 60.0,
|
177
|
+
multiplier: 2,
|
178
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
179
|
+
}
|
180
|
+
|
181
|
+
default_config
|
182
|
+
end
|
183
|
+
yield @configure if block_given?
|
184
|
+
@configure
|
185
|
+
end
|
186
|
+
|
187
|
+
##
|
188
|
+
# Configure the BigtableInstanceAdmin Client instance.
|
189
|
+
#
|
190
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
191
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
192
|
+
# should be made on {Client.configure}.
|
193
|
+
#
|
194
|
+
# See {::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client::Configuration}
|
195
|
+
# for a description of the configuration fields.
|
196
|
+
#
|
197
|
+
# @yield [config] Configure the Client client.
|
198
|
+
# @yieldparam config [Client::Configuration]
|
199
|
+
#
|
200
|
+
# @return [Client::Configuration]
|
201
|
+
#
|
202
|
+
def configure
|
203
|
+
yield @config if block_given?
|
204
|
+
@config
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# Create a new BigtableInstanceAdmin client object.
|
209
|
+
#
|
210
|
+
# ## Examples
|
211
|
+
#
|
212
|
+
# To create a new BigtableInstanceAdmin client with the default
|
213
|
+
# configuration:
|
214
|
+
#
|
215
|
+
# client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new
|
216
|
+
#
|
217
|
+
# To create a new BigtableInstanceAdmin client with a custom
|
218
|
+
# configuration:
|
219
|
+
#
|
220
|
+
# client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config|
|
221
|
+
# config.timeout = 10.0
|
222
|
+
# end
|
223
|
+
#
|
224
|
+
# @yield [config] Configure the BigtableInstanceAdmin client.
|
225
|
+
# @yieldparam config [Client::Configuration]
|
226
|
+
#
|
227
|
+
def initialize
|
228
|
+
# These require statements are intentionally placed here to initialize
|
229
|
+
# the gRPC module only when it's required.
|
230
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
231
|
+
require "gapic/grpc"
|
232
|
+
require "google/bigtable/admin/v2/bigtable_instance_admin_services_pb"
|
233
|
+
|
234
|
+
# Create the configuration object
|
235
|
+
@config = Configuration.new Client.configure
|
236
|
+
|
237
|
+
# Yield the configuration if needed
|
238
|
+
yield @config if block_given?
|
239
|
+
|
240
|
+
# Create credentials
|
241
|
+
credentials = @config.credentials
|
242
|
+
credentials ||= Credentials.default scope: @config.scope
|
243
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
244
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
245
|
+
end
|
246
|
+
@quota_project_id = @config.quota_project
|
247
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
248
|
+
|
249
|
+
@operations_client = Operations.new do |config|
|
250
|
+
config.credentials = credentials
|
251
|
+
config.endpoint = @config.endpoint
|
252
|
+
end
|
253
|
+
|
254
|
+
@bigtable_instance_admin_stub = ::Gapic::ServiceStub.new(
|
255
|
+
::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Stub,
|
256
|
+
credentials: credentials,
|
257
|
+
endpoint: @config.endpoint,
|
258
|
+
channel_args: @config.channel_args,
|
259
|
+
interceptors: @config.interceptors
|
260
|
+
)
|
261
|
+
end
|
262
|
+
|
263
|
+
##
|
264
|
+
# Get the associated client for long-running operations.
|
265
|
+
#
|
266
|
+
# @return [::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Operations]
|
267
|
+
#
|
268
|
+
attr_reader :operations_client
|
269
|
+
|
270
|
+
# Service calls
|
271
|
+
|
272
|
+
##
|
273
|
+
# Create an instance within a project.
|
274
|
+
#
|
275
|
+
# @overload create_instance(request, options = nil)
|
276
|
+
# Pass arguments to `create_instance` via a request object, either of type
|
277
|
+
# {::Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest} or an equivalent Hash.
|
278
|
+
#
|
279
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest, ::Hash]
|
280
|
+
# A request object representing the call parameters. Required. To specify no
|
281
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
282
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
283
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
284
|
+
#
|
285
|
+
# @overload create_instance(parent: nil, instance_id: nil, instance: nil, clusters: nil)
|
286
|
+
# Pass arguments to `create_instance` via keyword arguments. Note that at
|
287
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
288
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
289
|
+
#
|
290
|
+
# @param parent [::String]
|
291
|
+
# Required. The unique name of the project in which to create the new instance.
|
292
|
+
# Values are of the form `projects/{project}`.
|
293
|
+
# @param instance_id [::String]
|
294
|
+
# Required. The ID to be used when referring to the new instance within its project,
|
295
|
+
# e.g., just `myinstance` rather than
|
296
|
+
# `projects/myproject/instances/myinstance`.
|
297
|
+
# @param instance [::Google::Cloud::Bigtable::Admin::V2::Instance, ::Hash]
|
298
|
+
# Required. The instance to create.
|
299
|
+
# Fields marked `OutputOnly` must be left blank.
|
300
|
+
# @param clusters [::Hash{::String => ::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash}]
|
301
|
+
# Required. The clusters to be created within the instance, mapped by desired
|
302
|
+
# cluster ID, e.g., just `mycluster` rather than
|
303
|
+
# `projects/myproject/instances/myinstance/clusters/mycluster`.
|
304
|
+
# Fields marked `OutputOnly` must be left blank.
|
305
|
+
# Currently, at most four clusters can be specified.
|
306
|
+
#
|
307
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
308
|
+
# @yieldparam response [::Gapic::Operation]
|
309
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
310
|
+
#
|
311
|
+
# @return [::Gapic::Operation]
|
312
|
+
#
|
313
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
314
|
+
#
|
315
|
+
def create_instance request, options = nil
|
316
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
317
|
+
|
318
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest
|
319
|
+
|
320
|
+
# Converts hash and nil to an options object
|
321
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
322
|
+
|
323
|
+
# Customize the options with defaults
|
324
|
+
metadata = @config.rpcs.create_instance.metadata.to_h
|
325
|
+
|
326
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
327
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
328
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
329
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
330
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
331
|
+
|
332
|
+
header_params = {
|
333
|
+
"parent" => request.parent
|
334
|
+
}
|
335
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
336
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
337
|
+
|
338
|
+
options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
|
339
|
+
metadata: metadata,
|
340
|
+
retry_policy: @config.rpcs.create_instance.retry_policy
|
341
|
+
options.apply_defaults metadata: @config.metadata,
|
342
|
+
retry_policy: @config.retry_policy
|
343
|
+
|
344
|
+
@bigtable_instance_admin_stub.call_rpc :create_instance, request, options: options do |response, operation|
|
345
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
346
|
+
yield response, operation if block_given?
|
347
|
+
return response
|
348
|
+
end
|
349
|
+
rescue ::GRPC::BadStatus => e
|
350
|
+
raise ::Google::Cloud::Error.from_error(e)
|
351
|
+
end
|
352
|
+
|
353
|
+
##
|
354
|
+
# Gets information about an instance.
|
355
|
+
#
|
356
|
+
# @overload get_instance(request, options = nil)
|
357
|
+
# Pass arguments to `get_instance` via a request object, either of type
|
358
|
+
# {::Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest} or an equivalent Hash.
|
359
|
+
#
|
360
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest, ::Hash]
|
361
|
+
# A request object representing the call parameters. Required. To specify no
|
362
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
363
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
364
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
365
|
+
#
|
366
|
+
# @overload get_instance(name: nil)
|
367
|
+
# Pass arguments to `get_instance` via keyword arguments. Note that at
|
368
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
369
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
370
|
+
#
|
371
|
+
# @param name [::String]
|
372
|
+
# Required. The unique name of the requested instance. Values are of the form
|
373
|
+
# `projects/{project}/instances/{instance}`.
|
374
|
+
#
|
375
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
376
|
+
# @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Instance]
|
377
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
378
|
+
#
|
379
|
+
# @return [::Google::Cloud::Bigtable::Admin::V2::Instance]
|
380
|
+
#
|
381
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
382
|
+
#
|
383
|
+
def get_instance request, options = nil
|
384
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
385
|
+
|
386
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest
|
387
|
+
|
388
|
+
# Converts hash and nil to an options object
|
389
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
390
|
+
|
391
|
+
# Customize the options with defaults
|
392
|
+
metadata = @config.rpcs.get_instance.metadata.to_h
|
393
|
+
|
394
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
395
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
396
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
397
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
398
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
399
|
+
|
400
|
+
header_params = {
|
401
|
+
"name" => request.name
|
402
|
+
}
|
403
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
404
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
405
|
+
|
406
|
+
options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
|
407
|
+
metadata: metadata,
|
408
|
+
retry_policy: @config.rpcs.get_instance.retry_policy
|
409
|
+
options.apply_defaults metadata: @config.metadata,
|
410
|
+
retry_policy: @config.retry_policy
|
411
|
+
|
412
|
+
@bigtable_instance_admin_stub.call_rpc :get_instance, request, options: options do |response, operation|
|
413
|
+
yield response, operation if block_given?
|
414
|
+
return response
|
415
|
+
end
|
416
|
+
rescue ::GRPC::BadStatus => e
|
417
|
+
raise ::Google::Cloud::Error.from_error(e)
|
418
|
+
end
|
419
|
+
|
420
|
+
##
|
421
|
+
# Lists information about instances in a project.
|
422
|
+
#
|
423
|
+
# @overload list_instances(request, options = nil)
|
424
|
+
# Pass arguments to `list_instances` via a request object, either of type
|
425
|
+
# {::Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest} or an equivalent Hash.
|
426
|
+
#
|
427
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest, ::Hash]
|
428
|
+
# A request object representing the call parameters. Required. To specify no
|
429
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
430
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
431
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
432
|
+
#
|
433
|
+
# @overload list_instances(parent: nil, page_token: nil)
|
434
|
+
# Pass arguments to `list_instances` via keyword arguments. Note that at
|
435
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
436
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
437
|
+
#
|
438
|
+
# @param parent [::String]
|
439
|
+
# Required. The unique name of the project for which a list of instances is requested.
|
440
|
+
# Values are of the form `projects/{project}`.
|
441
|
+
# @param page_token [::String]
|
442
|
+
# DEPRECATED: This field is unused and ignored.
|
443
|
+
#
|
444
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
445
|
+
# @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse]
|
446
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
447
|
+
#
|
448
|
+
# @return [::Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse]
|
449
|
+
#
|
450
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
451
|
+
#
|
452
|
+
def list_instances request, options = nil
|
453
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
454
|
+
|
455
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest
|
456
|
+
|
457
|
+
# Converts hash and nil to an options object
|
458
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
459
|
+
|
460
|
+
# Customize the options with defaults
|
461
|
+
metadata = @config.rpcs.list_instances.metadata.to_h
|
462
|
+
|
463
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
464
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
465
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
466
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
467
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
468
|
+
|
469
|
+
header_params = {
|
470
|
+
"parent" => request.parent
|
471
|
+
}
|
472
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
473
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
474
|
+
|
475
|
+
options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
|
476
|
+
metadata: metadata,
|
477
|
+
retry_policy: @config.rpcs.list_instances.retry_policy
|
478
|
+
options.apply_defaults metadata: @config.metadata,
|
479
|
+
retry_policy: @config.retry_policy
|
480
|
+
|
481
|
+
@bigtable_instance_admin_stub.call_rpc :list_instances, request, options: options do |response, operation|
|
482
|
+
yield response, operation if block_given?
|
483
|
+
return response
|
484
|
+
end
|
485
|
+
rescue ::GRPC::BadStatus => e
|
486
|
+
raise ::Google::Cloud::Error.from_error(e)
|
487
|
+
end
|
488
|
+
|
489
|
+
##
|
490
|
+
# Updates an instance within a project. This method updates only the display
|
491
|
+
# name and type for an Instance. To update other Instance properties, such as
|
492
|
+
# labels, use PartialUpdateInstance.
|
493
|
+
#
|
494
|
+
# @overload update_instance(request, options = nil)
|
495
|
+
# Pass arguments to `update_instance` via a request object, either of type
|
496
|
+
# {::Google::Cloud::Bigtable::Admin::V2::Instance} or an equivalent Hash.
|
497
|
+
#
|
498
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::Instance, ::Hash]
|
499
|
+
# A request object representing the call parameters. Required. To specify no
|
500
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
501
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
502
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
503
|
+
#
|
504
|
+
# @overload update_instance(display_name: nil, state: nil, type: nil, labels: nil)
|
505
|
+
# Pass arguments to `update_instance` via keyword arguments. Note that at
|
506
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
507
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
508
|
+
#
|
509
|
+
# @param display_name [::String]
|
510
|
+
# Required. The descriptive name for this instance as it appears in UIs.
|
511
|
+
# Can be changed at any time, but should be kept globally unique
|
512
|
+
# to avoid confusion.
|
513
|
+
# @param state [::Google::Cloud::Bigtable::Admin::V2::Instance::State]
|
514
|
+
# (`OutputOnly`)
|
515
|
+
# The current state of the instance.
|
516
|
+
# @param type [::Google::Cloud::Bigtable::Admin::V2::Instance::Type]
|
517
|
+
# The type of the instance. Defaults to `PRODUCTION`.
|
518
|
+
# @param labels [::Hash{::String => ::String}]
|
519
|
+
# Labels are a flexible and lightweight mechanism for organizing cloud
|
520
|
+
# resources into groups that reflect a customer's organizational needs and
|
521
|
+
# deployment strategies. They can be used to filter resources and aggregate
|
522
|
+
# metrics.
|
523
|
+
#
|
524
|
+
# * Label keys must be between 1 and 63 characters long and must conform to
|
525
|
+
# the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
|
526
|
+
# * Label values must be between 0 and 63 characters long and must conform to
|
527
|
+
# the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
|
528
|
+
# * No more than 64 labels can be associated with a given resource.
|
529
|
+
# * Keys and values must both be under 128 bytes.
|
530
|
+
#
|
531
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
532
|
+
# @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Instance]
|
533
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
534
|
+
#
|
535
|
+
# @return [::Google::Cloud::Bigtable::Admin::V2::Instance]
|
536
|
+
#
|
537
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
538
|
+
#
|
539
|
+
def update_instance request, options = nil
|
540
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
541
|
+
|
542
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::Instance
|
543
|
+
|
544
|
+
# Converts hash and nil to an options object
|
545
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
546
|
+
|
547
|
+
# Customize the options with defaults
|
548
|
+
metadata = @config.rpcs.update_instance.metadata.to_h
|
549
|
+
|
550
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
551
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
552
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
553
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
554
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
555
|
+
|
556
|
+
header_params = {
|
557
|
+
"name" => request.name
|
558
|
+
}
|
559
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
560
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
561
|
+
|
562
|
+
options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
|
563
|
+
metadata: metadata,
|
564
|
+
retry_policy: @config.rpcs.update_instance.retry_policy
|
565
|
+
options.apply_defaults metadata: @config.metadata,
|
566
|
+
retry_policy: @config.retry_policy
|
567
|
+
|
568
|
+
@bigtable_instance_admin_stub.call_rpc :update_instance, request, options: options do |response, operation|
|
569
|
+
yield response, operation if block_given?
|
570
|
+
return response
|
571
|
+
end
|
572
|
+
rescue ::GRPC::BadStatus => e
|
573
|
+
raise ::Google::Cloud::Error.from_error(e)
|
574
|
+
end
|
575
|
+
|
576
|
+
##
|
577
|
+
# Partially updates an instance within a project. This method can modify all
|
578
|
+
# fields of an Instance and is the preferred way to update an Instance.
|
579
|
+
#
|
580
|
+
# @overload partial_update_instance(request, options = nil)
|
581
|
+
# Pass arguments to `partial_update_instance` via a request object, either of type
|
582
|
+
# {::Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest} or an equivalent Hash.
|
583
|
+
#
|
584
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest, ::Hash]
|
585
|
+
# A request object representing the call parameters. Required. To specify no
|
586
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
587
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
588
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
589
|
+
#
|
590
|
+
# @overload partial_update_instance(instance: nil, update_mask: nil)
|
591
|
+
# Pass arguments to `partial_update_instance` via keyword arguments. Note that at
|
592
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
593
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
594
|
+
#
|
595
|
+
# @param instance [::Google::Cloud::Bigtable::Admin::V2::Instance, ::Hash]
|
596
|
+
# Required. The Instance which will (partially) replace the current value.
|
597
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
598
|
+
# Required. The subset of Instance fields which should be replaced.
|
599
|
+
# Must be explicitly set.
|
600
|
+
#
|
601
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
602
|
+
# @yieldparam response [::Gapic::Operation]
|
603
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
604
|
+
#
|
605
|
+
# @return [::Gapic::Operation]
|
606
|
+
#
|
607
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
608
|
+
#
|
609
|
+
def partial_update_instance request, options = nil
|
610
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
611
|
+
|
612
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest
|
613
|
+
|
614
|
+
# Converts hash and nil to an options object
|
615
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
616
|
+
|
617
|
+
# Customize the options with defaults
|
618
|
+
metadata = @config.rpcs.partial_update_instance.metadata.to_h
|
619
|
+
|
620
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
621
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
622
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
623
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
624
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
625
|
+
|
626
|
+
header_params = {
|
627
|
+
"instance.name" => request.instance.name
|
628
|
+
}
|
629
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
630
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
631
|
+
|
632
|
+
options.apply_defaults timeout: @config.rpcs.partial_update_instance.timeout,
|
633
|
+
metadata: metadata,
|
634
|
+
retry_policy: @config.rpcs.partial_update_instance.retry_policy
|
635
|
+
options.apply_defaults metadata: @config.metadata,
|
636
|
+
retry_policy: @config.retry_policy
|
637
|
+
|
638
|
+
@bigtable_instance_admin_stub.call_rpc :partial_update_instance, request, options: options do |response, operation|
|
639
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
640
|
+
yield response, operation if block_given?
|
641
|
+
return response
|
642
|
+
end
|
643
|
+
rescue ::GRPC::BadStatus => e
|
644
|
+
raise ::Google::Cloud::Error.from_error(e)
|
645
|
+
end
|
646
|
+
|
647
|
+
##
|
648
|
+
# Delete an instance from a project.
|
649
|
+
#
|
650
|
+
# @overload delete_instance(request, options = nil)
|
651
|
+
# Pass arguments to `delete_instance` via a request object, either of type
|
652
|
+
# {::Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest} or an equivalent Hash.
|
653
|
+
#
|
654
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest, ::Hash]
|
655
|
+
# A request object representing the call parameters. Required. To specify no
|
656
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
657
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
658
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
659
|
+
#
|
660
|
+
# @overload delete_instance(name: nil)
|
661
|
+
# Pass arguments to `delete_instance` via keyword arguments. Note that at
|
662
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
663
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
664
|
+
#
|
665
|
+
# @param name [::String]
|
666
|
+
# Required. The unique name of the instance to be deleted.
|
667
|
+
# Values are of the form `projects/{project}/instances/{instance}`.
|
668
|
+
#
|
669
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
670
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
671
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
672
|
+
#
|
673
|
+
# @return [::Google::Protobuf::Empty]
|
674
|
+
#
|
675
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
676
|
+
#
|
677
|
+
def delete_instance request, options = nil
|
678
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
679
|
+
|
680
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest
|
681
|
+
|
682
|
+
# Converts hash and nil to an options object
|
683
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
684
|
+
|
685
|
+
# Customize the options with defaults
|
686
|
+
metadata = @config.rpcs.delete_instance.metadata.to_h
|
687
|
+
|
688
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
689
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
690
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
691
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
692
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
693
|
+
|
694
|
+
header_params = {
|
695
|
+
"name" => request.name
|
696
|
+
}
|
697
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
698
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
699
|
+
|
700
|
+
options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
|
701
|
+
metadata: metadata,
|
702
|
+
retry_policy: @config.rpcs.delete_instance.retry_policy
|
703
|
+
options.apply_defaults metadata: @config.metadata,
|
704
|
+
retry_policy: @config.retry_policy
|
705
|
+
|
706
|
+
@bigtable_instance_admin_stub.call_rpc :delete_instance, request, options: options do |response, operation|
|
707
|
+
yield response, operation if block_given?
|
708
|
+
return response
|
709
|
+
end
|
710
|
+
rescue ::GRPC::BadStatus => e
|
711
|
+
raise ::Google::Cloud::Error.from_error(e)
|
712
|
+
end
|
713
|
+
|
714
|
+
##
|
715
|
+
# Creates a cluster within an instance.
|
716
|
+
#
|
717
|
+
# @overload create_cluster(request, options = nil)
|
718
|
+
# Pass arguments to `create_cluster` via a request object, either of type
|
719
|
+
# {::Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest} or an equivalent Hash.
|
720
|
+
#
|
721
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest, ::Hash]
|
722
|
+
# A request object representing the call parameters. Required. To specify no
|
723
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
724
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
725
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
726
|
+
#
|
727
|
+
# @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil)
|
728
|
+
# Pass arguments to `create_cluster` via keyword arguments. Note that at
|
729
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
730
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
731
|
+
#
|
732
|
+
# @param parent [::String]
|
733
|
+
# Required. The unique name of the instance in which to create the new cluster.
|
734
|
+
# Values are of the form
|
735
|
+
# `projects/{project}/instances/{instance}`.
|
736
|
+
# @param cluster_id [::String]
|
737
|
+
# Required. The ID to be used when referring to the new cluster within its instance,
|
738
|
+
# e.g., just `mycluster` rather than
|
739
|
+
# `projects/myproject/instances/myinstance/clusters/mycluster`.
|
740
|
+
# @param cluster [::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash]
|
741
|
+
# Required. The cluster to be created.
|
742
|
+
# Fields marked `OutputOnly` must be left blank.
|
743
|
+
#
|
744
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
745
|
+
# @yieldparam response [::Gapic::Operation]
|
746
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
747
|
+
#
|
748
|
+
# @return [::Gapic::Operation]
|
749
|
+
#
|
750
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
751
|
+
#
|
752
|
+
def create_cluster request, options = nil
|
753
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
754
|
+
|
755
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest
|
756
|
+
|
757
|
+
# Converts hash and nil to an options object
|
758
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
759
|
+
|
760
|
+
# Customize the options with defaults
|
761
|
+
metadata = @config.rpcs.create_cluster.metadata.to_h
|
762
|
+
|
763
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
764
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
765
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
766
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
767
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
768
|
+
|
769
|
+
header_params = {
|
770
|
+
"parent" => request.parent
|
771
|
+
}
|
772
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
773
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
774
|
+
|
775
|
+
options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
|
776
|
+
metadata: metadata,
|
777
|
+
retry_policy: @config.rpcs.create_cluster.retry_policy
|
778
|
+
options.apply_defaults metadata: @config.metadata,
|
779
|
+
retry_policy: @config.retry_policy
|
780
|
+
|
781
|
+
@bigtable_instance_admin_stub.call_rpc :create_cluster, request, options: options do |response, operation|
|
782
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
783
|
+
yield response, operation if block_given?
|
784
|
+
return response
|
785
|
+
end
|
786
|
+
rescue ::GRPC::BadStatus => e
|
787
|
+
raise ::Google::Cloud::Error.from_error(e)
|
788
|
+
end
|
789
|
+
|
790
|
+
##
|
791
|
+
# Gets information about a cluster.
|
792
|
+
#
|
793
|
+
# @overload get_cluster(request, options = nil)
|
794
|
+
# Pass arguments to `get_cluster` via a request object, either of type
|
795
|
+
# {::Google::Cloud::Bigtable::Admin::V2::GetClusterRequest} or an equivalent Hash.
|
796
|
+
#
|
797
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::GetClusterRequest, ::Hash]
|
798
|
+
# A request object representing the call parameters. Required. To specify no
|
799
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
800
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
801
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
802
|
+
#
|
803
|
+
# @overload get_cluster(name: nil)
|
804
|
+
# Pass arguments to `get_cluster` via keyword arguments. Note that at
|
805
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
806
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
807
|
+
#
|
808
|
+
# @param name [::String]
|
809
|
+
# Required. The unique name of the requested cluster. Values are of the form
|
810
|
+
# `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
811
|
+
#
|
812
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
813
|
+
# @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Cluster]
|
814
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
815
|
+
#
|
816
|
+
# @return [::Google::Cloud::Bigtable::Admin::V2::Cluster]
|
817
|
+
#
|
818
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
819
|
+
#
|
820
|
+
def get_cluster request, options = nil
|
821
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
822
|
+
|
823
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetClusterRequest
|
824
|
+
|
825
|
+
# Converts hash and nil to an options object
|
826
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
827
|
+
|
828
|
+
# Customize the options with defaults
|
829
|
+
metadata = @config.rpcs.get_cluster.metadata.to_h
|
830
|
+
|
831
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
832
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
833
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
834
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
835
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
836
|
+
|
837
|
+
header_params = {
|
838
|
+
"name" => request.name
|
839
|
+
}
|
840
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
841
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
842
|
+
|
843
|
+
options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
|
844
|
+
metadata: metadata,
|
845
|
+
retry_policy: @config.rpcs.get_cluster.retry_policy
|
846
|
+
options.apply_defaults metadata: @config.metadata,
|
847
|
+
retry_policy: @config.retry_policy
|
848
|
+
|
849
|
+
@bigtable_instance_admin_stub.call_rpc :get_cluster, request, options: options do |response, operation|
|
850
|
+
yield response, operation if block_given?
|
851
|
+
return response
|
852
|
+
end
|
853
|
+
rescue ::GRPC::BadStatus => e
|
854
|
+
raise ::Google::Cloud::Error.from_error(e)
|
855
|
+
end
|
856
|
+
|
857
|
+
##
|
858
|
+
# Lists information about clusters in an instance.
|
859
|
+
#
|
860
|
+
# @overload list_clusters(request, options = nil)
|
861
|
+
# Pass arguments to `list_clusters` via a request object, either of type
|
862
|
+
# {::Google::Cloud::Bigtable::Admin::V2::ListClustersRequest} or an equivalent Hash.
|
863
|
+
#
|
864
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::ListClustersRequest, ::Hash]
|
865
|
+
# A request object representing the call parameters. Required. To specify no
|
866
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
867
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
868
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
869
|
+
#
|
870
|
+
# @overload list_clusters(parent: nil, page_token: nil)
|
871
|
+
# Pass arguments to `list_clusters` via keyword arguments. Note that at
|
872
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
873
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
874
|
+
#
|
875
|
+
# @param parent [::String]
|
876
|
+
# Required. The unique name of the instance for which a list of clusters is requested.
|
877
|
+
# Values are of the form `projects/{project}/instances/{instance}`.
|
878
|
+
# Use `{instance} = '-'` to list Clusters for all Instances in a project,
|
879
|
+
# e.g., `projects/myproject/instances/-`.
|
880
|
+
# @param page_token [::String]
|
881
|
+
# DEPRECATED: This field is unused and ignored.
|
882
|
+
#
|
883
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
884
|
+
# @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::ListClustersResponse]
|
885
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
886
|
+
#
|
887
|
+
# @return [::Google::Cloud::Bigtable::Admin::V2::ListClustersResponse]
|
888
|
+
#
|
889
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
890
|
+
#
|
891
|
+
def list_clusters request, options = nil
|
892
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
893
|
+
|
894
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListClustersRequest
|
895
|
+
|
896
|
+
# Converts hash and nil to an options object
|
897
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
898
|
+
|
899
|
+
# Customize the options with defaults
|
900
|
+
metadata = @config.rpcs.list_clusters.metadata.to_h
|
901
|
+
|
902
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
903
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
904
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
905
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
906
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
907
|
+
|
908
|
+
header_params = {
|
909
|
+
"parent" => request.parent
|
910
|
+
}
|
911
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
912
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
913
|
+
|
914
|
+
options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
|
915
|
+
metadata: metadata,
|
916
|
+
retry_policy: @config.rpcs.list_clusters.retry_policy
|
917
|
+
options.apply_defaults metadata: @config.metadata,
|
918
|
+
retry_policy: @config.retry_policy
|
919
|
+
|
920
|
+
@bigtable_instance_admin_stub.call_rpc :list_clusters, request, options: options do |response, operation|
|
921
|
+
yield response, operation if block_given?
|
922
|
+
return response
|
923
|
+
end
|
924
|
+
rescue ::GRPC::BadStatus => e
|
925
|
+
raise ::Google::Cloud::Error.from_error(e)
|
926
|
+
end
|
927
|
+
|
928
|
+
##
|
929
|
+
# Updates a cluster within an instance.
|
930
|
+
#
|
931
|
+
# @overload update_cluster(request, options = nil)
|
932
|
+
# Pass arguments to `update_cluster` via a request object, either of type
|
933
|
+
# {::Google::Cloud::Bigtable::Admin::V2::Cluster} or an equivalent Hash.
|
934
|
+
#
|
935
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash]
|
936
|
+
# A request object representing the call parameters. Required. To specify no
|
937
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
938
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
939
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
940
|
+
#
|
941
|
+
# @overload update_cluster(location: nil, serve_nodes: nil, default_storage_type: nil)
|
942
|
+
# Pass arguments to `update_cluster` via keyword arguments. Note that at
|
943
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
944
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
945
|
+
#
|
946
|
+
# @param location [::String]
|
947
|
+
# (`CreationOnly`)
|
948
|
+
# The location where this cluster's nodes and storage reside. For best
|
949
|
+
# performance, clients should be located as close as possible to this
|
950
|
+
# cluster. Currently only zones are supported, so values should be of the
|
951
|
+
# form `projects/{project}/locations/{zone}`.
|
952
|
+
# @param serve_nodes [::Integer]
|
953
|
+
# Required. The number of nodes allocated to this cluster. More nodes enable
|
954
|
+
# higher throughput and more consistent performance.
|
955
|
+
# @param default_storage_type [::Google::Cloud::Bigtable::Admin::V2::StorageType]
|
956
|
+
# (`CreationOnly`)
|
957
|
+
# The type of storage used by this cluster to serve its
|
958
|
+
# parent instance's tables, unless explicitly overridden.
|
959
|
+
#
|
960
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
961
|
+
# @yieldparam response [::Gapic::Operation]
|
962
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
963
|
+
#
|
964
|
+
# @return [::Gapic::Operation]
|
965
|
+
#
|
966
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
967
|
+
#
|
968
|
+
def update_cluster request, options = nil
|
969
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
970
|
+
|
971
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::Cluster
|
972
|
+
|
973
|
+
# Converts hash and nil to an options object
|
974
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
975
|
+
|
976
|
+
# Customize the options with defaults
|
977
|
+
metadata = @config.rpcs.update_cluster.metadata.to_h
|
978
|
+
|
979
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
980
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
981
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
982
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
983
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
984
|
+
|
985
|
+
header_params = {
|
986
|
+
"name" => request.name
|
987
|
+
}
|
988
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
989
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
990
|
+
|
991
|
+
options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
|
992
|
+
metadata: metadata,
|
993
|
+
retry_policy: @config.rpcs.update_cluster.retry_policy
|
994
|
+
options.apply_defaults metadata: @config.metadata,
|
995
|
+
retry_policy: @config.retry_policy
|
996
|
+
|
997
|
+
@bigtable_instance_admin_stub.call_rpc :update_cluster, request, options: options do |response, operation|
|
998
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
999
|
+
yield response, operation if block_given?
|
1000
|
+
return response
|
1001
|
+
end
|
1002
|
+
rescue ::GRPC::BadStatus => e
|
1003
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1004
|
+
end
|
1005
|
+
|
1006
|
+
##
|
1007
|
+
# Deletes a cluster from an instance.
|
1008
|
+
#
|
1009
|
+
# @overload delete_cluster(request, options = nil)
|
1010
|
+
# Pass arguments to `delete_cluster` via a request object, either of type
|
1011
|
+
# {::Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest} or an equivalent Hash.
|
1012
|
+
#
|
1013
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest, ::Hash]
|
1014
|
+
# A request object representing the call parameters. Required. To specify no
|
1015
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1016
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1017
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1018
|
+
#
|
1019
|
+
# @overload delete_cluster(name: nil)
|
1020
|
+
# Pass arguments to `delete_cluster` via keyword arguments. Note that at
|
1021
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1022
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1023
|
+
#
|
1024
|
+
# @param name [::String]
|
1025
|
+
# Required. The unique name of the cluster to be deleted. Values are of the form
|
1026
|
+
# `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
1027
|
+
#
|
1028
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1029
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
1030
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1031
|
+
#
|
1032
|
+
# @return [::Google::Protobuf::Empty]
|
1033
|
+
#
|
1034
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1035
|
+
#
|
1036
|
+
def delete_cluster request, options = nil
|
1037
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1038
|
+
|
1039
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest
|
1040
|
+
|
1041
|
+
# Converts hash and nil to an options object
|
1042
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1043
|
+
|
1044
|
+
# Customize the options with defaults
|
1045
|
+
metadata = @config.rpcs.delete_cluster.metadata.to_h
|
1046
|
+
|
1047
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1048
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1049
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1050
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1051
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1052
|
+
|
1053
|
+
header_params = {
|
1054
|
+
"name" => request.name
|
1055
|
+
}
|
1056
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1057
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1058
|
+
|
1059
|
+
options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
|
1060
|
+
metadata: metadata,
|
1061
|
+
retry_policy: @config.rpcs.delete_cluster.retry_policy
|
1062
|
+
options.apply_defaults metadata: @config.metadata,
|
1063
|
+
retry_policy: @config.retry_policy
|
1064
|
+
|
1065
|
+
@bigtable_instance_admin_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
|
1066
|
+
yield response, operation if block_given?
|
1067
|
+
return response
|
1068
|
+
end
|
1069
|
+
rescue ::GRPC::BadStatus => e
|
1070
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1071
|
+
end
|
1072
|
+
|
1073
|
+
##
|
1074
|
+
# Creates an app profile within an instance.
|
1075
|
+
#
|
1076
|
+
# @overload create_app_profile(request, options = nil)
|
1077
|
+
# Pass arguments to `create_app_profile` via a request object, either of type
|
1078
|
+
# {::Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest} or an equivalent Hash.
|
1079
|
+
#
|
1080
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest, ::Hash]
|
1081
|
+
# A request object representing the call parameters. Required. To specify no
|
1082
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1083
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1084
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1085
|
+
#
|
1086
|
+
# @overload create_app_profile(parent: nil, app_profile_id: nil, app_profile: nil, ignore_warnings: nil)
|
1087
|
+
# Pass arguments to `create_app_profile` via keyword arguments. Note that at
|
1088
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1089
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1090
|
+
#
|
1091
|
+
# @param parent [::String]
|
1092
|
+
# Required. The unique name of the instance in which to create the new app profile.
|
1093
|
+
# Values are of the form
|
1094
|
+
# `projects/{project}/instances/{instance}`.
|
1095
|
+
# @param app_profile_id [::String]
|
1096
|
+
# Required. The ID to be used when referring to the new app profile within its
|
1097
|
+
# instance, e.g., just `myprofile` rather than
|
1098
|
+
# `projects/myproject/instances/myinstance/appProfiles/myprofile`.
|
1099
|
+
# @param app_profile [::Google::Cloud::Bigtable::Admin::V2::AppProfile, ::Hash]
|
1100
|
+
# Required. The app profile to be created.
|
1101
|
+
# Fields marked `OutputOnly` will be ignored.
|
1102
|
+
# @param ignore_warnings [::Boolean]
|
1103
|
+
# If true, ignore safety checks when creating the app profile.
|
1104
|
+
#
|
1105
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1106
|
+
# @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::AppProfile]
|
1107
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1108
|
+
#
|
1109
|
+
# @return [::Google::Cloud::Bigtable::Admin::V2::AppProfile]
|
1110
|
+
#
|
1111
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1112
|
+
#
|
1113
|
+
def create_app_profile request, options = nil
|
1114
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1115
|
+
|
1116
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest
|
1117
|
+
|
1118
|
+
# Converts hash and nil to an options object
|
1119
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1120
|
+
|
1121
|
+
# Customize the options with defaults
|
1122
|
+
metadata = @config.rpcs.create_app_profile.metadata.to_h
|
1123
|
+
|
1124
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1125
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1126
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1127
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1128
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1129
|
+
|
1130
|
+
header_params = {
|
1131
|
+
"parent" => request.parent
|
1132
|
+
}
|
1133
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1134
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1135
|
+
|
1136
|
+
options.apply_defaults timeout: @config.rpcs.create_app_profile.timeout,
|
1137
|
+
metadata: metadata,
|
1138
|
+
retry_policy: @config.rpcs.create_app_profile.retry_policy
|
1139
|
+
options.apply_defaults metadata: @config.metadata,
|
1140
|
+
retry_policy: @config.retry_policy
|
1141
|
+
|
1142
|
+
@bigtable_instance_admin_stub.call_rpc :create_app_profile, request, options: options do |response, operation|
|
1143
|
+
yield response, operation if block_given?
|
1144
|
+
return response
|
1145
|
+
end
|
1146
|
+
rescue ::GRPC::BadStatus => e
|
1147
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1148
|
+
end
|
1149
|
+
|
1150
|
+
##
|
1151
|
+
# Gets information about an app profile.
|
1152
|
+
#
|
1153
|
+
# @overload get_app_profile(request, options = nil)
|
1154
|
+
# Pass arguments to `get_app_profile` via a request object, either of type
|
1155
|
+
# {::Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest} or an equivalent Hash.
|
1156
|
+
#
|
1157
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest, ::Hash]
|
1158
|
+
# A request object representing the call parameters. Required. To specify no
|
1159
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1160
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1161
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1162
|
+
#
|
1163
|
+
# @overload get_app_profile(name: nil)
|
1164
|
+
# Pass arguments to `get_app_profile` via keyword arguments. Note that at
|
1165
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1166
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1167
|
+
#
|
1168
|
+
# @param name [::String]
|
1169
|
+
# Required. The unique name of the requested app profile. Values are of the form
|
1170
|
+
# `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
|
1171
|
+
#
|
1172
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1173
|
+
# @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::AppProfile]
|
1174
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1175
|
+
#
|
1176
|
+
# @return [::Google::Cloud::Bigtable::Admin::V2::AppProfile]
|
1177
|
+
#
|
1178
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1179
|
+
#
|
1180
|
+
def get_app_profile request, options = nil
|
1181
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1182
|
+
|
1183
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest
|
1184
|
+
|
1185
|
+
# Converts hash and nil to an options object
|
1186
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1187
|
+
|
1188
|
+
# Customize the options with defaults
|
1189
|
+
metadata = @config.rpcs.get_app_profile.metadata.to_h
|
1190
|
+
|
1191
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1192
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1193
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1194
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1195
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1196
|
+
|
1197
|
+
header_params = {
|
1198
|
+
"name" => request.name
|
1199
|
+
}
|
1200
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1201
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1202
|
+
|
1203
|
+
options.apply_defaults timeout: @config.rpcs.get_app_profile.timeout,
|
1204
|
+
metadata: metadata,
|
1205
|
+
retry_policy: @config.rpcs.get_app_profile.retry_policy
|
1206
|
+
options.apply_defaults metadata: @config.metadata,
|
1207
|
+
retry_policy: @config.retry_policy
|
1208
|
+
|
1209
|
+
@bigtable_instance_admin_stub.call_rpc :get_app_profile, request, options: options do |response, operation|
|
1210
|
+
yield response, operation if block_given?
|
1211
|
+
return response
|
1212
|
+
end
|
1213
|
+
rescue ::GRPC::BadStatus => e
|
1214
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1215
|
+
end
|
1216
|
+
|
1217
|
+
##
|
1218
|
+
# Lists information about app profiles in an instance.
|
1219
|
+
#
|
1220
|
+
# @overload list_app_profiles(request, options = nil)
|
1221
|
+
# Pass arguments to `list_app_profiles` via a request object, either of type
|
1222
|
+
# {::Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest} or an equivalent Hash.
|
1223
|
+
#
|
1224
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest, ::Hash]
|
1225
|
+
# A request object representing the call parameters. Required. To specify no
|
1226
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1227
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1228
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1229
|
+
#
|
1230
|
+
# @overload list_app_profiles(parent: nil, page_size: nil, page_token: nil)
|
1231
|
+
# Pass arguments to `list_app_profiles` via keyword arguments. Note that at
|
1232
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1233
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1234
|
+
#
|
1235
|
+
# @param parent [::String]
|
1236
|
+
# Required. The unique name of the instance for which a list of app profiles is
|
1237
|
+
# requested. Values are of the form
|
1238
|
+
# `projects/{project}/instances/{instance}`.
|
1239
|
+
# Use `{instance} = '-'` to list AppProfiles for all Instances in a project,
|
1240
|
+
# e.g., `projects/myproject/instances/-`.
|
1241
|
+
# @param page_size [::Integer]
|
1242
|
+
# Maximum number of results per page.
|
1243
|
+
#
|
1244
|
+
# A page_size of zero lets the server choose the number of items to return.
|
1245
|
+
# A page_size which is strictly positive will return at most that many items.
|
1246
|
+
# A negative page_size will cause an error.
|
1247
|
+
#
|
1248
|
+
# Following the first request, subsequent paginated calls are not required
|
1249
|
+
# to pass a page_size. If a page_size is set in subsequent calls, it must
|
1250
|
+
# match the page_size given in the first request.
|
1251
|
+
# @param page_token [::String]
|
1252
|
+
# The value of `next_page_token` returned by a previous call.
|
1253
|
+
#
|
1254
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1255
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::AppProfile>]
|
1256
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1257
|
+
#
|
1258
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::AppProfile>]
|
1259
|
+
#
|
1260
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1261
|
+
#
|
1262
|
+
def list_app_profiles request, options = nil
|
1263
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1264
|
+
|
1265
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest
|
1266
|
+
|
1267
|
+
# Converts hash and nil to an options object
|
1268
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1269
|
+
|
1270
|
+
# Customize the options with defaults
|
1271
|
+
metadata = @config.rpcs.list_app_profiles.metadata.to_h
|
1272
|
+
|
1273
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1274
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1275
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1276
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1277
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1278
|
+
|
1279
|
+
header_params = {
|
1280
|
+
"parent" => request.parent
|
1281
|
+
}
|
1282
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1283
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1284
|
+
|
1285
|
+
options.apply_defaults timeout: @config.rpcs.list_app_profiles.timeout,
|
1286
|
+
metadata: metadata,
|
1287
|
+
retry_policy: @config.rpcs.list_app_profiles.retry_policy
|
1288
|
+
options.apply_defaults metadata: @config.metadata,
|
1289
|
+
retry_policy: @config.retry_policy
|
1290
|
+
|
1291
|
+
@bigtable_instance_admin_stub.call_rpc :list_app_profiles, request, options: options do |response, operation|
|
1292
|
+
response = ::Gapic::PagedEnumerable.new @bigtable_instance_admin_stub, :list_app_profiles, request, response, operation, options
|
1293
|
+
yield response, operation if block_given?
|
1294
|
+
return response
|
1295
|
+
end
|
1296
|
+
rescue ::GRPC::BadStatus => e
|
1297
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1298
|
+
end
|
1299
|
+
|
1300
|
+
##
|
1301
|
+
# Updates an app profile within an instance.
|
1302
|
+
#
|
1303
|
+
# @overload update_app_profile(request, options = nil)
|
1304
|
+
# Pass arguments to `update_app_profile` via a request object, either of type
|
1305
|
+
# {::Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest} or an equivalent Hash.
|
1306
|
+
#
|
1307
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest, ::Hash]
|
1308
|
+
# A request object representing the call parameters. Required. To specify no
|
1309
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1310
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1311
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1312
|
+
#
|
1313
|
+
# @overload update_app_profile(app_profile: nil, update_mask: nil, ignore_warnings: nil)
|
1314
|
+
# Pass arguments to `update_app_profile` via keyword arguments. Note that at
|
1315
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1316
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1317
|
+
#
|
1318
|
+
# @param app_profile [::Google::Cloud::Bigtable::Admin::V2::AppProfile, ::Hash]
|
1319
|
+
# Required. The app profile which will (partially) replace the current value.
|
1320
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1321
|
+
# Required. The subset of app profile fields which should be replaced.
|
1322
|
+
# If unset, all fields will be replaced.
|
1323
|
+
# @param ignore_warnings [::Boolean]
|
1324
|
+
# If true, ignore safety checks when updating the app profile.
|
1325
|
+
#
|
1326
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1327
|
+
# @yieldparam response [::Gapic::Operation]
|
1328
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1329
|
+
#
|
1330
|
+
# @return [::Gapic::Operation]
|
1331
|
+
#
|
1332
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1333
|
+
#
|
1334
|
+
def update_app_profile request, options = nil
|
1335
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1336
|
+
|
1337
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest
|
1338
|
+
|
1339
|
+
# Converts hash and nil to an options object
|
1340
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1341
|
+
|
1342
|
+
# Customize the options with defaults
|
1343
|
+
metadata = @config.rpcs.update_app_profile.metadata.to_h
|
1344
|
+
|
1345
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1346
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1347
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1348
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1349
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1350
|
+
|
1351
|
+
header_params = {
|
1352
|
+
"app_profile.name" => request.app_profile.name
|
1353
|
+
}
|
1354
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1355
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1356
|
+
|
1357
|
+
options.apply_defaults timeout: @config.rpcs.update_app_profile.timeout,
|
1358
|
+
metadata: metadata,
|
1359
|
+
retry_policy: @config.rpcs.update_app_profile.retry_policy
|
1360
|
+
options.apply_defaults metadata: @config.metadata,
|
1361
|
+
retry_policy: @config.retry_policy
|
1362
|
+
|
1363
|
+
@bigtable_instance_admin_stub.call_rpc :update_app_profile, request, options: options do |response, operation|
|
1364
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1365
|
+
yield response, operation if block_given?
|
1366
|
+
return response
|
1367
|
+
end
|
1368
|
+
rescue ::GRPC::BadStatus => e
|
1369
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1370
|
+
end
|
1371
|
+
|
1372
|
+
##
|
1373
|
+
# Deletes an app profile from an instance.
|
1374
|
+
#
|
1375
|
+
# @overload delete_app_profile(request, options = nil)
|
1376
|
+
# Pass arguments to `delete_app_profile` via a request object, either of type
|
1377
|
+
# {::Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest} or an equivalent Hash.
|
1378
|
+
#
|
1379
|
+
# @param request [::Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest, ::Hash]
|
1380
|
+
# A request object representing the call parameters. Required. To specify no
|
1381
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1382
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1383
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1384
|
+
#
|
1385
|
+
# @overload delete_app_profile(name: nil, ignore_warnings: nil)
|
1386
|
+
# Pass arguments to `delete_app_profile` via keyword arguments. Note that at
|
1387
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1388
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1389
|
+
#
|
1390
|
+
# @param name [::String]
|
1391
|
+
# Required. The unique name of the app profile to be deleted. Values are of the form
|
1392
|
+
# `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
|
1393
|
+
# @param ignore_warnings [::Boolean]
|
1394
|
+
# If true, ignore safety checks when deleting the app profile.
|
1395
|
+
#
|
1396
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1397
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
1398
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1399
|
+
#
|
1400
|
+
# @return [::Google::Protobuf::Empty]
|
1401
|
+
#
|
1402
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1403
|
+
#
|
1404
|
+
def delete_app_profile request, options = nil
|
1405
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1406
|
+
|
1407
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest
|
1408
|
+
|
1409
|
+
# Converts hash and nil to an options object
|
1410
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1411
|
+
|
1412
|
+
# Customize the options with defaults
|
1413
|
+
metadata = @config.rpcs.delete_app_profile.metadata.to_h
|
1414
|
+
|
1415
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1416
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1417
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1418
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1419
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1420
|
+
|
1421
|
+
header_params = {
|
1422
|
+
"name" => request.name
|
1423
|
+
}
|
1424
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1425
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1426
|
+
|
1427
|
+
options.apply_defaults timeout: @config.rpcs.delete_app_profile.timeout,
|
1428
|
+
metadata: metadata,
|
1429
|
+
retry_policy: @config.rpcs.delete_app_profile.retry_policy
|
1430
|
+
options.apply_defaults metadata: @config.metadata,
|
1431
|
+
retry_policy: @config.retry_policy
|
1432
|
+
|
1433
|
+
@bigtable_instance_admin_stub.call_rpc :delete_app_profile, request, options: options do |response, operation|
|
1434
|
+
yield response, operation if block_given?
|
1435
|
+
return response
|
1436
|
+
end
|
1437
|
+
rescue ::GRPC::BadStatus => e
|
1438
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1439
|
+
end
|
1440
|
+
|
1441
|
+
##
|
1442
|
+
# Gets the access control policy for an instance resource. Returns an empty
|
1443
|
+
# policy if an instance exists but does not have a policy set.
|
1444
|
+
#
|
1445
|
+
# @overload get_iam_policy(request, options = nil)
|
1446
|
+
# Pass arguments to `get_iam_policy` via a request object, either of type
|
1447
|
+
# {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
|
1448
|
+
#
|
1449
|
+
# @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
|
1450
|
+
# A request object representing the call parameters. Required. To specify no
|
1451
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1452
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1453
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1454
|
+
#
|
1455
|
+
# @overload get_iam_policy(resource: nil, options: nil)
|
1456
|
+
# Pass arguments to `get_iam_policy` via keyword arguments. Note that at
|
1457
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1458
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1459
|
+
#
|
1460
|
+
# @param resource [::String]
|
1461
|
+
# REQUIRED: The resource for which the policy is being requested.
|
1462
|
+
# See the operation documentation for the appropriate value for this field.
|
1463
|
+
# @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
|
1464
|
+
# OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
1465
|
+
# `GetIamPolicy`. This field is only used by Cloud IAM.
|
1466
|
+
#
|
1467
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1468
|
+
# @yieldparam response [::Google::Iam::V1::Policy]
|
1469
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1470
|
+
#
|
1471
|
+
# @return [::Google::Iam::V1::Policy]
|
1472
|
+
#
|
1473
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1474
|
+
#
|
1475
|
+
def get_iam_policy request, options = nil
|
1476
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1477
|
+
|
1478
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
|
1479
|
+
|
1480
|
+
# Converts hash and nil to an options object
|
1481
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1482
|
+
|
1483
|
+
# Customize the options with defaults
|
1484
|
+
metadata = @config.rpcs.get_iam_policy.metadata.to_h
|
1485
|
+
|
1486
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1487
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1488
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1489
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1490
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1491
|
+
|
1492
|
+
header_params = {
|
1493
|
+
"resource" => request.resource
|
1494
|
+
}
|
1495
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1496
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1497
|
+
|
1498
|
+
options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
|
1499
|
+
metadata: metadata,
|
1500
|
+
retry_policy: @config.rpcs.get_iam_policy.retry_policy
|
1501
|
+
options.apply_defaults metadata: @config.metadata,
|
1502
|
+
retry_policy: @config.retry_policy
|
1503
|
+
|
1504
|
+
@bigtable_instance_admin_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
|
1505
|
+
yield response, operation if block_given?
|
1506
|
+
return response
|
1507
|
+
end
|
1508
|
+
rescue ::GRPC::BadStatus => e
|
1509
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1510
|
+
end
|
1511
|
+
|
1512
|
+
##
|
1513
|
+
# Sets the access control policy on an instance resource. Replaces any
|
1514
|
+
# existing policy.
|
1515
|
+
#
|
1516
|
+
# @overload set_iam_policy(request, options = nil)
|
1517
|
+
# Pass arguments to `set_iam_policy` via a request object, either of type
|
1518
|
+
# {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
|
1519
|
+
#
|
1520
|
+
# @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
|
1521
|
+
# A request object representing the call parameters. Required. To specify no
|
1522
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1523
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1524
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1525
|
+
#
|
1526
|
+
# @overload set_iam_policy(resource: nil, policy: nil)
|
1527
|
+
# Pass arguments to `set_iam_policy` via keyword arguments. Note that at
|
1528
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1529
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1530
|
+
#
|
1531
|
+
# @param resource [::String]
|
1532
|
+
# REQUIRED: The resource for which the policy is being specified.
|
1533
|
+
# See the operation documentation for the appropriate value for this field.
|
1534
|
+
# @param policy [::Google::Iam::V1::Policy, ::Hash]
|
1535
|
+
# REQUIRED: The complete policy to be applied to the `resource`. The size of
|
1536
|
+
# the policy is limited to a few 10s of KB. An empty policy is a
|
1537
|
+
# valid policy but certain Cloud Platform services (such as Projects)
|
1538
|
+
# might reject them.
|
1539
|
+
#
|
1540
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1541
|
+
# @yieldparam response [::Google::Iam::V1::Policy]
|
1542
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1543
|
+
#
|
1544
|
+
# @return [::Google::Iam::V1::Policy]
|
1545
|
+
#
|
1546
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1547
|
+
#
|
1548
|
+
def set_iam_policy request, options = nil
|
1549
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1550
|
+
|
1551
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
|
1552
|
+
|
1553
|
+
# Converts hash and nil to an options object
|
1554
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1555
|
+
|
1556
|
+
# Customize the options with defaults
|
1557
|
+
metadata = @config.rpcs.set_iam_policy.metadata.to_h
|
1558
|
+
|
1559
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1560
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1561
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1562
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1563
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1564
|
+
|
1565
|
+
header_params = {
|
1566
|
+
"resource" => request.resource
|
1567
|
+
}
|
1568
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1569
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1570
|
+
|
1571
|
+
options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
|
1572
|
+
metadata: metadata,
|
1573
|
+
retry_policy: @config.rpcs.set_iam_policy.retry_policy
|
1574
|
+
options.apply_defaults metadata: @config.metadata,
|
1575
|
+
retry_policy: @config.retry_policy
|
1576
|
+
|
1577
|
+
@bigtable_instance_admin_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
|
1578
|
+
yield response, operation if block_given?
|
1579
|
+
return response
|
1580
|
+
end
|
1581
|
+
rescue ::GRPC::BadStatus => e
|
1582
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1583
|
+
end
|
1584
|
+
|
1585
|
+
##
|
1586
|
+
# Returns permissions that the caller has on the specified instance resource.
|
1587
|
+
#
|
1588
|
+
# @overload test_iam_permissions(request, options = nil)
|
1589
|
+
# Pass arguments to `test_iam_permissions` via a request object, either of type
|
1590
|
+
# {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
|
1591
|
+
#
|
1592
|
+
# @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
|
1593
|
+
# A request object representing the call parameters. Required. To specify no
|
1594
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1595
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1596
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1597
|
+
#
|
1598
|
+
# @overload test_iam_permissions(resource: nil, permissions: nil)
|
1599
|
+
# Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
|
1600
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1601
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1602
|
+
#
|
1603
|
+
# @param resource [::String]
|
1604
|
+
# REQUIRED: The resource for which the policy detail is being requested.
|
1605
|
+
# See the operation documentation for the appropriate value for this field.
|
1606
|
+
# @param permissions [::Array<::String>]
|
1607
|
+
# The set of permissions to check for the `resource`. Permissions with
|
1608
|
+
# wildcards (such as '*' or 'storage.*') are not allowed. For more
|
1609
|
+
# information see
|
1610
|
+
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
1611
|
+
#
|
1612
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1613
|
+
# @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
|
1614
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1615
|
+
#
|
1616
|
+
# @return [::Google::Iam::V1::TestIamPermissionsResponse]
|
1617
|
+
#
|
1618
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1619
|
+
#
|
1620
|
+
def test_iam_permissions request, options = nil
|
1621
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1622
|
+
|
1623
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
|
1624
|
+
|
1625
|
+
# Converts hash and nil to an options object
|
1626
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1627
|
+
|
1628
|
+
# Customize the options with defaults
|
1629
|
+
metadata = @config.rpcs.test_iam_permissions.metadata.to_h
|
1630
|
+
|
1631
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1632
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1633
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1634
|
+
gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
|
1635
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1636
|
+
|
1637
|
+
header_params = {
|
1638
|
+
"resource" => request.resource
|
1639
|
+
}
|
1640
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1641
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1642
|
+
|
1643
|
+
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
1644
|
+
metadata: metadata,
|
1645
|
+
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
|
1646
|
+
options.apply_defaults metadata: @config.metadata,
|
1647
|
+
retry_policy: @config.retry_policy
|
1648
|
+
|
1649
|
+
@bigtable_instance_admin_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
|
1650
|
+
yield response, operation if block_given?
|
1651
|
+
return response
|
1652
|
+
end
|
1653
|
+
rescue ::GRPC::BadStatus => e
|
1654
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1655
|
+
end
|
1656
|
+
|
1657
|
+
##
|
1658
|
+
# Configuration class for the BigtableInstanceAdmin API.
|
1659
|
+
#
|
1660
|
+
# This class represents the configuration for BigtableInstanceAdmin,
|
1661
|
+
# providing control over timeouts, retry behavior, logging, transport
|
1662
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
1663
|
+
# applied individually to specific RPCs. See
|
1664
|
+
# {::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client::Configuration::Rpcs}
|
1665
|
+
# for a list of RPCs that can be configured independently.
|
1666
|
+
#
|
1667
|
+
# Configuration can be applied globally to all clients, or to a single client
|
1668
|
+
# on construction.
|
1669
|
+
#
|
1670
|
+
# # Examples
|
1671
|
+
#
|
1672
|
+
# To modify the global config, setting the timeout for create_instance
|
1673
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
1674
|
+
#
|
1675
|
+
# ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.configure do |config|
|
1676
|
+
# config.timeout = 10.0
|
1677
|
+
# config.rpcs.create_instance.timeout = 20.0
|
1678
|
+
# end
|
1679
|
+
#
|
1680
|
+
# To apply the above configuration only to a new client:
|
1681
|
+
#
|
1682
|
+
# client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config|
|
1683
|
+
# config.timeout = 10.0
|
1684
|
+
# config.rpcs.create_instance.timeout = 20.0
|
1685
|
+
# end
|
1686
|
+
#
|
1687
|
+
# @!attribute [rw] endpoint
|
1688
|
+
# The hostname or hostname:port of the service endpoint.
|
1689
|
+
# Defaults to `"bigtableadmin.googleapis.com"`.
|
1690
|
+
# @return [::String]
|
1691
|
+
# @!attribute [rw] credentials
|
1692
|
+
# Credentials to send with calls. You may provide any of the following types:
|
1693
|
+
# * (`String`) The path to a service account key file in JSON format
|
1694
|
+
# * (`Hash`) A service account key as a Hash
|
1695
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1696
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
1697
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1698
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
1699
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1700
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1701
|
+
# * (`nil`) indicating no credentials
|
1702
|
+
# @return [::Object]
|
1703
|
+
# @!attribute [rw] scope
|
1704
|
+
# The OAuth scopes
|
1705
|
+
# @return [::Array<::String>]
|
1706
|
+
# @!attribute [rw] lib_name
|
1707
|
+
# The library name as recorded in instrumentation and logging
|
1708
|
+
# @return [::String]
|
1709
|
+
# @!attribute [rw] lib_version
|
1710
|
+
# The library version as recorded in instrumentation and logging
|
1711
|
+
# @return [::String]
|
1712
|
+
# @!attribute [rw] channel_args
|
1713
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
1714
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
1715
|
+
# @return [::Hash]
|
1716
|
+
# @!attribute [rw] interceptors
|
1717
|
+
# An array of interceptors that are run before calls are executed.
|
1718
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
1719
|
+
# @!attribute [rw] timeout
|
1720
|
+
# The call timeout in seconds.
|
1721
|
+
# @return [::Numeric]
|
1722
|
+
# @!attribute [rw] metadata
|
1723
|
+
# Additional gRPC headers to be sent with the call.
|
1724
|
+
# @return [::Hash{::Symbol=>::String}]
|
1725
|
+
# @!attribute [rw] retry_policy
|
1726
|
+
# The retry policy. The value is a hash with the following keys:
|
1727
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1728
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1729
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1730
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1731
|
+
# trigger a retry.
|
1732
|
+
# @return [::Hash]
|
1733
|
+
# @!attribute [rw] quota_project
|
1734
|
+
# A separate project against which to charge quota.
|
1735
|
+
# @return [::String]
|
1736
|
+
#
|
1737
|
+
class Configuration
|
1738
|
+
extend ::Gapic::Config
|
1739
|
+
|
1740
|
+
config_attr :endpoint, "bigtableadmin.googleapis.com", ::String
|
1741
|
+
config_attr :credentials, nil do |value|
|
1742
|
+
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1743
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
1744
|
+
allowed.any? { |klass| klass === value }
|
1745
|
+
end
|
1746
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1747
|
+
config_attr :lib_name, nil, ::String, nil
|
1748
|
+
config_attr :lib_version, nil, ::String, nil
|
1749
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
1750
|
+
config_attr :interceptors, nil, ::Array, nil
|
1751
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1752
|
+
config_attr :metadata, nil, ::Hash, nil
|
1753
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1754
|
+
config_attr :quota_project, nil, ::String, nil
|
1755
|
+
|
1756
|
+
# @private
|
1757
|
+
def initialize parent_config = nil
|
1758
|
+
@parent_config = parent_config unless parent_config.nil?
|
1759
|
+
|
1760
|
+
yield self if block_given?
|
1761
|
+
end
|
1762
|
+
|
1763
|
+
##
|
1764
|
+
# Configurations for individual RPCs
|
1765
|
+
# @return [Rpcs]
|
1766
|
+
#
|
1767
|
+
def rpcs
|
1768
|
+
@rpcs ||= begin
|
1769
|
+
parent_rpcs = nil
|
1770
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
1771
|
+
Rpcs.new parent_rpcs
|
1772
|
+
end
|
1773
|
+
end
|
1774
|
+
|
1775
|
+
##
|
1776
|
+
# Configuration RPC class for the BigtableInstanceAdmin API.
|
1777
|
+
#
|
1778
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1779
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1780
|
+
# the following configuration fields:
|
1781
|
+
#
|
1782
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
1783
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
1784
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1785
|
+
# include the following keys:
|
1786
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1787
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1788
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1789
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1790
|
+
# trigger a retry.
|
1791
|
+
#
|
1792
|
+
class Rpcs
|
1793
|
+
##
|
1794
|
+
# RPC-specific configuration for `create_instance`
|
1795
|
+
# @return [::Gapic::Config::Method]
|
1796
|
+
#
|
1797
|
+
attr_reader :create_instance
|
1798
|
+
##
|
1799
|
+
# RPC-specific configuration for `get_instance`
|
1800
|
+
# @return [::Gapic::Config::Method]
|
1801
|
+
#
|
1802
|
+
attr_reader :get_instance
|
1803
|
+
##
|
1804
|
+
# RPC-specific configuration for `list_instances`
|
1805
|
+
# @return [::Gapic::Config::Method]
|
1806
|
+
#
|
1807
|
+
attr_reader :list_instances
|
1808
|
+
##
|
1809
|
+
# RPC-specific configuration for `update_instance`
|
1810
|
+
# @return [::Gapic::Config::Method]
|
1811
|
+
#
|
1812
|
+
attr_reader :update_instance
|
1813
|
+
##
|
1814
|
+
# RPC-specific configuration for `partial_update_instance`
|
1815
|
+
# @return [::Gapic::Config::Method]
|
1816
|
+
#
|
1817
|
+
attr_reader :partial_update_instance
|
1818
|
+
##
|
1819
|
+
# RPC-specific configuration for `delete_instance`
|
1820
|
+
# @return [::Gapic::Config::Method]
|
1821
|
+
#
|
1822
|
+
attr_reader :delete_instance
|
1823
|
+
##
|
1824
|
+
# RPC-specific configuration for `create_cluster`
|
1825
|
+
# @return [::Gapic::Config::Method]
|
1826
|
+
#
|
1827
|
+
attr_reader :create_cluster
|
1828
|
+
##
|
1829
|
+
# RPC-specific configuration for `get_cluster`
|
1830
|
+
# @return [::Gapic::Config::Method]
|
1831
|
+
#
|
1832
|
+
attr_reader :get_cluster
|
1833
|
+
##
|
1834
|
+
# RPC-specific configuration for `list_clusters`
|
1835
|
+
# @return [::Gapic::Config::Method]
|
1836
|
+
#
|
1837
|
+
attr_reader :list_clusters
|
1838
|
+
##
|
1839
|
+
# RPC-specific configuration for `update_cluster`
|
1840
|
+
# @return [::Gapic::Config::Method]
|
1841
|
+
#
|
1842
|
+
attr_reader :update_cluster
|
1843
|
+
##
|
1844
|
+
# RPC-specific configuration for `delete_cluster`
|
1845
|
+
# @return [::Gapic::Config::Method]
|
1846
|
+
#
|
1847
|
+
attr_reader :delete_cluster
|
1848
|
+
##
|
1849
|
+
# RPC-specific configuration for `create_app_profile`
|
1850
|
+
# @return [::Gapic::Config::Method]
|
1851
|
+
#
|
1852
|
+
attr_reader :create_app_profile
|
1853
|
+
##
|
1854
|
+
# RPC-specific configuration for `get_app_profile`
|
1855
|
+
# @return [::Gapic::Config::Method]
|
1856
|
+
#
|
1857
|
+
attr_reader :get_app_profile
|
1858
|
+
##
|
1859
|
+
# RPC-specific configuration for `list_app_profiles`
|
1860
|
+
# @return [::Gapic::Config::Method]
|
1861
|
+
#
|
1862
|
+
attr_reader :list_app_profiles
|
1863
|
+
##
|
1864
|
+
# RPC-specific configuration for `update_app_profile`
|
1865
|
+
# @return [::Gapic::Config::Method]
|
1866
|
+
#
|
1867
|
+
attr_reader :update_app_profile
|
1868
|
+
##
|
1869
|
+
# RPC-specific configuration for `delete_app_profile`
|
1870
|
+
# @return [::Gapic::Config::Method]
|
1871
|
+
#
|
1872
|
+
attr_reader :delete_app_profile
|
1873
|
+
##
|
1874
|
+
# RPC-specific configuration for `get_iam_policy`
|
1875
|
+
# @return [::Gapic::Config::Method]
|
1876
|
+
#
|
1877
|
+
attr_reader :get_iam_policy
|
1878
|
+
##
|
1879
|
+
# RPC-specific configuration for `set_iam_policy`
|
1880
|
+
# @return [::Gapic::Config::Method]
|
1881
|
+
#
|
1882
|
+
attr_reader :set_iam_policy
|
1883
|
+
##
|
1884
|
+
# RPC-specific configuration for `test_iam_permissions`
|
1885
|
+
# @return [::Gapic::Config::Method]
|
1886
|
+
#
|
1887
|
+
attr_reader :test_iam_permissions
|
1888
|
+
|
1889
|
+
# @private
|
1890
|
+
def initialize parent_rpcs = nil
|
1891
|
+
create_instance_config = parent_rpcs&.create_instance if parent_rpcs&.respond_to? :create_instance
|
1892
|
+
@create_instance = ::Gapic::Config::Method.new create_instance_config
|
1893
|
+
get_instance_config = parent_rpcs&.get_instance if parent_rpcs&.respond_to? :get_instance
|
1894
|
+
@get_instance = ::Gapic::Config::Method.new get_instance_config
|
1895
|
+
list_instances_config = parent_rpcs&.list_instances if parent_rpcs&.respond_to? :list_instances
|
1896
|
+
@list_instances = ::Gapic::Config::Method.new list_instances_config
|
1897
|
+
update_instance_config = parent_rpcs&.update_instance if parent_rpcs&.respond_to? :update_instance
|
1898
|
+
@update_instance = ::Gapic::Config::Method.new update_instance_config
|
1899
|
+
partial_update_instance_config = parent_rpcs&.partial_update_instance if parent_rpcs&.respond_to? :partial_update_instance
|
1900
|
+
@partial_update_instance = ::Gapic::Config::Method.new partial_update_instance_config
|
1901
|
+
delete_instance_config = parent_rpcs&.delete_instance if parent_rpcs&.respond_to? :delete_instance
|
1902
|
+
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
1903
|
+
create_cluster_config = parent_rpcs&.create_cluster if parent_rpcs&.respond_to? :create_cluster
|
1904
|
+
@create_cluster = ::Gapic::Config::Method.new create_cluster_config
|
1905
|
+
get_cluster_config = parent_rpcs&.get_cluster if parent_rpcs&.respond_to? :get_cluster
|
1906
|
+
@get_cluster = ::Gapic::Config::Method.new get_cluster_config
|
1907
|
+
list_clusters_config = parent_rpcs&.list_clusters if parent_rpcs&.respond_to? :list_clusters
|
1908
|
+
@list_clusters = ::Gapic::Config::Method.new list_clusters_config
|
1909
|
+
update_cluster_config = parent_rpcs&.update_cluster if parent_rpcs&.respond_to? :update_cluster
|
1910
|
+
@update_cluster = ::Gapic::Config::Method.new update_cluster_config
|
1911
|
+
delete_cluster_config = parent_rpcs&.delete_cluster if parent_rpcs&.respond_to? :delete_cluster
|
1912
|
+
@delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
|
1913
|
+
create_app_profile_config = parent_rpcs&.create_app_profile if parent_rpcs&.respond_to? :create_app_profile
|
1914
|
+
@create_app_profile = ::Gapic::Config::Method.new create_app_profile_config
|
1915
|
+
get_app_profile_config = parent_rpcs&.get_app_profile if parent_rpcs&.respond_to? :get_app_profile
|
1916
|
+
@get_app_profile = ::Gapic::Config::Method.new get_app_profile_config
|
1917
|
+
list_app_profiles_config = parent_rpcs&.list_app_profiles if parent_rpcs&.respond_to? :list_app_profiles
|
1918
|
+
@list_app_profiles = ::Gapic::Config::Method.new list_app_profiles_config
|
1919
|
+
update_app_profile_config = parent_rpcs&.update_app_profile if parent_rpcs&.respond_to? :update_app_profile
|
1920
|
+
@update_app_profile = ::Gapic::Config::Method.new update_app_profile_config
|
1921
|
+
delete_app_profile_config = parent_rpcs&.delete_app_profile if parent_rpcs&.respond_to? :delete_app_profile
|
1922
|
+
@delete_app_profile = ::Gapic::Config::Method.new delete_app_profile_config
|
1923
|
+
get_iam_policy_config = parent_rpcs&.get_iam_policy if parent_rpcs&.respond_to? :get_iam_policy
|
1924
|
+
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
1925
|
+
set_iam_policy_config = parent_rpcs&.set_iam_policy if parent_rpcs&.respond_to? :set_iam_policy
|
1926
|
+
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
1927
|
+
test_iam_permissions_config = parent_rpcs&.test_iam_permissions if parent_rpcs&.respond_to? :test_iam_permissions
|
1928
|
+
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
1929
|
+
|
1930
|
+
yield self if block_given?
|
1931
|
+
end
|
1932
|
+
end
|
1933
|
+
end
|
1934
|
+
end
|
1935
|
+
end
|
1936
|
+
end
|
1937
|
+
end
|
1938
|
+
end
|
1939
|
+
end
|
1940
|
+
end
|