Dataproc Metastore V1 API - Class Google::Cloud::Metastore::V1::DataprocMetastore::Client (v0.7.0)

Reference documentation and code samples for the Dataproc Metastore V1 API class Google::Cloud::Metastore::V1::DataprocMetastore::Client.

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}.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the DataprocMetastore Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all DataprocMetastore clients
::Google::Cloud::Metastore::V1::DataprocMetastore::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def 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 Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_backup

def create_backup(request, options = nil) -> ::Gapic::Operation
def create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil) -> ::Gapic::Operation

Creates a new backup in a given project and location.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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) — 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.
Example

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

#create_metadata_import

def create_metadata_import(request, options = nil) -> ::Gapic::Operation
def 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.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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) — 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.
Example

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.create_metadata_import 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

#create_service

def create_service(request, options = nil) -> ::Gapic::Operation
def create_service(parent: nil, service_id: nil, service: nil, request_id: nil) -> ::Gapic::Operation

Creates a metastore service in a project and location.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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) — 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.
Example

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

#delete_backup

def delete_backup(request, options = nil) -> ::Gapic::Operation
def delete_backup(name: nil, request_id: nil) -> ::Gapic::Operation

Deletes a single backup.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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.
Example

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

#delete_service

def delete_service(request, options = nil) -> ::Gapic::Operation
def delete_service(name: nil, request_id: nil) -> ::Gapic::Operation

Deletes a single service.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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.
Example

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

#export_metadata

def export_metadata(request, options = nil) -> ::Gapic::Operation
def export_metadata(destination_gcs_folder: nil, service: nil, request_id: nil, database_dump_type: nil) -> ::Gapic::Operation

Exports metadata from a service.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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) — 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.
Example

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.export_metadata 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

#get_backup

def get_backup(request, options = nil) -> ::Google::Cloud::Metastore::V1::Backup
def get_backup(name: nil) -> ::Google::Cloud::Metastore::V1::Backup

Gets details of a single backup.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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).
Parameter
  • name (::String) — 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
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

#get_metadata_import

def get_metadata_import(request, options = nil) -> ::Google::Cloud::Metastore::V1::MetadataImport
def get_metadata_import(name: nil) -> ::Google::Cloud::Metastore::V1::MetadataImport

Gets details of a single import.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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).
Parameter
  • name (::String) — 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
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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.get_metadata_import request

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

#get_service

def get_service(request, options = nil) -> ::Google::Cloud::Metastore::V1::Service
def get_service(name: nil) -> ::Google::Cloud::Metastore::V1::Service

Gets the details of a single service.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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).
Parameter
  • name (::String) — 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
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client

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

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

#initialize

def initialize() { |config| ... } -> Client

Create a new DataprocMetastore client object.

Yields
  • (config) — Configure the DataprocMetastore client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# 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

#list_backups

def list_backups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup>
def 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.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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) — Optional. The filter to apply to list results.
  • order_by (::String) — 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.
Example

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

#list_metadata_imports

def list_metadata_imports(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::MetadataImport>
def 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.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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) — Optional. The filter to apply to list results.
  • order_by (::String) — 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.
Example

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.list_metadata_imports 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

#list_services

def list_services(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Service>
def 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.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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) — Optional. The filter to apply to list results.
  • order_by (::String) — 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.
Example

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

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

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

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

#operations_client

def operations_client() -> ::Google::Cloud::Metastore::V1::DataprocMetastore::Operations

Get the associated client for long-running operations.

#restore_service

def restore_service(request, options = nil) -> ::Gapic::Operation
def restore_service(service: nil, backup: nil, restore_type: nil, request_id: nil) -> ::Gapic::Operation

Restores a service from a backup.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — Optional. The type of restore. If unspecified, defaults to METADATA_ONLY.
  • request_id (::String) — 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.
Example

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

#update_metadata_import

def update_metadata_import(request, options = nil) -> ::Gapic::Operation
def 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.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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.
Example

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.update_metadata_import 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

#update_service

def update_service(request, options = nil) -> ::Gapic::Operation
def update_service(update_mask: nil, service: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single service.

Overloads
def 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) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def 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) — 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) — 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) — 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.
Example

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