google-cloud-rapid_migration_assessment-v1 0.a → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/README.md +144 -8
- data/lib/google/cloud/rapid_migration_assessment/v1/bindings_override.rb +102 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb +1430 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials.rb +47 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations.rb +770 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb +88 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb +1134 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations.rb +795 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb +644 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest.rb +54 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.rb +56 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/rest.rb +38 -0
- data/lib/google/cloud/rapid_migration_assessment/v1/version.rb +7 -2
- data/lib/google/cloud/rapid_migration_assessment/v1.rb +45 -0
- data/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb +52 -0
- data/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb +65 -0
- data/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb +64 -0
- data/lib/google-cloud-rapid_migration_assessment-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.rb +184 -0
- data/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb +272 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +144 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- metadata +210 -12
@@ -0,0 +1,1134 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb"
|
21
|
+
require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module RapidMigrationAssessment
|
27
|
+
module V1
|
28
|
+
module RapidMigrationAssessment
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the RapidMigrationAssessment service.
|
32
|
+
#
|
33
|
+
# Rapid Migration Assessment service
|
34
|
+
#
|
35
|
+
class Client
|
36
|
+
include Paths
|
37
|
+
|
38
|
+
# @private
|
39
|
+
attr_reader :rapid_migration_assessment_stub
|
40
|
+
|
41
|
+
##
|
42
|
+
# Configure the RapidMigrationAssessment Client class.
|
43
|
+
#
|
44
|
+
# See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration}
|
45
|
+
# for a description of the configuration fields.
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
#
|
49
|
+
# # Modify the configuration for all RapidMigrationAssessment clients
|
50
|
+
# ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.configure do |config|
|
51
|
+
# config.timeout = 10.0
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
# @yield [config] Configure the Client client.
|
55
|
+
# @yieldparam config [Client::Configuration]
|
56
|
+
#
|
57
|
+
# @return [Client::Configuration]
|
58
|
+
#
|
59
|
+
def self.configure
|
60
|
+
@configure ||= begin
|
61
|
+
namespace = ["Google", "Cloud", "RapidMigrationAssessment", "V1"]
|
62
|
+
parent_config = while namespace.any?
|
63
|
+
parent_name = namespace.join "::"
|
64
|
+
parent_const = const_get parent_name
|
65
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
66
|
+
namespace.pop
|
67
|
+
end
|
68
|
+
default_config = Client::Configuration.new parent_config
|
69
|
+
|
70
|
+
default_config.rpcs.create_collector.timeout = 60.0
|
71
|
+
|
72
|
+
default_config.rpcs.create_annotation.timeout = 60.0
|
73
|
+
|
74
|
+
default_config.rpcs.get_annotation.timeout = 60.0
|
75
|
+
default_config.rpcs.get_annotation.retry_policy = {
|
76
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
|
77
|
+
}
|
78
|
+
|
79
|
+
default_config.rpcs.list_collectors.timeout = 60.0
|
80
|
+
default_config.rpcs.list_collectors.retry_policy = {
|
81
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
|
82
|
+
}
|
83
|
+
|
84
|
+
default_config.rpcs.get_collector.timeout = 60.0
|
85
|
+
default_config.rpcs.get_collector.retry_policy = {
|
86
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
|
87
|
+
}
|
88
|
+
|
89
|
+
default_config.rpcs.update_collector.timeout = 60.0
|
90
|
+
|
91
|
+
default_config.rpcs.delete_collector.timeout = 60.0
|
92
|
+
|
93
|
+
default_config.rpcs.resume_collector.timeout = 60.0
|
94
|
+
|
95
|
+
default_config.rpcs.register_collector.timeout = 60.0
|
96
|
+
|
97
|
+
default_config.rpcs.pause_collector.timeout = 60.0
|
98
|
+
|
99
|
+
default_config
|
100
|
+
end
|
101
|
+
yield @configure if block_given?
|
102
|
+
@configure
|
103
|
+
end
|
104
|
+
|
105
|
+
##
|
106
|
+
# Configure the RapidMigrationAssessment Client instance.
|
107
|
+
#
|
108
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
109
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
110
|
+
# should be made on {Client.configure}.
|
111
|
+
#
|
112
|
+
# See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration}
|
113
|
+
# for a description of the configuration fields.
|
114
|
+
#
|
115
|
+
# @yield [config] Configure the Client client.
|
116
|
+
# @yieldparam config [Client::Configuration]
|
117
|
+
#
|
118
|
+
# @return [Client::Configuration]
|
119
|
+
#
|
120
|
+
def configure
|
121
|
+
yield @config if block_given?
|
122
|
+
@config
|
123
|
+
end
|
124
|
+
|
125
|
+
##
|
126
|
+
# Create a new RapidMigrationAssessment REST client object.
|
127
|
+
#
|
128
|
+
# @example
|
129
|
+
#
|
130
|
+
# # Create a client using the default configuration
|
131
|
+
# client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
|
132
|
+
#
|
133
|
+
# # Create a client using a custom configuration
|
134
|
+
# client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config|
|
135
|
+
# config.timeout = 10.0
|
136
|
+
# end
|
137
|
+
#
|
138
|
+
# @yield [config] Configure the RapidMigrationAssessment client.
|
139
|
+
# @yieldparam config [Client::Configuration]
|
140
|
+
#
|
141
|
+
def initialize
|
142
|
+
# Create the configuration object
|
143
|
+
@config = Configuration.new Client.configure
|
144
|
+
|
145
|
+
# Yield the configuration if needed
|
146
|
+
yield @config if block_given?
|
147
|
+
|
148
|
+
# Create credentials
|
149
|
+
credentials = @config.credentials
|
150
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
151
|
+
# but only if the default endpoint does not have a region prefix.
|
152
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
153
|
+
!@config.endpoint.split(".").first.include?("-")
|
154
|
+
credentials ||= Credentials.default scope: @config.scope,
|
155
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
156
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
157
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
158
|
+
end
|
159
|
+
|
160
|
+
@quota_project_id = @config.quota_project
|
161
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
162
|
+
|
163
|
+
@operations_client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Operations.new do |config|
|
164
|
+
config.credentials = credentials
|
165
|
+
config.quota_project = @quota_project_id
|
166
|
+
config.endpoint = @config.endpoint
|
167
|
+
end
|
168
|
+
|
169
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
170
|
+
config.credentials = credentials
|
171
|
+
config.quota_project = @quota_project_id
|
172
|
+
config.endpoint = @config.endpoint
|
173
|
+
config.bindings_override = @config.bindings_override
|
174
|
+
end
|
175
|
+
|
176
|
+
@rapid_migration_assessment_stub = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
177
|
+
end
|
178
|
+
|
179
|
+
##
|
180
|
+
# Get the associated client for long-running operations.
|
181
|
+
#
|
182
|
+
# @return [::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Operations]
|
183
|
+
#
|
184
|
+
attr_reader :operations_client
|
185
|
+
|
186
|
+
##
|
187
|
+
# Get the associated client for mix-in of the Locations.
|
188
|
+
#
|
189
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
190
|
+
#
|
191
|
+
attr_reader :location_client
|
192
|
+
|
193
|
+
# Service calls
|
194
|
+
|
195
|
+
##
|
196
|
+
# Create a Collector to manage the on-prem appliance which collects
|
197
|
+
# information about Customer assets.
|
198
|
+
#
|
199
|
+
# @overload create_collector(request, options = nil)
|
200
|
+
# Pass arguments to `create_collector` via a request object, either of type
|
201
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest} or an equivalent Hash.
|
202
|
+
#
|
203
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, ::Hash]
|
204
|
+
# A request object representing the call parameters. Required. To specify no
|
205
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
206
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
207
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
208
|
+
#
|
209
|
+
# @overload create_collector(parent: nil, collector_id: nil, collector: nil, request_id: nil)
|
210
|
+
# Pass arguments to `create_collector` via keyword arguments. Note that at
|
211
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
212
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
213
|
+
#
|
214
|
+
# @param parent [::String]
|
215
|
+
# Required. Name of the parent (project+location).
|
216
|
+
# @param collector_id [::String]
|
217
|
+
# Required. Id of the requesting object.
|
218
|
+
# @param collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash]
|
219
|
+
# Required. The resource being created.
|
220
|
+
# @param request_id [::String]
|
221
|
+
# Optional. An optional request ID to identify requests.
|
222
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
223
|
+
# @yieldparam result [::Gapic::Operation]
|
224
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
225
|
+
#
|
226
|
+
# @return [::Gapic::Operation]
|
227
|
+
#
|
228
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
229
|
+
def create_collector request, options = nil
|
230
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
231
|
+
|
232
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest
|
233
|
+
|
234
|
+
# Converts hash and nil to an options object
|
235
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
236
|
+
|
237
|
+
# Customize the options with defaults
|
238
|
+
call_metadata = @config.rpcs.create_collector.metadata.to_h
|
239
|
+
|
240
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
241
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
242
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
243
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
244
|
+
transports_version_send: [:rest]
|
245
|
+
|
246
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
247
|
+
|
248
|
+
options.apply_defaults timeout: @config.rpcs.create_collector.timeout,
|
249
|
+
metadata: call_metadata,
|
250
|
+
retry_policy: @config.rpcs.create_collector.retry_policy
|
251
|
+
|
252
|
+
options.apply_defaults timeout: @config.timeout,
|
253
|
+
metadata: @config.metadata,
|
254
|
+
retry_policy: @config.retry_policy
|
255
|
+
|
256
|
+
@rapid_migration_assessment_stub.create_collector request, options do |result, operation|
|
257
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
258
|
+
yield result, operation if block_given?
|
259
|
+
return result
|
260
|
+
end
|
261
|
+
rescue ::Gapic::Rest::Error => e
|
262
|
+
raise ::Google::Cloud::Error.from_error(e)
|
263
|
+
end
|
264
|
+
|
265
|
+
##
|
266
|
+
# Creates an Annotation
|
267
|
+
#
|
268
|
+
# @overload create_annotation(request, options = nil)
|
269
|
+
# Pass arguments to `create_annotation` via a request object, either of type
|
270
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest} or an equivalent Hash.
|
271
|
+
#
|
272
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, ::Hash]
|
273
|
+
# A request object representing the call parameters. Required. To specify no
|
274
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
275
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
276
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
277
|
+
#
|
278
|
+
# @overload create_annotation(parent: nil, annotation: nil, request_id: nil)
|
279
|
+
# Pass arguments to `create_annotation` via keyword arguments. Note that at
|
280
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
281
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
282
|
+
#
|
283
|
+
# @param parent [::String]
|
284
|
+
# Required. Name of the parent (project+location).
|
285
|
+
# @param annotation [::Google::Cloud::RapidMigrationAssessment::V1::Annotation, ::Hash]
|
286
|
+
# Required. The resource being created.
|
287
|
+
# @param request_id [::String]
|
288
|
+
# Optional. An optional request ID to identify requests.
|
289
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
290
|
+
# @yieldparam result [::Gapic::Operation]
|
291
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
292
|
+
#
|
293
|
+
# @return [::Gapic::Operation]
|
294
|
+
#
|
295
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
296
|
+
def create_annotation request, options = nil
|
297
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
298
|
+
|
299
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest
|
300
|
+
|
301
|
+
# Converts hash and nil to an options object
|
302
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
303
|
+
|
304
|
+
# Customize the options with defaults
|
305
|
+
call_metadata = @config.rpcs.create_annotation.metadata.to_h
|
306
|
+
|
307
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
308
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
309
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
310
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
311
|
+
transports_version_send: [:rest]
|
312
|
+
|
313
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
314
|
+
|
315
|
+
options.apply_defaults timeout: @config.rpcs.create_annotation.timeout,
|
316
|
+
metadata: call_metadata,
|
317
|
+
retry_policy: @config.rpcs.create_annotation.retry_policy
|
318
|
+
|
319
|
+
options.apply_defaults timeout: @config.timeout,
|
320
|
+
metadata: @config.metadata,
|
321
|
+
retry_policy: @config.retry_policy
|
322
|
+
|
323
|
+
@rapid_migration_assessment_stub.create_annotation request, options do |result, operation|
|
324
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
325
|
+
yield result, operation if block_given?
|
326
|
+
return result
|
327
|
+
end
|
328
|
+
rescue ::Gapic::Rest::Error => e
|
329
|
+
raise ::Google::Cloud::Error.from_error(e)
|
330
|
+
end
|
331
|
+
|
332
|
+
##
|
333
|
+
# Gets details of a single Annotation.
|
334
|
+
#
|
335
|
+
# @overload get_annotation(request, options = nil)
|
336
|
+
# Pass arguments to `get_annotation` via a request object, either of type
|
337
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest} or an equivalent Hash.
|
338
|
+
#
|
339
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, ::Hash]
|
340
|
+
# A request object representing the call parameters. Required. To specify no
|
341
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
342
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
343
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
344
|
+
#
|
345
|
+
# @overload get_annotation(name: nil)
|
346
|
+
# Pass arguments to `get_annotation` via keyword arguments. Note that at
|
347
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
348
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
349
|
+
#
|
350
|
+
# @param name [::String]
|
351
|
+
# Required. Name of the resource.
|
352
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
353
|
+
# @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::Annotation]
|
354
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
355
|
+
#
|
356
|
+
# @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation]
|
357
|
+
#
|
358
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
359
|
+
def get_annotation request, options = nil
|
360
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
361
|
+
|
362
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest
|
363
|
+
|
364
|
+
# Converts hash and nil to an options object
|
365
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
366
|
+
|
367
|
+
# Customize the options with defaults
|
368
|
+
call_metadata = @config.rpcs.get_annotation.metadata.to_h
|
369
|
+
|
370
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
371
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
372
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
373
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
374
|
+
transports_version_send: [:rest]
|
375
|
+
|
376
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
377
|
+
|
378
|
+
options.apply_defaults timeout: @config.rpcs.get_annotation.timeout,
|
379
|
+
metadata: call_metadata,
|
380
|
+
retry_policy: @config.rpcs.get_annotation.retry_policy
|
381
|
+
|
382
|
+
options.apply_defaults timeout: @config.timeout,
|
383
|
+
metadata: @config.metadata,
|
384
|
+
retry_policy: @config.retry_policy
|
385
|
+
|
386
|
+
@rapid_migration_assessment_stub.get_annotation request, options do |result, operation|
|
387
|
+
yield result, operation if block_given?
|
388
|
+
return result
|
389
|
+
end
|
390
|
+
rescue ::Gapic::Rest::Error => e
|
391
|
+
raise ::Google::Cloud::Error.from_error(e)
|
392
|
+
end
|
393
|
+
|
394
|
+
##
|
395
|
+
# Lists Collectors in a given project and location.
|
396
|
+
#
|
397
|
+
# @overload list_collectors(request, options = nil)
|
398
|
+
# Pass arguments to `list_collectors` via a request object, either of type
|
399
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest} or an equivalent Hash.
|
400
|
+
#
|
401
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, ::Hash]
|
402
|
+
# A request object representing the call parameters. Required. To specify no
|
403
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
404
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
405
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
406
|
+
#
|
407
|
+
# @overload list_collectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
408
|
+
# Pass arguments to `list_collectors` via keyword arguments. Note that at
|
409
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
410
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
411
|
+
#
|
412
|
+
# @param parent [::String]
|
413
|
+
# Required. Parent value for ListCollectorsRequest.
|
414
|
+
# @param page_size [::Integer]
|
415
|
+
# Requested page size. Server may return fewer items than requested.
|
416
|
+
# If unspecified, server will pick an appropriate default.
|
417
|
+
# @param page_token [::String]
|
418
|
+
# A token identifying a page of results the server should return.
|
419
|
+
# @param filter [::String]
|
420
|
+
# Filtering results.
|
421
|
+
# @param order_by [::String]
|
422
|
+
# Hint for how to order the results.
|
423
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
424
|
+
# @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse]
|
425
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
426
|
+
#
|
427
|
+
# @return [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse]
|
428
|
+
#
|
429
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
430
|
+
def list_collectors request, options = nil
|
431
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
432
|
+
|
433
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest
|
434
|
+
|
435
|
+
# Converts hash and nil to an options object
|
436
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
437
|
+
|
438
|
+
# Customize the options with defaults
|
439
|
+
call_metadata = @config.rpcs.list_collectors.metadata.to_h
|
440
|
+
|
441
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
442
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
443
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
444
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
445
|
+
transports_version_send: [:rest]
|
446
|
+
|
447
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
448
|
+
|
449
|
+
options.apply_defaults timeout: @config.rpcs.list_collectors.timeout,
|
450
|
+
metadata: call_metadata,
|
451
|
+
retry_policy: @config.rpcs.list_collectors.retry_policy
|
452
|
+
|
453
|
+
options.apply_defaults timeout: @config.timeout,
|
454
|
+
metadata: @config.metadata,
|
455
|
+
retry_policy: @config.retry_policy
|
456
|
+
|
457
|
+
@rapid_migration_assessment_stub.list_collectors request, options do |result, operation|
|
458
|
+
yield result, operation if block_given?
|
459
|
+
return result
|
460
|
+
end
|
461
|
+
rescue ::Gapic::Rest::Error => e
|
462
|
+
raise ::Google::Cloud::Error.from_error(e)
|
463
|
+
end
|
464
|
+
|
465
|
+
##
|
466
|
+
# Gets details of a single Collector.
|
467
|
+
#
|
468
|
+
# @overload get_collector(request, options = nil)
|
469
|
+
# Pass arguments to `get_collector` via a request object, either of type
|
470
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest} or an equivalent Hash.
|
471
|
+
#
|
472
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, ::Hash]
|
473
|
+
# A request object representing the call parameters. Required. To specify no
|
474
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
475
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
476
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
477
|
+
#
|
478
|
+
# @overload get_collector(name: nil)
|
479
|
+
# Pass arguments to `get_collector` via keyword arguments. Note that at
|
480
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
481
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
482
|
+
#
|
483
|
+
# @param name [::String]
|
484
|
+
# Required. Name of the resource.
|
485
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
486
|
+
# @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::Collector]
|
487
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
488
|
+
#
|
489
|
+
# @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector]
|
490
|
+
#
|
491
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
492
|
+
def get_collector request, options = nil
|
493
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
494
|
+
|
495
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest
|
496
|
+
|
497
|
+
# Converts hash and nil to an options object
|
498
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
499
|
+
|
500
|
+
# Customize the options with defaults
|
501
|
+
call_metadata = @config.rpcs.get_collector.metadata.to_h
|
502
|
+
|
503
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
504
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
505
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
506
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
507
|
+
transports_version_send: [:rest]
|
508
|
+
|
509
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
510
|
+
|
511
|
+
options.apply_defaults timeout: @config.rpcs.get_collector.timeout,
|
512
|
+
metadata: call_metadata,
|
513
|
+
retry_policy: @config.rpcs.get_collector.retry_policy
|
514
|
+
|
515
|
+
options.apply_defaults timeout: @config.timeout,
|
516
|
+
metadata: @config.metadata,
|
517
|
+
retry_policy: @config.retry_policy
|
518
|
+
|
519
|
+
@rapid_migration_assessment_stub.get_collector request, options do |result, operation|
|
520
|
+
yield result, operation if block_given?
|
521
|
+
return result
|
522
|
+
end
|
523
|
+
rescue ::Gapic::Rest::Error => e
|
524
|
+
raise ::Google::Cloud::Error.from_error(e)
|
525
|
+
end
|
526
|
+
|
527
|
+
##
|
528
|
+
# Updates the parameters of a single Collector.
|
529
|
+
#
|
530
|
+
# @overload update_collector(request, options = nil)
|
531
|
+
# Pass arguments to `update_collector` via a request object, either of type
|
532
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest} or an equivalent Hash.
|
533
|
+
#
|
534
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, ::Hash]
|
535
|
+
# A request object representing the call parameters. Required. To specify no
|
536
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
537
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
538
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
539
|
+
#
|
540
|
+
# @overload update_collector(update_mask: nil, collector: nil, request_id: nil)
|
541
|
+
# Pass arguments to `update_collector` via keyword arguments. Note that at
|
542
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
543
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
544
|
+
#
|
545
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
546
|
+
# Required. Field mask is used to specify the fields to be overwritten in the
|
547
|
+
# Collector resource by the update.
|
548
|
+
# The fields specified in the update_mask are relative to the resource, not
|
549
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
550
|
+
# user does not provide a mask then all fields will be overwritten.
|
551
|
+
# @param collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash]
|
552
|
+
# Required. The resource being updated.
|
553
|
+
# @param request_id [::String]
|
554
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
555
|
+
# request ID so that if you must retry your request, the server will know to
|
556
|
+
# ignore the request if it has already been completed. The server will
|
557
|
+
# guarantee that for at least 60 minutes since the first request.
|
558
|
+
#
|
559
|
+
# For example, consider a situation where you make an initial request and
|
560
|
+
# the request times out. If you make the request again with the same request
|
561
|
+
# ID, the server can check if original operation with the same request ID
|
562
|
+
# was received, and if so, will ignore the second request. This prevents
|
563
|
+
# clients from accidentally creating duplicate commitments.
|
564
|
+
#
|
565
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
566
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
567
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
568
|
+
# @yieldparam result [::Gapic::Operation]
|
569
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
570
|
+
#
|
571
|
+
# @return [::Gapic::Operation]
|
572
|
+
#
|
573
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
574
|
+
def update_collector request, options = nil
|
575
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
576
|
+
|
577
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest
|
578
|
+
|
579
|
+
# Converts hash and nil to an options object
|
580
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
581
|
+
|
582
|
+
# Customize the options with defaults
|
583
|
+
call_metadata = @config.rpcs.update_collector.metadata.to_h
|
584
|
+
|
585
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
586
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
587
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
588
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
589
|
+
transports_version_send: [:rest]
|
590
|
+
|
591
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
592
|
+
|
593
|
+
options.apply_defaults timeout: @config.rpcs.update_collector.timeout,
|
594
|
+
metadata: call_metadata,
|
595
|
+
retry_policy: @config.rpcs.update_collector.retry_policy
|
596
|
+
|
597
|
+
options.apply_defaults timeout: @config.timeout,
|
598
|
+
metadata: @config.metadata,
|
599
|
+
retry_policy: @config.retry_policy
|
600
|
+
|
601
|
+
@rapid_migration_assessment_stub.update_collector request, options do |result, operation|
|
602
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
603
|
+
yield result, operation if block_given?
|
604
|
+
return result
|
605
|
+
end
|
606
|
+
rescue ::Gapic::Rest::Error => e
|
607
|
+
raise ::Google::Cloud::Error.from_error(e)
|
608
|
+
end
|
609
|
+
|
610
|
+
##
|
611
|
+
# Deletes a single Collector - changes state of collector to "Deleting".
|
612
|
+
#
|
613
|
+
# @overload delete_collector(request, options = nil)
|
614
|
+
# Pass arguments to `delete_collector` via a request object, either of type
|
615
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest} or an equivalent Hash.
|
616
|
+
#
|
617
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, ::Hash]
|
618
|
+
# A request object representing the call parameters. Required. To specify no
|
619
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
620
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
621
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
622
|
+
#
|
623
|
+
# @overload delete_collector(name: nil, request_id: nil)
|
624
|
+
# Pass arguments to `delete_collector` via keyword arguments. Note that at
|
625
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
626
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
627
|
+
#
|
628
|
+
# @param name [::String]
|
629
|
+
# Required. Name of the resource.
|
630
|
+
# @param request_id [::String]
|
631
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
632
|
+
# request ID so that if you must retry your request, the server will know to
|
633
|
+
# ignore the request if it has already been completed. The server will
|
634
|
+
# guarantee that for at least 60 minutes after the first request.
|
635
|
+
#
|
636
|
+
# For example, consider a situation where you make an initial request and
|
637
|
+
# the request times out. If you make the request again with the same request
|
638
|
+
# ID, the server can check if original operation with the same request ID
|
639
|
+
# was received, and if so, will ignore the second request. This prevents
|
640
|
+
# clients from accidentally creating duplicate commitments.
|
641
|
+
#
|
642
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
643
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
644
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
645
|
+
# @yieldparam result [::Gapic::Operation]
|
646
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
647
|
+
#
|
648
|
+
# @return [::Gapic::Operation]
|
649
|
+
#
|
650
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
651
|
+
def delete_collector request, options = nil
|
652
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
653
|
+
|
654
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest
|
655
|
+
|
656
|
+
# Converts hash and nil to an options object
|
657
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
658
|
+
|
659
|
+
# Customize the options with defaults
|
660
|
+
call_metadata = @config.rpcs.delete_collector.metadata.to_h
|
661
|
+
|
662
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
663
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
664
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
665
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
666
|
+
transports_version_send: [:rest]
|
667
|
+
|
668
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
669
|
+
|
670
|
+
options.apply_defaults timeout: @config.rpcs.delete_collector.timeout,
|
671
|
+
metadata: call_metadata,
|
672
|
+
retry_policy: @config.rpcs.delete_collector.retry_policy
|
673
|
+
|
674
|
+
options.apply_defaults timeout: @config.timeout,
|
675
|
+
metadata: @config.metadata,
|
676
|
+
retry_policy: @config.retry_policy
|
677
|
+
|
678
|
+
@rapid_migration_assessment_stub.delete_collector request, options do |result, operation|
|
679
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
680
|
+
yield result, operation if block_given?
|
681
|
+
return result
|
682
|
+
end
|
683
|
+
rescue ::Gapic::Rest::Error => e
|
684
|
+
raise ::Google::Cloud::Error.from_error(e)
|
685
|
+
end
|
686
|
+
|
687
|
+
##
|
688
|
+
# Resumes the given collector.
|
689
|
+
#
|
690
|
+
# @overload resume_collector(request, options = nil)
|
691
|
+
# Pass arguments to `resume_collector` via a request object, either of type
|
692
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest} or an equivalent Hash.
|
693
|
+
#
|
694
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, ::Hash]
|
695
|
+
# A request object representing the call parameters. Required. To specify no
|
696
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
697
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
698
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
699
|
+
#
|
700
|
+
# @overload resume_collector(name: nil, request_id: nil)
|
701
|
+
# Pass arguments to `resume_collector` via keyword arguments. Note that at
|
702
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
703
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
704
|
+
#
|
705
|
+
# @param name [::String]
|
706
|
+
# Required. Name of the resource.
|
707
|
+
# @param request_id [::String]
|
708
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
709
|
+
# request ID so that if you must retry your request, the server will know to
|
710
|
+
# ignore the request if it has already been completed. The server will
|
711
|
+
# guarantee that for at least 60 minutes after the first request.
|
712
|
+
#
|
713
|
+
# For example, consider a situation where you make an initial request and
|
714
|
+
# the request times out. If you make the request again with the same request
|
715
|
+
# ID, the server can check if original operation with the same request ID
|
716
|
+
# was received, and if so, will ignore the second request. This prevents
|
717
|
+
# clients from accidentally creating duplicate commitments.
|
718
|
+
#
|
719
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
720
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
721
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
722
|
+
# @yieldparam result [::Gapic::Operation]
|
723
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
724
|
+
#
|
725
|
+
# @return [::Gapic::Operation]
|
726
|
+
#
|
727
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
728
|
+
def resume_collector request, options = nil
|
729
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
730
|
+
|
731
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest
|
732
|
+
|
733
|
+
# Converts hash and nil to an options object
|
734
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
735
|
+
|
736
|
+
# Customize the options with defaults
|
737
|
+
call_metadata = @config.rpcs.resume_collector.metadata.to_h
|
738
|
+
|
739
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
740
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
741
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
742
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
743
|
+
transports_version_send: [:rest]
|
744
|
+
|
745
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
746
|
+
|
747
|
+
options.apply_defaults timeout: @config.rpcs.resume_collector.timeout,
|
748
|
+
metadata: call_metadata,
|
749
|
+
retry_policy: @config.rpcs.resume_collector.retry_policy
|
750
|
+
|
751
|
+
options.apply_defaults timeout: @config.timeout,
|
752
|
+
metadata: @config.metadata,
|
753
|
+
retry_policy: @config.retry_policy
|
754
|
+
|
755
|
+
@rapid_migration_assessment_stub.resume_collector request, options do |result, operation|
|
756
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
757
|
+
yield result, operation if block_given?
|
758
|
+
return result
|
759
|
+
end
|
760
|
+
rescue ::Gapic::Rest::Error => e
|
761
|
+
raise ::Google::Cloud::Error.from_error(e)
|
762
|
+
end
|
763
|
+
|
764
|
+
##
|
765
|
+
# Registers the given collector.
|
766
|
+
#
|
767
|
+
# @overload register_collector(request, options = nil)
|
768
|
+
# Pass arguments to `register_collector` via a request object, either of type
|
769
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest} or an equivalent Hash.
|
770
|
+
#
|
771
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, ::Hash]
|
772
|
+
# A request object representing the call parameters. Required. To specify no
|
773
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
774
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
775
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
776
|
+
#
|
777
|
+
# @overload register_collector(name: nil, request_id: nil)
|
778
|
+
# Pass arguments to `register_collector` via keyword arguments. Note that at
|
779
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
780
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
781
|
+
#
|
782
|
+
# @param name [::String]
|
783
|
+
# Required. Name of the resource.
|
784
|
+
# @param request_id [::String]
|
785
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
786
|
+
# request ID so that if you must retry your request, the server will know to
|
787
|
+
# ignore the request if it has already been completed. The server will
|
788
|
+
# guarantee that for at least 60 minutes after the first request.
|
789
|
+
#
|
790
|
+
# For example, consider a situation where you make an initial request and
|
791
|
+
# the request times out. If you make the request again with the same request
|
792
|
+
# ID, the server can check if original operation with the same request ID
|
793
|
+
# was received, and if so, will ignore the second request. This prevents
|
794
|
+
# clients from accidentally creating duplicate commitments.
|
795
|
+
#
|
796
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
797
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
798
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
799
|
+
# @yieldparam result [::Gapic::Operation]
|
800
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
801
|
+
#
|
802
|
+
# @return [::Gapic::Operation]
|
803
|
+
#
|
804
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
805
|
+
def register_collector request, options = nil
|
806
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
807
|
+
|
808
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest
|
809
|
+
|
810
|
+
# Converts hash and nil to an options object
|
811
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
812
|
+
|
813
|
+
# Customize the options with defaults
|
814
|
+
call_metadata = @config.rpcs.register_collector.metadata.to_h
|
815
|
+
|
816
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
817
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
818
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
819
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
820
|
+
transports_version_send: [:rest]
|
821
|
+
|
822
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
823
|
+
|
824
|
+
options.apply_defaults timeout: @config.rpcs.register_collector.timeout,
|
825
|
+
metadata: call_metadata,
|
826
|
+
retry_policy: @config.rpcs.register_collector.retry_policy
|
827
|
+
|
828
|
+
options.apply_defaults timeout: @config.timeout,
|
829
|
+
metadata: @config.metadata,
|
830
|
+
retry_policy: @config.retry_policy
|
831
|
+
|
832
|
+
@rapid_migration_assessment_stub.register_collector request, options do |result, operation|
|
833
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
834
|
+
yield result, operation if block_given?
|
835
|
+
return result
|
836
|
+
end
|
837
|
+
rescue ::Gapic::Rest::Error => e
|
838
|
+
raise ::Google::Cloud::Error.from_error(e)
|
839
|
+
end
|
840
|
+
|
841
|
+
##
|
842
|
+
# Pauses the given collector.
|
843
|
+
#
|
844
|
+
# @overload pause_collector(request, options = nil)
|
845
|
+
# Pass arguments to `pause_collector` via a request object, either of type
|
846
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest} or an equivalent Hash.
|
847
|
+
#
|
848
|
+
# @param request [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, ::Hash]
|
849
|
+
# A request object representing the call parameters. Required. To specify no
|
850
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
851
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
852
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
853
|
+
#
|
854
|
+
# @overload pause_collector(name: nil, request_id: nil)
|
855
|
+
# Pass arguments to `pause_collector` via keyword arguments. Note that at
|
856
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
857
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
858
|
+
#
|
859
|
+
# @param name [::String]
|
860
|
+
# Required. Name of the resource.
|
861
|
+
# @param request_id [::String]
|
862
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
863
|
+
# request ID so that if you must retry your request, the server will know to
|
864
|
+
# ignore the request if it has already been completed. The server will
|
865
|
+
# guarantee that for at least 60 minutes after the first request.
|
866
|
+
#
|
867
|
+
# For example, consider a situation where you make an initial request and
|
868
|
+
# the request times out. If you make the request again with the same request
|
869
|
+
# ID, the server can check if original operation with the same request ID
|
870
|
+
# was received, and if so, will ignore the second request. This prevents
|
871
|
+
# clients from accidentally creating duplicate commitments.
|
872
|
+
#
|
873
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
874
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
875
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
876
|
+
# @yieldparam result [::Gapic::Operation]
|
877
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
878
|
+
#
|
879
|
+
# @return [::Gapic::Operation]
|
880
|
+
#
|
881
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
882
|
+
def pause_collector request, options = nil
|
883
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
884
|
+
|
885
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest
|
886
|
+
|
887
|
+
# Converts hash and nil to an options object
|
888
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
889
|
+
|
890
|
+
# Customize the options with defaults
|
891
|
+
call_metadata = @config.rpcs.pause_collector.metadata.to_h
|
892
|
+
|
893
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
894
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
895
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
896
|
+
gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
|
897
|
+
transports_version_send: [:rest]
|
898
|
+
|
899
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
900
|
+
|
901
|
+
options.apply_defaults timeout: @config.rpcs.pause_collector.timeout,
|
902
|
+
metadata: call_metadata,
|
903
|
+
retry_policy: @config.rpcs.pause_collector.retry_policy
|
904
|
+
|
905
|
+
options.apply_defaults timeout: @config.timeout,
|
906
|
+
metadata: @config.metadata,
|
907
|
+
retry_policy: @config.retry_policy
|
908
|
+
|
909
|
+
@rapid_migration_assessment_stub.pause_collector request, options do |result, operation|
|
910
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
911
|
+
yield result, operation if block_given?
|
912
|
+
return result
|
913
|
+
end
|
914
|
+
rescue ::Gapic::Rest::Error => e
|
915
|
+
raise ::Google::Cloud::Error.from_error(e)
|
916
|
+
end
|
917
|
+
|
918
|
+
##
|
919
|
+
# Configuration class for the RapidMigrationAssessment REST API.
|
920
|
+
#
|
921
|
+
# This class represents the configuration for RapidMigrationAssessment REST,
|
922
|
+
# providing control over timeouts, retry behavior, logging, transport
|
923
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
924
|
+
# applied individually to specific RPCs. See
|
925
|
+
# {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration::Rpcs}
|
926
|
+
# for a list of RPCs that can be configured independently.
|
927
|
+
#
|
928
|
+
# Configuration can be applied globally to all clients, or to a single client
|
929
|
+
# on construction.
|
930
|
+
#
|
931
|
+
# @example
|
932
|
+
#
|
933
|
+
# # Modify the global config, setting the timeout for
|
934
|
+
# # create_collector to 20 seconds,
|
935
|
+
# # and all remaining timeouts to 10 seconds.
|
936
|
+
# ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.configure do |config|
|
937
|
+
# config.timeout = 10.0
|
938
|
+
# config.rpcs.create_collector.timeout = 20.0
|
939
|
+
# end
|
940
|
+
#
|
941
|
+
# # Apply the above configuration only to a new client.
|
942
|
+
# client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config|
|
943
|
+
# config.timeout = 10.0
|
944
|
+
# config.rpcs.create_collector.timeout = 20.0
|
945
|
+
# end
|
946
|
+
#
|
947
|
+
# @!attribute [rw] endpoint
|
948
|
+
# The hostname or hostname:port of the service endpoint.
|
949
|
+
# Defaults to `"rapidmigrationassessment.googleapis.com"`.
|
950
|
+
# @return [::String]
|
951
|
+
# @!attribute [rw] credentials
|
952
|
+
# Credentials to send with calls. You may provide any of the following types:
|
953
|
+
# * (`String`) The path to a service account key file in JSON format
|
954
|
+
# * (`Hash`) A service account key as a Hash
|
955
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
956
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
957
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
958
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
959
|
+
# * (`nil`) indicating no credentials
|
960
|
+
# @return [::Object]
|
961
|
+
# @!attribute [rw] scope
|
962
|
+
# The OAuth scopes
|
963
|
+
# @return [::Array<::String>]
|
964
|
+
# @!attribute [rw] lib_name
|
965
|
+
# The library name as recorded in instrumentation and logging
|
966
|
+
# @return [::String]
|
967
|
+
# @!attribute [rw] lib_version
|
968
|
+
# The library version as recorded in instrumentation and logging
|
969
|
+
# @return [::String]
|
970
|
+
# @!attribute [rw] timeout
|
971
|
+
# The call timeout in seconds.
|
972
|
+
# @return [::Numeric]
|
973
|
+
# @!attribute [rw] metadata
|
974
|
+
# Additional headers to be sent with the call.
|
975
|
+
# @return [::Hash{::Symbol=>::String}]
|
976
|
+
# @!attribute [rw] retry_policy
|
977
|
+
# The retry policy. The value is a hash with the following keys:
|
978
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
979
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
980
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
981
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
982
|
+
# trigger a retry.
|
983
|
+
# @return [::Hash]
|
984
|
+
# @!attribute [rw] quota_project
|
985
|
+
# A separate project against which to charge quota.
|
986
|
+
# @return [::String]
|
987
|
+
#
|
988
|
+
class Configuration
|
989
|
+
extend ::Gapic::Config
|
990
|
+
|
991
|
+
DEFAULT_ENDPOINT = "rapidmigrationassessment.googleapis.com"
|
992
|
+
|
993
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
994
|
+
config_attr :credentials, nil do |value|
|
995
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
996
|
+
allowed.any? { |klass| klass === value }
|
997
|
+
end
|
998
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
999
|
+
config_attr :lib_name, nil, ::String, nil
|
1000
|
+
config_attr :lib_version, nil, ::String, nil
|
1001
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1002
|
+
config_attr :metadata, nil, ::Hash, nil
|
1003
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1004
|
+
config_attr :quota_project, nil, ::String, nil
|
1005
|
+
|
1006
|
+
# @private
|
1007
|
+
# Overrides for http bindings for the RPCs of this service
|
1008
|
+
# are only used when this service is used as mixin, and only
|
1009
|
+
# by the host service.
|
1010
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1011
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
1012
|
+
|
1013
|
+
# @private
|
1014
|
+
def initialize parent_config = nil
|
1015
|
+
@parent_config = parent_config unless parent_config.nil?
|
1016
|
+
|
1017
|
+
yield self if block_given?
|
1018
|
+
end
|
1019
|
+
|
1020
|
+
##
|
1021
|
+
# Configurations for individual RPCs
|
1022
|
+
# @return [Rpcs]
|
1023
|
+
#
|
1024
|
+
def rpcs
|
1025
|
+
@rpcs ||= begin
|
1026
|
+
parent_rpcs = nil
|
1027
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1028
|
+
Rpcs.new parent_rpcs
|
1029
|
+
end
|
1030
|
+
end
|
1031
|
+
|
1032
|
+
##
|
1033
|
+
# Configuration RPC class for the RapidMigrationAssessment API.
|
1034
|
+
#
|
1035
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1036
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1037
|
+
# the following configuration fields:
|
1038
|
+
#
|
1039
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
1040
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
1041
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1042
|
+
# include the following keys:
|
1043
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1044
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1045
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1046
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1047
|
+
# trigger a retry.
|
1048
|
+
#
|
1049
|
+
class Rpcs
|
1050
|
+
##
|
1051
|
+
# RPC-specific configuration for `create_collector`
|
1052
|
+
# @return [::Gapic::Config::Method]
|
1053
|
+
#
|
1054
|
+
attr_reader :create_collector
|
1055
|
+
##
|
1056
|
+
# RPC-specific configuration for `create_annotation`
|
1057
|
+
# @return [::Gapic::Config::Method]
|
1058
|
+
#
|
1059
|
+
attr_reader :create_annotation
|
1060
|
+
##
|
1061
|
+
# RPC-specific configuration for `get_annotation`
|
1062
|
+
# @return [::Gapic::Config::Method]
|
1063
|
+
#
|
1064
|
+
attr_reader :get_annotation
|
1065
|
+
##
|
1066
|
+
# RPC-specific configuration for `list_collectors`
|
1067
|
+
# @return [::Gapic::Config::Method]
|
1068
|
+
#
|
1069
|
+
attr_reader :list_collectors
|
1070
|
+
##
|
1071
|
+
# RPC-specific configuration for `get_collector`
|
1072
|
+
# @return [::Gapic::Config::Method]
|
1073
|
+
#
|
1074
|
+
attr_reader :get_collector
|
1075
|
+
##
|
1076
|
+
# RPC-specific configuration for `update_collector`
|
1077
|
+
# @return [::Gapic::Config::Method]
|
1078
|
+
#
|
1079
|
+
attr_reader :update_collector
|
1080
|
+
##
|
1081
|
+
# RPC-specific configuration for `delete_collector`
|
1082
|
+
# @return [::Gapic::Config::Method]
|
1083
|
+
#
|
1084
|
+
attr_reader :delete_collector
|
1085
|
+
##
|
1086
|
+
# RPC-specific configuration for `resume_collector`
|
1087
|
+
# @return [::Gapic::Config::Method]
|
1088
|
+
#
|
1089
|
+
attr_reader :resume_collector
|
1090
|
+
##
|
1091
|
+
# RPC-specific configuration for `register_collector`
|
1092
|
+
# @return [::Gapic::Config::Method]
|
1093
|
+
#
|
1094
|
+
attr_reader :register_collector
|
1095
|
+
##
|
1096
|
+
# RPC-specific configuration for `pause_collector`
|
1097
|
+
# @return [::Gapic::Config::Method]
|
1098
|
+
#
|
1099
|
+
attr_reader :pause_collector
|
1100
|
+
|
1101
|
+
# @private
|
1102
|
+
def initialize parent_rpcs = nil
|
1103
|
+
create_collector_config = parent_rpcs.create_collector if parent_rpcs.respond_to? :create_collector
|
1104
|
+
@create_collector = ::Gapic::Config::Method.new create_collector_config
|
1105
|
+
create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation
|
1106
|
+
@create_annotation = ::Gapic::Config::Method.new create_annotation_config
|
1107
|
+
get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation
|
1108
|
+
@get_annotation = ::Gapic::Config::Method.new get_annotation_config
|
1109
|
+
list_collectors_config = parent_rpcs.list_collectors if parent_rpcs.respond_to? :list_collectors
|
1110
|
+
@list_collectors = ::Gapic::Config::Method.new list_collectors_config
|
1111
|
+
get_collector_config = parent_rpcs.get_collector if parent_rpcs.respond_to? :get_collector
|
1112
|
+
@get_collector = ::Gapic::Config::Method.new get_collector_config
|
1113
|
+
update_collector_config = parent_rpcs.update_collector if parent_rpcs.respond_to? :update_collector
|
1114
|
+
@update_collector = ::Gapic::Config::Method.new update_collector_config
|
1115
|
+
delete_collector_config = parent_rpcs.delete_collector if parent_rpcs.respond_to? :delete_collector
|
1116
|
+
@delete_collector = ::Gapic::Config::Method.new delete_collector_config
|
1117
|
+
resume_collector_config = parent_rpcs.resume_collector if parent_rpcs.respond_to? :resume_collector
|
1118
|
+
@resume_collector = ::Gapic::Config::Method.new resume_collector_config
|
1119
|
+
register_collector_config = parent_rpcs.register_collector if parent_rpcs.respond_to? :register_collector
|
1120
|
+
@register_collector = ::Gapic::Config::Method.new register_collector_config
|
1121
|
+
pause_collector_config = parent_rpcs.pause_collector if parent_rpcs.respond_to? :pause_collector
|
1122
|
+
@pause_collector = ::Gapic::Config::Method.new pause_collector_config
|
1123
|
+
|
1124
|
+
yield self if block_given?
|
1125
|
+
end
|
1126
|
+
end
|
1127
|
+
end
|
1128
|
+
end
|
1129
|
+
end
|
1130
|
+
end
|
1131
|
+
end
|
1132
|
+
end
|
1133
|
+
end
|
1134
|
+
end
|