- 4.50.0 (latest)
- 4.49.0
- 4.48.0
- 4.46.0
- 4.45.0
- 4.44.0
- 4.43.0
- 4.42.0
- 4.41.0
- 4.40.0
- 4.39.0
- 4.38.0
- 4.37.0
- 4.36.0
- 4.34.0
- 4.33.0
- 4.32.0
- 4.31.0
- 4.30.0
- 4.29.0
- 4.28.0
- 4.27.0
- 4.26.0
- 4.25.0
- 4.24.0
- 4.21.0
- 4.20.0
- 4.19.0
- 4.18.0
- 4.17.0
- 4.16.0
- 4.15.0
- 4.14.0
- 4.13.0
- 4.12.0
- 4.11.0
- 4.10.0
- 4.9.0
- 4.8.0
- 4.6.0
- 4.5.0
- 4.4.0
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.8
- 3.1.2
- 3.0.3
- 2.3.1
public class WorkflowTemplateServiceClient implements BackgroundResource
Service Description: The API interface for managing Workflow Templates in the Dataproc API.
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:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
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.newHttpJsonBuilder().build();
WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final WorkflowTemplateServiceClient create()
Constructs an instance of WorkflowTemplateServiceClient with default settings.
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(WorkflowTemplateServiceSettings settings)
public static final WorkflowTemplateServiceClient create(WorkflowTemplateServiceSettings settings)
Constructs an instance of WorkflowTemplateServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Parameter | |
---|---|
Name | Description |
settings | WorkflowTemplateServiceSettings |
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(WorkflowTemplateServiceStub stub)
public static final WorkflowTemplateServiceClient create(WorkflowTemplateServiceStub stub)
Constructs an instance of WorkflowTemplateServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(WorkflowTemplateServiceSettings).
Parameter | |
---|---|
Name | Description |
stub | WorkflowTemplateServiceStub |
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceClient |
Constructors
WorkflowTemplateServiceClient(WorkflowTemplateServiceSettings settings)
protected WorkflowTemplateServiceClient(WorkflowTemplateServiceSettings settings)
Constructs an instance of WorkflowTemplateServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Parameter | |
---|---|
Name | Description |
settings | WorkflowTemplateServiceSettings |
WorkflowTemplateServiceClient(WorkflowTemplateServiceStub stub)
protected WorkflowTemplateServiceClient(WorkflowTemplateServiceStub stub)
Parameter | |
---|---|
Name | Description |
stub | WorkflowTemplateServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration | long |
unit | TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
close()
public final void close()
createWorkflowTemplate(CreateWorkflowTemplateRequest request)
public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateRequest request)
Creates new workflow 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()) {
CreateWorkflowTemplateRequest request =
CreateWorkflowTemplateRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setTemplate(WorkflowTemplate.newBuilder().build())
.build();
WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request);
}
Parameter | |
---|---|
Name | Description |
request | CreateWorkflowTemplateRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
createWorkflowTemplate(LocationName parent, WorkflowTemplate template)
public final WorkflowTemplate createWorkflowTemplate(LocationName parent, WorkflowTemplate template)
Creates new workflow 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);
}
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
template | WorkflowTemplate Required. The Dataproc workflow template to create. |
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
createWorkflowTemplate(RegionName parent, WorkflowTemplate template)
public final WorkflowTemplate createWorkflowTemplate(RegionName parent, WorkflowTemplate template)
Creates new workflow 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);
}
Parameters | |
---|---|
Name | Description |
parent | RegionName Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
template | WorkflowTemplate Required. The Dataproc workflow template to create. |
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
createWorkflowTemplate(String parent, WorkflowTemplate template)
public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template)
Creates new workflow 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);
}
Parameters | |
---|---|
Name | Description |
parent | String Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
template | WorkflowTemplate Required. The Dataproc workflow template to create. |
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
createWorkflowTemplateCallable()
public final UnaryCallable<CreateWorkflowTemplateRequest,WorkflowTemplate> createWorkflowTemplateCallable()
Creates new workflow 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()) {
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateWorkflowTemplateRequest,WorkflowTemplate> |
deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request)
public final void deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request)
Deletes a workflow template. It does not cancel in-progress workflows.
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);
}
Parameter | |
---|---|
Name | Description |
request | DeleteWorkflowTemplateRequest The request object containing all of the parameters for the API call. |
deleteWorkflowTemplate(WorkflowTemplateName name)
public final void deleteWorkflowTemplate(WorkflowTemplateName name)
Deletes a workflow template. It does not cancel in-progress workflows.
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);
}
Parameter | |
---|---|
Name | Description |
name | WorkflowTemplateName Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.
|
deleteWorkflowTemplate(String name)
public final void deleteWorkflowTemplate(String name)
Deletes a workflow template. It does not cancel in-progress workflows.
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);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.
|
deleteWorkflowTemplateCallable()
public final UnaryCallable<DeleteWorkflowTemplateRequest,Empty> deleteWorkflowTemplateCallable()
Deletes a workflow template. It does not cancel in-progress workflows.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteWorkflowTemplateRequest,Empty> |
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getSettings()
public final WorkflowTemplateServiceSettings getSettings()
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceSettings |
getStub()
public WorkflowTemplateServiceStub getStub()
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceStub |
getWorkflowTemplate(GetWorkflowTemplateRequest request)
public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request)
Retrieves the latest workflow template.
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);
}
Parameter | |
---|---|
Name | Description |
request | GetWorkflowTemplateRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
getWorkflowTemplate(WorkflowTemplateName name)
public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name)
Retrieves the latest workflow template.
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);
}
Parameter | |
---|---|
Name | Description |
name | WorkflowTemplateName Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.
|
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
getWorkflowTemplate(String name)
public final WorkflowTemplate getWorkflowTemplate(String name)
Retrieves the latest workflow template.
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);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.
|
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
getWorkflowTemplateCallable()
public final UnaryCallable<GetWorkflowTemplateRequest,WorkflowTemplate> getWorkflowTemplateCallable()
Retrieves the latest workflow template.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetWorkflowTemplateRequest,WorkflowTemplate> |
instantiateInlineWorkflowTemplateAsync(InstantiateInlineWorkflowTemplateRequest request)
public final OperationFuture<Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateAsync(InstantiateInlineWorkflowTemplateRequest request)
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.
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();
}
Parameter | |
---|---|
Name | Description |
request | InstantiateInlineWorkflowTemplateRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateInlineWorkflowTemplateAsync(LocationName parent, WorkflowTemplate template)
public final OperationFuture<Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateAsync(LocationName parent, WorkflowTemplate template)
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.
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();
}
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
template | WorkflowTemplate Required. The workflow template to instantiate. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateInlineWorkflowTemplateAsync(RegionName parent, WorkflowTemplate template)
public final OperationFuture<Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateAsync(RegionName parent, WorkflowTemplate template)
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.
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();
}
Parameters | |
---|---|
Name | Description |
parent | RegionName Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
template | WorkflowTemplate Required. The workflow template to instantiate. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateInlineWorkflowTemplateAsync(String parent, WorkflowTemplate template)
public final OperationFuture<Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateAsync(String parent, WorkflowTemplate template)
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.
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();
}
Parameters | |
---|---|
Name | Description |
parent | String Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
template | WorkflowTemplate Required. The workflow template to instantiate. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateInlineWorkflowTemplateCallable()
public final UnaryCallable<InstantiateInlineWorkflowTemplateRequest,Operation> instantiateInlineWorkflowTemplateCallable()
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.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<InstantiateInlineWorkflowTemplateRequest,Operation> |
instantiateInlineWorkflowTemplateOperationCallable()
public final OperationCallable<InstantiateInlineWorkflowTemplateRequest,Empty,WorkflowMetadata> instantiateInlineWorkflowTemplateOperationCallable()
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.
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<InstantiateInlineWorkflowTemplateRequest,Empty,WorkflowMetadata> |
instantiateWorkflowTemplateAsync(InstantiateWorkflowTemplateRequest request)
public final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(InstantiateWorkflowTemplateRequest request)
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.
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();
}
Parameter | |
---|---|
Name | Description |
request | InstantiateWorkflowTemplateRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateWorkflowTemplateAsync(WorkflowTemplateName name)
public final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(WorkflowTemplateName name)
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.
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();
}
Parameter | |
---|---|
Name | Description |
name | WorkflowTemplateName Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateWorkflowTemplateAsync(WorkflowTemplateName name, Map<String,String> parameters)
public final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(WorkflowTemplateName name, Map<String,String> parameters)
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.
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();
}
Parameters | |
---|---|
Name | Description |
name | WorkflowTemplateName Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.
|
parameters | Map<String,String> Optional. Map from parameter names to values that should be used for those parameters. Values may not exceed 1000 characters. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateWorkflowTemplateAsync(String name)
public final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(String name)
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.
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();
}
Parameter | |
---|---|
Name | Description |
name | String Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateWorkflowTemplateAsync(String name, Map<String,String> parameters)
public final OperationFuture<Empty,WorkflowMetadata> instantiateWorkflowTemplateAsync(String name, Map<String,String> parameters)
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.
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();
}
Parameters | |
---|---|
Name | Description |
name | String Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names.
|
parameters | Map<String,String> Optional. Map from parameter names to values that should be used for those parameters. Values may not exceed 1000 characters. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,WorkflowMetadata> |
instantiateWorkflowTemplateCallable()
public final UnaryCallable<InstantiateWorkflowTemplateRequest,Operation> instantiateWorkflowTemplateCallable()
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.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<InstantiateWorkflowTemplateRequest,Operation> |
instantiateWorkflowTemplateOperationCallable()
public final OperationCallable<InstantiateWorkflowTemplateRequest,Empty,WorkflowMetadata> instantiateWorkflowTemplateOperationCallable()
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.
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<InstantiateWorkflowTemplateRequest,Empty,WorkflowMetadata> |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
listWorkflowTemplates(ListWorkflowTemplatesRequest request)
public final WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse listWorkflowTemplates(ListWorkflowTemplatesRequest request)
Lists workflows that match the specified filter in the 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);
}
}
Parameter | |
---|---|
Name | Description |
request | ListWorkflowTemplatesRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse |
listWorkflowTemplates(LocationName parent)
public final WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse listWorkflowTemplates(LocationName parent)
Lists workflows that match the specified filter in the 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()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (WorkflowTemplate element :
workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse |
listWorkflowTemplates(RegionName parent)
public final WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse listWorkflowTemplates(RegionName parent)
Lists workflows that match the specified filter in the 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()) {
RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
for (WorkflowTemplate element :
workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent | RegionName Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse |
listWorkflowTemplates(String parent)
public final WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse listWorkflowTemplates(String parent)
Lists workflows that match the specified filter in the 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()) {
String parent = RegionName.of("[PROJECT]", "[REGION]").toString();
for (WorkflowTemplate element :
workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent | String Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names.
|
Returns | |
---|---|
Type | Description |
WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse |
listWorkflowTemplatesCallable()
public final UnaryCallable<ListWorkflowTemplatesRequest,ListWorkflowTemplatesResponse> listWorkflowTemplatesCallable()
Lists workflows that match the specified filter in the 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();
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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListWorkflowTemplatesRequest,ListWorkflowTemplatesResponse> |
listWorkflowTemplatesPagedCallable()
public final UnaryCallable<ListWorkflowTemplatesRequest,WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse> listWorkflowTemplatesPagedCallable()
Lists workflows that match the specified filter in the 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();
ApiFuture<WorkflowTemplate> future =
workflowTemplateServiceClient.listWorkflowTemplatesPagedCallable().futureCall(request);
// Do something.
for (WorkflowTemplate element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListWorkflowTemplatesRequest,ListWorkflowTemplatesPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateWorkflowTemplate(UpdateWorkflowTemplateRequest request)
public final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateRequest request)
Updates (replaces) workflow template. The updated template must contain version that matches the current server version.
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);
}
Parameter | |
---|---|
Name | Description |
request | UpdateWorkflowTemplateRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
updateWorkflowTemplate(WorkflowTemplate template)
public final WorkflowTemplate updateWorkflowTemplate(WorkflowTemplate template)
Updates (replaces) workflow template. The updated template must contain version that matches the current server version.
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);
}
Parameter | |
---|---|
Name | Description |
template | WorkflowTemplate Required. The updated workflow template. The |
Returns | |
---|---|
Type | Description |
WorkflowTemplate |
updateWorkflowTemplateCallable()
public final UnaryCallable<UpdateWorkflowTemplateRequest,WorkflowTemplate> updateWorkflowTemplateCallable()
Updates (replaces) workflow template. The updated template must contain version that matches the current server version.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UpdateWorkflowTemplateRequest,WorkflowTemplate> |