Implements a client for the Cloud Dataproc API.
Example
# tokio_test::block_on(async {
# use google_cloud_dataproc_v1::client::WorkflowTemplateService;
let client = WorkflowTemplateService::builder().build().await?;
// use `client` to make requests to the Cloud Dataproc API.
# gax::client_builder::Result::<()>::Ok(()) });
Service Description
The API interface for managing Workflow Templates in the Dataproc API.
Configuration
To configure WorkflowTemplateService use the with_* methods in the type returned
by [builder()][WorkflowTemplateService::builder]. The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://dataproc.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
Pooling and Cloning
WorkflowTemplateService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap WorkflowTemplateService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations
builder
fn builder() -> super::builder::workflow_template_service::ClientBuilder
Returns a builder for [WorkflowTemplateService].
# tokio_test::block_on(async {
# use google_cloud_dataproc_v1::client::WorkflowTemplateService;
let client = WorkflowTemplateService::builder().build().await?;
# gax::client_builder::Result::<()>::Ok(()) });
from_stub
fn from_stub<T>(stub: T) -> Self
where
T: super::stub::WorkflowTemplateService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client's behavior.
create_workflow_template
fn create_workflow_template(self: &Self) -> super::builder::workflow_template_service::CreateWorkflowTemplate
Creates new workflow template.
get_workflow_template
fn get_workflow_template(self: &Self) -> super::builder::workflow_template_service::GetWorkflowTemplate
Retrieves the latest workflow template.
Can retrieve previously instantiated template by specifying optional version parameter.
instantiate_workflow_template
fn instantiate_workflow_template(self: &Self) -> super::builder::workflow_template_service::InstantiateWorkflowTemplate
Instantiates a template and begins execution.
The returned Operation can be used to track execution of workflow by polling [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when entire workflow is finished.
The running workflow can be aborted via [operations.cancel][google.longrunning.Operations.CancelOperation]. 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.
Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
instantiate_inline_workflow_template
fn instantiate_inline_workflow_template(self: &Self) -> super::builder::workflow_template_service::InstantiateInlineWorkflowTemplate
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][google.longrunning.Operations.GetOperation]. The Operation will complete when entire workflow is finished.
The running workflow can be aborted via [operations.cancel][google.longrunning.Operations.CancelOperation]. 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.
Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
update_workflow_template
fn update_workflow_template(self: &Self) -> super::builder::workflow_template_service::UpdateWorkflowTemplate
Updates (replaces) workflow template. The updated template must contain version that matches the current server version.
list_workflow_templates
fn list_workflow_templates(self: &Self) -> super::builder::workflow_template_service::ListWorkflowTemplates
Lists workflows that match the specified filter in the request.
delete_workflow_template
fn delete_workflow_template(self: &Self) -> super::builder::workflow_template_service::DeleteWorkflowTemplate
Deletes a workflow template. It does not cancel in-progress workflows.
set_iam_policy
fn set_iam_policy(self: &Self) -> super::builder::workflow_template_service::SetIamPolicy
Sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
errors.
get_iam_policy
fn get_iam_policy(self: &Self) -> super::builder::workflow_template_service::GetIamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
test_iam_permissions
fn test_iam_permissions(self: &Self) -> super::builder::workflow_template_service::TestIamPermissions
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
list_operations
fn list_operations(self: &Self) -> super::builder::workflow_template_service::ListOperations
Provides the Operations service functionality in this service.
get_operation
fn get_operation(self: &Self) -> super::builder::workflow_template_service::GetOperation
Provides the Operations service functionality in this service.
delete_operation
fn delete_operation(self: &Self) -> super::builder::workflow_template_service::DeleteOperation
Provides the Operations service functionality in this service.
cancel_operation
fn cancel_operation(self: &Self) -> super::builder::workflow_template_service::CancelOperation
Provides the Operations service functionality in this service.