Class WorkflowTemplateServiceClient (2.24.0)

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

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

WorkflowTemplateServiceClient(WorkflowTemplateServiceClient const &)

Copy and move support

Parameter
Name Description
WorkflowTemplateServiceClient const &

WorkflowTemplateServiceClient(WorkflowTemplateServiceClient &&)

Copy and move support

Parameter
Name Description
WorkflowTemplateServiceClient &&

WorkflowTemplateServiceClient(std::shared_ptr< WorkflowTemplateServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< WorkflowTemplateServiceConnection >
opts Options

Operators

operator=(WorkflowTemplateServiceClient const &)

Copy and move support

Parameter
Name Description
WorkflowTemplateServiceClient const &
Returns
Type Description
WorkflowTemplateServiceClient &

operator=(WorkflowTemplateServiceClient &&)

Copy and move support

Parameter
Name Description
WorkflowTemplateServiceClient &&
Returns
Type Description
WorkflowTemplateServiceClient &

Functions

CreateWorkflowTemplate(std::string const &, google::cloud::dataproc::v1::WorkflowTemplate const &, Options)

Creates new workflow template.

Parameters
Name Description
parent std::string const &

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 const &

Required. The Dataproc workflow template to create.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::dataproc::v1::WorkflowTemplate >

the result of the RPC. The response message type (google.cloud.dataproc.v1.WorkflowTemplate) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateWorkflowTemplate(google::cloud::dataproc::v1::CreateWorkflowTemplateRequest const &, Options)

Creates new workflow template.

Parameters
Name Description
request google::cloud::dataproc::v1::CreateWorkflowTemplateRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.CreateWorkflowTemplateRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::dataproc::v1::WorkflowTemplate >

the result of the RPC. The response message type (google.cloud.dataproc.v1.WorkflowTemplate) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetWorkflowTemplate(std::string const &, Options)

Retrieves the latest workflow template.

Can retrieve previously instantiated template by specifying optional version parameter.

Parameters
Name Description
name std::string const &

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}
opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::dataproc::v1::WorkflowTemplate >

the result of the RPC. The response message type (google.cloud.dataproc.v1.WorkflowTemplate) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetWorkflowTemplate(google::cloud::dataproc::v1::GetWorkflowTemplateRequest const &, Options)

Retrieves the latest workflow template.

Can retrieve previously instantiated template by specifying optional version parameter.

Parameters
Name Description
request google::cloud::dataproc::v1::GetWorkflowTemplateRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.GetWorkflowTemplateRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::dataproc::v1::WorkflowTemplate >

the result of the RPC. The response message type (google.cloud.dataproc.v1.WorkflowTemplate) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

InstantiateWorkflowTemplate(std::string const &, Options)

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 Description
name std::string const &

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}
opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::WorkflowMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.WorkflowMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

InstantiateWorkflowTemplate(std::string const &, std::map< std::string, std::string > const &, Options)

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 Description
name std::string const &

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}
parameters std::map< std::string, std::string > const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::WorkflowMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.WorkflowMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

InstantiateWorkflowTemplate(google::cloud::dataproc::v1::InstantiateWorkflowTemplateRequest const &, Options)

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 Description
request google::cloud::dataproc::v1::InstantiateWorkflowTemplateRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::WorkflowMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.WorkflowMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

InstantiateInlineWorkflowTemplate(std::string const &, google::cloud::dataproc::v1::WorkflowTemplate const &, Options)

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 Description
parent std::string const &

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 const &

Required. The workflow template to instantiate.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::WorkflowMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.WorkflowMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

InstantiateInlineWorkflowTemplate(google::cloud::dataproc::v1::InstantiateInlineWorkflowTemplateRequest const &, Options)

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 Description
request google::cloud::dataproc::v1::InstantiateInlineWorkflowTemplateRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::WorkflowMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.WorkflowMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateWorkflowTemplate(google::cloud::dataproc::v1::WorkflowTemplate const &, Options)

Updates (replaces) workflow template.

The updated template must contain version that matches the current server version.

Parameters
Name Description
template_ google::cloud::dataproc::v1::WorkflowTemplate const &

Required. The updated workflow template.
The template.version field must match the current version.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::dataproc::v1::WorkflowTemplate >

the result of the RPC. The response message type (google.cloud.dataproc.v1.WorkflowTemplate) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateWorkflowTemplate(google::cloud::dataproc::v1::UpdateWorkflowTemplateRequest const &, Options)

Updates (replaces) workflow template.

The updated template must contain version that matches the current server version.

Parameters
Name Description
request google::cloud::dataproc::v1::UpdateWorkflowTemplateRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::dataproc::v1::WorkflowTemplate >

the result of the RPC. The response message type (google.cloud.dataproc.v1.WorkflowTemplate) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListWorkflowTemplates(std::string const &, Options)

Lists workflows that match the specified filter in the request.

Parameters
Name Description
parent std::string const &

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}
opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::dataproc::v1::WorkflowTemplate >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.dataproc.v1.WorkflowTemplate, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListWorkflowTemplates(google::cloud::dataproc::v1::ListWorkflowTemplatesRequest, Options)

Lists workflows that match the specified filter in the request.

Parameters
Name Description
request google::cloud::dataproc::v1::ListWorkflowTemplatesRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.ListWorkflowTemplatesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::dataproc::v1::WorkflowTemplate >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.dataproc.v1.WorkflowTemplate, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

DeleteWorkflowTemplate(std::string const &, Options)

Deletes a workflow template.

It does not cancel in-progress workflows.

Parameters
Name Description
name std::string const &

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}
opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteWorkflowTemplate(google::cloud::dataproc::v1::DeleteWorkflowTemplateRequest const &, Options)

Deletes a workflow template.

It does not cancel in-progress workflows.

Parameters
Name Description
request google::cloud::dataproc::v1::DeleteWorkflowTemplateRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.