google-cloud-metastore-v1 0.8.1 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15230d3c05fc03d40bac887e9a1a1aa2fc43a771f2e2cb96362c0b0f5b94e455
4
- data.tar.gz: b44a2bccac989645e0b326660c2c663b8c572638b461cf78dcbcecedd8904ed1
3
+ metadata.gz: ac4a8bea604f120099cf58e0d1dfb3301a94937eb0b275125e0c3376480eaa4c
4
+ data.tar.gz: 1ccc1f5c20c36939a480a79138c8f03b70e3367f422936f51259d07b8a2922e6
5
5
  SHA512:
6
- metadata.gz: 37b88b5c711d0b87d1dc495f5dd59628e6bb41d701cd4235050999890b4bd3574fb62b3d24cb0e1d6af7dcd8f0add6b6e628a07930bc7d295989ae203b28dfc8
7
- data.tar.gz: ab270a6d1064d68c7222da62fb88b72bc4cf048d66124525c05f4256e685d806c8a6ab08edc94efa957ddc9050d8d24cec0b494fff2a37b634169a8f74e7be87
6
+ metadata.gz: 442fc5a493e527fb962cd07db1bc4d43e43c05879c15e406d8d3613eb1007049848d1c8ce3ab9dbf922b6b7eae8bfcdc148bd6a2a4f84403ab5585c4c7e180a3
7
+ data.tar.gz: 595e85edb85d3e4437284f93050f9e4a58c29dea56db56146500d624bfb1d7cee8bc680d010fa3b2484a63a6d94c61b2adb3485cc2227e82fa4fc863b9578f44
@@ -197,7 +197,8 @@ module Google
197
197
  credentials: credentials,
198
198
  endpoint: @config.endpoint,
199
199
  channel_args: @config.channel_args,
200
- interceptors: @config.interceptors
200
+ interceptors: @config.interceptors,
201
+ channel_pool_config: @config.channel_pool
201
202
  )
202
203
  end
203
204
 
@@ -1868,6 +1869,316 @@ module Google
1868
1869
  raise ::Google::Cloud::Error.from_error(e)
1869
1870
  end
1870
1871
 
