@Generated(value="by gapic-generator-java") public class PipelineServiceClient extends Object implements com.google.api.gax.core.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:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
TrainingPipeline response =
pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
}
Note: close() needs to be called on the PipelineServiceClient 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 PipelineServiceSettings to create(). For example:
To customize credentials:
PipelineServiceSettings pipelineServiceSettings =
PipelineServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
PipelineServiceClient pipelineServiceClient =
PipelineServiceClient.create(pipelineServiceSettings);
To customize the endpoint:
PipelineServiceSettings pipelineServiceSettings =
PipelineServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
PipelineServiceClient pipelineServiceClient =
PipelineServiceClient.create(pipelineServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Modifier and Type | Class and Description |
---|---|
static class |
PipelineServiceClient.ListTrainingPipelinesFixedSizeCollection |
static class |
PipelineServiceClient.ListTrainingPipelinesPage |
static class |
PipelineServiceClient.ListTrainingPipelinesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
PipelineServiceClient(PipelineServiceSettings settings)
Constructs an instance of PipelineServiceClient, using the given settings.
|
protected |
PipelineServiceClient(PipelineServiceStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
cancelTrainingPipeline(CancelTrainingPipelineRequest request)
Cancels a TrainingPipeline.
|
void |
cancelTrainingPipeline(String name)
Cancels a TrainingPipeline.
|
void |
cancelTrainingPipeline(TrainingPipelineName name)
Cancels a TrainingPipeline.
|
com.google.api.gax.rpc.UnaryCallable<CancelTrainingPipelineRequest,com.google.protobuf.Empty> |
cancelTrainingPipelineCallable()
Cancels a TrainingPipeline.
|
void |
close() |
static PipelineServiceClient |
create()
Constructs an instance of PipelineServiceClient with default settings.
|
static PipelineServiceClient |
create(PipelineServiceSettings settings)
Constructs an instance of PipelineServiceClient, using the given settings.
|
static PipelineServiceClient |
create(PipelineServiceStub stub)
Constructs an instance of PipelineServiceClient, using the given stub for making calls.
|
TrainingPipeline |
createTrainingPipeline(CreateTrainingPipelineRequest request)
Creates a TrainingPipeline.
|
TrainingPipeline |
createTrainingPipeline(LocationName parent,
TrainingPipeline trainingPipeline)
Creates a TrainingPipeline.
|
TrainingPipeline |
createTrainingPipeline(String parent,
TrainingPipeline trainingPipeline)
Creates a TrainingPipeline.
|
com.google.api.gax.rpc.UnaryCallable<CreateTrainingPipelineRequest,TrainingPipeline> |
createTrainingPipelineCallable()
Creates a TrainingPipeline.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteTrainingPipelineAsync(DeleteTrainingPipelineRequest request)
Deletes a TrainingPipeline.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteTrainingPipelineAsync(String name)
Deletes a TrainingPipeline.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteTrainingPipelineAsync(TrainingPipelineName name)
Deletes a TrainingPipeline.
|
com.google.api.gax.rpc.UnaryCallable<DeleteTrainingPipelineRequest,com.google.longrunning.Operation> |
deleteTrainingPipelineCallable()
Deletes a TrainingPipeline.
|
com.google.api.gax.rpc.OperationCallable<DeleteTrainingPipelineRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteTrainingPipelineOperationCallable()
Deletes a TrainingPipeline.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
PipelineServiceSettings |
getSettings() |
PipelineServiceStub |
getStub() |
TrainingPipeline |
getTrainingPipeline(GetTrainingPipelineRequest request)
Gets a TrainingPipeline.
|
TrainingPipeline |
getTrainingPipeline(String name)
Gets a TrainingPipeline.
|
TrainingPipeline |
getTrainingPipeline(TrainingPipelineName name)
Gets a TrainingPipeline.
|
com.google.api.gax.rpc.UnaryCallable<GetTrainingPipelineRequest,TrainingPipeline> |
getTrainingPipelineCallable()
Gets a TrainingPipeline.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
PipelineServiceClient.ListTrainingPipelinesPagedResponse |
listTrainingPipelines(ListTrainingPipelinesRequest request)
Lists TrainingPipelines in a Location.
|
PipelineServiceClient.ListTrainingPipelinesPagedResponse |
listTrainingPipelines(LocationName parent)
Lists TrainingPipelines in a Location.
|
PipelineServiceClient.ListTrainingPipelinesPagedResponse |
listTrainingPipelines(String parent)
Lists TrainingPipelines in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListTrainingPipelinesRequest,ListTrainingPipelinesResponse> |
listTrainingPipelinesCallable()
Lists TrainingPipelines in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListTrainingPipelinesRequest,PipelineServiceClient.ListTrainingPipelinesPagedResponse> |
listTrainingPipelinesPagedCallable()
Lists TrainingPipelines in a Location.
|
void |
shutdown() |
void |
shutdownNow() |
protected PipelineServiceClient(PipelineServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected PipelineServiceClient(PipelineServiceStub stub)
public static final PipelineServiceClient create() throws IOException
IOException
public static final PipelineServiceClient create(PipelineServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final PipelineServiceClient create(PipelineServiceStub stub)
public final PipelineServiceSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public PipelineServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
public final TrainingPipeline createTrainingPipeline(LocationName parent, TrainingPipeline trainingPipeline)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
TrainingPipeline response =
pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
}
parent
- Required. The resource name of the Location to create the TrainingPipeline in.
Format: `projects/{project}/locations/{location}`trainingPipeline
- Required. The TrainingPipeline to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TrainingPipeline createTrainingPipeline(String parent, TrainingPipeline trainingPipeline)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
TrainingPipeline response =
pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
}
parent
- Required. The resource name of the Location to create the TrainingPipeline in.
Format: `projects/{project}/locations/{location}`trainingPipeline
- Required. The TrainingPipeline to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TrainingPipeline createTrainingPipeline(CreateTrainingPipelineRequest request)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
CreateTrainingPipelineRequest request =
CreateTrainingPipelineRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTrainingPipeline(TrainingPipeline.newBuilder().build())
.build();
TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateTrainingPipelineRequest,TrainingPipeline> createTrainingPipelineCallable()
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
CreateTrainingPipelineRequest request =
CreateTrainingPipelineRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTrainingPipeline(TrainingPipeline.newBuilder().build())
.build();
ApiFuture<TrainingPipeline> future =
pipelineServiceClient.createTrainingPipelineCallable().futureCall(request);
// Do something.
TrainingPipeline response = future.get();
}
public final TrainingPipeline getTrainingPipeline(TrainingPipelineName name)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
TrainingPipelineName name =
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name);
}
name
- Required. The name of the TrainingPipeline resource. Format:
`projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TrainingPipeline getTrainingPipeline(String name)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
String name =
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name);
}
name
- Required. The name of the TrainingPipeline resource. Format:
`projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final TrainingPipeline getTrainingPipeline(GetTrainingPipelineRequest request)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
GetTrainingPipelineRequest request =
GetTrainingPipelineRequest.newBuilder()
.setName(
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
.toString())
.build();
TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetTrainingPipelineRequest,TrainingPipeline> getTrainingPipelineCallable()
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
GetTrainingPipelineRequest request =
GetTrainingPipelineRequest.newBuilder()
.setName(
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
.toString())
.build();
ApiFuture<TrainingPipeline> future =
pipelineServiceClient.getTrainingPipelineCallable().futureCall(request);
// Do something.
TrainingPipeline response = future.get();
}
public final PipelineServiceClient.ListTrainingPipelinesPagedResponse listTrainingPipelines(LocationName parent)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (TrainingPipeline element :
pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the Location to list the TrainingPipelines from.
Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final PipelineServiceClient.ListTrainingPipelinesPagedResponse listTrainingPipelines(String parent)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (TrainingPipeline element :
pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the Location to list the TrainingPipelines from.
Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final PipelineServiceClient.ListTrainingPipelinesPagedResponse listTrainingPipelines(ListTrainingPipelinesRequest request)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
ListTrainingPipelinesRequest request =
ListTrainingPipelinesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (TrainingPipeline element :
pipelineServiceClient.listTrainingPipelines(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListTrainingPipelinesRequest,PipelineServiceClient.ListTrainingPipelinesPagedResponse> listTrainingPipelinesPagedCallable()
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
ListTrainingPipelinesRequest request =
ListTrainingPipelinesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<TrainingPipeline> future =
pipelineServiceClient.listTrainingPipelinesPagedCallable().futureCall(request);
// Do something.
for (TrainingPipeline element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTrainingPipelinesRequest,ListTrainingPipelinesResponse> listTrainingPipelinesCallable()
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
ListTrainingPipelinesRequest request =
ListTrainingPipelinesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListTrainingPipelinesResponse response =
pipelineServiceClient.listTrainingPipelinesCallable().call(request);
for (TrainingPipeline element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteTrainingPipelineAsync(TrainingPipelineName name)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
TrainingPipelineName name =
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
}
name
- Required. The name of the TrainingPipeline resource to be deleted. Format:
`projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteTrainingPipelineAsync(String name)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
String name =
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
}
name
- Required. The name of the TrainingPipeline resource to be deleted. Format:
`projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteTrainingPipelineAsync(DeleteTrainingPipelineRequest request)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
DeleteTrainingPipelineRequest request =
DeleteTrainingPipelineRequest.newBuilder()
.setName(
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
.toString())
.build();
pipelineServiceClient.deleteTrainingPipelineAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteTrainingPipelineRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteTrainingPipelineOperationCallable()
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
DeleteTrainingPipelineRequest request =
DeleteTrainingPipelineRequest.newBuilder()
.setName(
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
.toString())
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
pipelineServiceClient.deleteTrainingPipelineOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteTrainingPipelineRequest,com.google.longrunning.Operation> deleteTrainingPipelineCallable()
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
DeleteTrainingPipelineRequest request =
DeleteTrainingPipelineRequest.newBuilder()
.setName(
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
.toString())
.build();
ApiFuture<Operation> future =
pipelineServiceClient.deleteTrainingPipelineCallable().futureCall(request);
// Do something.
future.get();
}
public final void cancelTrainingPipeline(TrainingPipelineName name)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
TrainingPipelineName name =
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
pipelineServiceClient.cancelTrainingPipeline(name);
}
name
- Required. The name of the TrainingPipeline to cancel. Format:
`projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelTrainingPipeline(String name)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
String name =
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
pipelineServiceClient.cancelTrainingPipeline(name);
}
name
- Required. The name of the TrainingPipeline to cancel. Format:
`projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelTrainingPipeline(CancelTrainingPipelineRequest request)
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
CancelTrainingPipelineRequest request =
CancelTrainingPipelineRequest.newBuilder()
.setName(
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
.toString())
.build();
pipelineServiceClient.cancelTrainingPipeline(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelTrainingPipelineRequest,com.google.protobuf.Empty> cancelTrainingPipelineCallable()
Sample code:
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
CancelTrainingPipelineRequest request =
CancelTrainingPipelineRequest.newBuilder()
.setName(
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
.toString())
.build();
ApiFuture<Empty> future =
pipelineServiceClient.cancelTrainingPipelineCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2021 Google LLC. All rights reserved.