- 0.54.0 (latest)
- 0.53.0
- 0.51.0
- 0.50.0
- 0.49.0
- 0.48.0
- 0.47.0
- 0.46.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.41.0
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.0
- 0.3.8
public class WorkflowsServiceV2BetaClient implements BackgroundResource
Service Description: A service for running workflows, such as pipelines consisting of Docker containers.
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:
try (WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient =
WorkflowsServiceV2BetaClient.create()) {
RunPipelineRequest request =
RunPipelineRequest.newBuilder()
.setParent("parent-995424086")
.setPipeline(Pipeline.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setPubSubTopic("pubSubTopic320524524")
.build();
RunPipelineResponse response = workflowsServiceV2BetaClient.runPipelineAsync(request).get();
}
Note: close() needs to be called on the WorkflowsServiceV2BetaClient 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 WorkflowsServiceV2BetaSettings to create(). For example:
To customize credentials:
WorkflowsServiceV2BetaSettings workflowsServiceV2BetaSettings =
WorkflowsServiceV2BetaSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient =
WorkflowsServiceV2BetaClient.create(workflowsServiceV2BetaSettings);
To customize the endpoint:
WorkflowsServiceV2BetaSettings workflowsServiceV2BetaSettings =
WorkflowsServiceV2BetaSettings.newBuilder().setEndpoint(myEndpoint).build();
WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient =
WorkflowsServiceV2BetaClient.create(workflowsServiceV2BetaSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final WorkflowsServiceV2BetaClient create()
Constructs an instance of WorkflowsServiceV2BetaClient with default settings.
Type | Description |
WorkflowsServiceV2BetaClient |
Type | Description |
IOException |
create(WorkflowsServiceV2BetaSettings settings)
public static final WorkflowsServiceV2BetaClient create(WorkflowsServiceV2BetaSettings settings)
Constructs an instance of WorkflowsServiceV2BetaClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | WorkflowsServiceV2BetaSettings |
Type | Description |
WorkflowsServiceV2BetaClient |
Type | Description |
IOException |
create(WorkflowsServiceV2BetaStub stub)
public static final WorkflowsServiceV2BetaClient create(WorkflowsServiceV2BetaStub stub)
Constructs an instance of WorkflowsServiceV2BetaClient, using the given stub for making calls. This is for advanced usage - prefer using create(WorkflowsServiceV2BetaSettings).
Name | Description |
stub | WorkflowsServiceV2BetaStub |
Type | Description |
WorkflowsServiceV2BetaClient |
Constructors
WorkflowsServiceV2BetaClient(WorkflowsServiceV2BetaSettings settings)
protected WorkflowsServiceV2BetaClient(WorkflowsServiceV2BetaSettings settings)
Constructs an instance of WorkflowsServiceV2BetaClient, 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.
Name | Description |
settings | WorkflowsServiceV2BetaSettings |
WorkflowsServiceV2BetaClient(WorkflowsServiceV2BetaStub stub)
protected WorkflowsServiceV2BetaClient(WorkflowsServiceV2BetaStub stub)
Name | Description |
stub | WorkflowsServiceV2BetaStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
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.
Type | Description |
OperationsClient |
getSettings()
public final WorkflowsServiceV2BetaSettings getSettings()
Type | Description |
WorkflowsServiceV2BetaSettings |
getStub()
public WorkflowsServiceV2BetaStub getStub()
Type | Description |
WorkflowsServiceV2BetaStub |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
runPipelineAsync(RunPipelineRequest request)
public final OperationFuture<RunPipelineResponse,Metadata> runPipelineAsync(RunPipelineRequest request)
Runs a pipeline. The returned Operation's [metadata] [google.longrunning.Operation.metadata] field will contain a google.cloud.lifesciences.v2beta.Metadata object describing the status of the pipeline execution. The response field will contain a google.cloud.lifesciences.v2beta.RunPipelineResponse object if the pipeline completes successfully.
**Note:** Before you can use this method, the *Life Sciences Service Agent* must have access to your project. This is done automatically when the Cloud Life Sciences API is first enabled, but if you delete this permission you must disable and re-enable the API to grant the Life Sciences Service Agent the required permissions. Authorization requires the following Google IAM permission:
lifesciences.workflows.run
Sample code:
try (WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient =
WorkflowsServiceV2BetaClient.create()) {
RunPipelineRequest request =
RunPipelineRequest.newBuilder()
.setParent("parent-995424086")
.setPipeline(Pipeline.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setPubSubTopic("pubSubTopic320524524")
.build();
RunPipelineResponse response = workflowsServiceV2BetaClient.runPipelineAsync(request).get();
}
Name | Description |
request | RunPipelineRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<RunPipelineResponse,Metadata> |
runPipelineCallable()
public final UnaryCallable<RunPipelineRequest,Operation> runPipelineCallable()
Runs a pipeline. The returned Operation's [metadata] [google.longrunning.Operation.metadata] field will contain a google.cloud.lifesciences.v2beta.Metadata object describing the status of the pipeline execution. The response field will contain a google.cloud.lifesciences.v2beta.RunPipelineResponse object if the pipeline completes successfully.
**Note:** Before you can use this method, the *Life Sciences Service Agent* must have access to your project. This is done automatically when the Cloud Life Sciences API is first enabled, but if you delete this permission you must disable and re-enable the API to grant the Life Sciences Service Agent the required permissions. Authorization requires the following Google IAM permission:
lifesciences.workflows.run
Sample code:
try (WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient =
WorkflowsServiceV2BetaClient.create()) {
RunPipelineRequest request =
RunPipelineRequest.newBuilder()
.setParent("parent-995424086")
.setPipeline(Pipeline.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setPubSubTopic("pubSubTopic320524524")
.build();
ApiFuture<Operation> future =
workflowsServiceV2BetaClient.runPipelineCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<RunPipelineRequest,Operation> |
runPipelineOperationCallable()
public final OperationCallable<RunPipelineRequest,RunPipelineResponse,Metadata> runPipelineOperationCallable()
Runs a pipeline. The returned Operation's [metadata] [google.longrunning.Operation.metadata] field will contain a google.cloud.lifesciences.v2beta.Metadata object describing the status of the pipeline execution. The response field will contain a google.cloud.lifesciences.v2beta.RunPipelineResponse object if the pipeline completes successfully.
**Note:** Before you can use this method, the *Life Sciences Service Agent* must have access to your project. This is done automatically when the Cloud Life Sciences API is first enabled, but if you delete this permission you must disable and re-enable the API to grant the Life Sciences Service Agent the required permissions. Authorization requires the following Google IAM permission:
lifesciences.workflows.run
Sample code:
try (WorkflowsServiceV2BetaClient workflowsServiceV2BetaClient =
WorkflowsServiceV2BetaClient.create()) {
RunPipelineRequest request =
RunPipelineRequest.newBuilder()
.setParent("parent-995424086")
.setPipeline(Pipeline.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setPubSubTopic("pubSubTopic320524524")
.build();
OperationFuture<RunPipelineResponse, Metadata> future =
workflowsServiceV2BetaClient.runPipelineOperationCallable().futureCall(request);
// Do something.
RunPipelineResponse response = future.get();
}
Type | Description |
OperationCallable<RunPipelineRequest,RunPipelineResponse,Metadata> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()