google-cloud-metastore-v1beta 0.3.0 → 0.5.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 +4 -4
- data/lib/google/cloud/metastore/v1beta/dataproc_metastore/client.rb +507 -54
- data/lib/google/cloud/metastore/v1beta/dataproc_metastore/operations.rb +12 -14
- data/lib/google/cloud/metastore/v1beta/dataproc_metastore.rb +1 -1
- data/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/client.rb +66 -39
- data/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation/operations.rb +12 -14
- data/lib/google/cloud/metastore/v1beta/dataproc_metastore_federation.rb +1 -1
- data/lib/google/cloud/metastore/v1beta/metastore_pb.rb +37 -0
- data/lib/google/cloud/metastore/v1beta/metastore_services_pb.rb +11 -0
- data/lib/google/cloud/metastore/v1beta/version.rb +1 -1
- data/lib/google/cloud/metastore/v1beta.rb +2 -2
- data/proto_docs/google/cloud/metastore/v1beta/metastore.rb +120 -0
- data/proto_docs/google/cloud/metastore/v1beta/metastore_federation.rb +28 -26
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +47 -7
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/metastore/v1beta/metastore_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
require "google/iam/v1"
|
21
23
|
|
22
24
|
module Google
|
23
25
|
module Cloud
|
@@ -178,6 +180,18 @@ module Google
|
|
178
180
|
config.endpoint = @config.endpoint
|
179
181
|
end
|
180
182
|
|
183
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
184
|
+
config.credentials = credentials
|
185
|
+
config.quota_project = @quota_project_id
|
186
|
+
config.endpoint = @config.endpoint
|
187
|
+
end
|
188
|
+
|
189
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
190
|
+
config.credentials = credentials
|
191
|
+
config.quota_project = @quota_project_id
|
192
|
+
config.endpoint = @config.endpoint
|
193
|
+
end
|
194
|
+
|
181
195
|
@dataproc_metastore_stub = ::Gapic::ServiceStub.new(
|
182
196
|
::Google::Cloud::Metastore::V1beta::DataprocMetastore::Stub,
|
183
197
|
credentials: credentials,
|
@@ -194,6 +208,20 @@ module Google
|
|
194
208
|
#
|
195
209
|
attr_reader :operations_client
|
196
210
|
|
211
|
+
##
|
212
|
+
# Get the associated client for mix-in of the Locations.
|
213
|
+
#
|
214
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
215
|
+
#
|
216
|
+
attr_reader :location_client
|
217
|
+
|
218
|
+
##
|
219
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
220
|
+
#
|
221
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
222
|
+
#
|
223
|
+
attr_reader :iam_policy_client
|
224
|
+
|
197
225
|
# Service calls
|
198
226
|
|
199
227
|
##
|
@@ -261,13 +289,11 @@ module Google
|
|
261
289
|
# # Call the list_services method.
|
262
290
|
# result = client.list_services request
|
263
291
|
#
|
264
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
265
|
-
# #
|
266
|
-
#
|
267
|
-
# # methods are also available for managing paging directly.
|
268
|
-
# result.each do |response|
|
292
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
293
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
294
|
+
# result.each do |item|
|
269
295
|
# # Each element is of type ::Google::Cloud::Metastore::V1beta::Service.
|
270
|
-
# p
|
296
|
+
# p item
|
271
297
|
# end
|
272
298
|
#
|
273
299
|
def list_services request, options = nil
|
@@ -468,14 +494,14 @@ module Google
|
|
468
494
|
# # Call the create_service method.
|
469
495
|
# result = client.create_service request
|
470
496
|
#
|
471
|
-
# # The returned object is of type Gapic::Operation. You can use
|
472
|
-
# #
|
473
|
-
# #
|
497
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
498
|
+
# # check the status of an operation, cancel it, or wait for results.
|
499
|
+
# # Here is how to wait for a response.
|
474
500
|
# result.wait_until_done! timeout: 60
|
475
501
|
# if result.response?
|
476
502
|
# p result.response
|
477
503
|
# else
|
478
|
-
# puts "
|
504
|
+
# puts "No response received."
|
479
505
|
# end
|
480
506
|
#
|
481
507
|
def create_service request, options = nil
|
@@ -583,14 +609,14 @@ module Google
|
|
583
609
|
# # Call the update_service method.
|
584
610
|
# result = client.update_service request
|
585
611
|
#
|
586
|
-
# # The returned object is of type Gapic::Operation. You can use
|
587
|
-
# #
|
588
|
-
# #
|
612
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
613
|
+
# # check the status of an operation, cancel it, or wait for results.
|
614
|
+
# # Here is how to wait for a response.
|
589
615
|
# result.wait_until_done! timeout: 60
|
590
616
|
# if result.response?
|
591
617
|
# p result.response
|
592
618
|
# else
|
593
|
-
# puts "
|
619
|
+
# puts "No response received."
|
594
620
|
# end
|
595
621
|
#
|
596
622
|
def update_service request, options = nil
|
@@ -692,14 +718,14 @@ module Google
|
|
692
718
|
# # Call the delete_service method.
|
693
719
|
# result = client.delete_service request
|
694
720
|
#
|
695
|
-
# # The returned object is of type Gapic::Operation. You can use
|
696
|
-
# #
|
697
|
-
# #
|
721
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
722
|
+
# # check the status of an operation, cancel it, or wait for results.
|
723
|
+
# # Here is how to wait for a response.
|
698
724
|
# result.wait_until_done! timeout: 60
|
699
725
|
# if result.response?
|
700
726
|
# p result.response
|
701
727
|
# else
|
702
|
-
# puts "
|
728
|
+
# puts "No response received."
|
703
729
|
# end
|
704
730
|
#
|
705
731
|
def delete_service request, options = nil
|
@@ -808,13 +834,11 @@ module Google
|
|
808
834
|
# # Call the list_metadata_imports method.
|
809
835
|
# result = client.list_metadata_imports request
|
810
836
|
#
|
811
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
812
|
-
# #
|
813
|
-
#
|
814
|
-
# # methods are also available for managing paging directly.
|
815
|
-
# result.each do |response|
|
837
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
838
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
839
|
+
# result.each do |item|
|
816
840
|
# # Each element is of type ::Google::Cloud::Metastore::V1beta::MetadataImport.
|
817
|
-
# p
|
841
|
+
# p item
|
818
842
|
# end
|
819
843
|
#
|
820
844
|
def list_metadata_imports request, options = nil
|
@@ -1015,14 +1039,14 @@ module Google
|
|
1015
1039
|
# # Call the create_metadata_import method.
|
1016
1040
|
# result = client.create_metadata_import request
|
1017
1041
|
#
|
1018
|
-
# # The returned object is of type Gapic::Operation. You can use
|
1019
|
-
# #
|
1020
|
-
# #
|
1042
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1043
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1044
|
+
# # Here is how to wait for a response.
|
1021
1045
|
# result.wait_until_done! timeout: 60
|
1022
1046
|
# if result.response?
|
1023
1047
|
# p result.response
|
1024
1048
|
# else
|
1025
|
-
# puts "
|
1049
|
+
# puts "No response received."
|
1026
1050
|
# end
|
1027
1051
|
#
|
1028
1052
|
def create_metadata_import request, options = nil
|
@@ -1131,14 +1155,14 @@ module Google
|
|
1131
1155
|
# # Call the update_metadata_import method.
|
1132
1156
|
# result = client.update_metadata_import request
|
1133
1157
|
#
|
1134
|
-
# # The returned object is of type Gapic::Operation. You can use
|
1135
|
-
# #
|
1136
|
-
# #
|
1158
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1159
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1160
|
+
# # Here is how to wait for a response.
|
1137
1161
|
# result.wait_until_done! timeout: 60
|
1138
1162
|
# if result.response?
|
1139
1163
|
# p result.response
|
1140
1164
|
# else
|
1141
|
-
# puts "
|
1165
|
+
# puts "No response received."
|
1142
1166
|
# end
|
1143
1167
|
#
|
1144
1168
|
def update_metadata_import request, options = nil
|
@@ -1247,14 +1271,14 @@ module Google
|
|
1247
1271
|
# # Call the export_metadata method.
|
1248
1272
|
# result = client.export_metadata request
|
1249
1273
|
#
|
1250
|
-
# # The returned object is of type Gapic::Operation. You can use
|
1251
|
-
# #
|
1252
|
-
# #
|
1274
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1275
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1276
|
+
# # Here is how to wait for a response.
|
1253
1277
|
# result.wait_until_done! timeout: 60
|
1254
1278
|
# if result.response?
|
1255
1279
|
# p result.response
|
1256
1280
|
# else
|
1257
|
-
# puts "
|
1281
|
+
# puts "No response received."
|
1258
1282
|
# end
|
1259
1283
|
#
|
1260
1284
|
def export_metadata request, options = nil
|
@@ -1363,14 +1387,14 @@ module Google
|
|
1363
1387
|
# # Call the restore_service method.
|
1364
1388
|
# result = client.restore_service request
|
1365
1389
|
#
|
1366
|
-
# # The returned object is of type Gapic::Operation. You can use
|
1367
|
-
# #
|
1368
|
-
# #
|
1390
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1391
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1392
|
+
# # Here is how to wait for a response.
|
1369
1393
|
# result.wait_until_done! timeout: 60
|
1370
1394
|
# if result.response?
|
1371
1395
|
# p result.response
|
1372
1396
|
# else
|
1373
|
-
# puts "
|
1397
|
+
# puts "No response received."
|
1374
1398
|
# end
|
1375
1399
|
#
|
1376
1400
|
def restore_service request, options = nil
|
@@ -1479,13 +1503,11 @@ module Google
|
|
1479
1503
|
# # Call the list_backups method.
|
1480
1504
|
# result = client.list_backups request
|
1481
1505
|
#
|
1482
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1483
|
-
# #
|
1484
|
-
#
|
1485
|
-
# # methods are also available for managing paging directly.
|
1486
|
-
# result.each do |response|
|
1506
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1507
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1508
|
+
# result.each do |item|
|
1487
1509
|
# # Each element is of type ::Google::Cloud::Metastore::V1beta::Backup.
|
1488
|
-
# p
|
1510
|
+
# p item
|
1489
1511
|
# end
|
1490
1512
|
#
|
1491
1513
|
def list_backups request, options = nil
|
@@ -1685,14 +1707,14 @@ module Google
|
|
1685
1707
|
# # Call the create_backup method.
|
1686
1708
|
# result = client.create_backup request
|
1687
1709
|
#
|
1688
|
-
# # The returned object is of type Gapic::Operation. You can use
|
1689
|
-
# #
|
1690
|
-
# #
|
1710
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1711
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1712
|
+
# # Here is how to wait for a response.
|
1691
1713
|
# result.wait_until_done! timeout: 60
|
1692
1714
|
# if result.response?
|
1693
1715
|
# p result.response
|
1694
1716
|
# else
|
1695
|
-
# puts "
|
1717
|
+
# puts "No response received."
|
1696
1718
|
# end
|
1697
1719
|
#
|
1698
1720
|
def create_backup request, options = nil
|
@@ -1794,14 +1816,14 @@ module Google
|
|
1794
1816
|
# # Call the delete_backup method.
|
1795
1817
|
# result = client.delete_backup request
|
1796
1818
|
#
|
1797
|
-
# # The returned object is of type Gapic::Operation. You can use
|
1798
|
-
# #
|
1799
|
-
# #
|
1819
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1820
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1821
|
+
# # Here is how to wait for a response.
|
1800
1822
|
# result.wait_until_done! timeout: 60
|
1801
1823
|
# if result.response?
|
1802
1824
|
# p result.response
|
1803
1825
|
# else
|
1804
|
-
# puts "
|
1826
|
+
# puts "No response received."
|
1805
1827
|
# end
|
1806
1828
|
#
|
1807
1829
|
def delete_backup request, options = nil
|
@@ -1846,6 +1868,409 @@ module Google
|
|
1846
1868
|
raise ::Google::Cloud::Error.from_error(e)
|
1847
1869
|
end
|
1848
1870
|
|
1871
|
+
##
|
1872
|
+
# Removes the attached IAM policies for a resource
|
1873
|
+
#
|
1874
|
+
# @overload remove_iam_policy(request, options = nil)
|
1875
|
+
# Pass arguments to `remove_iam_policy` via a request object, either of type
|
1876
|
+
# {::Google::Cloud::Metastore::V1beta::RemoveIamPolicyRequest} or an equivalent Hash.
|
1877
|
+
#
|
1878
|
+
# @param request [::Google::Cloud::Metastore::V1beta::RemoveIamPolicyRequest, ::Hash]
|
1879
|
+
# A request object representing the call parameters. Required. To specify no
|
1880
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1881
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1882
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1883
|
+
#
|
1884
|
+
# @overload remove_iam_policy(resource: nil, asynchronous: nil)
|
1885
|
+
# Pass arguments to `remove_iam_policy` via keyword arguments. Note that at
|
1886
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1887
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1888
|
+
#
|
1889
|
+
# @param resource [::String]
|
1890
|
+
# Required. The relative resource name of the dataplane resource to remove
|
1891
|
+
# IAM policy, in the following form:
|
1892
|
+
#
|
1893
|
+
# `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}`
|
1894
|
+
# or
|
1895
|
+
# `projects/{project_id}/locations/{location_id}/services/{service_id}/databases/{database_id}/tables/{table_id}`.
|
1896
|
+
# @param asynchronous [::Boolean]
|
1897
|
+
# Optional. Removes IAM policy attached to database or table asynchronously
|
1898
|
+
# when it is set. The default is false.
|
1899
|
+
#
|
1900
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1901
|
+
# @yieldparam response [::Google::Cloud::Metastore::V1beta::RemoveIamPolicyResponse]
|
1902
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1903
|
+
#
|
1904
|
+
# @return [::Google::Cloud::Metastore::V1beta::RemoveIamPolicyResponse]
|
1905
|
+
#
|
1906
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1907
|
+
#
|
1908
|
+
# @example Basic example
|
1909
|
+
# require "google/cloud/metastore/v1beta"
|
1910
|
+
#
|
1911
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1912
|
+
# client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new
|
1913
|
+
#
|
1914
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1915
|
+
# request = Google::Cloud::Metastore::V1beta::RemoveIamPolicyRequest.new
|
1916
|
+
#
|
1917
|
+
# # Call the remove_iam_policy method.
|
1918
|
+
# result = client.remove_iam_policy request
|
1919
|
+
#
|
1920
|
+
# # The returned object is of type Google::Cloud::Metastore::V1beta::RemoveIamPolicyResponse.
|
1921
|
+
# p result
|
1922
|
+
#
|
1923
|
+
def remove_iam_policy request, options = nil
|
1924
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1925
|
+
|
1926
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1beta::RemoveIamPolicyRequest
|
1927
|
+
|
1928
|
+
# Converts hash and nil to an options object
|
1929
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1930
|
+
|
1931
|
+
# Customize the options with defaults
|
1932
|
+
metadata = @config.rpcs.remove_iam_policy.metadata.to_h
|
1933
|
+
|
1934
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1935
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1936
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1937
|
+
gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
|
1938
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1939
|
+
|
1940
|
+
header_params = {}
|
1941
|
+
if request.resource
|
1942
|
+
header_params["resource"] = request.resource
|
1943
|
+
end
|
1944
|
+
|
1945
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1946
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1947
|
+
|
1948
|
+
options.apply_defaults timeout: @config.rpcs.remove_iam_policy.timeout,
|
1949
|
+
metadata: metadata,
|
1950
|
+
retry_policy: @config.rpcs.remove_iam_policy.retry_policy
|
1951
|
+
|
1952
|
+
options.apply_defaults timeout: @config.timeout,
|
1953
|
+
metadata: @config.metadata,
|
1954
|
+
retry_policy: @config.retry_policy
|
1955
|
+
|
1956
|
+
@dataproc_metastore_stub.call_rpc :remove_iam_policy, request, options: options do |response, operation|
|
1957
|
+
yield response, operation if block_given?
|
1958
|
+
return response
|
1959
|
+
end
|
1960
|
+
rescue ::GRPC::BadStatus => e
|
1961
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1962
|
+
end
|
1963
|
+
|
1964
|
+
##
|
1965
|
+
# Query DPMS metadata.
|
1966
|
+
#
|
1967
|
+
# @overload query_metadata(request, options = nil)
|
1968
|
+
# Pass arguments to `query_metadata` via a request object, either of type
|
1969
|
+
# {::Google::Cloud::Metastore::V1beta::QueryMetadataRequest} or an equivalent Hash.
|
1970
|
+
#
|
1971
|
+
# @param request [::Google::Cloud::Metastore::V1beta::QueryMetadataRequest, ::Hash]
|
1972
|
+
# A request object representing the call parameters. Required. To specify no
|
1973
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1974
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1975
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1976
|
+
#
|
1977
|
+
# @overload query_metadata(service: nil, query: nil)
|
1978
|
+
# Pass arguments to `query_metadata` via keyword arguments. Note that at
|
1979
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1980
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1981
|
+
#
|
1982
|
+
# @param service [::String]
|
1983
|
+
# Required. The relative resource name of the metastore service to query
|
1984
|
+
# metadata, in the following format:
|
1985
|
+
#
|
1986
|
+
# `projects/{project_id}/locations/{location_id}/services/{service_id}`.
|
1987
|
+
# @param query [::String]
|
1988
|
+
# Required. A read-only SQL query to execute against the metadata database.
|
1989
|
+
# The query cannot change or mutate the data.
|
1990
|
+
#
|
1991
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1992
|
+
# @yieldparam response [::Gapic::Operation]
|
1993
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1994
|
+
#
|
1995
|
+
# @return [::Gapic::Operation]
|
1996
|
+
#
|
1997
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1998
|
+
#
|
1999
|
+
# @example Basic example
|
2000
|
+
# require "google/cloud/metastore/v1beta"
|
2001
|
+
#
|
2002
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2003
|
+
# client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new
|
2004
|
+
#
|
2005
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2006
|
+
# request = Google::Cloud::Metastore::V1beta::QueryMetadataRequest.new
|
2007
|
+
#
|
2008
|
+
# # Call the query_metadata method.
|
2009
|
+
# result = client.query_metadata request
|
2010
|
+
#
|
2011
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2012
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2013
|
+
# # Here is how to wait for a response.
|
2014
|
+
# result.wait_until_done! timeout: 60
|
2015
|
+
# if result.response?
|
2016
|
+
# p result.response
|
2017
|
+
# else
|
2018
|
+
# puts "No response received."
|
2019
|
+
# end
|
2020
|
+
#
|
2021
|
+
def query_metadata request, options = nil
|
2022
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2023
|
+
|
2024
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1beta::QueryMetadataRequest
|
2025
|
+
|
2026
|
+
# Converts hash and nil to an options object
|
2027
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2028
|
+
|
2029
|
+
# Customize the options with defaults
|
2030
|
+
metadata = @config.rpcs.query_metadata.metadata.to_h
|
2031
|
+
|
2032
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2033
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2034
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2035
|
+
gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
|
2036
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2037
|
+
|
2038
|
+
header_params = {}
|
2039
|
+
if request.service
|
2040
|
+
header_params["service"] = request.service
|
2041
|
+
end
|
2042
|
+
|
2043
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2044
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2045
|
+
|
2046
|
+
options.apply_defaults timeout: @config.rpcs.query_metadata.timeout,
|
2047
|
+
metadata: metadata,
|
2048
|
+
retry_policy: @config.rpcs.query_metadata.retry_policy
|
2049
|
+
|
2050
|
+
options.apply_defaults timeout: @config.timeout,
|
2051
|
+
metadata: @config.metadata,
|
2052
|
+
retry_policy: @config.retry_policy
|
2053
|
+
|
2054
|
+
@dataproc_metastore_stub.call_rpc :query_metadata, request, options: options do |response, operation|
|
2055
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2056
|
+
yield response, operation if block_given?
|
2057
|
+
return response
|
2058
|
+
end
|
2059
|
+
rescue ::GRPC::BadStatus => e
|
2060
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2061
|
+
end
|
2062
|
+
|
2063
|
+
##
|
2064
|
+
# Move a table to another database.
|
2065
|
+
#
|
2066
|
+
# @overload move_table_to_database(request, options = nil)
|
2067
|
+
# Pass arguments to `move_table_to_database` via a request object, either of type
|
2068
|
+
# {::Google::Cloud::Metastore::V1beta::MoveTableToDatabaseRequest} or an equivalent Hash.
|
2069
|
+
#
|
2070
|
+
# @param request [::Google::Cloud::Metastore::V1beta::MoveTableToDatabaseRequest, ::Hash]
|
2071
|
+
# A request object representing the call parameters. Required. To specify no
|
2072
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2073
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2074
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2075
|
+
#
|
2076
|
+
# @overload move_table_to_database(service: nil, table_name: nil, db_name: nil, destination_db_name: nil)
|
2077
|
+
# Pass arguments to `move_table_to_database` via keyword arguments. Note that at
|
2078
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2079
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2080
|
+
#
|
2081
|
+
# @param service [::String]
|
2082
|
+
# Required. The relative resource name of the metastore service to mutate
|
2083
|
+
# metadata, in the following format:
|
2084
|
+
#
|
2085
|
+
# `projects/{project_id}/locations/{location_id}/services/{service_id}`.
|
2086
|
+
# @param table_name [::String]
|
2087
|
+
# Required. The name of the table to be moved.
|
2088
|
+
# @param db_name [::String]
|
2089
|
+
# Required. The name of the database where the table resides.
|
2090
|
+
# @param destination_db_name [::String]
|
2091
|
+
# Required. The name of the database where the table should be moved.
|
2092
|
+
#
|
2093
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2094
|
+
# @yieldparam response [::Gapic::Operation]
|
2095
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2096
|
+
#
|
2097
|
+
# @return [::Gapic::Operation]
|
2098
|
+
#
|
2099
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2100
|
+
#
|
2101
|
+
# @example Basic example
|
2102
|
+
# require "google/cloud/metastore/v1beta"
|
2103
|
+
#
|
2104
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2105
|
+
# client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new
|
2106
|
+
#
|
2107
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2108
|
+
# request = Google::Cloud::Metastore::V1beta::MoveTableToDatabaseRequest.new
|
2109
|
+
#
|
2110
|
+
# # Call the move_table_to_database method.
|
2111
|
+
# result = client.move_table_to_database request
|
2112
|
+
#
|
2113
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2114
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2115
|
+
# # Here is how to wait for a response.
|
2116
|
+
# result.wait_until_done! timeout: 60
|
2117
|
+
# if result.response?
|
2118
|
+
# p result.response
|
2119
|
+
# else
|
2120
|
+
# puts "No response received."
|
2121
|
+
# end
|
2122
|
+
#
|
2123
|
+
def move_table_to_database request, options = nil
|
2124
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2125
|
+
|
2126
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1beta::MoveTableToDatabaseRequest
|
2127
|
+
|
2128
|
+
# Converts hash and nil to an options object
|
2129
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2130
|
+
|
2131
|
+
# Customize the options with defaults
|
2132
|
+
metadata = @config.rpcs.move_table_to_database.metadata.to_h
|
2133
|
+
|
2134
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2135
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2136
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2137
|
+
gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
|
2138
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2139
|
+
|
2140
|
+
header_params = {}
|
2141
|
+
if request.service
|
2142
|
+
header_params["service"] = request.service
|
2143
|
+
end
|
2144
|
+
|
2145
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2146
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2147
|
+
|
2148
|
+
options.apply_defaults timeout: @config.rpcs.move_table_to_database.timeout,
|
2149
|
+
metadata: metadata,
|
2150
|
+
retry_policy: @config.rpcs.move_table_to_database.retry_policy
|
2151
|
+
|
2152
|
+
options.apply_defaults timeout: @config.timeout,
|
2153
|
+
metadata: @config.metadata,
|
2154
|
+
retry_policy: @config.retry_policy
|
2155
|
+
|
2156
|
+
@dataproc_metastore_stub.call_rpc :move_table_to_database, request, options: options do |response, operation|
|
2157
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2158
|
+
yield response, operation if block_given?
|
2159
|
+
return response
|
2160
|
+
end
|
2161
|
+
rescue ::GRPC::BadStatus => e
|
2162
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2163
|
+
end
|
2164
|
+
|
2165
|
+
##
|
2166
|
+
# Alter metadata resource location. The metadata resource can be a database,
|
2167
|
+
# table, or partition. This functionality only updates the parent directory
|
2168
|
+
# for the respective metadata resource and does not transfer any existing
|
2169
|
+
# data to the new location.
|
2170
|
+
#
|
2171
|
+
# @overload alter_metadata_resource_location(request, options = nil)
|
2172
|
+
# Pass arguments to `alter_metadata_resource_location` via a request object, either of type
|
2173
|
+
# {::Google::Cloud::Metastore::V1beta::AlterMetadataResourceLocationRequest} or an equivalent Hash.
|
2174
|
+
#
|
2175
|
+
# @param request [::Google::Cloud::Metastore::V1beta::AlterMetadataResourceLocationRequest, ::Hash]
|
2176
|
+
# A request object representing the call parameters. Required. To specify no
|
2177
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2178
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2179
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2180
|
+
#
|
2181
|
+
# @overload alter_metadata_resource_location(service: nil, resource_name: nil, location_uri: nil)
|
2182
|
+
# Pass arguments to `alter_metadata_resource_location` via keyword arguments. Note that at
|
2183
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2184
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2185
|
+
#
|
2186
|
+
# @param service [::String]
|
2187
|
+
# Required. The relative resource name of the metastore service to mutate
|
2188
|
+
# metadata, in the following format:
|
2189
|
+
#
|
2190
|
+
# `projects/{project_id}/locations/{location_id}/services/{service_id}`.
|
2191
|
+
# @param resource_name [::String]
|
2192
|
+
# Required. The relative metadata resource name in the following format.
|
2193
|
+
#
|
2194
|
+
# `databases/{database_id}`
|
2195
|
+
# or
|
2196
|
+
# `databases/{database_id}/tables/{table_id}`
|
2197
|
+
# or
|
2198
|
+
# `databases/{database_id}/tables/{table_id}/partitions/{partition_id}`
|
2199
|
+
# @param location_uri [::String]
|
2200
|
+
# Required. The new location URI for the metadata resource.
|
2201
|
+
#
|
2202
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2203
|
+
# @yieldparam response [::Gapic::Operation]
|
2204
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2205
|
+
#
|
2206
|
+
# @return [::Gapic::Operation]
|
2207
|
+
#
|
2208
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2209
|
+
#
|
2210
|
+
# @example Basic example
|
2211
|
+
# require "google/cloud/metastore/v1beta"
|
2212
|
+
#
|
2213
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2214
|
+
# client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new
|
2215
|
+
#
|
2216
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2217
|
+
# request = Google::Cloud::Metastore::V1beta::AlterMetadataResourceLocationRequest.new
|
2218
|
+
#
|
2219
|
+
# # Call the alter_metadata_resource_location method.
|
2220
|
+
# result = client.alter_metadata_resource_location request
|
2221
|
+
#
|
2222
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2223
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2224
|
+
# # Here is how to wait for a response.
|
2225
|
+
# result.wait_until_done! timeout: 60
|
2226
|
+
# if result.response?
|
2227
|
+
# p result.response
|
2228
|
+
# else
|
2229
|
+
# puts "No response received."
|
2230
|
+
# end
|
2231
|
+
#
|
2232
|
+
def alter_metadata_resource_location request, options = nil
|
2233
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2234
|
+
|
2235
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1beta::AlterMetadataResourceLocationRequest
|
2236
|
+
|
2237
|
+
# Converts hash and nil to an options object
|
2238
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2239
|
+
|
2240
|
+
# Customize the options with defaults
|
2241
|
+
metadata = @config.rpcs.alter_metadata_resource_location.metadata.to_h
|
2242
|
+
|
2243
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2244
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2245
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2246
|
+
gapic_version: ::Google::Cloud::Metastore::V1beta::VERSION
|
2247
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2248
|
+
|
2249
|
+
header_params = {}
|
2250
|
+
if request.service
|
2251
|
+
header_params["service"] = request.service
|
2252
|
+
end
|
2253
|
+
|
2254
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2255
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2256
|
+
|
2257
|
+
options.apply_defaults timeout: @config.rpcs.alter_metadata_resource_location.timeout,
|
2258
|
+
metadata: metadata,
|
2259
|
+
retry_policy: @config.rpcs.alter_metadata_resource_location.retry_policy
|
2260
|
+
|
2261
|
+
options.apply_defaults timeout: @config.timeout,
|
2262
|
+
metadata: @config.metadata,
|
2263
|
+
retry_policy: @config.retry_policy
|
2264
|
+
|
2265
|
+
@dataproc_metastore_stub.call_rpc :alter_metadata_resource_location, request, options: options do |response, operation|
|
2266
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2267
|
+
yield response, operation if block_given?
|
2268
|
+
return response
|
2269
|
+
end
|
2270
|
+
rescue ::GRPC::BadStatus => e
|
2271
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2272
|
+
end
|
2273
|
+
|
1849
2274
|
##
|
1850
2275
|
# Configuration class for the DataprocMetastore API.
|
1851
2276
|
#
|
@@ -2056,6 +2481,26 @@ module Google
|
|
2056
2481
|
# @return [::Gapic::Config::Method]
|
2057
2482
|
#
|
2058
2483
|
attr_reader :delete_backup
|
2484
|
+
##
|
2485
|
+
# RPC-specific configuration for `remove_iam_policy`
|
2486
|
+
# @return [::Gapic::Config::Method]
|
2487
|
+
#
|
2488
|
+
attr_reader :remove_iam_policy
|
2489
|
+
##
|
2490
|
+
# RPC-specific configuration for `query_metadata`
|
2491
|
+
# @return [::Gapic::Config::Method]
|
2492
|
+
#
|
2493
|
+
attr_reader :query_metadata
|
2494
|
+
##
|
2495
|
+
# RPC-specific configuration for `move_table_to_database`
|
2496
|
+
# @return [::Gapic::Config::Method]
|
2497
|
+
#
|
2498
|
+
attr_reader :move_table_to_database
|
2499
|
+
##
|
2500
|
+
# RPC-specific configuration for `alter_metadata_resource_location`
|
2501
|
+
# @return [::Gapic::Config::Method]
|
2502
|
+
#
|
2503
|
+
attr_reader :alter_metadata_resource_location
|
2059
2504
|
|
2060
2505
|
# @private
|
2061
2506
|
def initialize parent_rpcs = nil
|
@@ -2089,6 +2534,14 @@ module Google
|
|
2089
2534
|
@create_backup = ::Gapic::Config::Method.new create_backup_config
|
2090
2535
|
delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
|
2091
2536
|
@delete_backup = ::Gapic::Config::Method.new delete_backup_config
|
2537
|
+
remove_iam_policy_config = parent_rpcs.remove_iam_policy if parent_rpcs.respond_to? :remove_iam_policy
|
2538
|
+
@remove_iam_policy = ::Gapic::Config::Method.new remove_iam_policy_config
|
2539
|
+
query_metadata_config = parent_rpcs.query_metadata if parent_rpcs.respond_to? :query_metadata
|
2540
|
+
@query_metadata = ::Gapic::Config::Method.new query_metadata_config
|
2541
|
+
move_table_to_database_config = parent_rpcs.move_table_to_database if parent_rpcs.respond_to? :move_table_to_database
|
2542
|
+
@move_table_to_database = ::Gapic::Config::Method.new move_table_to_database_config
|
2543
|
+
alter_metadata_resource_location_config = parent_rpcs.alter_metadata_resource_location if parent_rpcs.respond_to? :alter_metadata_resource_location
|
2544
|
+
@alter_metadata_resource_location = ::Gapic::Config::Method.new alter_metadata_resource_location_config
|
2092
2545
|
|
2093
2546
|
yield self if block_given?
|
2094
2547
|
end
|