Class PipelineServiceClient
- java.lang.Object
-
- com.google.cloud.aiplatform.v1beta1.PipelineServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@BetaApi @Generated("by gapic-generator-java") public class PipelineServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: A service for creating and managing Vertex AI's pipelines. This includes both `TrainingPipeline` resources (used for AutoML and custom training) and `PipelineJob` resources (used for Vertex AI Pipelines).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 (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:
- 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 PipelineServiceSettings 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 PipelineServiceSettings pipelineServiceSettings = PipelineServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create(pipelineServiceSettings);
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 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PipelineServiceClient.ListLocationsFixedSizeCollection
static class
PipelineServiceClient.ListLocationsPage
static class
PipelineServiceClient.ListLocationsPagedResponse
static class
PipelineServiceClient.ListPipelineJobsFixedSizeCollection
static class
PipelineServiceClient.ListPipelineJobsPage
static class
PipelineServiceClient.ListPipelineJobsPagedResponse
static class
PipelineServiceClient.ListTrainingPipelinesFixedSizeCollection
static class
PipelineServiceClient.ListTrainingPipelinesPage
static class
PipelineServiceClient.ListTrainingPipelinesPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
PipelineServiceClient(PipelineServiceSettings settings)
Constructs an instance of PipelineServiceClient, using the given settings.protected
PipelineServiceClient(PipelineServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
cancelPipelineJob(CancelPipelineJobRequest request)
Cancels a PipelineJob.void
cancelPipelineJob(PipelineJobName name)
Cancels a PipelineJob.void
cancelPipelineJob(String name)
Cancels a PipelineJob.com.google.api.gax.rpc.UnaryCallable<CancelPipelineJobRequest,com.google.protobuf.Empty>
cancelPipelineJobCallable()
Cancels a PipelineJob.void
cancelTrainingPipeline(CancelTrainingPipelineRequest request)
Cancels a TrainingPipeline.void
cancelTrainingPipeline(TrainingPipelineName name)
Cancels a TrainingPipeline.void
cancelTrainingPipeline(String 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.PipelineJob
createPipelineJob(CreatePipelineJobRequest request)
Creates a PipelineJob.PipelineJob
createPipelineJob(LocationName parent, PipelineJob pipelineJob, String pipelineJobId)
Creates a PipelineJob.PipelineJob
createPipelineJob(String parent, PipelineJob pipelineJob, String pipelineJobId)
Creates a PipelineJob.com.google.api.gax.rpc.UnaryCallable<CreatePipelineJobRequest,PipelineJob>
createPipelineJobCallable()
Creates a PipelineJob.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>
deletePipelineJobAsync(DeletePipelineJobRequest request)
Deletes a PipelineJob.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata>
deletePipelineJobAsync(PipelineJobName name)
Deletes a PipelineJob.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata>
deletePipelineJobAsync(String name)
Deletes a PipelineJob.com.google.api.gax.rpc.UnaryCallable<DeletePipelineJobRequest,com.google.longrunning.Operation>
deletePipelineJobCallable()
Deletes a PipelineJob.com.google.api.gax.rpc.OperationCallable<DeletePipelineJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata>
deletePipelineJobOperationCallable()
Deletes a PipelineJob.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(TrainingPipelineName name)
Deletes a TrainingPipeline.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata>
deleteTrainingPipelineAsync(String 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.iam.v1.Policy
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>
getIamPolicyCallable()
Gets the access control policy for a resource.com.google.cloud.location.Location
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>
getLocationCallable()
Gets information about a location.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.PipelineJob
getPipelineJob(GetPipelineJobRequest request)
Gets a PipelineJob.PipelineJob
getPipelineJob(PipelineJobName name)
Gets a PipelineJob.PipelineJob
getPipelineJob(String name)
Gets a PipelineJob.com.google.api.gax.rpc.UnaryCallable<GetPipelineJobRequest,PipelineJob>
getPipelineJobCallable()
Gets a PipelineJob.PipelineServiceSettings
getSettings()
PipelineServiceStub
getStub()
TrainingPipeline
getTrainingPipeline(GetTrainingPipelineRequest request)
Gets a TrainingPipeline.TrainingPipeline
getTrainingPipeline(TrainingPipelineName name)
Gets a TrainingPipeline.TrainingPipeline
getTrainingPipeline(String name)
Gets a TrainingPipeline.com.google.api.gax.rpc.UnaryCallable<GetTrainingPipelineRequest,TrainingPipeline>
getTrainingPipelineCallable()
Gets a TrainingPipeline.boolean
isShutdown()
boolean
isTerminated()
PipelineServiceClient.ListLocationsPagedResponse
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>
listLocationsCallable()
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,PipelineServiceClient.ListLocationsPagedResponse>
listLocationsPagedCallable()
Lists information about the supported locations for this service.PipelineServiceClient.ListPipelineJobsPagedResponse
listPipelineJobs(ListPipelineJobsRequest request)
Lists PipelineJobs in a Location.PipelineServiceClient.ListPipelineJobsPagedResponse
listPipelineJobs(LocationName parent)
Lists PipelineJobs in a Location.PipelineServiceClient.ListPipelineJobsPagedResponse
listPipelineJobs(String parent)
Lists PipelineJobs in a Location.com.google.api.gax.rpc.UnaryCallable<ListPipelineJobsRequest,ListPipelineJobsResponse>
listPipelineJobsCallable()
Lists PipelineJobs in a Location.com.google.api.gax.rpc.UnaryCallable<ListPipelineJobsRequest,PipelineServiceClient.ListPipelineJobsPagedResponse>
listPipelineJobsPagedCallable()
Lists PipelineJobs in a Location.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.com.google.iam.v1.Policy
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>
setIamPolicyCallable()
Sets the access control policy on the specified resource.void
shutdown()
void
shutdownNow()
com.google.iam.v1.TestIamPermissionsResponse
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
-
-
-
Constructor Detail
-
PipelineServiceClient
protected PipelineServiceClient(PipelineServiceSettings settings) throws IOException
Constructs an instance of PipelineServiceClient, 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.- Throws:
IOException
-
PipelineServiceClient
protected PipelineServiceClient(PipelineServiceStub stub)
-
-
Method Detail
-
create
public static final PipelineServiceClient create() throws IOException
Constructs an instance of PipelineServiceClient with default settings.- Throws:
IOException
-
create
public static final PipelineServiceClient create(PipelineServiceSettings settings) throws IOException
Constructs an instance of PipelineServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final PipelineServiceClient create(PipelineServiceStub stub)
Constructs an instance of PipelineServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(PipelineServiceSettings).
-
getSettings
public final PipelineServiceSettings getSettings()
-
getStub
public PipelineServiceStub getStub()
-
getOperationsClient
public final 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.
-
createTrainingPipeline
public final TrainingPipeline createTrainingPipeline(LocationName parent, TrainingPipeline trainingPipeline)
Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build(); TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline); }
- Parameters:
parent
- Required. The resource name of the Location to create the TrainingPipeline in. Format: `projects/{project}/locations/{location}`trainingPipeline
- Required. The TrainingPipeline to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createTrainingPipeline
public final TrainingPipeline createTrainingPipeline(String parent, TrainingPipeline trainingPipeline)
Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build(); TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline); }
- Parameters:
parent
- Required. The resource name of the Location to create the TrainingPipeline in. Format: `projects/{project}/locations/{location}`trainingPipeline
- Required. The TrainingPipeline to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createTrainingPipeline
public final TrainingPipeline createTrainingPipeline(CreateTrainingPipelineRequest request)
Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { CreateTrainingPipelineRequest request = CreateTrainingPipelineRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setTrainingPipeline(TrainingPipeline.newBuilder().build()) .build(); TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createTrainingPipelineCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateTrainingPipelineRequest,TrainingPipeline> createTrainingPipelineCallable()
Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.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 (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(); }
-
getTrainingPipeline
public final TrainingPipeline getTrainingPipeline(TrainingPipelineName name)
Gets a TrainingPipeline.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]"); TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name); }
- Parameters:
name
- Required. The name of the TrainingPipeline resource. Format: `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTrainingPipeline
public final TrainingPipeline getTrainingPipeline(String name)
Gets a TrainingPipeline.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString(); TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name); }
- Parameters:
name
- Required. The name of the TrainingPipeline resource. Format: `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTrainingPipeline
public final TrainingPipeline getTrainingPipeline(GetTrainingPipelineRequest request)
Gets a TrainingPipeline.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { GetTrainingPipelineRequest request = GetTrainingPipelineRequest.newBuilder() .setName( TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]") .toString()) .build(); TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getTrainingPipelineCallable
public final com.google.api.gax.rpc.UnaryCallable<GetTrainingPipelineRequest,TrainingPipeline> getTrainingPipelineCallable()
Gets a TrainingPipeline.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 (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(); }
-
listTrainingPipelines
public final PipelineServiceClient.ListTrainingPipelinesPagedResponse listTrainingPipelines(LocationName parent)
Lists TrainingPipelines in a Location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (TrainingPipeline element : pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The resource name of the Location to list the TrainingPipelines from. Format: `projects/{project}/locations/{location}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTrainingPipelines
public final PipelineServiceClient.ListTrainingPipelinesPagedResponse listTrainingPipelines(String parent)
Lists TrainingPipelines in a Location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (TrainingPipeline element : pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The resource name of the Location to list the TrainingPipelines from. Format: `projects/{project}/locations/{location}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTrainingPipelines
public final PipelineServiceClient.ListTrainingPipelinesPagedResponse listTrainingPipelines(ListTrainingPipelinesRequest request)
Lists TrainingPipelines in a Location.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 (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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listTrainingPipelinesPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListTrainingPipelinesRequest,PipelineServiceClient.ListTrainingPipelinesPagedResponse> listTrainingPipelinesPagedCallable()
Lists TrainingPipelines in a Location.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 (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); } }
-
listTrainingPipelinesCallable
public final com.google.api.gax.rpc.UnaryCallable<ListTrainingPipelinesRequest,ListTrainingPipelinesResponse> listTrainingPipelinesCallable()
Lists TrainingPipelines in a Location.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 (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.getTrainingPipelinesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
deleteTrainingPipelineAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteTrainingPipelineAsync(TrainingPipelineName name)
Deletes a TrainingPipeline.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]"); pipelineServiceClient.deleteTrainingPipelineAsync(name).get(); }
- Parameters:
name
- Required. The name of the TrainingPipeline resource to be deleted. Format: `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteTrainingPipelineAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteTrainingPipelineAsync(String name)
Deletes a TrainingPipeline.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString(); pipelineServiceClient.deleteTrainingPipelineAsync(name).get(); }
- Parameters:
name
- Required. The name of the TrainingPipeline resource to be deleted. Format: `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteTrainingPipelineAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteTrainingPipelineAsync(DeleteTrainingPipelineRequest request)
Deletes a TrainingPipeline.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { DeleteTrainingPipelineRequest request = DeleteTrainingPipelineRequest.newBuilder() .setName( TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]") .toString()) .build(); pipelineServiceClient.deleteTrainingPipelineAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteTrainingPipelineOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteTrainingPipelineRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteTrainingPipelineOperationCallable()
Deletes a TrainingPipeline.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 (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(); }
-
deleteTrainingPipelineCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteTrainingPipelineRequest,com.google.longrunning.Operation> deleteTrainingPipelineCallable()
Deletes a TrainingPipeline.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 (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(); }
-
cancelTrainingPipeline
public final void cancelTrainingPipeline(TrainingPipelineName name)
Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline] or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead it becomes a pipeline with a [TrainingPipeline.error][google.cloud.aiplatform.v1beta1.TrainingPipeline.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [TrainingPipeline.state][google.cloud.aiplatform.v1beta1.TrainingPipeline.state] is set to `CANCELLED`.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { TrainingPipelineName name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]"); pipelineServiceClient.cancelTrainingPipeline(name); }
- Parameters:
name
- Required. The name of the TrainingPipeline to cancel. Format: `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
cancelTrainingPipeline
public final void cancelTrainingPipeline(String name)
Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline] or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead it becomes a pipeline with a [TrainingPipeline.error][google.cloud.aiplatform.v1beta1.TrainingPipeline.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [TrainingPipeline.state][google.cloud.aiplatform.v1beta1.TrainingPipeline.state] is set to `CANCELLED`.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String name = TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString(); pipelineServiceClient.cancelTrainingPipeline(name); }
- Parameters:
name
- Required. The name of the TrainingPipeline to cancel. Format: `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
cancelTrainingPipeline
public final void cancelTrainingPipeline(CancelTrainingPipelineRequest request)
Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline] or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead it becomes a pipeline with a [TrainingPipeline.error][google.cloud.aiplatform.v1beta1.TrainingPipeline.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [TrainingPipeline.state][google.cloud.aiplatform.v1beta1.TrainingPipeline.state] is set to `CANCELLED`.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { CancelTrainingPipelineRequest request = CancelTrainingPipelineRequest.newBuilder() .setName( TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]") .toString()) .build(); pipelineServiceClient.cancelTrainingPipeline(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
cancelTrainingPipelineCallable
public final com.google.api.gax.rpc.UnaryCallable<CancelTrainingPipelineRequest,com.google.protobuf.Empty> cancelTrainingPipelineCallable()
Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1beta1.PipelineService.GetTrainingPipeline] or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead it becomes a pipeline with a [TrainingPipeline.error][google.cloud.aiplatform.v1beta1.TrainingPipeline.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [TrainingPipeline.state][google.cloud.aiplatform.v1beta1.TrainingPipeline.state] is set to `CANCELLED`.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 (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(); }
-
createPipelineJob
public final PipelineJob createPipelineJob(LocationName parent, PipelineJob pipelineJob, String pipelineJobId)
Creates a PipelineJob. A PipelineJob will run immediately when created.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); PipelineJob pipelineJob = PipelineJob.newBuilder().build(); String pipelineJobId = "pipelineJobId-1711315914"; PipelineJob response = pipelineServiceClient.createPipelineJob(parent, pipelineJob, pipelineJobId); }
- Parameters:
parent
- Required. The resource name of the Location to create the PipelineJob in. Format: `projects/{project}/locations/{location}`pipelineJob
- Required. The PipelineJob to create.pipelineJobId
- The ID to use for the PipelineJob, which will become the final component of the PipelineJob name. If not provided, an ID will be automatically generated.This value should be less than 128 characters, and valid characters are /[a-z][0-9]-/.
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createPipelineJob
public final PipelineJob createPipelineJob(String parent, PipelineJob pipelineJob, String pipelineJobId)
Creates a PipelineJob. A PipelineJob will run immediately when created.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); PipelineJob pipelineJob = PipelineJob.newBuilder().build(); String pipelineJobId = "pipelineJobId-1711315914"; PipelineJob response = pipelineServiceClient.createPipelineJob(parent, pipelineJob, pipelineJobId); }
- Parameters:
parent
- Required. The resource name of the Location to create the PipelineJob in. Format: `projects/{project}/locations/{location}`pipelineJob
- Required. The PipelineJob to create.pipelineJobId
- The ID to use for the PipelineJob, which will become the final component of the PipelineJob name. If not provided, an ID will be automatically generated.This value should be less than 128 characters, and valid characters are /[a-z][0-9]-/.
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createPipelineJob
public final PipelineJob createPipelineJob(CreatePipelineJobRequest request)
Creates a PipelineJob. A PipelineJob will run immediately when created.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { CreatePipelineJobRequest request = CreatePipelineJobRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPipelineJob(PipelineJob.newBuilder().build()) .setPipelineJobId("pipelineJobId-1711315914") .build(); PipelineJob response = pipelineServiceClient.createPipelineJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createPipelineJobCallable
public final com.google.api.gax.rpc.UnaryCallable<CreatePipelineJobRequest,PipelineJob> createPipelineJobCallable()
Creates a PipelineJob. A PipelineJob will run immediately when created.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { CreatePipelineJobRequest request = CreatePipelineJobRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPipelineJob(PipelineJob.newBuilder().build()) .setPipelineJobId("pipelineJobId-1711315914") .build(); ApiFuture<PipelineJob> future = pipelineServiceClient.createPipelineJobCallable().futureCall(request); // Do something. PipelineJob response = future.get(); }
-
getPipelineJob
public final PipelineJob getPipelineJob(PipelineJobName name)
Gets a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { PipelineJobName name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]"); PipelineJob response = pipelineServiceClient.getPipelineJob(name); }
- Parameters:
name
- Required. The name of the PipelineJob resource. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getPipelineJob
public final PipelineJob getPipelineJob(String name)
Gets a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString(); PipelineJob response = pipelineServiceClient.getPipelineJob(name); }
- Parameters:
name
- Required. The name of the PipelineJob resource. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getPipelineJob
public final PipelineJob getPipelineJob(GetPipelineJobRequest request)
Gets a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { GetPipelineJobRequest request = GetPipelineJobRequest.newBuilder() .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString()) .build(); PipelineJob response = pipelineServiceClient.getPipelineJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getPipelineJobCallable
public final com.google.api.gax.rpc.UnaryCallable<GetPipelineJobRequest,PipelineJob> getPipelineJobCallable()
Gets a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { GetPipelineJobRequest request = GetPipelineJobRequest.newBuilder() .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString()) .build(); ApiFuture<PipelineJob> future = pipelineServiceClient.getPipelineJobCallable().futureCall(request); // Do something. PipelineJob response = future.get(); }
-
listPipelineJobs
public final PipelineServiceClient.ListPipelineJobsPagedResponse listPipelineJobs(LocationName parent)
Lists PipelineJobs in a Location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (PipelineJob element : pipelineServiceClient.listPipelineJobs(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The resource name of the Location to list the PipelineJobs from. Format: `projects/{project}/locations/{location}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPipelineJobs
public final PipelineServiceClient.ListPipelineJobsPagedResponse listPipelineJobs(String parent)
Lists PipelineJobs in a Location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (PipelineJob element : pipelineServiceClient.listPipelineJobs(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The resource name of the Location to list the PipelineJobs from. Format: `projects/{project}/locations/{location}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPipelineJobs
public final PipelineServiceClient.ListPipelineJobsPagedResponse listPipelineJobs(ListPipelineJobsRequest request)
Lists PipelineJobs in a Location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { ListPipelineJobsRequest request = ListPipelineJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setReadMask(FieldMask.newBuilder().build()) .build(); for (PipelineJob element : pipelineServiceClient.listPipelineJobs(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPipelineJobsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListPipelineJobsRequest,PipelineServiceClient.ListPipelineJobsPagedResponse> listPipelineJobsPagedCallable()
Lists PipelineJobs in a Location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { ListPipelineJobsRequest request = ListPipelineJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setReadMask(FieldMask.newBuilder().build()) .build(); ApiFuture<PipelineJob> future = pipelineServiceClient.listPipelineJobsPagedCallable().futureCall(request); // Do something. for (PipelineJob element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listPipelineJobsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListPipelineJobsRequest,ListPipelineJobsResponse> listPipelineJobsCallable()
Lists PipelineJobs in a Location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { ListPipelineJobsRequest request = ListPipelineJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .setOrderBy("orderBy-1207110587") .setReadMask(FieldMask.newBuilder().build()) .build(); while (true) { ListPipelineJobsResponse response = pipelineServiceClient.listPipelineJobsCallable().call(request); for (PipelineJob element : response.getPipelineJobsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
deletePipelineJobAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deletePipelineJobAsync(PipelineJobName name)
Deletes a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { PipelineJobName name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]"); pipelineServiceClient.deletePipelineJobAsync(name).get(); }
- Parameters:
name
- Required. The name of the PipelineJob resource to be deleted. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deletePipelineJobAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deletePipelineJobAsync(String name)
Deletes a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString(); pipelineServiceClient.deletePipelineJobAsync(name).get(); }
- Parameters:
name
- Required. The name of the PipelineJob resource to be deleted. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deletePipelineJobAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deletePipelineJobAsync(DeletePipelineJobRequest request)
Deletes a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { DeletePipelineJobRequest request = DeletePipelineJobRequest.newBuilder() .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString()) .build(); pipelineServiceClient.deletePipelineJobAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deletePipelineJobOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeletePipelineJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deletePipelineJobOperationCallable()
Deletes a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { DeletePipelineJobRequest request = DeletePipelineJobRequest.newBuilder() .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString()) .build(); OperationFuture<Empty, DeleteOperationMetadata> future = pipelineServiceClient.deletePipelineJobOperationCallable().futureCall(request); // Do something. future.get(); }
-
deletePipelineJobCallable
public final com.google.api.gax.rpc.UnaryCallable<DeletePipelineJobRequest,com.google.longrunning.Operation> deletePipelineJobCallable()
Deletes a PipelineJob.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { DeletePipelineJobRequest request = DeletePipelineJobRequest.newBuilder() .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString()) .build(); ApiFuture<Operation> future = pipelineServiceClient.deletePipelineJobCallable().futureCall(request); // Do something. future.get(); }
-
cancelPipelineJob
public final void cancelPipelineJob(PipelineJobName name)
Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob] or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the PipelineJob is not deleted; instead it becomes a pipeline with a [PipelineJob.error][google.cloud.aiplatform.v1beta1.PipelineJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1beta1.PipelineJob.state] is set to `CANCELLED`.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { PipelineJobName name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]"); pipelineServiceClient.cancelPipelineJob(name); }
- Parameters:
name
- Required. The name of the PipelineJob to cancel. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
cancelPipelineJob
public final void cancelPipelineJob(String name)
Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob] or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the PipelineJob is not deleted; instead it becomes a pipeline with a [PipelineJob.error][google.cloud.aiplatform.v1beta1.PipelineJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1beta1.PipelineJob.state] is set to `CANCELLED`.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { String name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString(); pipelineServiceClient.cancelPipelineJob(name); }
- Parameters:
name
- Required. The name of the PipelineJob to cancel. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
cancelPipelineJob
public final void cancelPipelineJob(CancelPipelineJobRequest request)
Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob] or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the PipelineJob is not deleted; instead it becomes a pipeline with a [PipelineJob.error][google.cloud.aiplatform.v1beta1.PipelineJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1beta1.PipelineJob.state] is set to `CANCELLED`.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { CancelPipelineJobRequest request = CancelPipelineJobRequest.newBuilder() .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString()) .build(); pipelineServiceClient.cancelPipelineJob(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
cancelPipelineJobCallable
public final com.google.api.gax.rpc.UnaryCallable<CancelPipelineJobRequest,com.google.protobuf.Empty> cancelPipelineJobCallable()
Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can use [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.GetPipelineJob] or other methods to check whether the cancellation succeeded or whether the pipeline completed despite cancellation. On successful cancellation, the PipelineJob is not deleted; instead it becomes a pipeline with a [PipelineJob.error][google.cloud.aiplatform.v1beta1.PipelineJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1beta1.PipelineJob.state] is set to `CANCELLED`.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { CancelPipelineJobRequest request = CancelPipelineJobRequest.newBuilder() .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString()) .build(); ApiFuture<Empty> future = pipelineServiceClient.cancelPipelineJobCallable().futureCall(request); // Do something. future.get(); }
-
listLocations
public final PipelineServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : pipelineServiceClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLocationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,PipelineServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Lists information about the supported locations for this service.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = pipelineServiceClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listLocationsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = pipelineServiceClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getLocation
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = pipelineServiceClient.getLocation(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLocationCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Gets information about a location.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = pipelineServiceClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); }
-
setIamPolicy
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = pipelineServiceClient.setIamPolicy(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = pipelineServiceClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); }
-
getIamPolicy
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = pipelineServiceClient.getIamPolicy(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = pipelineServiceClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); }
-
testIamPermissions
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = pipelineServiceClient.testIamPermissions(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
testIamPermissionsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( EndpointName.ofProjectLocationEndpointName( "[PROJECT]", "[LOCATION]", "[ENDPOINT]") .toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = pipelineServiceClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-