- 3.54.0 (latest)
- 3.53.0
- 3.52.0
- 3.50.0
- 3.49.0
- 3.48.0
- 3.47.0
- 3.46.0
- 3.45.0
- 3.44.0
- 3.43.0
- 3.42.0
- 3.41.0
- 3.40.0
- 3.38.0
- 3.37.0
- 3.36.0
- 3.35.0
- 3.34.0
- 3.33.0
- 3.32.0
- 3.31.0
- 3.30.0
- 3.29.0
- 3.28.0
- 3.25.0
- 3.24.0
- 3.23.0
- 3.22.0
- 3.21.0
- 3.20.0
- 3.19.0
- 3.18.0
- 3.17.0
- 3.16.0
- 3.15.0
- 3.14.0
- 3.13.0
- 3.12.0
- 3.11.0
- 3.10.0
- 3.9.0
- 3.8.0
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.2
- 3.3.0
- 3.2.0
- 3.0.0
- 2.9.8
- 2.8.9
- 2.7.4
- 2.5.3
- 2.4.0
public class VizierServiceClient implements BackgroundResource
Service Description: Vertex AI Vizier API.
Vertex AI Vizier is a service to solve blackbox optimization problems, such as tuning machine learning hyperparameters and searching over deep learning architectures.
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 (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Study study = Study.newBuilder().build();
Study response = vizierServiceClient.createStudy(parent, study);
}
Note: close() needs to be called on the VizierServiceClient 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 VizierServiceSettings to create(). For example:
To customize credentials:
VizierServiceSettings vizierServiceSettings =
VizierServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
VizierServiceClient vizierServiceClient = VizierServiceClient.create(vizierServiceSettings);
To customize the endpoint:
VizierServiceSettings vizierServiceSettings =
VizierServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
VizierServiceClient vizierServiceClient = VizierServiceClient.create(vizierServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceConstructors
VizierServiceClient(VizierServiceSettings settings)
protected VizierServiceClient(VizierServiceSettings settings)
Constructs an instance of VizierServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Name | Description |
settings | VizierServiceSettings |
VizierServiceClient(VizierServiceStub stub)
protected VizierServiceClient(VizierServiceStub stub)
Name | Description |
stub | VizierServiceStub |
Methods
addTrialMeasurement(AddTrialMeasurementRequest request)
public final Trial addTrialMeasurement(AddTrialMeasurementRequest request)
Adds a measurement of the objective metrics to a Trial. This measurement is assumed to have been taken before the Trial is complete.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
AddTrialMeasurementRequest request =
AddTrialMeasurementRequest.newBuilder()
.setTrialName(
TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.setMeasurement(Measurement.newBuilder().build())
.build();
Trial response = vizierServiceClient.addTrialMeasurement(request);
}
Name | Description |
request | AddTrialMeasurementRequest The request object containing all of the parameters for the API call. |
Type | Description |
Trial |
addTrialMeasurementCallable()
public final UnaryCallable<AddTrialMeasurementRequest,Trial> addTrialMeasurementCallable()
Adds a measurement of the objective metrics to a Trial. This measurement is assumed to have been taken before the Trial is complete.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
AddTrialMeasurementRequest request =
AddTrialMeasurementRequest.newBuilder()
.setTrialName(
TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.setMeasurement(Measurement.newBuilder().build())
.build();
ApiFuture<Trial> future =
vizierServiceClient.addTrialMeasurementCallable().futureCall(request);
// Do something.
Trial response = future.get();
}
Type | Description |
UnaryCallable<AddTrialMeasurementRequest,Trial> |
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
checkTrialEarlyStoppingStateAsync(CheckTrialEarlyStoppingStateRequest request)
public final OperationFuture<CheckTrialEarlyStoppingStateResponse,CheckTrialEarlyStoppingStateMetatdata> checkTrialEarlyStoppingStateAsync(CheckTrialEarlyStoppingStateRequest request)
Checks whether a Trial should stop or not. Returns a long-running operation. When the operation is successful, it will contain a CheckTrialEarlyStoppingStateResponse.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CheckTrialEarlyStoppingStateRequest request =
CheckTrialEarlyStoppingStateRequest.newBuilder()
.setTrialName(
TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
CheckTrialEarlyStoppingStateResponse response =
vizierServiceClient.checkTrialEarlyStoppingStateAsync(request).get();
}
Name | Description |
request | CheckTrialEarlyStoppingStateRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<CheckTrialEarlyStoppingStateResponse,CheckTrialEarlyStoppingStateMetatdata> |
checkTrialEarlyStoppingStateCallable()
public final UnaryCallable<CheckTrialEarlyStoppingStateRequest,Operation> checkTrialEarlyStoppingStateCallable()
Checks whether a Trial should stop or not. Returns a long-running operation. When the operation is successful, it will contain a CheckTrialEarlyStoppingStateResponse.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CheckTrialEarlyStoppingStateRequest request =
CheckTrialEarlyStoppingStateRequest.newBuilder()
.setTrialName(
TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
ApiFuture<Operation> future =
vizierServiceClient.checkTrialEarlyStoppingStateCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<CheckTrialEarlyStoppingStateRequest,Operation> |
checkTrialEarlyStoppingStateOperationCallable()
public final OperationCallable<CheckTrialEarlyStoppingStateRequest,CheckTrialEarlyStoppingStateResponse,CheckTrialEarlyStoppingStateMetatdata> checkTrialEarlyStoppingStateOperationCallable()
Checks whether a Trial should stop or not. Returns a long-running operation. When the operation is successful, it will contain a CheckTrialEarlyStoppingStateResponse.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CheckTrialEarlyStoppingStateRequest request =
CheckTrialEarlyStoppingStateRequest.newBuilder()
.setTrialName(
TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
OperationFuture
Type | Description |
OperationCallable<CheckTrialEarlyStoppingStateRequest,CheckTrialEarlyStoppingStateResponse,CheckTrialEarlyStoppingStateMetatdata> |
close()
public final void close()
completeTrial(CompleteTrialRequest request)
public final Trial completeTrial(CompleteTrialRequest request)
Marks a Trial as complete.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CompleteTrialRequest request =
CompleteTrialRequest.newBuilder()
.setName(TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.setFinalMeasurement(Measurement.newBuilder().build())
.setTrialInfeasible(true)
.setInfeasibleReason("infeasibleReason1040725388")
.build();
Trial response = vizierServiceClient.completeTrial(request);
}
Name | Description |
request | CompleteTrialRequest The request object containing all of the parameters for the API call. |
Type | Description |
Trial |
completeTrialCallable()
public final UnaryCallable<CompleteTrialRequest,Trial> completeTrialCallable()
Marks a Trial as complete.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CompleteTrialRequest request =
CompleteTrialRequest.newBuilder()
.setName(TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.setFinalMeasurement(Measurement.newBuilder().build())
.setTrialInfeasible(true)
.setInfeasibleReason("infeasibleReason1040725388")
.build();
ApiFuture<Trial> future = vizierServiceClient.completeTrialCallable().futureCall(request);
// Do something.
Trial response = future.get();
}
Type | Description |
UnaryCallable<CompleteTrialRequest,Trial> |
create()
public static final VizierServiceClient create()
Constructs an instance of VizierServiceClient with default settings.
Type | Description |
VizierServiceClient |
Type | Description |
IOException |
create(VizierServiceSettings settings)
public static final VizierServiceClient create(VizierServiceSettings settings)
Constructs an instance of VizierServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | VizierServiceSettings |
Type | Description |
VizierServiceClient |
Type | Description |
IOException |
create(VizierServiceStub stub)
public static final VizierServiceClient create(VizierServiceStub stub)
Constructs an instance of VizierServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(VizierServiceSettings).
Name | Description |
stub | VizierServiceStub |
Type | Description |
VizierServiceClient |
createStudy(CreateStudyRequest request)
public final Study createStudy(CreateStudyRequest request)
Creates a Study. A resource name will be generated after creation of the Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CreateStudyRequest request =
CreateStudyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setStudy(Study.newBuilder().build())
.build();
Study response = vizierServiceClient.createStudy(request);
}
Name | Description |
request | CreateStudyRequest The request object containing all of the parameters for the API call. |
Type | Description |
Study |
createStudy(LocationName parent, Study study)
public final Study createStudy(LocationName parent, Study study)
Creates a Study. A resource name will be generated after creation of the Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Study study = Study.newBuilder().build();
Study response = vizierServiceClient.createStudy(parent, study);
}
Name | Description |
parent | LocationName Required. The resource name of the Location to create the CustomJob in. Format:
|
study | Study Required. The Study configuration used to create the Study. |
Type | Description |
Study |
createStudy(String parent, Study study)
public final Study createStudy(String parent, Study study)
Creates a Study. A resource name will be generated after creation of the Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Study study = Study.newBuilder().build();
Study response = vizierServiceClient.createStudy(parent, study);
}
Name | Description |
parent | String Required. The resource name of the Location to create the CustomJob in. Format:
|
study | Study Required. The Study configuration used to create the Study. |
Type | Description |
Study |
createStudyCallable()
public final UnaryCallable<CreateStudyRequest,Study> createStudyCallable()
Creates a Study. A resource name will be generated after creation of the Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CreateStudyRequest request =
CreateStudyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setStudy(Study.newBuilder().build())
.build();
ApiFuture<Study> future = vizierServiceClient.createStudyCallable().futureCall(request);
// Do something.
Study response = future.get();
}
Type | Description |
UnaryCallable<CreateStudyRequest,Study> |
createTrial(CreateTrialRequest request)
public final Trial createTrial(CreateTrialRequest request)
Adds a user provided Trial to a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CreateTrialRequest request =
CreateTrialRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.setTrial(Trial.newBuilder().build())
.build();
Trial response = vizierServiceClient.createTrial(request);
}
Name | Description |
request | CreateTrialRequest The request object containing all of the parameters for the API call. |
Type | Description |
Trial |
createTrial(StudyName parent, Trial trial)
public final Trial createTrial(StudyName parent, Trial trial)
Adds a user provided Trial to a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
StudyName parent = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]");
Trial trial = Trial.newBuilder().build();
Trial response = vizierServiceClient.createTrial(parent, trial);
}
Name | Description |
parent | StudyName Required. The resource name of the Study to create the Trial in. Format:
|
trial | Trial Required. The Trial to create. |
Type | Description |
Trial |
createTrial(String parent, Trial trial)
public final Trial createTrial(String parent, Trial trial)
Adds a user provided Trial to a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String parent = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString();
Trial trial = Trial.newBuilder().build();
Trial response = vizierServiceClient.createTrial(parent, trial);
}
Name | Description |
parent | String Required. The resource name of the Study to create the Trial in. Format:
|
trial | Trial Required. The Trial to create. |
Type | Description |
Trial |
createTrialCallable()
public final UnaryCallable<CreateTrialRequest,Trial> createTrialCallable()
Adds a user provided Trial to a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
CreateTrialRequest request =
CreateTrialRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.setTrial(Trial.newBuilder().build())
.build();
ApiFuture<Trial> future = vizierServiceClient.createTrialCallable().futureCall(request);
// Do something.
Trial response = future.get();
}
Type | Description |
UnaryCallable<CreateTrialRequest,Trial> |
deleteStudy(DeleteStudyRequest request)
public final void deleteStudy(DeleteStudyRequest request)
Deletes a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
DeleteStudyRequest request =
DeleteStudyRequest.newBuilder()
.setName(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.build();
vizierServiceClient.deleteStudy(request);
}
Name | Description |
request | DeleteStudyRequest The request object containing all of the parameters for the API call. |
deleteStudy(StudyName name)
public final void deleteStudy(StudyName name)
Deletes a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
StudyName name = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]");
vizierServiceClient.deleteStudy(name);
}
Name | Description |
name | StudyName Required. The name of the Study resource to be deleted. Format:
|
deleteStudy(String name)
public final void deleteStudy(String name)
Deletes a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String name = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString();
vizierServiceClient.deleteStudy(name);
}
Name | Description |
name | String Required. The name of the Study resource to be deleted. Format:
|
deleteStudyCallable()
public final UnaryCallable<DeleteStudyRequest,Empty> deleteStudyCallable()
Deletes a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
DeleteStudyRequest request =
DeleteStudyRequest.newBuilder()
.setName(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.build();
ApiFuture<Empty> future = vizierServiceClient.deleteStudyCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteStudyRequest,Empty> |
deleteTrial(DeleteTrialRequest request)
public final void deleteTrial(DeleteTrialRequest request)
Deletes a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
DeleteTrialRequest request =
DeleteTrialRequest.newBuilder()
.setName(TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
vizierServiceClient.deleteTrial(request);
}
Name | Description |
request | DeleteTrialRequest The request object containing all of the parameters for the API call. |
deleteTrial(TrialName name)
public final void deleteTrial(TrialName name)
Deletes a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
TrialName name = TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]");
vizierServiceClient.deleteTrial(name);
}
Name | Description |
name | TrialName Required. The Trial's name. Format:
|
deleteTrial(String name)
public final void deleteTrial(String name)
Deletes a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String name = TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString();
vizierServiceClient.deleteTrial(name);
}
Name | Description |
name | String Required. The Trial's name. Format:
|
deleteTrialCallable()
public final UnaryCallable<DeleteTrialRequest,Empty> deleteTrialCallable()
Deletes a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
DeleteTrialRequest request =
DeleteTrialRequest.newBuilder()
.setName(TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
ApiFuture<Empty> future = vizierServiceClient.deleteTrialCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteTrialRequest,Empty> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Type | Description |
OperationsClient |
getSettings()
public final VizierServiceSettings getSettings()
Type | Description |
VizierServiceSettings |
getStub()
public VizierServiceStub getStub()
Type | Description |
VizierServiceStub |
getStudy(GetStudyRequest request)
public final Study getStudy(GetStudyRequest request)
Gets a Study by name.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
GetStudyRequest request =
GetStudyRequest.newBuilder()
.setName(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.build();
Study response = vizierServiceClient.getStudy(request);
}
Name | Description |
request | GetStudyRequest The request object containing all of the parameters for the API call. |
Type | Description |
Study |
getStudy(StudyName name)
public final Study getStudy(StudyName name)
Gets a Study by name.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
StudyName name = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]");
Study response = vizierServiceClient.getStudy(name);
}
Name | Description |
name | StudyName Required. The name of the Study resource. Format:
|
Type | Description |
Study |
getStudy(String name)
public final Study getStudy(String name)
Gets a Study by name.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String name = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString();
Study response = vizierServiceClient.getStudy(name);
}
Name | Description |
name | String Required. The name of the Study resource. Format:
|
Type | Description |
Study |
getStudyCallable()
public final UnaryCallable<GetStudyRequest,Study> getStudyCallable()
Gets a Study by name.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
GetStudyRequest request =
GetStudyRequest.newBuilder()
.setName(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.build();
ApiFuture<Study> future = vizierServiceClient.getStudyCallable().futureCall(request);
// Do something.
Study response = future.get();
}
Type | Description |
UnaryCallable<GetStudyRequest,Study> |
getTrial(GetTrialRequest request)
public final Trial getTrial(GetTrialRequest request)
Gets a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
GetTrialRequest request =
GetTrialRequest.newBuilder()
.setName(TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
Trial response = vizierServiceClient.getTrial(request);
}
Name | Description |
request | GetTrialRequest The request object containing all of the parameters for the API call. |
Type | Description |
Trial |
getTrial(TrialName name)
public final Trial getTrial(TrialName name)
Gets a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
TrialName name = TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]");
Trial response = vizierServiceClient.getTrial(name);
}
Name | Description |
name | TrialName Required. The name of the Trial resource. Format:
|
Type | Description |
Trial |
getTrial(String name)
public final Trial getTrial(String name)
Gets a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String name = TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString();
Trial response = vizierServiceClient.getTrial(name);
}
Name | Description |
name | String Required. The name of the Trial resource. Format:
|
Type | Description |
Trial |
getTrialCallable()
public final UnaryCallable<GetTrialRequest,Trial> getTrialCallable()
Gets a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
GetTrialRequest request =
GetTrialRequest.newBuilder()
.setName(TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
ApiFuture<Trial> future = vizierServiceClient.getTrialCallable().futureCall(request);
// Do something.
Trial response = future.get();
}
Type | Description |
UnaryCallable<GetTrialRequest,Trial> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listOptimalTrials(ListOptimalTrialsRequest request)
public final ListOptimalTrialsResponse listOptimalTrials(ListOptimalTrialsRequest request)
Lists the pareto-optimal Trials for multi-objective Study or the optimal Trials for single-objective Study. The definition of pareto-optimal can be checked in wiki page. https://en.wikipedia.org/wiki/Pareto_efficiency
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
ListOptimalTrialsRequest request =
ListOptimalTrialsRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.build();
ListOptimalTrialsResponse response = vizierServiceClient.listOptimalTrials(request);
}
Name | Description |
request | ListOptimalTrialsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ListOptimalTrialsResponse |
listOptimalTrials(StudyName parent)
public final ListOptimalTrialsResponse listOptimalTrials(StudyName parent)
Lists the pareto-optimal Trials for multi-objective Study or the optimal Trials for single-objective Study. The definition of pareto-optimal can be checked in wiki page. https://en.wikipedia.org/wiki/Pareto_efficiency
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
StudyName parent = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]");
ListOptimalTrialsResponse response = vizierServiceClient.listOptimalTrials(parent);
}
Name | Description |
parent | StudyName Required. The name of the Study that the optimal Trial belongs to. |
Type | Description |
ListOptimalTrialsResponse |
listOptimalTrials(String parent)
public final ListOptimalTrialsResponse listOptimalTrials(String parent)
Lists the pareto-optimal Trials for multi-objective Study or the optimal Trials for single-objective Study. The definition of pareto-optimal can be checked in wiki page. https://en.wikipedia.org/wiki/Pareto_efficiency
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String parent = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString();
ListOptimalTrialsResponse response = vizierServiceClient.listOptimalTrials(parent);
}
Name | Description |
parent | String Required. The name of the Study that the optimal Trial belongs to. |
Type | Description |
ListOptimalTrialsResponse |
listOptimalTrialsCallable()
public final UnaryCallable<ListOptimalTrialsRequest,ListOptimalTrialsResponse> listOptimalTrialsCallable()
Lists the pareto-optimal Trials for multi-objective Study or the optimal Trials for single-objective Study. The definition of pareto-optimal can be checked in wiki page. https://en.wikipedia.org/wiki/Pareto_efficiency
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
ListOptimalTrialsRequest request =
ListOptimalTrialsRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.build();
ApiFuture
Type | Description |
UnaryCallable<ListOptimalTrialsRequest,ListOptimalTrialsResponse> |
listStudies(ListStudiesRequest request)
public final VizierServiceClient.ListStudiesPagedResponse listStudies(ListStudiesRequest request)
Lists all the studies in a region for an associated project.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
ListStudiesRequest request =
ListStudiesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (Study element : vizierServiceClient.listStudies(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListStudiesRequest The request object containing all of the parameters for the API call. |
Type | Description |
VizierServiceClient.ListStudiesPagedResponse |
listStudies(LocationName parent)
public final VizierServiceClient.ListStudiesPagedResponse listStudies(LocationName parent)
Lists all the studies in a region for an associated project.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Study element : vizierServiceClient.listStudies(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | LocationName Required. The resource name of the Location to list the Study from. Format:
|
Type | Description |
VizierServiceClient.ListStudiesPagedResponse |
listStudies(String parent)
public final VizierServiceClient.ListStudiesPagedResponse listStudies(String parent)
Lists all the studies in a region for an associated project.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Study element : vizierServiceClient.listStudies(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The resource name of the Location to list the Study from. Format:
|
Type | Description |
VizierServiceClient.ListStudiesPagedResponse |
listStudiesCallable()
public final UnaryCallable<ListStudiesRequest,ListStudiesResponse> listStudiesCallable()
Lists all the studies in a region for an associated project.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
ListStudiesRequest request =
ListStudiesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListStudiesResponse response = vizierServiceClient.listStudiesCallable().call(request);
for (Study element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListStudiesRequest,ListStudiesResponse> |
listStudiesPagedCallable()
public final UnaryCallable<ListStudiesRequest,VizierServiceClient.ListStudiesPagedResponse> listStudiesPagedCallable()
Lists all the studies in a region for an associated project.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
ListStudiesRequest request =
ListStudiesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<Study> future = vizierServiceClient.listStudiesPagedCallable().futureCall(request);
// Do something.
for (Study element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListStudiesRequest,ListStudiesPagedResponse> |
listTrials(ListTrialsRequest request)
public final VizierServiceClient.ListTrialsPagedResponse listTrials(ListTrialsRequest request)
Lists the Trials associated with a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
ListTrialsRequest request =
ListTrialsRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (Trial element : vizierServiceClient.listTrials(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListTrialsRequest The request object containing all of the parameters for the API call. |
Type | Description |
VizierServiceClient.ListTrialsPagedResponse |
listTrials(StudyName parent)
public final VizierServiceClient.ListTrialsPagedResponse listTrials(StudyName parent)
Lists the Trials associated with a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
StudyName parent = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]");
for (Trial element : vizierServiceClient.listTrials(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | StudyName Required. The resource name of the Study to list the Trial from. Format:
|
Type | Description |
VizierServiceClient.ListTrialsPagedResponse |
listTrials(String parent)
public final VizierServiceClient.ListTrialsPagedResponse listTrials(String parent)
Lists the Trials associated with a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String parent = StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString();
for (Trial element : vizierServiceClient.listTrials(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The resource name of the Study to list the Trial from. Format:
|
Type | Description |
VizierServiceClient.ListTrialsPagedResponse |
listTrialsCallable()
public final UnaryCallable<ListTrialsRequest,ListTrialsResponse> listTrialsCallable()
Lists the Trials associated with a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
ListTrialsRequest request =
ListTrialsRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListTrialsResponse response = vizierServiceClient.listTrialsCallable().call(request);
for (Trial element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListTrialsRequest,ListTrialsResponse> |
listTrialsPagedCallable()
public final UnaryCallable<ListTrialsRequest,VizierServiceClient.ListTrialsPagedResponse> listTrialsPagedCallable()
Lists the Trials associated with a Study.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
ListTrialsRequest request =
ListTrialsRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<Trial> future = vizierServiceClient.listTrialsPagedCallable().futureCall(request);
// Do something.
for (Trial element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListTrialsRequest,ListTrialsPagedResponse> |
lookupStudy(LocationName parent)
public final Study lookupStudy(LocationName parent)
Looks a study up using the user-defined display_name field instead of the fully qualified resource name.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Study response = vizierServiceClient.lookupStudy(parent);
}
Name | Description |
parent | LocationName Required. The resource name of the Location to get the Study from. Format:
|
Type | Description |
Study |
lookupStudy(LookupStudyRequest request)
public final Study lookupStudy(LookupStudyRequest request)
Looks a study up using the user-defined display_name field instead of the fully qualified resource name.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
LookupStudyRequest request =
LookupStudyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDisplayName("displayName1714148973")
.build();
Study response = vizierServiceClient.lookupStudy(request);
}
Name | Description |
request | LookupStudyRequest The request object containing all of the parameters for the API call. |
Type | Description |
Study |
lookupStudy(String parent)
public final Study lookupStudy(String parent)
Looks a study up using the user-defined display_name field instead of the fully qualified resource name.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Study response = vizierServiceClient.lookupStudy(parent);
}
Name | Description |
parent | String Required. The resource name of the Location to get the Study from. Format:
|
Type | Description |
Study |
lookupStudyCallable()
public final UnaryCallable<LookupStudyRequest,Study> lookupStudyCallable()
Looks a study up using the user-defined display_name field instead of the fully qualified resource name.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
LookupStudyRequest request =
LookupStudyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDisplayName("displayName1714148973")
.build();
ApiFuture<Study> future = vizierServiceClient.lookupStudyCallable().futureCall(request);
// Do something.
Study response = future.get();
}
Type | Description |
UnaryCallable<LookupStudyRequest,Study> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
stopTrial(StopTrialRequest request)
public final Trial stopTrial(StopTrialRequest request)
Stops a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
StopTrialRequest request =
StopTrialRequest.newBuilder()
.setName(TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
Trial response = vizierServiceClient.stopTrial(request);
}
Name | Description |
request | StopTrialRequest The request object containing all of the parameters for the API call. |
Type | Description |
Trial |
stopTrialCallable()
public final UnaryCallable<StopTrialRequest,Trial> stopTrialCallable()
Stops a Trial.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
StopTrialRequest request =
StopTrialRequest.newBuilder()
.setName(TrialName.of("[PROJECT]", "[LOCATION]", "[STUDY]", "[TRIAL]").toString())
.build();
ApiFuture<Trial> future = vizierServiceClient.stopTrialCallable().futureCall(request);
// Do something.
Trial response = future.get();
}
Type | Description |
UnaryCallable<StopTrialRequest,Trial> |
suggestTrialsAsync(SuggestTrialsRequest request)
public final OperationFuture<SuggestTrialsResponse,SuggestTrialsMetadata> suggestTrialsAsync(SuggestTrialsRequest request)
Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a SuggestTrialsResponse.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
SuggestTrialsRequest request =
SuggestTrialsRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.setSuggestionCount(390130452)
.setClientId("clientId908408390")
.build();
SuggestTrialsResponse response = vizierServiceClient.suggestTrialsAsync(request).get();
}
Name | Description |
request | SuggestTrialsRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<SuggestTrialsResponse,SuggestTrialsMetadata> |
suggestTrialsCallable()
public final UnaryCallable<SuggestTrialsRequest,Operation> suggestTrialsCallable()
Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a SuggestTrialsResponse.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
SuggestTrialsRequest request =
SuggestTrialsRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.setSuggestionCount(390130452)
.setClientId("clientId908408390")
.build();
ApiFuture<Operation> future = vizierServiceClient.suggestTrialsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<SuggestTrialsRequest,Operation> |
suggestTrialsOperationCallable()
public final OperationCallable<SuggestTrialsRequest,SuggestTrialsResponse,SuggestTrialsMetadata> suggestTrialsOperationCallable()
Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a SuggestTrialsResponse.
Sample code:
try (VizierServiceClient vizierServiceClient = VizierServiceClient.create()) {
SuggestTrialsRequest request =
SuggestTrialsRequest.newBuilder()
.setParent(StudyName.of("[PROJECT]", "[LOCATION]", "[STUDY]").toString())
.setSuggestionCount(390130452)
.setClientId("clientId908408390")
.build();
OperationFuture
Type | Description |
OperationCallable<SuggestTrialsRequest,SuggestTrialsResponse,SuggestTrialsMetadata> |