1872
+ ##
1873
+ # Query DPMS metadata.
1874
+ #
1875
+ # @overload query_metadata(request, options = nil)
1876
+ # Pass arguments to `query_metadata` via a request object, either of type
1877
+ # {::Google::Cloud::Metastore::V1::QueryMetadataRequest} or an equivalent Hash.
1878
+ #
1879
+ # @param request [::Google::Cloud::Metastore::V1::QueryMetadataRequest, ::Hash]
1880
+ # A request object representing the call parameters. Required. To specify no
1881
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1882
+ # @param options [::Gapic::CallOptions, ::Hash]
1883
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1884
+ #
1885
+ # @overload query_metadata(service: nil, query: nil)
1886
+ # Pass arguments to `query_metadata` via keyword arguments. Note that at
1887
+ # least one keyword argument is required. To specify no parameters, or to keep all
1888
+ # the default parameter values, pass an empty Hash as a request object (see above).
1889
+ #
1890
+ # @param service [::String]
1891
+ # Required. The relative resource name of the metastore service to query
1892
+ # metadata, in the following format:
1893
+ #
1894
+ # `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1895
+ # @param query [::String]
1896
+ # Required. A read-only SQL query to execute against the metadata database.
1897
+ # The query cannot change or mutate the data.
1898
+ #
1899
+ # @yield [response, operation] Access the result along with the RPC operation
1900
+ # @yieldparam response [::Gapic::Operation]
1901
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1902
+ #
1903
+ # @return [::Gapic::Operation]
1904
+ #
1905
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1906
+ #
1907
+ # @example Basic example
1908
+ # require "google/cloud/metastore/v1"
1909
+ #
1910
+ # # Create a client object. The client can be reused for multiple calls.
1911
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
1912
+ #
1913
+ # # Create a request. To set request fields, pass in keyword arguments.
1914
+ # request = Google::Cloud::Metastore::V1::QueryMetadataRequest.new
1915
+ #
1916
+ # # Call the query_metadata method.
1917
+ # result = client.query_metadata request
1918
+ #
1919
+ # # The returned object is of type Gapic::Operation. You can use it to
1920
+ # # check the status of an operation, cancel it, or wait for results.
1921
+ # # Here is how to wait for a response.
1922
+ # result.wait_until_done! timeout: 60
1923
+ # if result.response?
1924
+ # p result.response
1925
+ # else
1926
+ # puts "No response received."
1927
+ # end
1928
+ #
1929
+ def query_metadata request, options = nil
1930
+ raise ::ArgumentError, "request must be provided" if request.nil?
1931
+
1932
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::QueryMetadataRequest
1933
+
1934
+ # Converts hash and nil to an options object
1935
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1936
+
1937
+ # Customize the options with defaults
1938
+ metadata = @config.rpcs.query_metadata.metadata.to_h
1939
+
1940
+ # Set x-goog-api-client and x-goog-user-project headers
1941
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1942
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1943
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION
1944
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1945
+
1946
+ header_params = {}
1947
+ if request.service
1948
+ header_params["service"] = request.service
1949
+ end
1950
+
1951
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1952
+ metadata[:"x-goog-request-params"] ||= request_params_header
1953
+
1954
+ options.apply_defaults timeout: @config.rpcs.query_metadata.timeout,
1955
+ metadata: metadata,
1956
+ retry_policy: @config.rpcs.query_metadata.retry_policy
1957
+
1958
+ options.apply_defaults timeout: @config.timeout,
1959
+ metadata: @config.metadata,
1960
+ retry_policy: @config.retry_policy
1961
+
1962
+ @dataproc_metastore_stub.call_rpc :query_metadata, request, options: options do |response, operation|
1963
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1964
+ yield response, operation if block_given?
1965
+ return response
1966
+ end
1967
+ rescue ::GRPC::BadStatus => e
1968
+ raise ::Google::Cloud::Error.from_error(e)
1969
+ end
1970
+
1971
+ ##
1972
+ # Move a table to another database.
1973
+ #
1974
+ # @overload move_table_to_database(request, options = nil)
1975
+ # Pass arguments to `move_table_to_database` via a request object, either of type
1976
+ # {::Google::Cloud::Metastore::V1::MoveTableToDatabaseRequest} or an equivalent Hash.
1977
+ #
1978
+ # @param request [::Google::Cloud::Metastore::V1::MoveTableToDatabaseRequest, ::Hash]
1979
+ # A request object representing the call parameters. Required. To specify no
1980
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1981
+ # @param options [::Gapic::CallOptions, ::Hash]
1982
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1983
+ #
1984
+ # @overload move_table_to_database(service: nil, table_name: nil, db_name: nil, destination_db_name: nil)
1985
+ # Pass arguments to `move_table_to_database` via keyword arguments. Note that at
1986
+ # least one keyword argument is required. To specify no parameters, or to keep all
1987
+ # the default parameter values, pass an empty Hash as a request object (see above).
1988
+ #
1989
+ # @param service [::String]
1990
+ # Required. The relative resource name of the metastore service to mutate
1991
+ # metadata, in the following format:
1992
+ #
1993
+ # `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1994
+ # @param table_name [::String]
1995
+ # Required. The name of the table to be moved.
1996
+ # @param db_name [::String]
1997
+ # Required. The name of the database where the table resides.
1998
+ # @param destination_db_name [::String]
1999
+ # Required. The name of the database where the table should be moved.
2000
+ #
2001
+ # @yield [response, operation] Access the result along with the RPC operation
2002
+ # @yieldparam response [::Gapic::Operation]
2003
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2004
+ #
2005
+ # @return [::Gapic::Operation]
2006
+ #
2007
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2008
+ #
2009
+ # @example Basic example
2010
+ # require "google/cloud/metastore/v1"
2011
+ #
2012
+ # # Create a client object. The client can be reused for multiple calls.
2013
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
2014
+ #
2015
+ # # Create a request. To set request fields, pass in keyword arguments.
2016
+ # request = Google::Cloud::Metastore::V1::MoveTableToDatabaseRequest.new
2017
+ #
2018
+ # # Call the move_table_to_database method.
2019
+ # result = client.move_table_to_database request
2020
+ #
2021
+ # # The returned object is of type Gapic::Operation. You can use it to
2022
+ # # check the status of an operation, cancel it, or wait for results.
2023
+ # # Here is how to wait for a response.
2024
+ # result.wait_until_done! timeout: 60
2025
+ # if result.response?
2026
+ # p result.response
2027
+ # else
2028
+ # puts "No response received."
2029
+ # end
2030
+ #
2031
+ def move_table_to_database request, options = nil
2032
+ raise ::ArgumentError, "request must be provided" if request.nil?
2033
+
2034
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::MoveTableToDatabaseRequest
2035
+
2036
+ # Converts hash and nil to an options object
2037
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2038
+
2039
+ # Customize the options with defaults
2040
+ metadata = @config.rpcs.move_table_to_database.metadata.to_h
2041
+
2042
+ # Set x-goog-api-client and x-goog-user-project headers
2043
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2044
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2045
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION
2046
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2047
+
2048
+ header_params = {}
2049
+ if request.service
2050
+ header_params["service"] = request.service
2051
+ end
2052
+
2053
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2054
+ metadata[:"x-goog-request-params"] ||= request_params_header
2055
+
2056
+ options.apply_defaults timeout: @config.rpcs.move_table_to_database.timeout,
2057
+ metadata: metadata,
2058
+ retry_policy: @config.rpcs.move_table_to_database.retry_policy
2059
+
2060
+ options.apply_defaults timeout: @config.timeout,
2061
+ metadata: @config.metadata,
2062
+ retry_policy: @config.retry_policy
2063
+
2064
+ @dataproc_metastore_stub.call_rpc :move_table_to_database, request, options: options do |response, operation|
2065
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2066
+ yield response, operation if block_given?
2067
+ return response
2068
+ end
2069
+ rescue ::GRPC::BadStatus => e
2070
+ raise ::Google::Cloud::Error.from_error(e)
2071
+ end
2072
+
2073
+ ##
2074
+ # Alter metadata resource location. The metadata resource can be a database,
2075
+ # table, or partition. This functionality only updates the parent directory
2076
+ # for the respective metadata resource and does not transfer any existing
2077
+ # data to the new location.
2078
+ #
2079
+ # @overload alter_metadata_resource_location(request, options = nil)
2080
+ # Pass arguments to `alter_metadata_resource_location` via a request object, either of type
2081
+ # {::Google::Cloud::Metastore::V1::AlterMetadataResourceLocationRequest} or an equivalent Hash.
2082
+ #
2083
+ # @param request [::Google::Cloud::Metastore::V1::AlterMetadataResourceLocationRequest, ::Hash]
2084
+ # A request object representing the call parameters. Required. To specify no
2085
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2086
+ # @param options [::Gapic::CallOptions, ::Hash]
2087
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2088
+ #
2089
+ # @overload alter_metadata_resource_location(service: nil, resource_name: nil, location_uri: nil)
2090
+ # Pass arguments to `alter_metadata_resource_location` via keyword arguments. Note that at
2091
+ # least one keyword argument is required. To specify no parameters, or to keep all
2092
+ # the default parameter values, pass an empty Hash as a request object (see above).
2093
+ #
2094
+ # @param service [::String]
2095
+ # Required. The relative resource name of the metastore service to mutate
2096
+ # metadata, in the following format:
2097
+ #
2098
+ # `projects/{project_id}/locations/{location_id}/services/{service_id}`.
2099
+ # @param resource_name [::String]
2100
+ # Required. The relative metadata resource name in the following format.
2101
+ #
2102
+ # `databases/{database_id}`
2103
+ # or
2104
+ # `databases/{database_id}/tables/{table_id}`
2105
+ # or
2106
+ # `databases/{database_id}/tables/{table_id}/partitions/{partition_id}`
2107
+ # @param location_uri [::String]
2108
+ # Required. The new location URI for the metadata resource.
2109
+ #
2110
+ # @yield [response, operation] Access the result along with the RPC operation
2111
+ # @yieldparam response [::Gapic::Operation]
2112
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2113
+ #
2114
+ # @return [::Gapic::Operation]
2115
+ #
2116
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2117
+ #
2118
+ # @example Basic example
2119
+ # require "google/cloud/metastore/v1"
2120
+ #
2121
+ # # Create a client object. The client can be reused for multiple calls.
2122
+ # client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
2123
+ #
2124
+ # # Create a request. To set request fields, pass in keyword arguments.
2125
+ # request = Google::Cloud::Metastore::V1::AlterMetadataResourceLocationRequest.new
2126
+ #
2127
+ # # Call the alter_metadata_resource_location method.
2128
+ # result = client.alter_metadata_resource_location request
2129
+ #
2130
+ # # The returned object is of type Gapic::Operation. You can use it to
2131
+ # # check the status of an operation, cancel it, or wait for results.
2132
+ # # Here is how to wait for a response.
2133
+ # result.wait_until_done! timeout: 60
2134
+ # if result.response?
2135
+ # p result.response
2136
+ # else
2137
+ # puts "No response received."
2138
+ # end
2139
+ #
2140
+ def alter_metadata_resource_location request, options = nil
2141
+ raise ::ArgumentError, "request must be provided" if request.nil?
2142
+
2143
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::AlterMetadataResourceLocationRequest
2144
+
2145
+ # Converts hash and nil to an options object
2146
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2147
+
2148
+ # Customize the options with defaults
2149
+ metadata = @config.rpcs.alter_metadata_resource_location.metadata.to_h
2150
+
2151
+ # Set x-goog-api-client and x-goog-user-project headers
2152
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2153
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2154
+ gapic_version: ::Google::Cloud::Metastore::V1::VERSION
2155
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2156
+
2157
+ header_params = {}
2158
+ if request.service
2159
+ header_params["service"] = request.service
2160
+ end
2161
+
2162
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2163
+ metadata[:"x-goog-request-params"] ||= request_params_header
2164
+
2165
+ options.apply_defaults timeout: @config.rpcs.alter_metadata_resource_location.timeout,
2166
+ metadata: metadata,
2167
+ retry_policy: @config.rpcs.alter_metadata_resource_location.retry_policy
2168
+
2169
+ options.apply_defaults timeout: @config.timeout,
2170
+ metadata: @config.metadata,
2171
+ retry_policy: @config.retry_policy
2172
+
2173
+ @dataproc_metastore_stub.call_rpc :alter_metadata_resource_location, request, options: options do |response, operation|
2174
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2175
+ yield response, operation if block_given?
2176
+ return response
2177
+ end
2178
+ rescue ::GRPC::BadStatus => e
2179
+ raise ::Google::Cloud::Error.from_error(e)
2180
+ end
2181
+
1871
2182
  ##
