WorkflowTemplateServiceClient

WorkflowTemplateServiceClient

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

Constructor

new WorkflowTemplateServiceClient(optionsopt)

Construct an instance of WorkflowTemplateServiceClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. See the subsequent parameters for more details.

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

Members

(static) apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

(static) port

The port for this API service.

(static) scopes

The scopes needed to make gRPC calls for every method defined in this service.

(static) servicePath

The DNS address for this API service.

Methods

(async) checkInstantiateInlineWorkflowTemplateProgress(name) → {Promise}

Check the status of the long running operation returned by the instantiateInlineWorkflowTemplate() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

(async) checkInstantiateWorkflowTemplateProgress(name) → {Promise}

Check the status of the long running operation returned by the instantiateWorkflowTemplate() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

close()

Terminate the GRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

createWorkflowTemplate(request, optionsopt) → {Promise}

Creates new workflow template.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
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.v1.WorkflowTemplate

Required. The Dataproc workflow template to create.

options object <optional>

Call options. See CallOptions for more details.

deleteWorkflowTemplate(request, optionsopt) → {Promise}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
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 number <optional>

Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.

options object <optional>

Call options. See CallOptions for more details.

getProjectId(callback)

Return the project ID used by this class.

Parameters:
Name Type Description
callback function

the callback to be called with the current project Id.

getWorkflowTemplate(request, optionsopt) → {Promise}

Retrieves the latest workflow template.

Can retrieve previously instantiated template by specifying optional version parameter.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
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 number <optional>

Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.

If unspecified, retrieves the current version.

options object <optional>

Call options. See CallOptions for more details.

initialize() → {Promise}

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

instantiateInlineWorkflowTemplate(request, optionsopt) → {Promise}

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.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
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.v1.WorkflowTemplate

Required. The workflow template to instantiate.

requestId string <optional>

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.

options object <optional>

Call options. See CallOptions for more details.

instantiateWorkflowTemplate(request, optionsopt) → {Promise}

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.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
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 number <optional>

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.

requestId string <optional>

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 Array.<number> <optional>

Optional. Map from parameter names to values that should be used for those parameters. Values may not exceed 100 characters.

options object <optional>

Call options. See CallOptions for more details.

listWorkflowTemplates(request, optionsopt) → {Promise}

Lists workflows that match the specified filter in the request.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
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}

pageSize number <optional>

Optional. The maximum number of results to return in each response.

pageToken string <optional>

Optional. The page token, returned by a previous call, to request the next page of results.

options object <optional>

Call options. See CallOptions for more details.

listWorkflowTemplatesAsync(request, optionsopt) → {Object}

Equivalent to listWorkflowTemplates, but returns an iterable object.

for-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
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}

pageSize number <optional>

Optional. The maximum number of results to return in each response.

pageToken string <optional>

Optional. The page token, returned by a previous call, to request the next page of results.

options object <optional>

Call options. See CallOptions for more details.

listWorkflowTemplatesStream(request, optionsopt) → {Stream}

Equivalent to listWorkflowTemplates, but returns a NodeJS Stream object.

This fetches the paged responses for listWorkflowTemplates continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
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}

pageSize number <optional>

Optional. The maximum number of results to return in each response.

pageToken string <optional>

Optional. The page token, returned by a previous call, to request the next page of results.

options object <optional>

Call options. See CallOptions for more details.

See:

matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName) → {string}

Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource.

Parameters:
Name Type Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName) → {string}

Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource.

Parameters:
Name Type Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName) → {string}

Parse the location from ProjectLocationAutoscalingPolicy resource.

Parameters:
Name Type Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName) → {string}

Parse the location from ProjectLocationWorkflowTemplate resource.

Parameters:
Name Type Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName) → {string}

Parse the project from ProjectLocationAutoscalingPolicy resource.

Parameters:
Name Type Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName) → {string}

Parse the project from ProjectLocationWorkflowTemplate resource.

Parameters:
Name Type Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

matchProjectFromProjectName(projectName) → {string}

Parse the project from Project resource.

Parameters:
Name Type Description
projectName string

A fully-qualified path representing Project resource.

matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName) → {string}

Parse the project from ProjectRegionAutoscalingPolicy resource.

Parameters:
Name Type Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName) → {string}

Parse the project from ProjectRegionWorkflowTemplate resource.

Parameters:
Name Type Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

matchProjectFromRegionName(regionName) → {string}

Parse the project from Region resource.

Parameters:
Name Type Description
regionName string

A fully-qualified path representing Region resource.

matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName) → {string}

Parse the region from ProjectRegionAutoscalingPolicy resource.

Parameters:
Name Type Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName) → {string}

Parse the region from ProjectRegionWorkflowTemplate resource.

Parameters:
Name Type Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

matchRegionFromRegionName(regionName) → {string}

Parse the region from Region resource.

Parameters:
Name Type Description
regionName string

A fully-qualified path representing Region resource.

matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName) → {string}

Parse the workflow_template from ProjectLocationWorkflowTemplate resource.

Parameters:
Name Type Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName) → {string}

Parse the workflow_template from ProjectRegionWorkflowTemplate resource.

Parameters:
Name Type Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

projectLocationAutoscalingPolicyPath(project, location, autoscaling_policy) → {string}

Return a fully-qualified projectLocationAutoscalingPolicy resource name string.

Parameters:
Name Type Description
project string
location string
autoscaling_policy string

projectLocationWorkflowTemplatePath(project, location, workflow_template) → {string}

Return a fully-qualified projectLocationWorkflowTemplate resource name string.

Parameters:
Name Type Description
project string
location string
workflow_template string

projectPath(project) → {string}

Return a fully-qualified project resource name string.

Parameters:
Name Type Description
project string

projectRegionAutoscalingPolicyPath(project, region, autoscaling_policy) → {string}

Return a fully-qualified projectRegionAutoscalingPolicy resource name string.

Parameters:
Name Type Description
project string
region string
autoscaling_policy string

projectRegionWorkflowTemplatePath(project, region, workflow_template) → {string}

Return a fully-qualified projectRegionWorkflowTemplate resource name string.

Parameters:
Name Type Description
project string
region string
workflow_template string

regionPath(project, region) → {string}

Return a fully-qualified region resource name string.

Parameters:
Name Type Description
project string
region string

updateWorkflowTemplate(request, optionsopt) → {Promise}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
template google.cloud.dataproc.v1.WorkflowTemplate

Required. The updated workflow template.

The template.version field must match the current version.

options object <optional>

Call options. See CallOptions for more details.