Cloud Data Fusion V1 API - Class Google::Cloud::DataFusion::V1::DataFusion::Client (v0.2.0)

Reference documentation and code samples for the Cloud Data Fusion V1 API class Google::Cloud::DataFusion::V1::DataFusion::Client.

Client for the DataFusion service.

Service for creating and managing Data Fusion instances. Data Fusion enables ETL developers to build code-free, data integration pipelines via a point-and-click UI.

Inherits

  • Object

Methods

.configure

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

Configure the DataFusion 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 DataFusion clients
::Google::Cloud::DataFusion::V1::DataFusion::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the DataFusion 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_instance

def create_instance(request, options = nil) -> ::Gapic::Operation
def create_instance(parent: nil, instance_id: nil, instance: nil) -> ::Gapic::Operation

Creates a new Data Fusion instance in the specified project and location.

Overloads
def create_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_instance via a request object, either of type CreateInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DataFusion::V1::CreateInstanceRequest, ::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_instance(parent: nil, instance_id: nil, instance: nil) -> ::Gapic::Operation
Pass arguments to create_instance 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 instance's project and location in the format projects/{project}/locations/{location}.
  • instance_id (::String) — Required. The name of the instance to create.
  • instance (::Google::Cloud::DataFusion::V1::Instance, ::Hash) — An instance 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.
Example

Basic example

require "google/cloud/data_fusion/v1"

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

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

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

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

#delete_instance

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

Deletes a single Date Fusion instance.

Overloads
def delete_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_instance via a request object, either of type Google::Cloud::DataFusion::V1::DeleteInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DataFusion::V1::DeleteInstanceRequest, ::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_instance(name: nil) -> ::Gapic::Operation
Pass arguments to delete_instance 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 instance resource name in the format projects/{project}/locations/{location}/instances/{instance}
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/data_fusion/v1"

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

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

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

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

#get_instance

def get_instance(request, options = nil) -> ::Google::Cloud::DataFusion::V1::Instance
def get_instance(name: nil) -> ::Google::Cloud::DataFusion::V1::Instance

Gets details of a single Data Fusion instance.

Overloads
def get_instance(request, options = nil) -> ::Google::Cloud::DataFusion::V1::Instance
Pass arguments to get_instance via a request object, either of type GetInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DataFusion::V1::GetInstanceRequest, ::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_instance(name: nil) -> ::Google::Cloud::DataFusion::V1::Instance
Pass arguments to get_instance 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 instance resource name in the format projects/{project}/locations/{location}/instances/{instance}.
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/data_fusion/v1"

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

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

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

# The returned object is of type Google::Cloud::DataFusion::V1::Instance.
p result

#initialize

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

Create a new DataFusion client object.

Yields
  • (config) — Configure the DataFusion client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::DataFusion::V1::DataFusion::Client.new

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

#list_available_versions

def list_available_versions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DataFusion::V1::Version>
def list_available_versions(parent: nil, page_size: nil, page_token: nil, latest_patch_only: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DataFusion::V1::Version>

Lists possible versions for Data Fusion instances in the specified project and location.

Overloads
def list_available_versions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DataFusion::V1::Version>
Pass arguments to list_available_versions via a request object, either of type ListAvailableVersionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DataFusion::V1::ListAvailableVersionsRequest, ::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_available_versions(parent: nil, page_size: nil, page_token: nil, latest_patch_only: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DataFusion::V1::Version>
Pass arguments to list_available_versions 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 project and location for which to retrieve instance information in the format projects/{project}/locations/{location}.
  • page_size (::Integer) — The maximum number of items to return.
  • page_token (::String) — The next_page_token value to use if there are additional results to retrieve for this list request.
  • latest_patch_only (::Boolean) — Whether or not to return the latest patch of every available minor version. If true, only the latest patch will be returned. Ex. if allowed versions is [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0]
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/data_fusion/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::DataFusion::V1::Version.
  p response
end

#list_instances

def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DataFusion::V1::Instance>
def list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DataFusion::V1::Instance>

Lists Data Fusion instances in the specified project and location.

Overloads
def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DataFusion::V1::Instance>
Pass arguments to list_instances via a request object, either of type ListInstancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DataFusion::V1::ListInstancesRequest, ::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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DataFusion::V1::Instance>
Pass arguments to list_instances 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 project and location for which to retrieve instance information in the format projects/{project}/locations/{location}. If the location is specified as '-' (wildcard), then all regions available to the project are queried, and the results are aggregated.
  • page_size (::Integer) — The maximum number of items to return.
  • page_token (::String) — The next_page_token value to use if there are additional results to retrieve for this list request.
  • filter (::String) — List filter.
  • order_by (::String) — Sort results. Supported values are "name", "name desc", or "" (unsorted).
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/data_fusion/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::DataFusion::V1::Instance.
  p response
end

#operations_client

def operations_client() -> ::Google::Cloud::DataFusion::V1::DataFusion::Operations

Get the associated client for long-running operations.

#restart_instance

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

Restart a single Data Fusion instance. At the end of an operation instance is fully restarted.

Overloads
def restart_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to restart_instance via a request object, either of type RestartInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DataFusion::V1::RestartInstanceRequest, ::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 restart_instance(name: nil) -> ::Gapic::Operation
Pass arguments to restart_instance 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. Name of the Data Fusion instance which need to be restarted in the form of projects/{project}/locations/{location}/instances/{instance}
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/data_fusion/v1"

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

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

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

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

#update_instance

def update_instance(request, options = nil) -> ::Gapic::Operation
def update_instance(instance: nil, update_mask: nil) -> ::Gapic::Operation

Updates a single Data Fusion instance.

Overloads
def update_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_instance via a request object, either of type UpdateInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DataFusion::V1::UpdateInstanceRequest, ::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_instance(instance: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_instance 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
  • instance (::Google::Cloud::DataFusion::V1::Instance, ::Hash) — Required. The instance resource that replaces the resource on the server. Currently, Data Fusion only allows replacing labels, options, and stack driver settings. All other fields will be ignored.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Field mask is used to specify the fields that the update will overwrite in an instance resource. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask, all the supported fields (labels, options, and version currently) will be overwritten.
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/data_fusion/v1"

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

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

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

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