1872
2183
  # Configuration class for the DataprocMetastore API.
1873
2184
  #
@@ -1987,6 +2298,14 @@ module Google
1987
2298
  end
1988
2299
  end
1989
2300
 
2301
+ ##
2302
+ # Configuration for the channel pool
2303
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2304
+ #
2305
+ def channel_pool
2306
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2307
+ end
2308
+
1990
2309
  ##
1991
2310
  # Configuration RPC class for the DataprocMetastore API.
1992
2311
  #
@@ -2080,6 +2399,21 @@ module Google
2080
2399
  # @return [::Gapic::Config::Method]
2081
2400
  #
2082
2401
  attr_reader :delete_backup
2402
+ ##
2403
+ # RPC-specific configuration for `query_metadata`
2404
+ # @return [::Gapic::Config::Method]
2405
+ #
2406
+ attr_reader :query_metadata
2407
+ ##
2408
+ # RPC-specific configuration for `move_table_to_database`
2409
+ # @return [::Gapic::Config::Method]
2410
+ #
2411
+ attr_reader :move_table_to_database
2412
+ ##
2413
+ # RPC-specific configuration for `alter_metadata_resource_location`
2414
+ # @return [::Gapic::Config::Method]
2415
+ #
2416
+ attr_reader :alter_metadata_resource_location
2083
2417
 
