Cloud Dataproc V1beta2 API - Class Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client (v0.6.3)

Reference documentation and code samples for the Cloud Dataproc V1beta2 API class Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Client.

Client for the WorkflowTemplateService service.

The API interface for managing Workflow Templates in the Dataproc API.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the WorkflowTemplateService 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_workflow_template

def create_workflow_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
def create_workflow_template(parent: nil, template: nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate

Creates new workflow template.

Overloads
def create_workflow_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
Pass arguments to create_workflow_template via a request object, either of type CreateWorkflowTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1beta2::CreateWorkflowTemplateRequest, ::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_workflow_template(parent: nil, template: nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
Pass arguments to create_workflow_template 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 resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

    • For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

    • For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

  • template (::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate, ::Hash) — Required. The Dataproc workflow template to create.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.

#delete_workflow_template

def delete_workflow_template(request, options = nil) -> ::Google::Protobuf::Empty
def delete_workflow_template(name: nil, version: nil) -> ::Google::Protobuf::Empty

Deletes a workflow template. It does not cancel in-progress workflows.

Overloads
def delete_workflow_template(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_workflow_template via a request object, either of type DeleteWorkflowTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1beta2::DeleteWorkflowTemplateRequest, ::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_workflow_template(name: nil, version: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_workflow_template 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 resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.

    • For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id}

    • For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}

  • version (::Integer) — Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.

#get_workflow_template

def get_workflow_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
def get_workflow_template(name: nil, version: nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate

Retrieves the latest workflow template.

Can retrieve previously instantiated template by specifying optional version parameter.

Overloads
def get_workflow_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
Pass arguments to get_workflow_template via a request object, either of type GetWorkflowTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1beta2::GetWorkflowTemplateRequest, ::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_workflow_template(name: nil, version: nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
Pass arguments to get_workflow_template 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 resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.

    • For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id}

    • For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}

  • version (::Integer) — Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.

    If unspecified, retrieves the current version.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.

#initialize

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

Create a new WorkflowTemplateService client object.

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

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

#instantiate_inline_workflow_template

def instantiate_inline_workflow_template(request, options = nil) -> ::Gapic::Operation
def instantiate_inline_workflow_template(parent: nil, template: nil, instance_id: nil, request_id: nil) -> ::Gapic::Operation

Instantiates a template and begins execution.

This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.

The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.

The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.

The Operation.metadata will be WorkflowMetadata. Also see Using WorkflowMetadata.

On successful completion, Operation.response will be Empty.

Overloads
def instantiate_inline_workflow_template(request, options = nil) -> ::Gapic::Operation
Pass arguments to instantiate_inline_workflow_template via a request object, either of type InstantiateInlineWorkflowTemplateRequest or an equivalent Hash.
Parameters
def instantiate_inline_workflow_template(parent: nil, template: nil, instance_id: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to instantiate_inline_workflow_template 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 resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

    • For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region}

    • For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location}

  • template (::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate, ::Hash) — Required. The workflow template to instantiate.
  • instance_id (::String) — Deprecated. Please use request_id field instead.
  • request_id (::String) — Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.

    It is recommended to always set this value to a UUID.

    The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

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.

#instantiate_workflow_template

def instantiate_workflow_template(request, options = nil) -> ::Gapic::Operation
def instantiate_workflow_template(name: nil, version: nil, instance_id: nil, request_id: nil, parameters: nil) -> ::Gapic::Operation

Instantiates a template and begins execution.

The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.

The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.

The Operation.metadata will be WorkflowMetadata. Also see Using WorkflowMetadata.

On successful completion, Operation.response will be Empty.

Overloads
def instantiate_workflow_template(request, options = nil) -> ::Gapic::Operation
Pass arguments to instantiate_workflow_template via a request object, either of type InstantiateWorkflowTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1beta2::InstantiateWorkflowTemplateRequest, ::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 instantiate_workflow_template(name: nil, version: nil, instance_id: nil, request_id: nil, parameters: nil) -> ::Gapic::Operation
Pass arguments to instantiate_workflow_template 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 resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.

    • For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id}

    • For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}

  • version (::Integer) — Optional. The version of workflow template to instantiate. If specified, the workflow will be instantiated only if the current version of the workflow template has the supplied version.

    This option cannot be used to instantiate a previous version of workflow template.

  • instance_id (::String) — Deprecated. Please use request_id field instead.
  • request_id (::String) — Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.

    It is recommended to always set this value to a UUID.

    The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

  • parameters (::Hash{::String => ::String}) — Optional. Map from parameter names to values that should be used for those parameters. Values may not exceed 100 characters.
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.

#list_workflow_templates

def list_workflow_templates(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate>
def list_workflow_templates(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate>

Lists workflows that match the specified filter in the request.

Overloads
def list_workflow_templates(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate>
Pass arguments to list_workflow_templates via a request object, either of type ListWorkflowTemplatesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1beta2::ListWorkflowTemplatesRequest, ::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_workflow_templates(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate>
Pass arguments to list_workflow_templates 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 resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

    • For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region}

    • For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}

  • page_size (::Integer) — Optional. The maximum number of results to return in each response.
  • page_token (::String) — Optional. The page token, returned by a previous call, to request the next page of results.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.

#operations_client

def operations_client() -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplateService::Operations

Get the associated client for long-running operations.

#update_workflow_template

def update_workflow_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
def update_workflow_template(template: nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate

Updates (replaces) workflow template. The updated template must contain version that matches the current server version.

Overloads
def update_workflow_template(request, options = nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
Pass arguments to update_workflow_template via a request object, either of type UpdateWorkflowTemplateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataproc::V1beta2::UpdateWorkflowTemplateRequest, ::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_workflow_template(template: nil) -> ::Google::Cloud::Dataproc::V1beta2::WorkflowTemplate
Pass arguments to update_workflow_template 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
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.