google-apis-metastore_v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,715 @@
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 MetastoreV2
23
+ # Dataproc Metastore API
24
+ #
25
+ # The Dataproc Metastore API is used to manage the lifecycle and configuration
26
+ # of metastore services.
27
+ #
28
+ # @example
29
+ # require 'google/apis/metastore_v2'
30
+ #
31
+ # Metastore = Google::Apis::MetastoreV2 # Alias the module
32
+ # service = Metastore::DataprocMetastoreService.new
33
+ #
34
+ # @see https://cloud.google.com/dataproc-metastore/docs
35
+ class DataprocMetastoreService < Google::Apis::Core::BaseService
36
+ DEFAULT_ENDPOINT_TEMPLATE = "https://metastore.$UNIVERSE_DOMAIN$/"
37
+
38
+ # @return [String]
39
+ # API key. Your API key identifies your project and provides you with API access,
40
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
41
+ attr_accessor :key
42
+
43
+ # @return [String]
44
+ # Available to use for quota purposes for server-side applications. Can be any
45
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
46
+ attr_accessor :quota_user
47
+
48
+ def initialize
49
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
50
+ client_name: 'google-apis-metastore_v2',
51
+ client_version: Google::Apis::MetastoreV2::GEM_VERSION)
52
+ @batch_path = 'batch'
53
+ end
54
+
55
+ # Alter metadata resource location. The metadata resource can be a database,
56
+ # table, or partition. This functionality only updates the parent directory for
57
+ # the respective metadata resource and does not transfer any existing data to
58
+ # the new location.
59
+ # @param [String] service
60
+ # Required. The relative resource name of the metastore service to mutate
61
+ # metadata, in the following format:projects/`project_id`/locations/`location_id`
62
+ # /services/`service_id`.
63
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2AlterMetadataResourceLocationRequest] google_cloud_metastore_v2_alter_metadata_resource_location_request_object
64
+ # @param [String] fields
65
+ # Selector specifying which fields to include in a partial response.
66
+ # @param [String] quota_user
67
+ # Available to use for quota purposes for server-side applications. Can be any
68
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
69
+ # @param [Google::Apis::RequestOptions] options
70
+ # Request-specific options
71
+ #
72
+ # @yield [result, err] Result & error if block supplied
73
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
77
+ #
78
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
79
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
80
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
81
+ def alter_project_location_service_location(service, google_cloud_metastore_v2_alter_metadata_resource_location_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
82
+ command = make_simple_command(:post, 'v2/{+service}:alterLocation', options)
83
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2AlterMetadataResourceLocationRequest::Representation
84
+ command.request_object = google_cloud_metastore_v2_alter_metadata_resource_location_request_object
85
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
86
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
87
+ command.params['service'] = service unless service.nil?
88
+ command.query['fields'] = fields unless fields.nil?
89
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
90
+ execute_or_queue_command(command, &block)
91
+ end
92
+
93
+ # Alter metadata table properties.
94
+ # @param [String] service
95
+ # Required. The relative resource name of the Dataproc Metastore service that's
96
+ # being used to mutate metadata table properties, in the following format:
97
+ # projects/`project_id`/locations/`location_id`/services/`service_id`.
98
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2AlterTablePropertiesRequest] google_cloud_metastore_v2_alter_table_properties_request_object
99
+ # @param [String] fields
100
+ # Selector specifying which fields to include in a partial response.
101
+ # @param [String] quota_user
102
+ # Available to use for quota purposes for server-side applications. Can be any
103
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
104
+ # @param [Google::Apis::RequestOptions] options
105
+ # Request-specific options
106
+ #
107
+ # @yield [result, err] Result & error if block supplied
108
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
109
+ # @yieldparam err [StandardError] error object if request failed
110
+ #
111
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
112
+ #
113
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
114
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
115
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
116
+ def alter_project_location_service_table_properties(service, google_cloud_metastore_v2_alter_table_properties_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
117
+ command = make_simple_command(:post, 'v2/{+service}:alterTableProperties', options)
118
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2AlterTablePropertiesRequest::Representation
119
+ command.request_object = google_cloud_metastore_v2_alter_table_properties_request_object
120
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
121
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
122
+ command.params['service'] = service unless service.nil?
123
+ command.query['fields'] = fields unless fields.nil?
124
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
125
+ execute_or_queue_command(command, &block)
126
+ end
127
+
128
+ # Creates a metastore service in a project and location.
129
+ # @param [String] parent
130
+ # Required. The relative resource name of the location in which to create a
131
+ # metastore service, in the following form:projects/`project_number`/locations/`
132
+ # location_id`.
133
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Service] google_cloud_metastore_v2_service_object
134
+ # @param [String] request_id
135
+ # Optional. A request ID. Specify a unique request ID to allow the server to
136
+ # ignore the request if it has completed. The server will ignore subsequent
137
+ # requests that provide a duplicate request ID for at least 60 minutes after the
138
+ # first request.For example, if an initial request times out, followed by
139
+ # another request with the same request ID, the server ignores the second
140
+ # request to prevent the creation of duplicate commitments.The request ID must
141
+ # be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#
142
+ # Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
143
+ # @param [String] service_id
144
+ # Required. The ID of the metastore service, which is used as the final
145
+ # component of the metastore service's name.This value must be between 2 and 63
146
+ # characters long inclusive, begin with a letter, end with a letter or number,
147
+ # and consist of alpha-numeric ASCII characters or hyphens.
148
+ # @param [String] fields
149
+ # Selector specifying which fields to include in a partial response.
150
+ # @param [String] quota_user
151
+ # Available to use for quota purposes for server-side applications. Can be any
152
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
153
+ # @param [Google::Apis::RequestOptions] options
154
+ # Request-specific options
155
+ #
156
+ # @yield [result, err] Result & error if block supplied
157
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
158
+ # @yieldparam err [StandardError] error object if request failed
159
+ #
160
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
161
+ #
162
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
163
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
164
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
165
+ def create_project_location_service(parent, google_cloud_metastore_v2_service_object = nil, request_id: nil, service_id: nil, fields: nil, quota_user: nil, options: nil, &block)
166
+ command = make_simple_command(:post, 'v2/{+parent}/services', options)
167
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Service::Representation
168
+ command.request_object = google_cloud_metastore_v2_service_object
169
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
170
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
171
+ command.params['parent'] = parent unless parent.nil?
172
+ command.query['requestId'] = request_id unless request_id.nil?
173
+ command.query['serviceId'] = service_id unless service_id.nil?
174
+ command.query['fields'] = fields unless fields.nil?
175
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
176
+ execute_or_queue_command(command, &block)
177
+ end
178
+
179
+ # Deletes a single service.
180
+ # @param [String] name
181
+ # Required. The relative resource name of the metastore service to delete, in
182
+ # the following form:projects/`project_number`/locations/`location_id`/services/`
183
+ # service_id`.
184
+ # @param [String] request_id
185
+ # Optional. A request ID. Specify a unique request ID to allow the server to
186
+ # ignore the request if it has completed. The server will ignore subsequent
187
+ # requests that provide a duplicate request ID for at least 60 minutes after the
188
+ # first request.For example, if an initial request times out, followed by
189
+ # another request with the same request ID, the server ignores the second
190
+ # request to prevent the creation of duplicate commitments.The request ID must
191
+ # be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#
192
+ # Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
193
+ # @param [String] fields
194
+ # Selector specifying which fields to include in a partial response.
195
+ # @param [String] quota_user
196
+ # Available to use for quota purposes for server-side applications. Can be any
197
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
198
+ # @param [Google::Apis::RequestOptions] options
199
+ # Request-specific options
200
+ #
201
+ # @yield [result, err] Result & error if block supplied
202
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
203
+ # @yieldparam err [StandardError] error object if request failed
204
+ #
205
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
206
+ #
207
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
208
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
209
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
210
+ def delete_project_location_service(name, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
211
+ command = make_simple_command(:delete, 'v2/{+name}', options)
212
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
213
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
214
+ command.params['name'] = name unless name.nil?
215
+ command.query['requestId'] = request_id unless request_id.nil?
216
+ command.query['fields'] = fields unless fields.nil?
217
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
218
+ execute_or_queue_command(command, &block)
219
+ end
220
+
221
+ # Exports metadata from a service.
222
+ # @param [String] service
223
+ # Required. The relative resource name of the metastore service to run export,
224
+ # in the following form:projects/`project_id`/locations/`location_id`/services/`
225
+ # service_id`.
226
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ExportMetadataRequest] google_cloud_metastore_v2_export_metadata_request_object
227
+ # @param [String] fields
228
+ # Selector specifying which fields to include in a partial response.
229
+ # @param [String] quota_user
230
+ # Available to use for quota purposes for server-side applications. Can be any
231
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
232
+ # @param [Google::Apis::RequestOptions] options
233
+ # Request-specific options
234
+ #
235
+ # @yield [result, err] Result & error if block supplied
236
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
237
+ # @yieldparam err [StandardError] error object if request failed
238
+ #
239
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
240
+ #
241
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
242
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
243
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
244
+ def export_project_location_service_metadata(service, google_cloud_metastore_v2_export_metadata_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
245
+ command = make_simple_command(:post, 'v2/{+service}:exportMetadata', options)
246
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ExportMetadataRequest::Representation
247
+ command.request_object = google_cloud_metastore_v2_export_metadata_request_object
248
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
249
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
250
+ command.params['service'] = service unless service.nil?
251
+ command.query['fields'] = fields unless fields.nil?
252
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
253
+ execute_or_queue_command(command, &block)
254
+ end
255
+
256
+ # Gets the details of a single service.
257
+ # @param [String] name
258
+ # Required. The relative resource name of the metastore service to retrieve, in
259
+ # the following form:projects/`project_number`/locations/`location_id`/services/`
260
+ # service_id`.
261
+ # @param [String] fields
262
+ # Selector specifying which fields to include in a partial response.
263
+ # @param [String] quota_user
264
+ # Available to use for quota purposes for server-side applications. Can be any
265
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
266
+ # @param [Google::Apis::RequestOptions] options
267
+ # Request-specific options
268
+ #
269
+ # @yield [result, err] Result & error if block supplied
270
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Service] parsed result object
271
+ # @yieldparam err [StandardError] error object if request failed
272
+ #
273
+ # @return [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Service]
274
+ #
275
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
276
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
277
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
278
+ def get_project_location_service(name, fields: nil, quota_user: nil, options: nil, &block)
279
+ command = make_simple_command(:get, 'v2/{+name}', options)
280
+ command.response_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Service::Representation
281
+ command.response_class = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Service
282
+ command.params['name'] = name unless name.nil?
283
+ command.query['fields'] = fields unless fields.nil?
284
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
285
+ execute_or_queue_command(command, &block)
286
+ end
287
+
288
+ # Imports Metadata into a Dataproc Metastore service.
289
+ # @param [String] name
290
+ # Immutable. The relative resource name of the metastore service to run import,
291
+ # in the following form:projects/`project_id`/locations/`location_id`/services/`
292
+ # service_id`.
293
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ImportMetadataRequest] google_cloud_metastore_v2_import_metadata_request_object
294
+ # @param [String] fields
295
+ # Selector specifying which fields to include in a partial response.
296
+ # @param [String] quota_user
297
+ # Available to use for quota purposes for server-side applications. Can be any
298
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
299
+ # @param [Google::Apis::RequestOptions] options
300
+ # Request-specific options
301
+ #
302
+ # @yield [result, err] Result & error if block supplied
303
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
304
+ # @yieldparam err [StandardError] error object if request failed
305
+ #
306
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
307
+ #
308
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
309
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
310
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
311
+ def import_project_location_service_metadata(name, google_cloud_metastore_v2_import_metadata_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
312
+ command = make_simple_command(:post, 'v2/{+name}:importMetadata', options)
313
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ImportMetadataRequest::Representation
314
+ command.request_object = google_cloud_metastore_v2_import_metadata_request_object
315
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
316
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
317
+ command.params['name'] = name unless name.nil?
318
+ command.query['fields'] = fields unless fields.nil?
319
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
320
+ execute_or_queue_command(command, &block)
321
+ end
322
+
323
+ # Lists services in a project and location.
324
+ # @param [String] parent
325
+ # Required. The relative resource name of the location of metastore services to
326
+ # list, in the following form:projects/`project_number`/locations/`location_id`.
327
+ # @param [String] filter
328
+ # Optional. The filter to apply to list results.
329
+ # @param [String] order_by
330
+ # Optional. Specify the ordering of results as described in Sorting Order (https:
331
+ # //cloud.google.com/apis/design/design_patterns#sorting_order). If not
332
+ # specified, the results will be sorted in the default order.
333
+ # @param [Fixnum] page_size
334
+ # Optional. The maximum number of services to return. The response may contain
335
+ # less than the maximum number. If unspecified, no more than 500 services are
336
+ # returned. The maximum value is 1000; values above 1000 are changed to 1000.
337
+ # @param [String] page_token
338
+ # Optional. A page token, received from a previous DataprocMetastore.
339
+ # ListServices call. Provide this token to retrieve the subsequent page.To
340
+ # retrieve the first page, supply an empty page token.When paginating, other
341
+ # parameters provided to DataprocMetastore.ListServices must match the call that
342
+ # provided the page token.
343
+ # @param [String] fields
344
+ # Selector specifying which fields to include in a partial response.
345
+ # @param [String] quota_user
346
+ # Available to use for quota purposes for server-side applications. Can be any
347
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
348
+ # @param [Google::Apis::RequestOptions] options
349
+ # Request-specific options
350
+ #
351
+ # @yield [result, err] Result & error if block supplied
352
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ListServicesResponse] parsed result object
353
+ # @yieldparam err [StandardError] error object if request failed
354
+ #
355
+ # @return [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ListServicesResponse]
356
+ #
357
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
358
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
359
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
360
+ def list_project_location_services(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
361
+ command = make_simple_command(:get, 'v2/{+parent}/services', options)
362
+ command.response_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ListServicesResponse::Representation
363
+ command.response_class = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ListServicesResponse
364
+ command.params['parent'] = parent unless parent.nil?
365
+ command.query['filter'] = filter unless filter.nil?
366
+ command.query['orderBy'] = order_by unless order_by.nil?
367
+ command.query['pageSize'] = page_size unless page_size.nil?
368
+ command.query['pageToken'] = page_token unless page_token.nil?
369
+ command.query['fields'] = fields unless fields.nil?
370
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
371
+ execute_or_queue_command(command, &block)
372
+ end
373
+
374
+ # Move a table to another database.
375
+ # @param [String] service
376
+ # Required. The relative resource name of the metastore service to mutate
377
+ # metadata, in the following format:projects/`project_id`/locations/`location_id`
378
+ # /services/`service_id`.
379
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2MoveTableToDatabaseRequest] google_cloud_metastore_v2_move_table_to_database_request_object
380
+ # @param [String] fields
381
+ # Selector specifying which fields to include in a partial response.
382
+ # @param [String] quota_user
383
+ # Available to use for quota purposes for server-side applications. Can be any
384
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
385
+ # @param [Google::Apis::RequestOptions] options
386
+ # Request-specific options
387
+ #
388
+ # @yield [result, err] Result & error if block supplied
389
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
390
+ # @yieldparam err [StandardError] error object if request failed
391
+ #
392
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
393
+ #
394
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
395
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
396
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
397
+ def move_project_location_service_table_to_database(service, google_cloud_metastore_v2_move_table_to_database_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
398
+ command = make_simple_command(:post, 'v2/{+service}:moveTableToDatabase', options)
399
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2MoveTableToDatabaseRequest::Representation
400
+ command.request_object = google_cloud_metastore_v2_move_table_to_database_request_object
401
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
402
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
403
+ command.params['service'] = service unless service.nil?
404
+ command.query['fields'] = fields unless fields.nil?
405
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
406
+ execute_or_queue_command(command, &block)
407
+ end
408
+
409
+ # Updates the parameters of a single service.
410
+ # @param [String] name
411
+ # Immutable. The relative resource name of the metastore service, in the
412
+ # following format:projects/`project_number`/locations/`location_id`/services/`
413
+ # service_id`.
414
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Service] google_cloud_metastore_v2_service_object
415
+ # @param [String] request_id
416
+ # Optional. A request ID. Specify a unique request ID to allow the server to
417
+ # ignore the request if it has completed. The server will ignore subsequent
418
+ # requests that provide a duplicate request ID for at least 60 minutes after the
419
+ # first request.For example, if an initial request times out, followed by
420
+ # another request with the same request ID, the server ignores the second
421
+ # request to prevent the creation of duplicate commitments.The request ID must
422
+ # be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#
423
+ # Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
424
+ # @param [String] update_mask
425
+ # Required. A field mask used to specify the fields to be overwritten in the
426
+ # metastore service resource by the update. Fields specified in the update_mask
427
+ # are relative to the resource (not to the full request). A field is overwritten
428
+ # if it is in the mask.
429
+ # @param [String] fields
430
+ # Selector specifying which fields to include in a partial response.
431
+ # @param [String] quota_user
432
+ # Available to use for quota purposes for server-side applications. Can be any
433
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
434
+ # @param [Google::Apis::RequestOptions] options
435
+ # Request-specific options
436
+ #
437
+ # @yield [result, err] Result & error if block supplied
438
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
439
+ # @yieldparam err [StandardError] error object if request failed
440
+ #
441
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
442
+ #
443
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
444
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
445
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
446
+ def patch_project_location_service(name, google_cloud_metastore_v2_service_object = nil, request_id: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
447
+ command = make_simple_command(:patch, 'v2/{+name}', options)
448
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Service::Representation
449
+ command.request_object = google_cloud_metastore_v2_service_object
450
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
451
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
452
+ command.params['name'] = name unless name.nil?
453
+ command.query['requestId'] = request_id unless request_id.nil?
454
+ command.query['updateMask'] = update_mask unless update_mask.nil?
455
+ command.query['fields'] = fields unless fields.nil?
456
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
457
+ execute_or_queue_command(command, &block)
458
+ end
459
+
460
+ # Query Dataproc Metastore metadata.
461
+ # @param [String] service
462
+ # Required. The relative resource name of the metastore service to query
463
+ # metadata, in the following format:projects/`project_id`/locations/`location_id`
464
+ # /services/`service_id`.
465
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2QueryMetadataRequest] google_cloud_metastore_v2_query_metadata_request_object
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::MetastoreV2::GoogleLongrunningOperation] parsed result object
476
+ # @yieldparam err [StandardError] error object if request failed
477
+ #
478
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
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 query_project_location_service_metadata(service, google_cloud_metastore_v2_query_metadata_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
484
+ command = make_simple_command(:post, 'v2/{+service}:queryMetadata', options)
485
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2QueryMetadataRequest::Representation
486
+ command.request_object = google_cloud_metastore_v2_query_metadata_request_object
487
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
488
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
489
+ command.params['service'] = service unless service.nil?
490
+ command.query['fields'] = fields unless fields.nil?
491
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
492
+ execute_or_queue_command(command, &block)
493
+ end
494
+
495
+ # Restores a service from a backup.
496
+ # @param [String] service
497
+ # Required. The relative resource name of the metastore service to run restore,
498
+ # in the following form:projects/`project_id`/locations/`location_id`/services/`
499
+ # service_id`.
500
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2RestoreServiceRequest] google_cloud_metastore_v2_restore_service_request_object
501
+ # @param [String] fields
502
+ # Selector specifying which fields to include in a partial response.
503
+ # @param [String] quota_user
504
+ # Available to use for quota purposes for server-side applications. Can be any
505
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
506
+ # @param [Google::Apis::RequestOptions] options
507
+ # Request-specific options
508
+ #
509
+ # @yield [result, err] Result & error if block supplied
510
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
511
+ # @yieldparam err [StandardError] error object if request failed
512
+ #
513
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
514
+ #
515
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
516
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
517
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
518
+ def restore_project_location_service(service, google_cloud_metastore_v2_restore_service_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
519
+ command = make_simple_command(:post, 'v2/{+service}:restore', options)
520
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2RestoreServiceRequest::Representation
521
+ command.request_object = google_cloud_metastore_v2_restore_service_request_object
522
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
523
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
524
+ command.params['service'] = service unless service.nil?
525
+ command.query['fields'] = fields unless fields.nil?
526
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
527
+ execute_or_queue_command(command, &block)
528
+ end
529
+
530
+ # Creates a new backup in a given project and location.
531
+ # @param [String] parent
532
+ # Required. The relative resource name of the service in which to create a
533
+ # backup of the following form:projects/`project_number`/locations/`location_id`/
534
+ # services/`service_id`.
535
+ # @param [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Backup] google_cloud_metastore_v2_backup_object
536
+ # @param [String] backup_id
537
+ # Required. The ID of the backup, which is used as the final component of the
538
+ # backup's name.This value must be between 1 and 64 characters long, begin with
539
+ # a letter, end with a letter or number, and consist of alpha-numeric ASCII
540
+ # characters or hyphens.
541
+ # @param [String] request_id
542
+ # Optional. A request ID. Specify a unique request ID to allow the server to
543
+ # ignore the request if it has completed. The server will ignore subsequent
544
+ # requests that provide a duplicate request ID for at least 60 minutes after the
545
+ # first request.For example, if an initial request times out, followed by
546
+ # another request with the same request ID, the server ignores the second
547
+ # request to prevent the creation of duplicate commitments.The request ID must
548
+ # be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#
549
+ # Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
550
+ # @param [String] fields
551
+ # Selector specifying which fields to include in a partial response.
552
+ # @param [String] quota_user
553
+ # Available to use for quota purposes for server-side applications. Can be any
554
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
555
+ # @param [Google::Apis::RequestOptions] options
556
+ # Request-specific options
557
+ #
558
+ # @yield [result, err] Result & error if block supplied
559
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
560
+ # @yieldparam err [StandardError] error object if request failed
561
+ #
562
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
563
+ #
564
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
565
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
566
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
567
+ def create_project_location_service_backup(parent, google_cloud_metastore_v2_backup_object = nil, backup_id: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
568
+ command = make_simple_command(:post, 'v2/{+parent}/backups', options)
569
+ command.request_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Backup::Representation
570
+ command.request_object = google_cloud_metastore_v2_backup_object
571
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
572
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
573
+ command.params['parent'] = parent unless parent.nil?
574
+ command.query['backupId'] = backup_id unless backup_id.nil?
575
+ command.query['requestId'] = request_id unless request_id.nil?
576
+ command.query['fields'] = fields unless fields.nil?
577
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
578
+ execute_or_queue_command(command, &block)
579
+ end
580
+
581
+ # Deletes a single backup.
582
+ # @param [String] name
583
+ # Required. The relative resource name of the backup to delete, in the following
584
+ # form:projects/`project_number`/locations/`location_id`/services/`service_id`/
585
+ # backups/`backup_id`.
586
+ # @param [String] request_id
587
+ # Optional. A request ID. Specify a unique request ID to allow the server to
588
+ # ignore the request if it has completed. The server will ignore subsequent
589
+ # requests that provide a duplicate request ID for at least 60 minutes after the
590
+ # first request.For example, if an initial request times out, followed by
591
+ # another request with the same request ID, the server ignores the second
592
+ # request to prevent the creation of duplicate commitments.The request ID must
593
+ # be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#
594
+ # Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
595
+ # @param [String] fields
596
+ # Selector specifying which fields to include in a partial response.
597
+ # @param [String] quota_user
598
+ # Available to use for quota purposes for server-side applications. Can be any
599
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
600
+ # @param [Google::Apis::RequestOptions] options
601
+ # Request-specific options
602
+ #
603
+ # @yield [result, err] Result & error if block supplied
604
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleLongrunningOperation] parsed result object
605
+ # @yieldparam err [StandardError] error object if request failed
606
+ #
607
+ # @return [Google::Apis::MetastoreV2::GoogleLongrunningOperation]
608
+ #
609
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
610
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
611
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
612
+ def delete_project_location_service_backup(name, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
613
+ command = make_simple_command(:delete, 'v2/{+name}', options)
614
+ command.response_representation = Google::Apis::MetastoreV2::GoogleLongrunningOperation::Representation
615
+ command.response_class = Google::Apis::MetastoreV2::GoogleLongrunningOperation
616
+ command.params['name'] = name unless name.nil?
617
+ command.query['requestId'] = request_id unless request_id.nil?
618
+ command.query['fields'] = fields unless fields.nil?
619
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
620
+ execute_or_queue_command(command, &block)
621
+ end
622
+
623
+ # Gets details of a single backup.
624
+ # @param [String] name
625
+ # Required. The relative resource name of the backup to retrieve, in the
626
+ # following form:projects/`project_number`/locations/`location_id`/services/`
627
+ # service_id`/backups/`backup_id`.
628
+ # @param [String] fields
629
+ # Selector specifying which fields to include in a partial response.
630
+ # @param [String] quota_user
631
+ # Available to use for quota purposes for server-side applications. Can be any
632
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
633
+ # @param [Google::Apis::RequestOptions] options
634
+ # Request-specific options
635
+ #
636
+ # @yield [result, err] Result & error if block supplied
637
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Backup] parsed result object
638
+ # @yieldparam err [StandardError] error object if request failed
639
+ #
640
+ # @return [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Backup]
641
+ #
642
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
643
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
644
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
645
+ def get_project_location_service_backup(name, fields: nil, quota_user: nil, options: nil, &block)
646
+ command = make_simple_command(:get, 'v2/{+name}', options)
647
+ command.response_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Backup::Representation
648
+ command.response_class = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2Backup
649
+ command.params['name'] = name unless name.nil?
650
+ command.query['fields'] = fields unless fields.nil?
651
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
652
+ execute_or_queue_command(command, &block)
653
+ end
654
+
655
+ # Lists backups in a service.
656
+ # @param [String] parent
657
+ # Required. The relative resource name of the service whose backups to list, in
658
+ # the following form:projects/`project_number`/locations/`location_id`/services/`
659
+ # service_id`/backups.
660
+ # @param [String] filter
661
+ # Optional. The filter to apply to list results.
662
+ # @param [String] order_by
663
+ # Optional. Specify the ordering of results as described in Sorting Order (https:
664
+ # //cloud.google.com/apis/design/design_patterns#sorting_order). If not
665
+ # specified, the results will be sorted in the default order.
666
+ # @param [Fixnum] page_size
667
+ # Optional. The maximum number of backups to return. The response may contain
668
+ # less than the maximum number. If unspecified, no more than 500 backups are
669
+ # returned. The maximum value is 1000; values above 1000 are changed to 1000.
670
+ # @param [String] page_token
671
+ # Optional. A page token, received from a previous DataprocMetastore.ListBackups
672
+ # call. Provide this token to retrieve the subsequent page.To retrieve the first
673
+ # page, supply an empty page token.When paginating, other parameters provided to
674
+ # DataprocMetastore.ListBackups must match the call that provided the page token.
675
+ # @param [String] fields
676
+ # Selector specifying which fields to include in a partial response.
677
+ # @param [String] quota_user
678
+ # Available to use for quota purposes for server-side applications. Can be any
679
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
680
+ # @param [Google::Apis::RequestOptions] options
681
+ # Request-specific options
682
+ #
683
+ # @yield [result, err] Result & error if block supplied
684
+ # @yieldparam result [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ListBackupsResponse] parsed result object
685
+ # @yieldparam err [StandardError] error object if request failed
686
+ #
687
+ # @return [Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ListBackupsResponse]
688
+ #
689
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
690
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
691
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
692
+ def list_project_location_service_backups(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
693
+ command = make_simple_command(:get, 'v2/{+parent}/backups', options)
694
+ command.response_representation = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ListBackupsResponse::Representation
695
+ command.response_class = Google::Apis::MetastoreV2::GoogleCloudMetastoreV2ListBackupsResponse
696
+ command.params['parent'] = parent unless parent.nil?
697
+ command.query['filter'] = filter unless filter.nil?
698
+ command.query['orderBy'] = order_by unless order_by.nil?
699
+ command.query['pageSize'] = page_size unless page_size.nil?
700
+ command.query['pageToken'] = page_token unless page_token.nil?
701
+ command.query['fields'] = fields unless fields.nil?
702
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
703
+ execute_or_queue_command(command, &block)
704
+ end
705
+
706
+ protected
707
+
708
+ def apply_command_defaults(command)
709
+ command.query['key'] = key unless key.nil?
710
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
711
+ end
712
+ end
713
+ end
714
+ end
715
+ end