2084
2418
  # @private
2085
2419
  def initialize parent_rpcs = nil
@@ -2113,6 +2447,12 @@ module Google
2113
2447
  @create_backup = ::Gapic::Config::Method.new create_backup_config
2114
2448
  delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
2115
2449
  @delete_backup = ::Gapic::Config::Method.new delete_backup_config
2450
+ query_metadata_config = parent_rpcs.query_metadata if parent_rpcs.respond_to? :query_metadata
2451
+ @query_metadata = ::Gapic::Config::Method.new query_metadata_config
2452
+ move_table_to_database_config = parent_rpcs.move_table_to_database if parent_rpcs.respond_to? :move_table_to_database
2453
+ @move_table_to_database = ::Gapic::Config::Method.new move_table_to_database_config
2454
+ alter_metadata_resource_location_config = parent_rpcs.alter_metadata_resource_location if parent_rpcs.respond_to? :alter_metadata_resource_location
2455
+ @alter_metadata_resource_location = ::Gapic::Config::Method.new alter_metadata_resource_location_config
2116
2456
 
2117
2457
  yield self if block_given?
2118
2458
  end
@@ -93,7 +93,8 @@ module Google
93
93
  credentials: credentials,
94
94
  endpoint: @config.endpoint,
95
95
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
96
+ interceptors: @config.interceptors,
97
+ channel_pool_config: @config.channel_pool
97
98
  )
98
99
 
99
100
  # Used by an LRO wrapper for some methods of this service
@@ -701,6 +702,14 @@ module Google
701
702
  end
702
703
  end
703
704
 
705
+ ##
706
+ # Configuration for the channel pool
707
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
708
+ #
709
+ def channel_pool
710
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
711
+ end
712
+
704
713
  ##
705
714
  # Configuration RPC class for the Operations API.
706
715
  #