google-cloud-dataplex-v1 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +149 -0
- data/LICENSE.md +201 -0
- data/README.md +139 -0
- data/lib/google/cloud/dataplex/v1/dataplex_service/client.rb +3133 -0
- data/lib/google/cloud/dataplex/v1/dataplex_service/credentials.rb +47 -0
- data/lib/google/cloud/dataplex/v1/dataplex_service/operations.rb +767 -0
- data/lib/google/cloud/dataplex/v1/dataplex_service/paths.rb +157 -0
- data/lib/google/cloud/dataplex/v1/dataplex_service.rb +54 -0
- data/lib/google/cloud/dataplex/v1/logs_pb.rb +135 -0
- data/lib/google/cloud/dataplex/v1/metadata_pb.rb +214 -0
- data/lib/google/cloud/dataplex/v1/metadata_service/client.rb +729 -0
- data/lib/google/cloud/dataplex/v1/metadata_service/credentials.rb +47 -0
- data/lib/google/cloud/dataplex/v1/metadata_service/paths.rb +102 -0
- data/lib/google/cloud/dataplex/v1/metadata_service.rb +50 -0
- data/lib/google/cloud/dataplex/v1/metadata_services_pb.rb +52 -0
- data/lib/google/cloud/dataplex/v1/resources_pb.rb +298 -0
- data/lib/google/cloud/dataplex/v1/service_pb.rb +218 -0
- data/lib/google/cloud/dataplex/v1/service_services_pb.rb +102 -0
- data/lib/google/cloud/dataplex/v1/tasks_pb.rb +133 -0
- data/lib/google/cloud/dataplex/v1/version.rb +28 -0
- data/lib/google/cloud/dataplex/v1.rb +39 -0
- data/lib/google-cloud-dataplex-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/dataplex/v1/logs.rb +308 -0
- data/proto_docs/google/cloud/dataplex/v1/metadata.rb +533 -0
- data/proto_docs/google/cloud/dataplex/v1/resources.rb +821 -0
- data/proto_docs/google/cloud/dataplex/v1/service.rb +601 -0
- data/proto_docs/google/cloud/dataplex/v1/tasks.rb +349 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +231 -0
@@ -0,0 +1,729 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/dataplex/v1/metadata_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dataplex
|
25
|
+
module V1
|
26
|
+
module MetadataService
|
27
|
+
##
|
28
|
+
# Client for the MetadataService service.
|
29
|
+
#
|
30
|
+
# Metadata service manages metadata resources such as tables, filesets and
|
31
|
+
# partitions.
|
32
|
+
#
|
33
|
+
class Client
|
34
|
+
include Paths
|
35
|
+
|
36
|
+
# @private
|
37
|
+
attr_reader :metadata_service_stub
|
38
|
+
|
39
|
+
##
|
40
|
+
# Configure the MetadataService Client class.
|
41
|
+
#
|
42
|
+
# See {::Google::Cloud::Dataplex::V1::MetadataService::Client::Configuration}
|
43
|
+
# for a description of the configuration fields.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
#
|
47
|
+
# # Modify the configuration for all MetadataService clients
|
48
|
+
# ::Google::Cloud::Dataplex::V1::MetadataService::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "Dataplex", "V1"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.rpcs.get_entity.timeout = 60.0
|
69
|
+
default_config.rpcs.get_entity.retry_policy = {
|
70
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
71
|
+
}
|
72
|
+
|
73
|
+
default_config.rpcs.list_entities.timeout = 60.0
|
74
|
+
default_config.rpcs.list_entities.retry_policy = {
|
75
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
76
|
+
}
|
77
|
+
|
78
|
+
default_config.rpcs.get_partition.timeout = 60.0
|
79
|
+
default_config.rpcs.get_partition.retry_policy = {
|
80
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
81
|
+
}
|
82
|
+
|
83
|
+
default_config.rpcs.list_partitions.timeout = 60.0
|
84
|
+
default_config.rpcs.list_partitions.retry_policy = {
|
85
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
86
|
+
}
|
87
|
+
|
88
|
+
default_config
|
89
|
+
end
|
90
|
+
yield @configure if block_given?
|
91
|
+
@configure
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Configure the MetadataService Client instance.
|
96
|
+
#
|
97
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
98
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
99
|
+
# should be made on {Client.configure}.
|
100
|
+
#
|
101
|
+
# See {::Google::Cloud::Dataplex::V1::MetadataService::Client::Configuration}
|
102
|
+
# for a description of the configuration fields.
|
103
|
+
#
|
104
|
+
# @yield [config] Configure the Client client.
|
105
|
+
# @yieldparam config [Client::Configuration]
|
106
|
+
#
|
107
|
+
# @return [Client::Configuration]
|
108
|
+
#
|
109
|
+
def configure
|
110
|
+
yield @config if block_given?
|
111
|
+
@config
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# Create a new MetadataService client object.
|
116
|
+
#
|
117
|
+
# @example
|
118
|
+
#
|
119
|
+
# # Create a client using the default configuration
|
120
|
+
# client = ::Google::Cloud::Dataplex::V1::MetadataService::Client.new
|
121
|
+
#
|
122
|
+
# # Create a client using a custom configuration
|
123
|
+
# client = ::Google::Cloud::Dataplex::V1::MetadataService::Client.new do |config|
|
124
|
+
# config.timeout = 10.0
|
125
|
+
# end
|
126
|
+
#
|
127
|
+
# @yield [config] Configure the MetadataService client.
|
128
|
+
# @yieldparam config [Client::Configuration]
|
129
|
+
#
|
130
|
+
def initialize
|
131
|
+
# These require statements are intentionally placed here to initialize
|
132
|
+
# the gRPC module only when it's required.
|
133
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
134
|
+
require "gapic/grpc"
|
135
|
+
require "google/cloud/dataplex/v1/metadata_services_pb"
|
136
|
+
|
137
|
+
# Create the configuration object
|
138
|
+
@config = Configuration.new Client.configure
|
139
|
+
|
140
|
+
# Yield the configuration if needed
|
141
|
+
yield @config if block_given?
|
142
|
+
|
143
|
+
# Create credentials
|
144
|
+
credentials = @config.credentials
|
145
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
146
|
+
# but only if the default endpoint does not have a region prefix.
|
147
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
148
|
+
!@config.endpoint.split(".").first.include?("-")
|
149
|
+
credentials ||= Credentials.default scope: @config.scope,
|
150
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
151
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
152
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
153
|
+
end
|
154
|
+
@quota_project_id = @config.quota_project
|
155
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
156
|
+
|
157
|
+
@metadata_service_stub = ::Gapic::ServiceStub.new(
|
158
|
+
::Google::Cloud::Dataplex::V1::MetadataService::Stub,
|
159
|
+
credentials: credentials,
|
160
|
+
endpoint: @config.endpoint,
|
161
|
+
channel_args: @config.channel_args,
|
162
|
+
interceptors: @config.interceptors
|
163
|
+
)
|
164
|
+
end
|
165
|
+
|
166
|
+
# Service calls
|
167
|
+
|
168
|
+
##
|
169
|
+
# Get a metadata entity.
|
170
|
+
#
|
171
|
+
# @overload get_entity(request, options = nil)
|
172
|
+
# Pass arguments to `get_entity` via a request object, either of type
|
173
|
+
# {::Google::Cloud::Dataplex::V1::GetEntityRequest} or an equivalent Hash.
|
174
|
+
#
|
175
|
+
# @param request [::Google::Cloud::Dataplex::V1::GetEntityRequest, ::Hash]
|
176
|
+
# A request object representing the call parameters. Required. To specify no
|
177
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
178
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
179
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
180
|
+
#
|
181
|
+
# @overload get_entity(name: nil, view: nil)
|
182
|
+
# Pass arguments to `get_entity` via keyword arguments. Note that at
|
183
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
184
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
185
|
+
#
|
186
|
+
# @param name [::String]
|
187
|
+
# Required. The resource name of the entity:
|
188
|
+
# `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}.`
|
189
|
+
# @param view [::Google::Cloud::Dataplex::V1::GetEntityRequest::EntityView]
|
190
|
+
# Optional. Used to select the subset of entity information to return.
|
191
|
+
# Defaults to `BASIC`.
|
192
|
+
#
|
193
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
194
|
+
# @yieldparam response [::Google::Cloud::Dataplex::V1::Entity]
|
195
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
196
|
+
#
|
197
|
+
# @return [::Google::Cloud::Dataplex::V1::Entity]
|
198
|
+
#
|
199
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
200
|
+
#
|
201
|
+
# @example Basic example
|
202
|
+
# require "google/cloud/dataplex/v1"
|
203
|
+
#
|
204
|
+
# # Create a client object. The client can be reused for multiple calls.
|
205
|
+
# client = Google::Cloud::Dataplex::V1::MetadataService::Client.new
|
206
|
+
#
|
207
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
208
|
+
# request = Google::Cloud::Dataplex::V1::GetEntityRequest.new
|
209
|
+
#
|
210
|
+
# # Call the get_entity method.
|
211
|
+
# result = client.get_entity request
|
212
|
+
#
|
213
|
+
# # The returned object is of type Google::Cloud::Dataplex::V1::Entity.
|
214
|
+
# p result
|
215
|
+
#
|
216
|
+
def get_entity request, options = nil
|
217
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
218
|
+
|
219
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::GetEntityRequest
|
220
|
+
|
221
|
+
# Converts hash and nil to an options object
|
222
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
223
|
+
|
224
|
+
# Customize the options with defaults
|
225
|
+
metadata = @config.rpcs.get_entity.metadata.to_h
|
226
|
+
|
227
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
228
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
229
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
230
|
+
gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
|
231
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
232
|
+
|
233
|
+
header_params = {}
|
234
|
+
if request.name
|
235
|
+
header_params["name"] = request.name
|
236
|
+
end
|
237
|
+
|
238
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
239
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
240
|
+
|
241
|
+
options.apply_defaults timeout: @config.rpcs.get_entity.timeout,
|
242
|
+
metadata: metadata,
|
243
|
+
retry_policy: @config.rpcs.get_entity.retry_policy
|
244
|
+
|
245
|
+
options.apply_defaults timeout: @config.timeout,
|
246
|
+
metadata: @config.metadata,
|
247
|
+
retry_policy: @config.retry_policy
|
248
|
+
|
249
|
+
@metadata_service_stub.call_rpc :get_entity, request, options: options do |response, operation|
|
250
|
+
yield response, operation if block_given?
|
251
|
+
return response
|
252
|
+
end
|
253
|
+
rescue ::GRPC::BadStatus => e
|
254
|
+
raise ::Google::Cloud::Error.from_error(e)
|
255
|
+
end
|
256
|
+
|
257
|
+
##
|
258
|
+
# List metadata entities in a zone.
|
259
|
+
#
|
260
|
+
# @overload list_entities(request, options = nil)
|
261
|
+
# Pass arguments to `list_entities` via a request object, either of type
|
262
|
+
# {::Google::Cloud::Dataplex::V1::ListEntitiesRequest} or an equivalent Hash.
|
263
|
+
#
|
264
|
+
# @param request [::Google::Cloud::Dataplex::V1::ListEntitiesRequest, ::Hash]
|
265
|
+
# A request object representing the call parameters. Required. To specify no
|
266
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
267
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
268
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
269
|
+
#
|
270
|
+
# @overload list_entities(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil)
|
271
|
+
# Pass arguments to `list_entities` via keyword arguments. Note that at
|
272
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
273
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
274
|
+
#
|
275
|
+
# @param parent [::String]
|
276
|
+
# Required. The resource name of the parent zone:
|
277
|
+
# `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}`.
|
278
|
+
# @param view [::Google::Cloud::Dataplex::V1::ListEntitiesRequest::EntityView]
|
279
|
+
# Required. Specify the entity view to make a partial list request.
|
280
|
+
# @param page_size [::Integer]
|
281
|
+
# Optional. Maximum number of entities to return. The service may return fewer than
|
282
|
+
# this value. If unspecified, at most 10 entities will be returned. The
|
283
|
+
# maximum value is 1000; values above 1000 are set to 1000.
|
284
|
+
# @param page_token [::String]
|
285
|
+
# Optional. Page token received from a previous `ListEntities` call. Provide
|
286
|
+
# this to retrieve the subsequent page. When paginating, all other parameters
|
287
|
+
# provided to `ListEntities` must match the call that provided the
|
288
|
+
# page token.
|
289
|
+
# @param filter [::String]
|
290
|
+
# Optional. Filter request by name prefix.
|
291
|
+
#
|
292
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
293
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::Entity>]
|
294
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
295
|
+
#
|
296
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::Entity>]
|
297
|
+
#
|
298
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
299
|
+
#
|
300
|
+
# @example Basic example
|
301
|
+
# require "google/cloud/dataplex/v1"
|
302
|
+
#
|
303
|
+
# # Create a client object. The client can be reused for multiple calls.
|
304
|
+
# client = Google::Cloud::Dataplex::V1::MetadataService::Client.new
|
305
|
+
#
|
306
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
307
|
+
# request = Google::Cloud::Dataplex::V1::ListEntitiesRequest.new
|
308
|
+
#
|
309
|
+
# # Call the list_entities method.
|
310
|
+
# result = client.list_entities request
|
311
|
+
#
|
312
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
313
|
+
# # iterate over all elements by calling #each, and the enumerable
|
314
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
315
|
+
# # methods are also available for managing paging directly.
|
316
|
+
# result.each do |response|
|
317
|
+
# # Each element is of type ::Google::Cloud::Dataplex::V1::Entity.
|
318
|
+
# p response
|
319
|
+
# end
|
320
|
+
#
|
321
|
+
def list_entities request, options = nil
|
322
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
323
|
+
|
324
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::ListEntitiesRequest
|
325
|
+
|
326
|
+
# Converts hash and nil to an options object
|
327
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
328
|
+
|
329
|
+
# Customize the options with defaults
|
330
|
+
metadata = @config.rpcs.list_entities.metadata.to_h
|
331
|
+
|
332
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
333
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
334
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
335
|
+
gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
|
336
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
337
|
+
|
338
|
+
header_params = {}
|
339
|
+
if request.parent
|
340
|
+
header_params["parent"] = request.parent
|
341
|
+
end
|
342
|
+
|
343
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
344
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
345
|
+
|
346
|
+
options.apply_defaults timeout: @config.rpcs.list_entities.timeout,
|
347
|
+
metadata: metadata,
|
348
|
+
retry_policy: @config.rpcs.list_entities.retry_policy
|
349
|
+
|
350
|
+
options.apply_defaults timeout: @config.timeout,
|
351
|
+
metadata: @config.metadata,
|
352
|
+
retry_policy: @config.retry_policy
|
353
|
+
|
354
|
+
@metadata_service_stub.call_rpc :list_entities, request, options: options do |response, operation|
|
355
|
+
response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_entities, request, response, operation, options
|
356
|
+
yield response, operation if block_given?
|
357
|
+
return response
|
358
|
+
end
|
359
|
+
rescue ::GRPC::BadStatus => e
|
360
|
+
raise ::Google::Cloud::Error.from_error(e)
|
361
|
+
end
|
362
|
+
|
363
|
+
##
|
364
|
+
# Get a metadata partition of an entity.
|
365
|
+
#
|
366
|
+
# @overload get_partition(request, options = nil)
|
367
|
+
# Pass arguments to `get_partition` via a request object, either of type
|
368
|
+
# {::Google::Cloud::Dataplex::V1::GetPartitionRequest} or an equivalent Hash.
|
369
|
+
#
|
370
|
+
# @param request [::Google::Cloud::Dataplex::V1::GetPartitionRequest, ::Hash]
|
371
|
+
# A request object representing the call parameters. Required. To specify no
|
372
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
373
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
374
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
375
|
+
#
|
376
|
+
# @overload get_partition(name: nil)
|
377
|
+
# Pass arguments to `get_partition` via keyword arguments. Note that at
|
378
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
379
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
380
|
+
#
|
381
|
+
# @param name [::String]
|
382
|
+
# Required. The resource name of the partition:
|
383
|
+
# `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}/partitions/{partition_id}`.
|
384
|
+
#
|
385
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
386
|
+
# @yieldparam response [::Google::Cloud::Dataplex::V1::Partition]
|
387
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
388
|
+
#
|
389
|
+
# @return [::Google::Cloud::Dataplex::V1::Partition]
|
390
|
+
#
|
391
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
392
|
+
#
|
393
|
+
# @example Basic example
|
394
|
+
# require "google/cloud/dataplex/v1"
|
395
|
+
#
|
396
|
+
# # Create a client object. The client can be reused for multiple calls.
|
397
|
+
# client = Google::Cloud::Dataplex::V1::MetadataService::Client.new
|
398
|
+
#
|
399
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
400
|
+
# request = Google::Cloud::Dataplex::V1::GetPartitionRequest.new
|
401
|
+
#
|
402
|
+
# # Call the get_partition method.
|
403
|
+
# result = client.get_partition request
|
404
|
+
#
|
405
|
+
# # The returned object is of type Google::Cloud::Dataplex::V1::Partition.
|
406
|
+
# p result
|
407
|
+
#
|
408
|
+
def get_partition request, options = nil
|
409
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
410
|
+
|
411
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::GetPartitionRequest
|
412
|
+
|
413
|
+
# Converts hash and nil to an options object
|
414
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
415
|
+
|
416
|
+
# Customize the options with defaults
|
417
|
+
metadata = @config.rpcs.get_partition.metadata.to_h
|
418
|
+
|
419
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
420
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
421
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
422
|
+
gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
|
423
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
424
|
+
|
425
|
+
header_params = {}
|
426
|
+
if request.name
|
427
|
+
header_params["name"] = request.name
|
428
|
+
end
|
429
|
+
|
430
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
431
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
432
|
+
|
433
|
+
options.apply_defaults timeout: @config.rpcs.get_partition.timeout,
|
434
|
+
metadata: metadata,
|
435
|
+
retry_policy: @config.rpcs.get_partition.retry_policy
|
436
|
+
|
437
|
+
options.apply_defaults timeout: @config.timeout,
|
438
|
+
metadata: @config.metadata,
|
439
|
+
retry_policy: @config.retry_policy
|
440
|
+
|
441
|
+
@metadata_service_stub.call_rpc :get_partition, request, options: options do |response, operation|
|
442
|
+
yield response, operation if block_given?
|
443
|
+
return response
|
444
|
+
end
|
445
|
+
rescue ::GRPC::BadStatus => e
|
446
|
+
raise ::Google::Cloud::Error.from_error(e)
|
447
|
+
end
|
448
|
+
|
449
|
+
##
|
450
|
+
# List metadata partitions of an entity.
|
451
|
+
#
|
452
|
+
# @overload list_partitions(request, options = nil)
|
453
|
+
# Pass arguments to `list_partitions` via a request object, either of type
|
454
|
+
# {::Google::Cloud::Dataplex::V1::ListPartitionsRequest} or an equivalent Hash.
|
455
|
+
#
|
456
|
+
# @param request [::Google::Cloud::Dataplex::V1::ListPartitionsRequest, ::Hash]
|
457
|
+
# A request object representing the call parameters. Required. To specify no
|
458
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
459
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
460
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
461
|
+
#
|
462
|
+
# @overload list_partitions(parent: nil, page_size: nil, page_token: nil, filter: nil)
|
463
|
+
# Pass arguments to `list_partitions` via keyword arguments. Note that at
|
464
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
465
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
466
|
+
#
|
467
|
+
# @param parent [::String]
|
468
|
+
# Required. The resource name of the parent entity:
|
469
|
+
# `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}`.
|
470
|
+
# @param page_size [::Integer]
|
471
|
+
# Optional. Maximum number of partitions to return. The service may return fewer than
|
472
|
+
# this value. If unspecified, at most 10 partitions will be returned. The
|
473
|
+
# maximum value is 1000; values above 1000 will be coerced to 1000.
|
474
|
+
# @param page_token [::String]
|
475
|
+
# Optional. Page token received from a previous `ListPartitions` call. Provide
|
476
|
+
# this to retrieve the subsequent page. When paginating, all other parameters
|
477
|
+
# provided to `ListPartitions` must match the call that provided the
|
478
|
+
# page token.
|
479
|
+
# @param filter [::String]
|
480
|
+
# Optional. Filter request.
|
481
|
+
#
|
482
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
483
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::Partition>]
|
484
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
485
|
+
#
|
486
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataplex::V1::Partition>]
|
487
|
+
#
|
488
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
489
|
+
#
|
490
|
+
# @example Basic example
|
491
|
+
# require "google/cloud/dataplex/v1"
|
492
|
+
#
|
493
|
+
# # Create a client object. The client can be reused for multiple calls.
|
494
|
+
# client = Google::Cloud::Dataplex::V1::MetadataService::Client.new
|
495
|
+
#
|
496
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
497
|
+
# request = Google::Cloud::Dataplex::V1::ListPartitionsRequest.new
|
498
|
+
#
|
499
|
+
# # Call the list_partitions method.
|
500
|
+
# result = client.list_partitions request
|
501
|
+
#
|
502
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
503
|
+
# # iterate over all elements by calling #each, and the enumerable
|
504
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
505
|
+
# # methods are also available for managing paging directly.
|
506
|
+
# result.each do |response|
|
507
|
+
# # Each element is of type ::Google::Cloud::Dataplex::V1::Partition.
|
508
|
+
# p response
|
509
|
+
# end
|
510
|
+
#
|
511
|
+
def list_partitions request, options = nil
|
512
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
513
|
+
|
514
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataplex::V1::ListPartitionsRequest
|
515
|
+
|
516
|
+
# Converts hash and nil to an options object
|
517
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
518
|
+
|
519
|
+
# Customize the options with defaults
|
520
|
+
metadata = @config.rpcs.list_partitions.metadata.to_h
|
521
|
+
|
522
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
523
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
524
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
525
|
+
gapic_version: ::Google::Cloud::Dataplex::V1::VERSION
|
526
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
527
|
+
|
528
|
+
header_params = {}
|
529
|
+
if request.parent
|
530
|
+
header_params["parent"] = request.parent
|
531
|
+
end
|
532
|
+
|
533
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
534
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
535
|
+
|
536
|
+
options.apply_defaults timeout: @config.rpcs.list_partitions.timeout,
|
537
|
+
metadata: metadata,
|
538
|
+
retry_policy: @config.rpcs.list_partitions.retry_policy
|
539
|
+
|
540
|
+
options.apply_defaults timeout: @config.timeout,
|
541
|
+
metadata: @config.metadata,
|
542
|
+
retry_policy: @config.retry_policy
|
543
|
+
|
544
|
+
@metadata_service_stub.call_rpc :list_partitions, request, options: options do |response, operation|
|
545
|
+
response = ::Gapic::PagedEnumerable.new @metadata_service_stub, :list_partitions, request, response, operation, options
|
546
|
+
yield response, operation if block_given?
|
547
|
+
return response
|
548
|
+
end
|
549
|
+
rescue ::GRPC::BadStatus => e
|
550
|
+
raise ::Google::Cloud::Error.from_error(e)
|
551
|
+
end
|
552
|
+
|
553
|
+
##
|
554
|
+
# Configuration class for the MetadataService API.
|
555
|
+
#
|
556
|
+
# This class represents the configuration for MetadataService,
|
557
|
+
# providing control over timeouts, retry behavior, logging, transport
|
558
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
559
|
+
# applied individually to specific RPCs. See
|
560
|
+
# {::Google::Cloud::Dataplex::V1::MetadataService::Client::Configuration::Rpcs}
|
561
|
+
# for a list of RPCs that can be configured independently.
|
562
|
+
#
|
563
|
+
# Configuration can be applied globally to all clients, or to a single client
|
564
|
+
# on construction.
|
565
|
+
#
|
566
|
+
# @example
|
567
|
+
#
|
568
|
+
# # Modify the global config, setting the timeout for
|
569
|
+
# # get_entity to 20 seconds,
|
570
|
+
# # and all remaining timeouts to 10 seconds.
|
571
|
+
# ::Google::Cloud::Dataplex::V1::MetadataService::Client.configure do |config|
|
572
|
+
# config.timeout = 10.0
|
573
|
+
# config.rpcs.get_entity.timeout = 20.0
|
574
|
+
# end
|
575
|
+
#
|
576
|
+
# # Apply the above configuration only to a new client.
|
577
|
+
# client = ::Google::Cloud::Dataplex::V1::MetadataService::Client.new do |config|
|
578
|
+
# config.timeout = 10.0
|
579
|
+
# config.rpcs.get_entity.timeout = 20.0
|
580
|
+
# end
|
581
|
+
#
|
582
|
+
# @!attribute [rw] endpoint
|
583
|
+
# The hostname or hostname:port of the service endpoint.
|
584
|
+
# Defaults to `"dataplex.googleapis.com"`.
|
585
|
+
# @return [::String]
|
586
|
+
# @!attribute [rw] credentials
|
587
|
+
# Credentials to send with calls. You may provide any of the following types:
|
588
|
+
# * (`String`) The path to a service account key file in JSON format
|
589
|
+
# * (`Hash`) A service account key as a Hash
|
590
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
591
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
592
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
593
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
594
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
595
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
596
|
+
# * (`nil`) indicating no credentials
|
597
|
+
# @return [::Object]
|
598
|
+
# @!attribute [rw] scope
|
599
|
+
# The OAuth scopes
|
600
|
+
# @return [::Array<::String>]
|
601
|
+
# @!attribute [rw] lib_name
|
602
|
+
# The library name as recorded in instrumentation and logging
|
603
|
+
# @return [::String]
|
604
|
+
# @!attribute [rw] lib_version
|
605
|
+
# The library version as recorded in instrumentation and logging
|
606
|
+
# @return [::String]
|
607
|
+
# @!attribute [rw] channel_args
|
608
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
609
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
610
|
+
# @return [::Hash]
|
611
|
+
# @!attribute [rw] interceptors
|
612
|
+
# An array of interceptors that are run before calls are executed.
|
613
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
614
|
+
# @!attribute [rw] timeout
|
615
|
+
# The call timeout in seconds.
|
616
|
+
# @return [::Numeric]
|
617
|
+
# @!attribute [rw] metadata
|
618
|
+
# Additional gRPC headers to be sent with the call.
|
619
|
+
# @return [::Hash{::Symbol=>::String}]
|
620
|
+
# @!attribute [rw] retry_policy
|
621
|
+
# The retry policy. The value is a hash with the following keys:
|
622
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
623
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
624
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
625
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
626
|
+
# trigger a retry.
|
627
|
+
# @return [::Hash]
|
628
|
+
# @!attribute [rw] quota_project
|
629
|
+
# A separate project against which to charge quota.
|
630
|
+
# @return [::String]
|
631
|
+
#
|
632
|
+
class Configuration
|
633
|
+
extend ::Gapic::Config
|
634
|
+
|
635
|
+
config_attr :endpoint, "dataplex.googleapis.com", ::String
|
636
|
+
config_attr :credentials, nil do |value|
|
637
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
638
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
639
|
+
allowed.any? { |klass| klass === value }
|
640
|
+
end
|
641
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
642
|
+
config_attr :lib_name, nil, ::String, nil
|
643
|
+
config_attr :lib_version, nil, ::String, nil
|
644
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
645
|
+
config_attr :interceptors, nil, ::Array, nil
|
646
|
+
config_attr :timeout, nil, ::Numeric, nil
|
647
|
+
config_attr :metadata, nil, ::Hash, nil
|
648
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
649
|
+
config_attr :quota_project, nil, ::String, nil
|
650
|
+
|
651
|
+
# @private
|
652
|
+
def initialize parent_config = nil
|
653
|
+
@parent_config = parent_config unless parent_config.nil?
|
654
|
+
|
655
|
+
yield self if block_given?
|
656
|
+
end
|
657
|
+
|
658
|
+
##
|
659
|
+
# Configurations for individual RPCs
|
660
|
+
# @return [Rpcs]
|
661
|
+
#
|
662
|
+
def rpcs
|
663
|
+
@rpcs ||= begin
|
664
|
+
parent_rpcs = nil
|
665
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
666
|
+
Rpcs.new parent_rpcs
|
667
|
+
end
|
668
|
+
end
|
669
|
+
|
670
|
+
##
|
671
|
+
# Configuration RPC class for the MetadataService API.
|
672
|
+
#
|
673
|
+
# Includes fields providing the configuration for each RPC in this service.
|
674
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
675
|
+
# the following configuration fields:
|
676
|
+
#
|
677
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
678
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
679
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
680
|
+
# include the following keys:
|
681
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
682
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
683
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
684
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
685
|
+
# trigger a retry.
|
686
|
+
#
|
687
|
+
class Rpcs
|
688
|
+
##
|
689
|
+
# RPC-specific configuration for `get_entity`
|
690
|
+
# @return [::Gapic::Config::Method]
|
691
|
+
#
|
692
|
+
attr_reader :get_entity
|
693
|
+
##
|
694
|
+
# RPC-specific configuration for `list_entities`
|
695
|
+
# @return [::Gapic::Config::Method]
|
696
|
+
#
|
697
|
+
attr_reader :list_entities
|
698
|
+
##
|
699
|
+
# RPC-specific configuration for `get_partition`
|
700
|
+
# @return [::Gapic::Config::Method]
|
701
|
+
#
|
702
|
+
attr_reader :get_partition
|
703
|
+
##
|
704
|
+
# RPC-specific configuration for `list_partitions`
|
705
|
+
# @return [::Gapic::Config::Method]
|
706
|
+
#
|
707
|
+
attr_reader :list_partitions
|
708
|
+
|
709
|
+
# @private
|
710
|
+
def initialize parent_rpcs = nil
|
711
|
+
get_entity_config = parent_rpcs.get_entity if parent_rpcs.respond_to? :get_entity
|
712
|
+
@get_entity = ::Gapic::Config::Method.new get_entity_config
|
713
|
+
list_entities_config = parent_rpcs.list_entities if parent_rpcs.respond_to? :list_entities
|
714
|
+
@list_entities = ::Gapic::Config::Method.new list_entities_config
|
715
|
+
get_partition_config = parent_rpcs.get_partition if parent_rpcs.respond_to? :get_partition
|
716
|
+
@get_partition = ::Gapic::Config::Method.new get_partition_config
|
717
|
+
list_partitions_config = parent_rpcs.list_partitions if parent_rpcs.respond_to? :list_partitions
|
718
|
+
@list_partitions = ::Gapic::Config::Method.new list_partitions_config
|
719
|
+
|
720
|
+
yield self if block_given?
|
721
|
+
end
|
722
|
+
end
|
723
|
+
end
|
724
|
+
end
|
725
|
+
end
|
726
|
+
end
|
727
|
+
end
|
728
|
+
end
|
729
|
+
end
|