@Generated(value="by gapic-generator-java") public class WorkflowTemplateServiceClient extends Object implements BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
WorkflowTemplate response =
workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
}
Note: close() needs to be called on the WorkflowTemplateServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of WorkflowTemplateServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WorkflowTemplateServiceSettings workflowTemplateServiceSettings =
WorkflowTemplateServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WorkflowTemplateServiceSettings workflowTemplateServiceSettings =
WorkflowTemplateServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WorkflowTemplateServiceSettings workflowTemplateServiceSettings =
WorkflowTemplateServiceSettings.newBuilder()
.setTransportChannelProvider(
WorkflowTemplateServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
.build();
WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Modifier and Type | Class and Description |
---|---|
static class |
WorkflowTemplateServiceClient.ListWorkflowTemplatesFixedSizeCollection |
static class |
WorkflowTemplateServiceClient.ListWorkflowTemplatesPage |
static class |
WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
WorkflowTemplateServiceClient(WorkflowTemplateServiceSettings settings)
Constructs an instance of WorkflowTemplateServiceClient, using the given settings.
|
protected |
WorkflowTemplateServiceClient(WorkflowTemplateServiceStub stub) |
protected WorkflowTemplateServiceClient(WorkflowTemplateServiceSettings settings) throws IOException
IOException
protected WorkflowTemplateServiceClient(WorkflowTemplateServiceStub stub)
public static final WorkflowTemplateServiceClient create() throws IOException
IOException
public static final WorkflowTemplateServiceClient create(WorkflowTemplateServiceSettings settings) throws IOException
IOException
public static final WorkflowTemplateServiceClient create(WorkflowTemplateServiceStub stub)
public final WorkflowTemplateServiceSettings getSettings()
public WorkflowTemplateServiceStub getStub()
public final OperationsClient getOperationsClient()
@BetaApi public final OperationsClient getHttpJsonOperationsClient()
public final WorkflowTemplate createWorkflowTemplate(LocationName parent, WorkflowTemplate template)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
WorkflowTemplate response =
workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
template
- Required. The Dataproc workflow template to create.ApiException
- if the remote call failspublic final WorkflowTemplate createWorkflowTemplate(RegionName parent, WorkflowTemplate template)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
WorkflowTemplate response =
workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
template
- Required. The Dataproc workflow template to create.ApiException
- if the remote call failspublic final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
String parent = RegionName.of("[PROJECT]", "[REGION]").toString();
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
WorkflowTemplate response =
workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
template
- Required. The Dataproc workflow template to create.ApiException
- if the remote call failspublic final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
CreateWorkflowTemplateRequest request =
CreateWorkflowTemplateRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setTemplate(WorkflowTemplate.newBuilder().build())
.build();
WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateWorkflowTemplateRequest,WorkflowTemplate> createWorkflowTemplateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
CreateWorkflowTemplateRequest request =
CreateWorkflowTemplateRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setTemplate(WorkflowTemplate.newBuilder().build())
.build();
ApiFuture<WorkflowTemplate> future =
workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request);
// Do something.
WorkflowTemplate response = future.get();
}
public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name)
Can retrieve previously instantiated template by specifying optional version parameter.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
WorkflowTemplateName name =
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
}
name
- Required. The resource name of the workflow template, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final WorkflowTemplate getWorkflowTemplate(String name)
Can retrieve previously instantiated template by specifying optional version parameter.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
String name =
WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
"[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
.toString();
WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
}
name
- Required. The resource name of the workflow template, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request)
Can retrieve previously instantiated template by specifying optional version parameter.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
GetWorkflowTemplateRequest request =
GetWorkflowTemplateRequest.newBuilder()
.setName(
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
.toString())
.setVersion(351608024)
.build();
WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetWorkflowTemplateRequest,WorkflowTemplate> getWorkflowTemplateCallable()
Can retrieve previously instantiated template by specifying optional version parameter.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
GetWorkflowTemplateRequest request =
GetWorkflowTemplateRequest.newBuilder()
.setName(
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
.toString())
.setVersion(351608024)
.build();
ApiFuture<WorkflowTemplate> future =
workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request);
// Do something.
WorkflowTemplate response = future.get();
}
public final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(WorkflowTemplateName name)
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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
WorkflowTemplateName name =
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
}
name
- Required. The resource name of the workflow template, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(String name)
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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
String name =
WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
"[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
.toString();
workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
}
name
- Required. The resource name of the workflow template, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(WorkflowTemplateName name, Map<String,String> parameters)
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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
WorkflowTemplateName name =
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
Map<String, String> parameters = new HashMap<>();
workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
}
name
- Required. The resource name of the workflow template, as described in
https://cloud.google.com/apis/design/resource_names.
parameters
- Optional. Map from parameter names to values that should be used for those
parameters. Values may not exceed 1000 characters.ApiException
- if the remote call failspublic final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(String name, Map<String,String> parameters)
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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
String name =
WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
"[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
.toString();
Map<String, String> parameters = new HashMap<>();
workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
}
name
- Required. The resource name of the workflow template, as described in
https://cloud.google.com/apis/design/resource_names.
parameters
- Optional. Map from parameter names to values that should be used for those
parameters. Values may not exceed 1000 characters.ApiException
- if the remote call failspublic final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(InstantiateWorkflowTemplateRequest request)
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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
InstantiateWorkflowTemplateRequest request =
InstantiateWorkflowTemplateRequest.newBuilder()
.setName(
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
.toString())
.setVersion(351608024)
.setRequestId("requestId693933066")
.putAllParameters(new HashMap<String, String>())
.build();
workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final OperationCallable<InstantiateWorkflowTemplateRequest,Empty,WorkflowMetadata> instantiateWorkflowTemplateOperationCallable()
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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
InstantiateWorkflowTemplateRequest request =
InstantiateWorkflowTemplateRequest.newBuilder()
.setName(
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
.toString())
.setVersion(351608024)
.setRequestId("requestId693933066")
.putAllParameters(new HashMap<String, String>())
.build();
OperationFuture<Empty, WorkflowMetadata> future =
workflowTemplateServiceClient
.instantiateWorkflowTemplateOperationCallable()
.futureCall(request);
// Do something.
future.get();
}
public final UnaryCallable<InstantiateWorkflowTemplateRequest,Operation> instantiateWorkflowTemplateCallable()
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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
InstantiateWorkflowTemplateRequest request =
InstantiateWorkflowTemplateRequest.newBuilder()
.setName(
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
.toString())
.setVersion(351608024)
.setRequestId("requestId693933066")
.putAllParameters(new HashMap<String, String>())
.build();
ApiFuture<Operation> future =
workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request);
// Do something.
future.get();
}
public final OperationFuture<Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateAsync(LocationName parent, WorkflowTemplate template)
This method is equivalent to executing the sequence [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
template
- Required. The workflow template to instantiate.ApiException
- if the remote call failspublic final OperationFuture<Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateAsync(RegionName parent, WorkflowTemplate template)
This method is equivalent to executing the sequence [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
template
- Required. The workflow template to instantiate.ApiException
- if the remote call failspublic final OperationFuture<Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateAsync(String parent, WorkflowTemplate template)
This method is equivalent to executing the sequence [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
String parent = RegionName.of("[PROJECT]", "[REGION]").toString();
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
template
- Required. The workflow template to instantiate.ApiException
- if the remote call failspublic final OperationFuture<Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateAsync(InstantiateInlineWorkflowTemplateRequest request)
This method is equivalent to executing the sequence [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
InstantiateInlineWorkflowTemplateRequest request =
InstantiateInlineWorkflowTemplateRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setTemplate(WorkflowTemplate.newBuilder().build())
.setRequestId("requestId693933066")
.build();
workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final OperationCallable<InstantiateInlineWorkflowTemplateRequest,Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateOperationCallable()
This method is equivalent to executing the sequence [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
InstantiateInlineWorkflowTemplateRequest request =
InstantiateInlineWorkflowTemplateRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setTemplate(WorkflowTemplate.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, WorkflowMetadata> future =
workflowTemplateServiceClient
.instantiateInlineWorkflowTemplateOperationCallable()
.futureCall(request);
// Do something.
future.get();
}
public final UnaryCallable<InstantiateInlineWorkflowTemplateRequest,Operation> instantiateInlineWorkflowTemplateCallable()
This method is equivalent to executing the sequence [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.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][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
InstantiateInlineWorkflowTemplateRequest request =
InstantiateInlineWorkflowTemplateRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setTemplate(WorkflowTemplate.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
workflowTemplateServiceClient
.instantiateInlineWorkflowTemplateCallable()
.futureCall(request);
// Do something.
future.get();
}
public final WorkflowTemplate updateWorkflowTemplate(WorkflowTemplate template)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(template);
}
template
- Required. The updated workflow template.
The `template.version` field must match the current version.
ApiException
- if the remote call failspublic final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
UpdateWorkflowTemplateRequest request =
UpdateWorkflowTemplateRequest.newBuilder()
.setTemplate(WorkflowTemplate.newBuilder().build())
.build();
WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateWorkflowTemplateRequest,WorkflowTemplate> updateWorkflowTemplateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
UpdateWorkflowTemplateRequest request =
UpdateWorkflowTemplateRequest.newBuilder()
.setTemplate(WorkflowTemplate.newBuilder().build())
.build();
ApiFuture<WorkflowTemplate> future =
workflowTemplateServiceClient.updateWorkflowTemplateCallable().futureCall(request);
// Do something.
WorkflowTemplate response = future.get();
}
public final WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse listWorkflowTemplates(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (WorkflowTemplate element :
workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse listWorkflowTemplates(RegionName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
for (WorkflowTemplate element :
workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse listWorkflowTemplates(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
String parent = RegionName.of("[PROJECT]", "[REGION]").toString();
for (WorkflowTemplate element :
workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the region or location, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse listWorkflowTemplates(ListWorkflowTemplatesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
ListWorkflowTemplatesRequest request =
ListWorkflowTemplatesRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (WorkflowTemplate element :
workflowTemplateServiceClient.listWorkflowTemplates(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListWorkflowTemplatesRequest,WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse> listWorkflowTemplatesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
ListWorkflowTemplatesRequest request =
ListWorkflowTemplatesRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<WorkflowTemplate> future =
workflowTemplateServiceClient.listWorkflowTemplatesPagedCallable().futureCall(request);
// Do something.
for (WorkflowTemplate element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListWorkflowTemplatesRequest,ListWorkflowTemplatesResponse> listWorkflowTemplatesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
ListWorkflowTemplatesRequest request =
ListWorkflowTemplatesRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListWorkflowTemplatesResponse response =
workflowTemplateServiceClient.listWorkflowTemplatesCallable().call(request);
for (WorkflowTemplate element : response.getTemplatesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteWorkflowTemplate(WorkflowTemplateName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
WorkflowTemplateName name =
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
workflowTemplateServiceClient.deleteWorkflowTemplate(name);
}
name
- Required. The resource name of the workflow template, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final void deleteWorkflowTemplate(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
String name =
WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
"[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
.toString();
workflowTemplateServiceClient.deleteWorkflowTemplate(name);
}
name
- Required. The resource name of the workflow template, as described in
https://cloud.google.com/apis/design/resource_names.
ApiException
- if the remote call failspublic final void deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
DeleteWorkflowTemplateRequest request =
DeleteWorkflowTemplateRequest.newBuilder()
.setName(
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
.toString())
.setVersion(351608024)
.build();
workflowTemplateServiceClient.deleteWorkflowTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<DeleteWorkflowTemplateRequest,Empty> deleteWorkflowTemplateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
DeleteWorkflowTemplateRequest request =
DeleteWorkflowTemplateRequest.newBuilder()
.setName(
WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
"[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
.toString())
.setVersion(351608024)
.build();
ApiFuture<Empty> future =
workflowTemplateServiceClient.deleteWorkflowTemplateCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2022 Google LLC. All rights reserved.