Class: Google::Cloud::Metastore::V1::DataprocMetastore::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/metastore/v1/dataproc_metastore/client.rb

Overview

Client for the DataprocMetastore service.

Configures and manages metastore services. Metastore services are fully managed, highly available, autoscaled, autohealing, OSS-native deployments of technical metadata management software. Each metastore service exposes a network endpoint through which metadata queries are served. Metadata queries can originate from a variety of sources, including Apache Hive, Apache Presto, and Apache Spark.

The Dataproc Metastore API defines the following resource model:

  • The service works with a collection of Google Cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/* (a location must refer to a Google Cloud region)
  • Each location has a collection of services, named: /services/*
  • Dataproc Metastore services are resources with names of the form:

/projects/{project_number}/locations/{location_id}/services/{service_id}.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#backup_path, #location_path, #metadata_import_path, #network_path, #service_path, #subnetwork_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new DataprocMetastore client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the DataprocMetastore client.

Yield Parameters:



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 165

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/metastore/v1/metastore_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @dataproc_metastore_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Metastore::V1::DataprocMetastore::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool,
    logger: @config.logger
  )

  @dataproc_metastore_stub.stub_logger&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @dataproc_metastore_stub.endpoint
    config.universe_domain = @dataproc_metastore_stub.universe_domain
    config.logger = @dataproc_metastore_stub.logger if config.respond_to? :logger=
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @dataproc_metastore_stub.endpoint
    config.universe_domain = @dataproc_metastore_stub.universe_domain
    config.logger = @dataproc_metastore_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Client (readonly)

Get the associated client for mix-in of the IAMPolicy.

Returns:

  • (Google::Iam::V1::IAMPolicy::Client)


258
259
260
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 258

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Client)


251
252
253
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 251

def location_client
  @location_client
end

#operations_client::Google::Cloud::Metastore::V1::DataprocMetastore::Operations (readonly)

Get the associated client for long-running operations.



244
245
246
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 244

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the DataprocMetastore Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all DataprocMetastore clients
::Google::Cloud::Metastore::V1::DataprocMetastore::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 80

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Metastore", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0
    default_config.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_service.timeout = 60.0

    default_config.rpcs.update_service.timeout = 60.0

    default_config.rpcs.delete_service.timeout = 60.0

    default_config.rpcs..timeout = 60.0

    default_config.rpcs..timeout = 60.0

    default_config.rpcs..timeout = 60.0

    default_config.rpcs.restore_service.timeout = 60.0

    default_config.rpcs.create_backup.timeout = 60.0

    default_config.rpcs.delete_backup.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#alter_metadata_resource_location(request, options = nil) ⇒ ::Gapic::Operation #alter_metadata_resource_location(service: nil, resource_name: nil, location_uri: nil) ⇒ ::Gapic::Operation

Alter metadata resource location. The metadata resource can be a database, table, or partition. This functionality only updates the parent directory for the respective metadata resource and does not transfer any existing data to the new location.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::AlterMetadataResourceLocationRequest.new

# Call the alter_metadata_resource_location method.
result = client. request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #alter_metadata_resource_location(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to alter_metadata_resource_location via a request object, either of type AlterMetadataResourceLocationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::AlterMetadataResourceLocationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #alter_metadata_resource_location(service: nil, resource_name: nil, location_uri: nil) ⇒ ::Gapic::Operation

    Pass arguments to alter_metadata_resource_location via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • service (::String) (defaults to: nil)

      Required. The relative resource name of the metastore service to mutate metadata, in the following format:

      projects/{project_id}/locations/{location_id}/services/{service_id}.

    • resource_name (::String) (defaults to: nil)

      Required. The relative metadata resource name in the following format.

      databases/{database_id} or databases/{database_id}/tables/{table_id} or databases/{database_id}/tables/{table_id}/partitions/{partition_id}

    • location_uri (::String) (defaults to: nil)

      Required. The new location URI for the metadata resource.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 2197

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::AlterMetadataResourceLocationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.service
    header_params["service"] = request.service
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :alter_metadata_resource_location, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure {|config| ... } ⇒ Client::Configuration

Configure the DataprocMetastore Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



135
136
137
138
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 135

def configure
  yield @config if block_given?
  @config
end

#create_backup(request, options = nil) ⇒ ::Gapic::Operation #create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new backup in a given project and location.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::CreateBackupRequest.new

# Call the create_backup method.
result = client.create_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_backup(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_backup via a request object, either of type CreateBackupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::CreateBackupRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The relative resource name of the service in which to create a backup of the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}.

    • backup_id (::String) (defaults to: nil)

      Required. The ID of the backup, which is used as the final component of the backup's name.

      This value must be between 1 and 64 characters long, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.

    • backup (::Google::Cloud::Metastore::V1::Backup, ::Hash) (defaults to: nil)

      Required. The backup to create. The name field is ignored. The ID of the created backup must be provided in the request's backup_id field.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1774

def create_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::CreateBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_backup..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_backup.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :create_backup, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_metadata_import(request, options = nil) ⇒ ::Gapic::Operation #create_metadata_import(parent: nil, metadata_import_id: nil, metadata_import: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new MetadataImport in a given project and location.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::CreateMetadataImportRequest.new

# Call the create_metadata_import method.
result = client. request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_metadata_import(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_metadata_import via a request object, either of type CreateMetadataImportRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::CreateMetadataImportRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_metadata_import(parent: nil, metadata_import_id: nil, metadata_import: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_metadata_import via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The relative resource name of the service in which to create a metastore import, in the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}.

    • metadata_import_id (::String) (defaults to: nil)

      Required. The ID of the metadata import, which is used as the final component of the metadata import's name.

      This value must be between 1 and 64 characters long, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.

    • metadata_import (::Google::Cloud::Metastore::V1::MetadataImport, ::Hash) (defaults to: nil)

      Required. The metadata import to create. The name field is ignored. The ID of the created metadata import must be provided in the request's metadata_import_id field.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1101

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::CreateMetadataImportRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :create_metadata_import, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_service(request, options = nil) ⇒ ::Gapic::Operation #create_service(parent: nil, service_id: nil, service: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a metastore service in a project and location.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::CreateServiceRequest.new

# Call the create_service method.
result = client.create_service request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_service(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_service via a request object, either of type CreateServiceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::CreateServiceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_service(parent: nil, service_id: nil, service: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The relative resource name of the location in which to create a metastore service, in the following form:

      projects/{project_number}/locations/{location_id}.

    • service_id (::String) (defaults to: nil)

      Required. The ID of the metastore service, which is used as the final component of the metastore service's name.

      This value must be between 2 and 63 characters long inclusive, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.

    • service (::Google::Cloud::Metastore::V1::Service, ::Hash) (defaults to: nil)

      Required. The Metastore service to create. The name field is ignored. The ID of the created metastore service must be provided in the request's service_id field.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 552

def create_service request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::CreateServiceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_service..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_service.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :create_service, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_backup(request, options = nil) ⇒ ::Gapic::Operation #delete_backup(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single backup.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::DeleteBackupRequest.new

# Call the delete_backup method.
result = client.delete_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_backup(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup via a request object, either of type Google::Cloud::Metastore::V1::DeleteBackupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::DeleteBackupRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_backup(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The relative resource name of the backup to delete, in the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1884

def delete_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::DeleteBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_backup..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_backup.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :delete_backup, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_service(request, options = nil) ⇒ ::Gapic::Operation #delete_service(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single service.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::DeleteServiceRequest.new

# Call the delete_service method.
result = client.delete_service request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_service(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_service via a request object, either of type Google::Cloud::Metastore::V1::DeleteServiceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::DeleteServiceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_service(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The relative resource name of the metastore service to delete, in the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 778

def delete_service request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::DeleteServiceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_service..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_service.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :delete_service, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#export_metadata(request, options = nil) ⇒ ::Gapic::Operation #export_metadata(destination_gcs_folder: nil, service: nil, request_id: nil, database_dump_type: nil) ⇒ ::Gapic::Operation

Exports metadata from a service.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::ExportMetadataRequest.new

# Call the export_metadata method.
result = client. request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #export_metadata(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to export_metadata via a request object, either of type ExportMetadataRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::ExportMetadataRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #export_metadata(destination_gcs_folder: nil, service: nil, request_id: nil, database_dump_type: nil) ⇒ ::Gapic::Operation

    Pass arguments to export_metadata via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • destination_gcs_folder (::String) (defaults to: nil)

      A Cloud Storage URI of a folder, in the format gs://<bucket_name>/<path_inside_bucket>. A sub-folder <export_folder> containing exported files will be created below it.

    • service (::String) (defaults to: nil)

      Required. The relative resource name of the metastore service to run export, in the following form:

      projects/{project_id}/locations/{location_id}/services/{service_id}.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID. A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

    • database_dump_type (::Google::Cloud::Metastore::V1::DatabaseDumpSpec::Type) (defaults to: nil)

      Optional. The type of the database dump. If unspecified, defaults to MYSQL.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1335

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ExportMetadataRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.service
    header_params["service"] = request.service
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :export_metadata, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_backup(request, options = nil) ⇒ ::Google::Cloud::Metastore::V1::Backup #get_backup(name: nil) ⇒ ::Google::Cloud::Metastore::V1::Backup

Gets details of a single backup.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::GetBackupRequest.new

# Call the get_backup method.
result = client.get_backup request

# The returned object is of type Google::Cloud::Metastore::V1::Backup.
p result

Overloads:

  • #get_backup(request, options = nil) ⇒ ::Google::Cloud::Metastore::V1::Backup

    Pass arguments to get_backup via a request object, either of type GetBackupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::GetBackupRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_backup(name: nil) ⇒ ::Google::Cloud::Metastore::V1::Backup

    Pass arguments to get_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The relative resource name of the backup to retrieve, in the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1656

def get_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::GetBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_backup..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_backup.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :get_backup, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_metadata_import(request, options = nil) ⇒ ::Google::Cloud::Metastore::V1::MetadataImport #get_metadata_import(name: nil) ⇒ ::Google::Cloud::Metastore::V1::MetadataImport

Gets details of a single import.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::GetMetadataImportRequest.new

# Call the get_metadata_import method.
result = client. request

# The returned object is of type Google::Cloud::Metastore::V1::MetadataImport.
p result

Overloads:

  • #get_metadata_import(request, options = nil) ⇒ ::Google::Cloud::Metastore::V1::MetadataImport

    Pass arguments to get_metadata_import via a request object, either of type GetMetadataImportRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::GetMetadataImportRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_metadata_import(name: nil) ⇒ ::Google::Cloud::Metastore::V1::MetadataImport

    Pass arguments to get_metadata_import via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The relative resource name of the metadata import to retrieve, in the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 982

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::GetMetadataImportRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :get_metadata_import, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_service(request, options = nil) ⇒ ::Google::Cloud::Metastore::V1::Service #get_service(name: nil) ⇒ ::Google::Cloud::Metastore::V1::Service

Gets the details of a single service.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::GetServiceRequest.new

# Call the get_service method.
result = client.get_service request

# The returned object is of type Google::Cloud::Metastore::V1::Service.
p result

Overloads:

  • #get_service(request, options = nil) ⇒ ::Google::Cloud::Metastore::V1::Service

    Pass arguments to get_service via a request object, either of type GetServiceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::GetServiceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_service(name: nil) ⇒ ::Google::Cloud::Metastore::V1::Service

    Pass arguments to get_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The relative resource name of the metastore service to retrieve, in the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 433

def get_service request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::GetServiceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_service..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_service.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :get_service, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_backups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup> #list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup>

Lists backups in a service.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::ListBackupsRequest.new

# Call the list_backups method.
result = client.list_backups request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Metastore::V1::Backup.
  p item
end

Overloads:

  • #list_backups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup>

    Pass arguments to list_backups via a request object, either of type ListBackupsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::ListBackupsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup>

    Pass arguments to list_backups via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The relative resource name of the service whose backups to list, in the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}/backups.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of backups to return. The response may contain less than the maximum number. If unspecified, no more than 500 backups are returned. The maximum value is 1000; values above 1000 are changed to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous DataprocMetastore.ListBackups call. Provide this token to retrieve the subsequent page.

      To retrieve the first page, supply an empty page token.

      When paginating, other parameters provided to DataprocMetastore.ListBackups must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. The filter to apply to list results.

    • order_by (::String) (defaults to: nil)

      Optional. Specify the ordering of results as described in Sorting Order. If not specified, the results will be sorted in the default order.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1566

def list_backups request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ListBackupsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_backups..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_backups.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_backups.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :list_backups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @dataproc_metastore_stub, :list_backups, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_metadata_imports(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::MetadataImport> #list_metadata_imports(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::MetadataImport>

Lists imports in a service.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::ListMetadataImportsRequest.new

# Call the list_metadata_imports method.
result = client. request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Metastore::V1::MetadataImport.
  p item
end

Overloads:

  • #list_metadata_imports(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::MetadataImport>

    Pass arguments to list_metadata_imports via a request object, either of type ListMetadataImportsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::ListMetadataImportsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_metadata_imports(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::MetadataImport>

    Pass arguments to list_metadata_imports via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The relative resource name of the service whose metadata imports to list, in the following form:

      projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of imports to return. The response may contain less than the maximum number. If unspecified, no more than 500 imports are returned. The maximum value is 1000; values above 1000 are changed to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous DataprocMetastore.ListServices call. Provide this token to retrieve the subsequent page.

      To retrieve the first page, supply an empty page token.

      When paginating, other parameters provided to DataprocMetastore.ListServices must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. The filter to apply to list results.

    • order_by (::String) (defaults to: nil)

      Optional. Specify the ordering of results as described in Sorting Order. If not specified, the results will be sorted in the default order.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 892

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ListMetadataImportsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :list_metadata_imports, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @dataproc_metastore_stub, :list_metadata_imports, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_services(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Service> #list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Service>

Lists services in a project and location.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::ListServicesRequest.new

# Call the list_services method.
result = client.list_services request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Metastore::V1::Service.
  p item
end

Overloads:

  • #list_services(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Service>

    Pass arguments to list_services via a request object, either of type ListServicesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::ListServicesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Service>

    Pass arguments to list_services via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The relative resource name of the location of metastore services to list, in the following form:

      projects/{project_number}/locations/{location_id}.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of services to return. The response may contain less than the maximum number. If unspecified, no more than 500 services are returned. The maximum value is 1000; values above 1000 are changed to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous DataprocMetastore.ListServices call. Provide this token to retrieve the subsequent page.

      To retrieve the first page, supply an empty page token.

      When paginating, other parameters provided to DataprocMetastore.ListServices must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. The filter to apply to list results.

    • order_by (::String) (defaults to: nil)

      Optional. Specify the ordering of results as described in Sorting Order. If not specified, the results will be sorted in the default order.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 343

def list_services request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ListServicesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_services..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_services.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_services.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :list_services, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @dataproc_metastore_stub, :list_services, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


265
266
267
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 265

def logger
  @dataproc_metastore_stub.logger
end

#move_table_to_database(request, options = nil) ⇒ ::Gapic::Operation #move_table_to_database(service: nil, table_name: nil, db_name: nil, destination_db_name: nil) ⇒ ::Gapic::Operation

Move a table to another database.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::MoveTableToDatabaseRequest.new

# Call the move_table_to_database method.
result = client.move_table_to_database request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #move_table_to_database(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to move_table_to_database via a request object, either of type MoveTableToDatabaseRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::MoveTableToDatabaseRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #move_table_to_database(service: nil, table_name: nil, db_name: nil, destination_db_name: nil) ⇒ ::Gapic::Operation

    Pass arguments to move_table_to_database via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • service (::String) (defaults to: nil)

      Required. The relative resource name of the metastore service to mutate metadata, in the following format:

      projects/{project_id}/locations/{location_id}/services/{service_id}.

    • table_name (::String) (defaults to: nil)

      Required. The name of the table to be moved.

    • db_name (::String) (defaults to: nil)

      Required. The name of the database where the table resides.

    • destination_db_name (::String) (defaults to: nil)

      Required. The name of the database where the table should be moved.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 2087

def move_table_to_database request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::MoveTableToDatabaseRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.move_table_to_database..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.service
    header_params["service"] = request.service
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.move_table_to_database.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.move_table_to_database.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :move_table_to_database, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#query_metadata(request, options = nil) ⇒ ::Gapic::Operation #query_metadata(service: nil, query: nil) ⇒ ::Gapic::Operation

Query DPMS metadata.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::QueryMetadataRequest.new

# Call the query_metadata method.
result = client. request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #query_metadata(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to query_metadata via a request object, either of type QueryMetadataRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::QueryMetadataRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #query_metadata(service: nil, query: nil) ⇒ ::Gapic::Operation

    Pass arguments to query_metadata via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • service (::String) (defaults to: nil)

      Required. The relative resource name of the metastore service to query metadata, in the following format:

      projects/{project_id}/locations/{location_id}/services/{service_id}.

    • query (::String) (defaults to: nil)

      Required. A read-only SQL query to execute against the metadata database. The query cannot change or mutate the data.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1984

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::QueryMetadataRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.service
    header_params["service"] = request.service
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :query_metadata, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#restore_service(request, options = nil) ⇒ ::Gapic::Operation #restore_service(service: nil, backup: nil, restore_type: nil, request_id: nil) ⇒ ::Gapic::Operation

Restores a service from a backup.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::RestoreServiceRequest.new

# Call the restore_service method.
result = client.restore_service request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #restore_service(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to restore_service via a request object, either of type RestoreServiceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::RestoreServiceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #restore_service(service: nil, backup: nil, restore_type: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to restore_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • service (::String) (defaults to: nil)

      Required. The relative resource name of the metastore service to run restore, in the following form:

      projects/{project_id}/locations/{location_id}/services/{service_id}.

    • backup (::String) (defaults to: nil)

      Required. The relative resource name of the metastore service backup to restore from, in the following form:

      projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}.

    • restore_type (::Google::Cloud::Metastore::V1::Restore::RestoreType) (defaults to: nil)

      Optional. The type of restore. If unspecified, defaults to METADATA_ONLY.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID. A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1452

def restore_service request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::RestoreServiceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.restore_service..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.service
    header_params["service"] = request.service
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.restore_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.restore_service.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :restore_service, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


145
146
147
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 145

def universe_domain
  @dataproc_metastore_stub.universe_domain
end

#update_metadata_import(request, options = nil) ⇒ ::Gapic::Operation #update_metadata_import(update_mask: nil, metadata_import: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates a single import. Only the description field of MetadataImport is supported to be updated.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::UpdateMetadataImportRequest.new

# Call the update_metadata_import method.
result = client. request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_metadata_import(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_metadata_import via a request object, either of type UpdateMetadataImportRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::UpdateMetadataImportRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_metadata_import(update_mask: nil, metadata_import: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_metadata_import via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. A field mask used to specify the fields to be overwritten in the metadata import resource by the update. Fields specified in the update_mask are relative to the resource (not to the full request). A field is overwritten if it is in the mask.

    • metadata_import (::Google::Cloud::Metastore::V1::MetadataImport, ::Hash) (defaults to: nil)

      Required. The metadata import to update. The server only merges fields in the import if they are specified in update_mask.

      The metadata import's name field is used to identify the metastore import to be updated.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 1218

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::UpdateMetadataImportRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.&.name
    header_params["metadata_import.name"] = request..name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :update_metadata_import, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_service(request, options = nil) ⇒ ::Gapic::Operation #update_service(update_mask: nil, service: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the parameters of a single service.

Examples:

Basic example

require "google/cloud/metastore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Metastore::V1::UpdateServiceRequest.new

# Call the update_service method.
result = client.update_service request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_service(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_service via a request object, either of type UpdateServiceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Metastore::V1::UpdateServiceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_service(update_mask: nil, service: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. A field mask used to specify the fields to be overwritten in the metastore service resource by the update. Fields specified in the update_mask are relative to the resource (not to the full request). A field is overwritten if it is in the mask.

    • service (::Google::Cloud::Metastore::V1::Service, ::Hash) (defaults to: nil)

      Required. The metastore service to update. The server only merges fields in the service if they are specified in update_mask.

      The metastore service's name field is used to identify the metastore service to be updated.

    • request_id (::String) (defaults to: nil)

      Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.

      For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.

      The request ID must be a valid UUID A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
# File 'lib/google/cloud/metastore/v1/dataproc_metastore/client.rb', line 668

def update_service request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::UpdateServiceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_service..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Metastore::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.service&.name
    header_params["service.name"] = request.service.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_service.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @dataproc_metastore_stub.call_rpc :update_service, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end