google-apis-datamigration_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1178 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module DatamigrationV1
23
+ # Database Migration API
24
+ #
25
+ # Manage Cloud Database Migration Service resources on Google Cloud Platform.
26
+ #
27
+ # @example
28
+ # require 'google/apis/datamigration_v1'
29
+ #
30
+ # Datamigration = Google::Apis::DatamigrationV1 # Alias the module
31
+ # service = Datamigration::DatabaseMigrationServiceService.new
32
+ #
33
+ # @see https://cloud.google.com/database-migration/
34
+ class DatabaseMigrationServiceService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://datamigration.googleapis.com/', '',
47
+ client_name: 'google-apis-datamigration_v1',
48
+ client_version: Google::Apis::DatamigrationV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets information about a location.
53
+ # @param [String] name
54
+ # Resource name for the location.
55
+ # @param [String] fields
56
+ # Selector specifying which fields to include in a partial response.
57
+ # @param [String] quota_user
58
+ # Available to use for quota purposes for server-side applications. Can be any
59
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
60
+ # @param [Google::Apis::RequestOptions] options
61
+ # Request-specific options
62
+ #
63
+ # @yield [result, err] Result & error if block supplied
64
+ # @yieldparam result [Google::Apis::DatamigrationV1::Location] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::DatamigrationV1::Location]
68
+ #
69
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
72
+ def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:get, 'v1/{+name}', options)
74
+ command.response_representation = Google::Apis::DatamigrationV1::Location::Representation
75
+ command.response_class = Google::Apis::DatamigrationV1::Location
76
+ command.params['name'] = name unless name.nil?
77
+ command.query['fields'] = fields unless fields.nil?
78
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
79
+ execute_or_queue_command(command, &block)
80
+ end
81
+
82
+ # Lists information about the supported locations for this service.
83
+ # @param [String] name
84
+ # The resource that owns the locations collection, if applicable.
85
+ # @param [String] filter
86
+ # A filter to narrow down results to a preferred subset. The filtering language
87
+ # accepts strings like "displayName=tokyo", and is documented in more detail in [
88
+ # AIP-160](https://google.aip.dev/160).
89
+ # @param [Fixnum] page_size
90
+ # The maximum number of results to return. If not set, the service will select a
91
+ # default.
92
+ # @param [String] page_token
93
+ # A page token received from the `next_page_token` field in the response. Send
94
+ # that page token to receive the subsequent page.
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
97
+ # @param [String] quota_user
98
+ # Available to use for quota purposes for server-side applications. Can be any
99
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
100
+ # @param [Google::Apis::RequestOptions] options
101
+ # Request-specific options
102
+ #
103
+ # @yield [result, err] Result & error if block supplied
104
+ # @yieldparam result [Google::Apis::DatamigrationV1::ListLocationsResponse] parsed result object
105
+ # @yieldparam err [StandardError] error object if request failed
106
+ #
107
+ # @return [Google::Apis::DatamigrationV1::ListLocationsResponse]
108
+ #
109
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
110
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
111
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
112
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
113
+ command = make_simple_command(:get, 'v1/{+name}/locations', options)
114
+ command.response_representation = Google::Apis::DatamigrationV1::ListLocationsResponse::Representation
115
+ command.response_class = Google::Apis::DatamigrationV1::ListLocationsResponse
116
+ command.params['name'] = name unless name.nil?
117
+ command.query['filter'] = filter unless filter.nil?
118
+ command.query['pageSize'] = page_size unless page_size.nil?
119
+ command.query['pageToken'] = page_token unless page_token.nil?
120
+ command.query['fields'] = fields unless fields.nil?
121
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Creates a new connection profile in a given project and location.
126
+ # @param [String] parent
127
+ # Required. The parent, which owns this collection of connection profiles.
128
+ # @param [Google::Apis::DatamigrationV1::ConnectionProfile] connection_profile_object
129
+ # @param [String] connection_profile_id
130
+ # Required. The connection profile identifier.
131
+ # @param [String] request_id
132
+ # A unique id used to identify the request. If the server receives two requests
133
+ # with the same id, then the second request will be ignored. It is recommended
134
+ # to always set this value to a UUID. The id must contain only letters (a-z, A-Z)
135
+ # , numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40
136
+ # characters.
137
+ # @param [String] fields
138
+ # Selector specifying which fields to include in a partial response.
139
+ # @param [String] quota_user
140
+ # Available to use for quota purposes for server-side applications. Can be any
141
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
142
+ # @param [Google::Apis::RequestOptions] options
143
+ # Request-specific options
144
+ #
145
+ # @yield [result, err] Result & error if block supplied
146
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
147
+ # @yieldparam err [StandardError] error object if request failed
148
+ #
149
+ # @return [Google::Apis::DatamigrationV1::Operation]
150
+ #
151
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
152
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
153
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
154
+ def create_project_location_connection_profile(parent, connection_profile_object = nil, connection_profile_id: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
155
+ command = make_simple_command(:post, 'v1/{+parent}/connectionProfiles', options)
156
+ command.request_representation = Google::Apis::DatamigrationV1::ConnectionProfile::Representation
157
+ command.request_object = connection_profile_object
158
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
159
+ command.response_class = Google::Apis::DatamigrationV1::Operation
160
+ command.params['parent'] = parent unless parent.nil?
161
+ command.query['connectionProfileId'] = connection_profile_id unless connection_profile_id.nil?
162
+ command.query['requestId'] = request_id unless request_id.nil?
163
+ command.query['fields'] = fields unless fields.nil?
164
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
165
+ execute_or_queue_command(command, &block)
166
+ end
167
+
168
+ # Deletes a single Database Migration Service connection profile. A connection
169
+ # profile can only be deleted if it is not in use by any active migration jobs.
170
+ # @param [String] name
171
+ # Required. Name of the connection profile resource to delete.
172
+ # @param [Boolean] force
173
+ # In case of force delete, the CloudSQL replica database is also deleted (only
174
+ # for CloudSQL connection profile).
175
+ # @param [String] request_id
176
+ # A unique id used to identify the request. If the server receives two requests
177
+ # with the same id, then the second request will be ignored. It is recommended
178
+ # to always set this value to a UUID. The id must contain only letters (a-z, A-Z)
179
+ # , numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40
180
+ # characters.
181
+ # @param [String] fields
182
+ # Selector specifying which fields to include in a partial response.
183
+ # @param [String] quota_user
184
+ # Available to use for quota purposes for server-side applications. Can be any
185
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
186
+ # @param [Google::Apis::RequestOptions] options
187
+ # Request-specific options
188
+ #
189
+ # @yield [result, err] Result & error if block supplied
190
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
191
+ # @yieldparam err [StandardError] error object if request failed
192
+ #
193
+ # @return [Google::Apis::DatamigrationV1::Operation]
194
+ #
195
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
196
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
197
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
198
+ def delete_project_location_connection_profile(name, force: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
199
+ command = make_simple_command(:delete, 'v1/{+name}', options)
200
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
201
+ command.response_class = Google::Apis::DatamigrationV1::Operation
202
+ command.params['name'] = name unless name.nil?
203
+ command.query['force'] = force unless force.nil?
204
+ command.query['requestId'] = request_id unless request_id.nil?
205
+ command.query['fields'] = fields unless fields.nil?
206
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
207
+ execute_or_queue_command(command, &block)
208
+ end
209
+
210
+ # Gets details of a single connection profile.
211
+ # @param [String] name
212
+ # Required. Name of the connection profile resource to get.
213
+ # @param [String] fields
214
+ # Selector specifying which fields to include in a partial response.
215
+ # @param [String] quota_user
216
+ # Available to use for quota purposes for server-side applications. Can be any
217
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
218
+ # @param [Google::Apis::RequestOptions] options
219
+ # Request-specific options
220
+ #
221
+ # @yield [result, err] Result & error if block supplied
222
+ # @yieldparam result [Google::Apis::DatamigrationV1::ConnectionProfile] parsed result object
223
+ # @yieldparam err [StandardError] error object if request failed
224
+ #
225
+ # @return [Google::Apis::DatamigrationV1::ConnectionProfile]
226
+ #
227
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
228
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
229
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
230
+ def get_project_location_connection_profile(name, fields: nil, quota_user: nil, options: nil, &block)
231
+ command = make_simple_command(:get, 'v1/{+name}', options)
232
+ command.response_representation = Google::Apis::DatamigrationV1::ConnectionProfile::Representation
233
+ command.response_class = Google::Apis::DatamigrationV1::ConnectionProfile
234
+ command.params['name'] = name unless name.nil?
235
+ command.query['fields'] = fields unless fields.nil?
236
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
237
+ execute_or_queue_command(command, &block)
238
+ end
239
+
240
+ # Gets the access control policy for a resource. Returns an empty policy if the
241
+ # resource exists and does not have a policy set.
242
+ # @param [String] resource
243
+ # REQUIRED: The resource for which the policy is being requested. See the
244
+ # operation documentation for the appropriate value for this field.
245
+ # @param [Fixnum] options_requested_policy_version
246
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
247
+ # 3. Requests specifying an invalid value will be rejected. Requests for
248
+ # policies with any conditional bindings must specify version 3. Policies
249
+ # without any conditional bindings may specify any valid value or leave the
250
+ # field unset. To learn which resources support conditions in their IAM policies,
251
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
252
+ # resource-policies).
253
+ # @param [String] fields
254
+ # Selector specifying which fields to include in a partial response.
255
+ # @param [String] quota_user
256
+ # Available to use for quota purposes for server-side applications. Can be any
257
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
258
+ # @param [Google::Apis::RequestOptions] options
259
+ # Request-specific options
260
+ #
261
+ # @yield [result, err] Result & error if block supplied
262
+ # @yieldparam result [Google::Apis::DatamigrationV1::Policy] parsed result object
263
+ # @yieldparam err [StandardError] error object if request failed
264
+ #
265
+ # @return [Google::Apis::DatamigrationV1::Policy]
266
+ #
267
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
268
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
269
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
270
+ def get_project_location_connection_profile_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
271
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
272
+ command.response_representation = Google::Apis::DatamigrationV1::Policy::Representation
273
+ command.response_class = Google::Apis::DatamigrationV1::Policy
274
+ command.params['resource'] = resource unless resource.nil?
275
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
276
+ command.query['fields'] = fields unless fields.nil?
277
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
278
+ execute_or_queue_command(command, &block)
279
+ end
280
+
281
+ # Retrieve a list of all connection profiles in a given project and location.
282
+ # @param [String] parent
283
+ # Required. The parent, which owns this collection of connection profiles.
284
+ # @param [String] filter
285
+ # A filter expression that filters connection profiles listed in the response.
286
+ # The expression must specify the field name, a comparison operator, and the
287
+ # value that you want to use for filtering. The value must be a string, a number,
288
+ # or a boolean. The comparison operator must be either =, !=, >, or <. For
289
+ # example, list connection profiles created this year by specifying **createTime
290
+ # %gt; 2020-01-01T00:00:00.000000000Z**. You can also filter nested fields. For
291
+ # example, you could specify **mySql.username = %lt;my_username%gt;** to list
292
+ # all connection profiles configured to connect with a specific username.
293
+ # @param [String] order_by
294
+ # the order by fields for the result.
295
+ # @param [Fixnum] page_size
296
+ # The maximum number of connection profiles to return. The service may return
297
+ # fewer than this value. If unspecified, at most 50 connection profiles will be
298
+ # returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
299
+ # @param [String] page_token
300
+ # A page token, received from a previous `ListConnectionProfiles` call. Provide
301
+ # this to retrieve the subsequent page. When paginating, all other parameters
302
+ # provided to `ListConnectionProfiles` must match the call that provided the
303
+ # page token.
304
+ # @param [String] fields
305
+ # Selector specifying which fields to include in a partial response.
306
+ # @param [String] quota_user
307
+ # Available to use for quota purposes for server-side applications. Can be any
308
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
309
+ # @param [Google::Apis::RequestOptions] options
310
+ # Request-specific options
311
+ #
312
+ # @yield [result, err] Result & error if block supplied
313
+ # @yieldparam result [Google::Apis::DatamigrationV1::ListConnectionProfilesResponse] parsed result object
314
+ # @yieldparam err [StandardError] error object if request failed
315
+ #
316
+ # @return [Google::Apis::DatamigrationV1::ListConnectionProfilesResponse]
317
+ #
318
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
319
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
320
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
321
+ def list_project_location_connection_profiles(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
322
+ command = make_simple_command(:get, 'v1/{+parent}/connectionProfiles', options)
323
+ command.response_representation = Google::Apis::DatamigrationV1::ListConnectionProfilesResponse::Representation
324
+ command.response_class = Google::Apis::DatamigrationV1::ListConnectionProfilesResponse
325
+ command.params['parent'] = parent unless parent.nil?
326
+ command.query['filter'] = filter unless filter.nil?
327
+ command.query['orderBy'] = order_by unless order_by.nil?
328
+ command.query['pageSize'] = page_size unless page_size.nil?
329
+ command.query['pageToken'] = page_token unless page_token.nil?
330
+ command.query['fields'] = fields unless fields.nil?
331
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
332
+ execute_or_queue_command(command, &block)
333
+ end
334
+
335
+ # Update the configuration of a single connection profile.
336
+ # @param [String] name
337
+ # The name of this connection profile resource in the form of projects/`project`/
338
+ # locations/`location`/instances/`instance`.
339
+ # @param [Google::Apis::DatamigrationV1::ConnectionProfile] connection_profile_object
340
+ # @param [String] request_id
341
+ # A unique id used to identify the request. If the server receives two requests
342
+ # with the same id, then the second request will be ignored. It is recommended
343
+ # to always set this value to a UUID. The id must contain only letters (a-z, A-Z)
344
+ # , numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40
345
+ # characters.
346
+ # @param [String] update_mask
347
+ # Required. Field mask is used to specify the fields to be overwritten in the
348
+ # connection profile resource by the update.
349
+ # @param [String] fields
350
+ # Selector specifying which fields to include in a partial response.
351
+ # @param [String] quota_user
352
+ # Available to use for quota purposes for server-side applications. Can be any
353
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
354
+ # @param [Google::Apis::RequestOptions] options
355
+ # Request-specific options
356
+ #
357
+ # @yield [result, err] Result & error if block supplied
358
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
359
+ # @yieldparam err [StandardError] error object if request failed
360
+ #
361
+ # @return [Google::Apis::DatamigrationV1::Operation]
362
+ #
363
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
364
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
365
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
366
+ def patch_project_location_connection_profile(name, connection_profile_object = nil, request_id: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
367
+ command = make_simple_command(:patch, 'v1/{+name}', options)
368
+ command.request_representation = Google::Apis::DatamigrationV1::ConnectionProfile::Representation
369
+ command.request_object = connection_profile_object
370
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
371
+ command.response_class = Google::Apis::DatamigrationV1::Operation
372
+ command.params['name'] = name unless name.nil?
373
+ command.query['requestId'] = request_id unless request_id.nil?
374
+ command.query['updateMask'] = update_mask unless update_mask.nil?
375
+ command.query['fields'] = fields unless fields.nil?
376
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
377
+ execute_or_queue_command(command, &block)
378
+ end
379
+
380
+ # Sets the access control policy on the specified resource. Replaces any
381
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
382
+ # PERMISSION_DENIED` errors.
383
+ # @param [String] resource
384
+ # REQUIRED: The resource for which the policy is being specified. See the
385
+ # operation documentation for the appropriate value for this field.
386
+ # @param [Google::Apis::DatamigrationV1::SetIamPolicyRequest] set_iam_policy_request_object
387
+ # @param [String] fields
388
+ # Selector specifying which fields to include in a partial response.
389
+ # @param [String] quota_user
390
+ # Available to use for quota purposes for server-side applications. Can be any
391
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
392
+ # @param [Google::Apis::RequestOptions] options
393
+ # Request-specific options
394
+ #
395
+ # @yield [result, err] Result & error if block supplied
396
+ # @yieldparam result [Google::Apis::DatamigrationV1::Policy] parsed result object
397
+ # @yieldparam err [StandardError] error object if request failed
398
+ #
399
+ # @return [Google::Apis::DatamigrationV1::Policy]
400
+ #
401
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
402
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
403
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
404
+ def set_connection_profile_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
405
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
406
+ command.request_representation = Google::Apis::DatamigrationV1::SetIamPolicyRequest::Representation
407
+ command.request_object = set_iam_policy_request_object
408
+ command.response_representation = Google::Apis::DatamigrationV1::Policy::Representation
409
+ command.response_class = Google::Apis::DatamigrationV1::Policy
410
+ command.params['resource'] = resource unless resource.nil?
411
+ command.query['fields'] = fields unless fields.nil?
412
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
413
+ execute_or_queue_command(command, &block)
414
+ end
415
+
416
+ # Returns permissions that a caller has on the specified resource. If the
417
+ # resource does not exist, this will return an empty set of permissions, not a `
418
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
419
+ # permission-aware UIs and command-line tools, not for authorization checking.
420
+ # This operation may "fail open" without warning.
421
+ # @param [String] resource
422
+ # REQUIRED: The resource for which the policy detail is being requested. See the
423
+ # operation documentation for the appropriate value for this field.
424
+ # @param [Google::Apis::DatamigrationV1::TestIamPermissionsRequest] test_iam_permissions_request_object
425
+ # @param [String] fields
426
+ # Selector specifying which fields to include in a partial response.
427
+ # @param [String] quota_user
428
+ # Available to use for quota purposes for server-side applications. Can be any
429
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
430
+ # @param [Google::Apis::RequestOptions] options
431
+ # Request-specific options
432
+ #
433
+ # @yield [result, err] Result & error if block supplied
434
+ # @yieldparam result [Google::Apis::DatamigrationV1::TestIamPermissionsResponse] parsed result object
435
+ # @yieldparam err [StandardError] error object if request failed
436
+ #
437
+ # @return [Google::Apis::DatamigrationV1::TestIamPermissionsResponse]
438
+ #
439
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
440
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
441
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
442
+ def test_connection_profile_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
443
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
444
+ command.request_representation = Google::Apis::DatamigrationV1::TestIamPermissionsRequest::Representation
445
+ command.request_object = test_iam_permissions_request_object
446
+ command.response_representation = Google::Apis::DatamigrationV1::TestIamPermissionsResponse::Representation
447
+ command.response_class = Google::Apis::DatamigrationV1::TestIamPermissionsResponse
448
+ command.params['resource'] = resource unless resource.nil?
449
+ command.query['fields'] = fields unless fields.nil?
450
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
451
+ execute_or_queue_command(command, &block)
452
+ end
453
+
454
+ # Creates a new migration job in a given project and location.
455
+ # @param [String] parent
456
+ # Required. The parent, which owns this collection of migration jobs.
457
+ # @param [Google::Apis::DatamigrationV1::MigrationJob] migration_job_object
458
+ # @param [String] migration_job_id
459
+ # Required. The ID of the instance to create.
460
+ # @param [String] request_id
461
+ # A unique id used to identify the request. If the server receives two requests
462
+ # with the same id, then the second request will be ignored. It is recommended
463
+ # to always set this value to a UUID. The id must contain only letters (a-z, A-Z)
464
+ # , numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40
465
+ # characters.
466
+ # @param [String] fields
467
+ # Selector specifying which fields to include in a partial response.
468
+ # @param [String] quota_user
469
+ # Available to use for quota purposes for server-side applications. Can be any
470
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
471
+ # @param [Google::Apis::RequestOptions] options
472
+ # Request-specific options
473
+ #
474
+ # @yield [result, err] Result & error if block supplied
475
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
476
+ # @yieldparam err [StandardError] error object if request failed
477
+ #
478
+ # @return [Google::Apis::DatamigrationV1::Operation]
479
+ #
480
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
481
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
482
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
483
+ def create_project_location_migration_job(parent, migration_job_object = nil, migration_job_id: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
484
+ command = make_simple_command(:post, 'v1/{+parent}/migrationJobs', options)
485
+ command.request_representation = Google::Apis::DatamigrationV1::MigrationJob::Representation
486
+ command.request_object = migration_job_object
487
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
488
+ command.response_class = Google::Apis::DatamigrationV1::Operation
489
+ command.params['parent'] = parent unless parent.nil?
490
+ command.query['migrationJobId'] = migration_job_id unless migration_job_id.nil?
491
+ command.query['requestId'] = request_id unless request_id.nil?
492
+ command.query['fields'] = fields unless fields.nil?
493
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
494
+ execute_or_queue_command(command, &block)
495
+ end
496
+
497
+ # Deletes a single migration job.
498
+ # @param [String] name
499
+ # Required. Name of the migration job resource to delete.
500
+ # @param [Boolean] force
501
+ # The destination CloudSQL connection profile is always deleted with the
502
+ # migration job. In case of force delete, the destination CloudSQL replica
503
+ # database is also deleted.
504
+ # @param [String] request_id
505
+ # A unique id used to identify the request. If the server receives two requests
506
+ # with the same id, then the second request will be ignored. It is recommended
507
+ # to always set this value to a UUID. The id must contain only letters (a-z, A-Z)
508
+ # , numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40
509
+ # characters.
510
+ # @param [String] fields
511
+ # Selector specifying which fields to include in a partial response.
512
+ # @param [String] quota_user
513
+ # Available to use for quota purposes for server-side applications. Can be any
514
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
515
+ # @param [Google::Apis::RequestOptions] options
516
+ # Request-specific options
517
+ #
518
+ # @yield [result, err] Result & error if block supplied
519
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
520
+ # @yieldparam err [StandardError] error object if request failed
521
+ #
522
+ # @return [Google::Apis::DatamigrationV1::Operation]
523
+ #
524
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
525
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
526
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
527
+ def delete_project_location_migration_job(name, force: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
528
+ command = make_simple_command(:delete, 'v1/{+name}', options)
529
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
530
+ command.response_class = Google::Apis::DatamigrationV1::Operation
531
+ command.params['name'] = name unless name.nil?
532
+ command.query['force'] = force unless force.nil?
533
+ command.query['requestId'] = request_id unless request_id.nil?
534
+ command.query['fields'] = fields unless fields.nil?
535
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
536
+ execute_or_queue_command(command, &block)
537
+ end
538
+
539
+ # Generate a SSH configuration script to configure the reverse SSH connectivity.
540
+ # @param [String] migration_job
541
+ # Name of the migration job resource to generate the SSH script.
542
+ # @param [Google::Apis::DatamigrationV1::GenerateSshScriptRequest] generate_ssh_script_request_object
543
+ # @param [String] fields
544
+ # Selector specifying which fields to include in a partial response.
545
+ # @param [String] quota_user
546
+ # Available to use for quota purposes for server-side applications. Can be any
547
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
548
+ # @param [Google::Apis::RequestOptions] options
549
+ # Request-specific options
550
+ #
551
+ # @yield [result, err] Result & error if block supplied
552
+ # @yieldparam result [Google::Apis::DatamigrationV1::SshScript] parsed result object
553
+ # @yieldparam err [StandardError] error object if request failed
554
+ #
555
+ # @return [Google::Apis::DatamigrationV1::SshScript]
556
+ #
557
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
558
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
559
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
560
+ def generate_migration_job_ssh_script(migration_job, generate_ssh_script_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
561
+ command = make_simple_command(:post, 'v1/{+migrationJob}:generateSshScript', options)
562
+ command.request_representation = Google::Apis::DatamigrationV1::GenerateSshScriptRequest::Representation
563
+ command.request_object = generate_ssh_script_request_object
564
+ command.response_representation = Google::Apis::DatamigrationV1::SshScript::Representation
565
+ command.response_class = Google::Apis::DatamigrationV1::SshScript
566
+ command.params['migrationJob'] = migration_job unless migration_job.nil?
567
+ command.query['fields'] = fields unless fields.nil?
568
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
569
+ execute_or_queue_command(command, &block)
570
+ end
571
+
572
+ # Gets details of a single migration job.
573
+ # @param [String] name
574
+ # Required. Name of the migration job resource to get.
575
+ # @param [String] fields
576
+ # Selector specifying which fields to include in a partial response.
577
+ # @param [String] quota_user
578
+ # Available to use for quota purposes for server-side applications. Can be any
579
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
580
+ # @param [Google::Apis::RequestOptions] options
581
+ # Request-specific options
582
+ #
583
+ # @yield [result, err] Result & error if block supplied
584
+ # @yieldparam result [Google::Apis::DatamigrationV1::MigrationJob] parsed result object
585
+ # @yieldparam err [StandardError] error object if request failed
586
+ #
587
+ # @return [Google::Apis::DatamigrationV1::MigrationJob]
588
+ #
589
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
590
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
591
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
592
+ def get_project_location_migration_job(name, fields: nil, quota_user: nil, options: nil, &block)
593
+ command = make_simple_command(:get, 'v1/{+name}', options)
594
+ command.response_representation = Google::Apis::DatamigrationV1::MigrationJob::Representation
595
+ command.response_class = Google::Apis::DatamigrationV1::MigrationJob
596
+ command.params['name'] = name unless name.nil?
597
+ command.query['fields'] = fields unless fields.nil?
598
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
599
+ execute_or_queue_command(command, &block)
600
+ end
601
+
602
+ # Gets the access control policy for a resource. Returns an empty policy if the
603
+ # resource exists and does not have a policy set.
604
+ # @param [String] resource
605
+ # REQUIRED: The resource for which the policy is being requested. See the
606
+ # operation documentation for the appropriate value for this field.
607
+ # @param [Fixnum] options_requested_policy_version
608
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
609
+ # 3. Requests specifying an invalid value will be rejected. Requests for
610
+ # policies with any conditional bindings must specify version 3. Policies
611
+ # without any conditional bindings may specify any valid value or leave the
612
+ # field unset. To learn which resources support conditions in their IAM policies,
613
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
614
+ # resource-policies).
615
+ # @param [String] fields
616
+ # Selector specifying which fields to include in a partial response.
617
+ # @param [String] quota_user
618
+ # Available to use for quota purposes for server-side applications. Can be any
619
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
620
+ # @param [Google::Apis::RequestOptions] options
621
+ # Request-specific options
622
+ #
623
+ # @yield [result, err] Result & error if block supplied
624
+ # @yieldparam result [Google::Apis::DatamigrationV1::Policy] parsed result object
625
+ # @yieldparam err [StandardError] error object if request failed
626
+ #
627
+ # @return [Google::Apis::DatamigrationV1::Policy]
628
+ #
629
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
630
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
631
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
632
+ def get_project_location_migration_job_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
633
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
634
+ command.response_representation = Google::Apis::DatamigrationV1::Policy::Representation
635
+ command.response_class = Google::Apis::DatamigrationV1::Policy
636
+ command.params['resource'] = resource unless resource.nil?
637
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
638
+ command.query['fields'] = fields unless fields.nil?
639
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
640
+ execute_or_queue_command(command, &block)
641
+ end
642
+
643
+ # Lists migration jobs in a given project and location.
644
+ # @param [String] parent
645
+ # Required. The parent, which owns this collection of migrationJobs.
646
+ # @param [String] filter
647
+ # A filter expression that filters migration jobs listed in the response. The
648
+ # expression must specify the field name, a comparison operator, and the value
649
+ # that you want to use for filtering. The value must be a string, a number, or a
650
+ # boolean. The comparison operator must be either =, !=, >, or <. For example,
651
+ # list migration jobs created this year by specifying **createTime %gt; 2020-01-
652
+ # 01T00:00:00.000000000Z.** You can also filter nested fields. For example, you
653
+ # could specify **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all
654
+ # migration jobs connecting through the specific SSH tunnel bastion.
655
+ # @param [String] order_by
656
+ # Sort the results based on the migration job name. Valid values are: "name", "
657
+ # name asc", and "name desc".
658
+ # @param [Fixnum] page_size
659
+ # The maximum number of migration jobs to return. The service may return fewer
660
+ # than this value. If unspecified, at most 50 migration jobs will be returned.
661
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
662
+ # @param [String] page_token
663
+ # The nextPageToken value received in the previous call to migrationJobs.list,
664
+ # used in the subsequent request to retrieve the next page of results. On first
665
+ # call this should be left blank. When paginating, all other parameters provided
666
+ # to migrationJobs.list must match the call that provided the page token.
667
+ # @param [String] fields
668
+ # Selector specifying which fields to include in a partial response.
669
+ # @param [String] quota_user
670
+ # Available to use for quota purposes for server-side applications. Can be any
671
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
672
+ # @param [Google::Apis::RequestOptions] options
673
+ # Request-specific options
674
+ #
675
+ # @yield [result, err] Result & error if block supplied
676
+ # @yieldparam result [Google::Apis::DatamigrationV1::ListMigrationJobsResponse] parsed result object
677
+ # @yieldparam err [StandardError] error object if request failed
678
+ #
679
+ # @return [Google::Apis::DatamigrationV1::ListMigrationJobsResponse]
680
+ #
681
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
682
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
683
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
684
+ def list_project_location_migration_jobs(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
685
+ command = make_simple_command(:get, 'v1/{+parent}/migrationJobs', options)
686
+ command.response_representation = Google::Apis::DatamigrationV1::ListMigrationJobsResponse::Representation
687
+ command.response_class = Google::Apis::DatamigrationV1::ListMigrationJobsResponse
688
+ command.params['parent'] = parent unless parent.nil?
689
+ command.query['filter'] = filter unless filter.nil?
690
+ command.query['orderBy'] = order_by unless order_by.nil?
691
+ command.query['pageSize'] = page_size unless page_size.nil?
692
+ command.query['pageToken'] = page_token unless page_token.nil?
693
+ command.query['fields'] = fields unless fields.nil?
694
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
695
+ execute_or_queue_command(command, &block)
696
+ end
697
+
698
+ # Updates the parameters of a single migration job.
699
+ # @param [String] name
700
+ # The name (URI) of this migration job resource, in the form of: projects/`
701
+ # project`/locations/`location`/instances/`instance`.
702
+ # @param [Google::Apis::DatamigrationV1::MigrationJob] migration_job_object
703
+ # @param [String] request_id
704
+ # A unique id used to identify the request. If the server receives two requests
705
+ # with the same id, then the second request will be ignored. It is recommended
706
+ # to always set this value to a UUID. The id must contain only letters (a-z, A-Z)
707
+ # , numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40
708
+ # characters.
709
+ # @param [String] update_mask
710
+ # Required. Field mask is used to specify the fields to be overwritten in the
711
+ # migration job resource by the update.
712
+ # @param [String] fields
713
+ # Selector specifying which fields to include in a partial response.
714
+ # @param [String] quota_user
715
+ # Available to use for quota purposes for server-side applications. Can be any
716
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
717
+ # @param [Google::Apis::RequestOptions] options
718
+ # Request-specific options
719
+ #
720
+ # @yield [result, err] Result & error if block supplied
721
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
722
+ # @yieldparam err [StandardError] error object if request failed
723
+ #
724
+ # @return [Google::Apis::DatamigrationV1::Operation]
725
+ #
726
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
727
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
728
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
729
+ def patch_project_location_migration_job(name, migration_job_object = nil, request_id: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
730
+ command = make_simple_command(:patch, 'v1/{+name}', options)
731
+ command.request_representation = Google::Apis::DatamigrationV1::MigrationJob::Representation
732
+ command.request_object = migration_job_object
733
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
734
+ command.response_class = Google::Apis::DatamigrationV1::Operation
735
+ command.params['name'] = name unless name.nil?
736
+ command.query['requestId'] = request_id unless request_id.nil?
737
+ command.query['updateMask'] = update_mask unless update_mask.nil?
738
+ command.query['fields'] = fields unless fields.nil?
739
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
740
+ execute_or_queue_command(command, &block)
741
+ end
742
+
743
+ # Promote a migration job, stopping replication to the destination and promoting
744
+ # the destination to be a standalone database.
745
+ # @param [String] name
746
+ # Name of the migration job resource to promote.
747
+ # @param [Google::Apis::DatamigrationV1::PromoteMigrationJobRequest] promote_migration_job_request_object
748
+ # @param [String] fields
749
+ # Selector specifying which fields to include in a partial response.
750
+ # @param [String] quota_user
751
+ # Available to use for quota purposes for server-side applications. Can be any
752
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
753
+ # @param [Google::Apis::RequestOptions] options
754
+ # Request-specific options
755
+ #
756
+ # @yield [result, err] Result & error if block supplied
757
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
758
+ # @yieldparam err [StandardError] error object if request failed
759
+ #
760
+ # @return [Google::Apis::DatamigrationV1::Operation]
761
+ #
762
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
763
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
764
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
765
+ def promote_migration_job(name, promote_migration_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
766
+ command = make_simple_command(:post, 'v1/{+name}:promote', options)
767
+ command.request_representation = Google::Apis::DatamigrationV1::PromoteMigrationJobRequest::Representation
768
+ command.request_object = promote_migration_job_request_object
769
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
770
+ command.response_class = Google::Apis::DatamigrationV1::Operation
771
+ command.params['name'] = name unless name.nil?
772
+ command.query['fields'] = fields unless fields.nil?
773
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
774
+ execute_or_queue_command(command, &block)
775
+ end
776
+
777
+ # Restart a stopped or failed migration job, resetting the destination instance
778
+ # to its original state and starting the migration process from scratch.
779
+ # @param [String] name
780
+ # Name of the migration job resource to restart.
781
+ # @param [Google::Apis::DatamigrationV1::RestartMigrationJobRequest] restart_migration_job_request_object
782
+ # @param [String] fields
783
+ # Selector specifying which fields to include in a partial response.
784
+ # @param [String] quota_user
785
+ # Available to use for quota purposes for server-side applications. Can be any
786
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
787
+ # @param [Google::Apis::RequestOptions] options
788
+ # Request-specific options
789
+ #
790
+ # @yield [result, err] Result & error if block supplied
791
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
792
+ # @yieldparam err [StandardError] error object if request failed
793
+ #
794
+ # @return [Google::Apis::DatamigrationV1::Operation]
795
+ #
796
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
797
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
798
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
799
+ def restart_migration_job(name, restart_migration_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
800
+ command = make_simple_command(:post, 'v1/{+name}:restart', options)
801
+ command.request_representation = Google::Apis::DatamigrationV1::RestartMigrationJobRequest::Representation
802
+ command.request_object = restart_migration_job_request_object
803
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
804
+ command.response_class = Google::Apis::DatamigrationV1::Operation
805
+ command.params['name'] = name unless name.nil?
806
+ command.query['fields'] = fields unless fields.nil?
807
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
808
+ execute_or_queue_command(command, &block)
809
+ end
810
+
811
+ # Resume a migration job that is currently stopped and is resumable (was stopped
812
+ # during CDC phase).
813
+ # @param [String] name
814
+ # Name of the migration job resource to resume.
815
+ # @param [Google::Apis::DatamigrationV1::ResumeMigrationJobRequest] resume_migration_job_request_object
816
+ # @param [String] fields
817
+ # Selector specifying which fields to include in a partial response.
818
+ # @param [String] quota_user
819
+ # Available to use for quota purposes for server-side applications. Can be any
820
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
821
+ # @param [Google::Apis::RequestOptions] options
822
+ # Request-specific options
823
+ #
824
+ # @yield [result, err] Result & error if block supplied
825
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
826
+ # @yieldparam err [StandardError] error object if request failed
827
+ #
828
+ # @return [Google::Apis::DatamigrationV1::Operation]
829
+ #
830
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
831
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
832
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
833
+ def resume_migration_job(name, resume_migration_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
834
+ command = make_simple_command(:post, 'v1/{+name}:resume', options)
835
+ command.request_representation = Google::Apis::DatamigrationV1::ResumeMigrationJobRequest::Representation
836
+ command.request_object = resume_migration_job_request_object
837
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
838
+ command.response_class = Google::Apis::DatamigrationV1::Operation
839
+ command.params['name'] = name unless name.nil?
840
+ command.query['fields'] = fields unless fields.nil?
841
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
842
+ execute_or_queue_command(command, &block)
843
+ end
844
+
845
+ # Sets the access control policy on the specified resource. Replaces any
846
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
847
+ # PERMISSION_DENIED` errors.
848
+ # @param [String] resource
849
+ # REQUIRED: The resource for which the policy is being specified. See the
850
+ # operation documentation for the appropriate value for this field.
851
+ # @param [Google::Apis::DatamigrationV1::SetIamPolicyRequest] set_iam_policy_request_object
852
+ # @param [String] fields
853
+ # Selector specifying which fields to include in a partial response.
854
+ # @param [String] quota_user
855
+ # Available to use for quota purposes for server-side applications. Can be any
856
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
857
+ # @param [Google::Apis::RequestOptions] options
858
+ # Request-specific options
859
+ #
860
+ # @yield [result, err] Result & error if block supplied
861
+ # @yieldparam result [Google::Apis::DatamigrationV1::Policy] parsed result object
862
+ # @yieldparam err [StandardError] error object if request failed
863
+ #
864
+ # @return [Google::Apis::DatamigrationV1::Policy]
865
+ #
866
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
867
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
868
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
869
+ def set_migration_job_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
870
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
871
+ command.request_representation = Google::Apis::DatamigrationV1::SetIamPolicyRequest::Representation
872
+ command.request_object = set_iam_policy_request_object
873
+ command.response_representation = Google::Apis::DatamigrationV1::Policy::Representation
874
+ command.response_class = Google::Apis::DatamigrationV1::Policy
875
+ command.params['resource'] = resource unless resource.nil?
876
+ command.query['fields'] = fields unless fields.nil?
877
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
878
+ execute_or_queue_command(command, &block)
879
+ end
880
+
881
+ # Start an already created migration job.
882
+ # @param [String] name
883
+ # Name of the migration job resource to start.
884
+ # @param [Google::Apis::DatamigrationV1::StartMigrationJobRequest] start_migration_job_request_object
885
+ # @param [String] fields
886
+ # Selector specifying which fields to include in a partial response.
887
+ # @param [String] quota_user
888
+ # Available to use for quota purposes for server-side applications. Can be any
889
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
890
+ # @param [Google::Apis::RequestOptions] options
891
+ # Request-specific options
892
+ #
893
+ # @yield [result, err] Result & error if block supplied
894
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
895
+ # @yieldparam err [StandardError] error object if request failed
896
+ #
897
+ # @return [Google::Apis::DatamigrationV1::Operation]
898
+ #
899
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
900
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
901
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
902
+ def start_migration_job(name, start_migration_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
903
+ command = make_simple_command(:post, 'v1/{+name}:start', options)
904
+ command.request_representation = Google::Apis::DatamigrationV1::StartMigrationJobRequest::Representation
905
+ command.request_object = start_migration_job_request_object
906
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
907
+ command.response_class = Google::Apis::DatamigrationV1::Operation
908
+ command.params['name'] = name unless name.nil?
909
+ command.query['fields'] = fields unless fields.nil?
910
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
911
+ execute_or_queue_command(command, &block)
912
+ end
913
+
914
+ # Stops a running migration job.
915
+ # @param [String] name
916
+ # Name of the migration job resource to stop.
917
+ # @param [Google::Apis::DatamigrationV1::StopMigrationJobRequest] stop_migration_job_request_object
918
+ # @param [String] fields
919
+ # Selector specifying which fields to include in a partial response.
920
+ # @param [String] quota_user
921
+ # Available to use for quota purposes for server-side applications. Can be any
922
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
923
+ # @param [Google::Apis::RequestOptions] options
924
+ # Request-specific options
925
+ #
926
+ # @yield [result, err] Result & error if block supplied
927
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
928
+ # @yieldparam err [StandardError] error object if request failed
929
+ #
930
+ # @return [Google::Apis::DatamigrationV1::Operation]
931
+ #
932
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
933
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
934
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
935
+ def stop_migration_job(name, stop_migration_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
936
+ command = make_simple_command(:post, 'v1/{+name}:stop', options)
937
+ command.request_representation = Google::Apis::DatamigrationV1::StopMigrationJobRequest::Representation
938
+ command.request_object = stop_migration_job_request_object
939
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
940
+ command.response_class = Google::Apis::DatamigrationV1::Operation
941
+ command.params['name'] = name unless name.nil?
942
+ command.query['fields'] = fields unless fields.nil?
943
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
944
+ execute_or_queue_command(command, &block)
945
+ end
946
+
947
+ # Returns permissions that a caller has on the specified resource. If the
948
+ # resource does not exist, this will return an empty set of permissions, not a `
949
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
950
+ # permission-aware UIs and command-line tools, not for authorization checking.
951
+ # This operation may "fail open" without warning.
952
+ # @param [String] resource
953
+ # REQUIRED: The resource for which the policy detail is being requested. See the
954
+ # operation documentation for the appropriate value for this field.
955
+ # @param [Google::Apis::DatamigrationV1::TestIamPermissionsRequest] test_iam_permissions_request_object
956
+ # @param [String] fields
957
+ # Selector specifying which fields to include in a partial response.
958
+ # @param [String] quota_user
959
+ # Available to use for quota purposes for server-side applications. Can be any
960
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
961
+ # @param [Google::Apis::RequestOptions] options
962
+ # Request-specific options
963
+ #
964
+ # @yield [result, err] Result & error if block supplied
965
+ # @yieldparam result [Google::Apis::DatamigrationV1::TestIamPermissionsResponse] parsed result object
966
+ # @yieldparam err [StandardError] error object if request failed
967
+ #
968
+ # @return [Google::Apis::DatamigrationV1::TestIamPermissionsResponse]
969
+ #
970
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
971
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
972
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
973
+ def test_migration_job_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
974
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
975
+ command.request_representation = Google::Apis::DatamigrationV1::TestIamPermissionsRequest::Representation
976
+ command.request_object = test_iam_permissions_request_object
977
+ command.response_representation = Google::Apis::DatamigrationV1::TestIamPermissionsResponse::Representation
978
+ command.response_class = Google::Apis::DatamigrationV1::TestIamPermissionsResponse
979
+ command.params['resource'] = resource unless resource.nil?
980
+ command.query['fields'] = fields unless fields.nil?
981
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
982
+ execute_or_queue_command(command, &block)
983
+ end
984
+
985
+ # Verify a migration job, making sure the destination can reach the source and
986
+ # that all configuration and prerequisites are met.
987
+ # @param [String] name
988
+ # Name of the migration job resource to verify.
989
+ # @param [Google::Apis::DatamigrationV1::VerifyMigrationJobRequest] verify_migration_job_request_object
990
+ # @param [String] fields
991
+ # Selector specifying which fields to include in a partial response.
992
+ # @param [String] quota_user
993
+ # Available to use for quota purposes for server-side applications. Can be any
994
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
995
+ # @param [Google::Apis::RequestOptions] options
996
+ # Request-specific options
997
+ #
998
+ # @yield [result, err] Result & error if block supplied
999
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
1000
+ # @yieldparam err [StandardError] error object if request failed
1001
+ #
1002
+ # @return [Google::Apis::DatamigrationV1::Operation]
1003
+ #
1004
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1005
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1006
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1007
+ def verify_migration_job(name, verify_migration_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1008
+ command = make_simple_command(:post, 'v1/{+name}:verify', options)
1009
+ command.request_representation = Google::Apis::DatamigrationV1::VerifyMigrationJobRequest::Representation
1010
+ command.request_object = verify_migration_job_request_object
1011
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
1012
+ command.response_class = Google::Apis::DatamigrationV1::Operation
1013
+ command.params['name'] = name unless name.nil?
1014
+ command.query['fields'] = fields unless fields.nil?
1015
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1016
+ execute_or_queue_command(command, &block)
1017
+ end
1018
+
1019
+ # Starts asynchronous cancellation on a long-running operation. The server makes
1020
+ # a best effort to cancel the operation, but success is not guaranteed. If the
1021
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
1022
+ # Clients can use Operations.GetOperation or other methods to check whether the
1023
+ # cancellation succeeded or whether the operation completed despite cancellation.
1024
+ # On successful cancellation, the operation is not deleted; instead, it becomes
1025
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
1026
+ # corresponding to `Code.CANCELLED`.
1027
+ # @param [String] name
1028
+ # The name of the operation resource to be cancelled.
1029
+ # @param [Google::Apis::DatamigrationV1::CancelOperationRequest] cancel_operation_request_object
1030
+ # @param [String] fields
1031
+ # Selector specifying which fields to include in a partial response.
1032
+ # @param [String] quota_user
1033
+ # Available to use for quota purposes for server-side applications. Can be any
1034
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1035
+ # @param [Google::Apis::RequestOptions] options
1036
+ # Request-specific options
1037
+ #
1038
+ # @yield [result, err] Result & error if block supplied
1039
+ # @yieldparam result [Google::Apis::DatamigrationV1::Empty] parsed result object
1040
+ # @yieldparam err [StandardError] error object if request failed
1041
+ #
1042
+ # @return [Google::Apis::DatamigrationV1::Empty]
1043
+ #
1044
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1045
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1046
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1047
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1048
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
1049
+ command.request_representation = Google::Apis::DatamigrationV1::CancelOperationRequest::Representation
1050
+ command.request_object = cancel_operation_request_object
1051
+ command.response_representation = Google::Apis::DatamigrationV1::Empty::Representation
1052
+ command.response_class = Google::Apis::DatamigrationV1::Empty
1053
+ command.params['name'] = name unless name.nil?
1054
+ command.query['fields'] = fields unless fields.nil?
1055
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1056
+ execute_or_queue_command(command, &block)
1057
+ end
1058
+
1059
+ # Deletes a long-running operation. This method indicates that the client is no
1060
+ # longer interested in the operation result. It does not cancel the operation.
1061
+ # If the server doesn't support this method, it returns `google.rpc.Code.
1062
+ # UNIMPLEMENTED`.
1063
+ # @param [String] name
1064
+ # The name of the operation resource to be deleted.
1065
+ # @param [String] fields
1066
+ # Selector specifying which fields to include in a partial response.
1067
+ # @param [String] quota_user
1068
+ # Available to use for quota purposes for server-side applications. Can be any
1069
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1070
+ # @param [Google::Apis::RequestOptions] options
1071
+ # Request-specific options
1072
+ #
1073
+ # @yield [result, err] Result & error if block supplied
1074
+ # @yieldparam result [Google::Apis::DatamigrationV1::Empty] parsed result object
1075
+ # @yieldparam err [StandardError] error object if request failed
1076
+ #
1077
+ # @return [Google::Apis::DatamigrationV1::Empty]
1078
+ #
1079
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1080
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1081
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1082
+ def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1083
+ command = make_simple_command(:delete, 'v1/{+name}', options)
1084
+ command.response_representation = Google::Apis::DatamigrationV1::Empty::Representation
1085
+ command.response_class = Google::Apis::DatamigrationV1::Empty
1086
+ command.params['name'] = name unless name.nil?
1087
+ command.query['fields'] = fields unless fields.nil?
1088
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1089
+ execute_or_queue_command(command, &block)
1090
+ end
1091
+
1092
+ # Gets the latest state of a long-running operation. Clients can use this method
1093
+ # to poll the operation result at intervals as recommended by the API service.
1094
+ # @param [String] name
1095
+ # The name of the operation resource.
1096
+ # @param [String] fields
1097
+ # Selector specifying which fields to include in a partial response.
1098
+ # @param [String] quota_user
1099
+ # Available to use for quota purposes for server-side applications. Can be any
1100
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1101
+ # @param [Google::Apis::RequestOptions] options
1102
+ # Request-specific options
1103
+ #
1104
+ # @yield [result, err] Result & error if block supplied
1105
+ # @yieldparam result [Google::Apis::DatamigrationV1::Operation] parsed result object
1106
+ # @yieldparam err [StandardError] error object if request failed
1107
+ #
1108
+ # @return [Google::Apis::DatamigrationV1::Operation]
1109
+ #
1110
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1111
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1112
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1113
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1114
+ command = make_simple_command(:get, 'v1/{+name}', options)
1115
+ command.response_representation = Google::Apis::DatamigrationV1::Operation::Representation
1116
+ command.response_class = Google::Apis::DatamigrationV1::Operation
1117
+ command.params['name'] = name unless name.nil?
1118
+ command.query['fields'] = fields unless fields.nil?
1119
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1120
+ execute_or_queue_command(command, &block)
1121
+ end
1122
+
1123
+ # Lists operations that match the specified filter in the request. If the server
1124
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
1125
+ # binding allows API services to override the binding to use different resource
1126
+ # name schemes, such as `users/*/operations`. To override the binding, API
1127
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
1128
+ # service configuration. For backwards compatibility, the default name includes
1129
+ # the operations collection id, however overriding users must ensure the name
1130
+ # binding is the parent resource, without the operations collection id.
1131
+ # @param [String] name
1132
+ # The name of the operation's parent resource.
1133
+ # @param [String] filter
1134
+ # The standard list filter.
1135
+ # @param [Fixnum] page_size
1136
+ # The standard list page size.
1137
+ # @param [String] page_token
1138
+ # The standard list page token.
1139
+ # @param [String] fields
1140
+ # Selector specifying which fields to include in a partial response.
1141
+ # @param [String] quota_user
1142
+ # Available to use for quota purposes for server-side applications. Can be any
1143
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1144
+ # @param [Google::Apis::RequestOptions] options
1145
+ # Request-specific options
1146
+ #
1147
+ # @yield [result, err] Result & error if block supplied
1148
+ # @yieldparam result [Google::Apis::DatamigrationV1::ListOperationsResponse] parsed result object
1149
+ # @yieldparam err [StandardError] error object if request failed
1150
+ #
1151
+ # @return [Google::Apis::DatamigrationV1::ListOperationsResponse]
1152
+ #
1153
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1154
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1155
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1156
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1157
+ command = make_simple_command(:get, 'v1/{+name}/operations', options)
1158
+ command.response_representation = Google::Apis::DatamigrationV1::ListOperationsResponse::Representation
1159
+ command.response_class = Google::Apis::DatamigrationV1::ListOperationsResponse
1160
+ command.params['name'] = name unless name.nil?
1161
+ command.query['filter'] = filter unless filter.nil?
1162
+ command.query['pageSize'] = page_size unless page_size.nil?
1163
+ command.query['pageToken'] = page_token unless page_token.nil?
1164
+ command.query['fields'] = fields unless fields.nil?
1165
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1166
+ execute_or_queue_command(command, &block)
1167
+ end
1168
+
1169
+ protected
1170
+
1171
+ def apply_command_defaults(command)
1172
+ command.query['key'] = key unless key.nil?
1173
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1174
+ end
1175
+ end
1176
+ end
1177
+ end
1178
+ end