- 3.61.0 (latest)
- 3.60.0
- 3.59.0
- 3.58.0
- 3.57.0
- 3.56.0
- 3.55.0
- 3.54.0
- 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
GitHub Repository | Product Reference | REST Documentation | RPC Documentation |
Service Description: The service that manages Vertex AI Dataset and its child resources.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
Dataset response = datasetServiceClient.getDataset(name);
}
Note: close() needs to be called on the DatasetServiceClient 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 DatasetServiceSettings 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
DatasetServiceSettings datasetServiceSettings =
DatasetServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings);
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
DatasetServiceSettings datasetServiceSettings =
DatasetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final DatasetServiceClient create()
Constructs an instance of DatasetServiceClient with default settings.
Returns | |
---|---|
Type | Description |
DatasetServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(DatasetServiceSettings settings)
public static final DatasetServiceClient create(DatasetServiceSettings settings)
Constructs an instance of DatasetServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Parameter | |
---|---|
Name | Description |
settings | DatasetServiceSettings |
Returns | |
---|---|
Type | Description |
DatasetServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(DatasetServiceStub stub)
public static final DatasetServiceClient create(DatasetServiceStub stub)
Constructs an instance of DatasetServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DatasetServiceSettings).
Parameter | |
---|---|
Name | Description |
stub | DatasetServiceStub |
Returns | |
---|---|
Type | Description |
DatasetServiceClient |
Constructors
DatasetServiceClient(DatasetServiceSettings settings)
protected DatasetServiceClient(DatasetServiceSettings settings)
Constructs an instance of DatasetServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Parameter | |
---|---|
Name | Description |
settings | DatasetServiceSettings |
DatasetServiceClient(DatasetServiceStub stub)
protected DatasetServiceClient(DatasetServiceStub stub)
Parameter | |
---|---|
Name | Description |
stub | DatasetServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration | long |
unit | TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
close()
public final void close()
createDatasetAsync(CreateDatasetRequest request)
public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(CreateDatasetRequest request)
Creates a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
CreateDatasetRequest request =
CreateDatasetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataset(Dataset.newBuilder().build())
.build();
Dataset response = datasetServiceClient.createDatasetAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | CreateDatasetRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Dataset,CreateDatasetOperationMetadata> |
createDatasetAsync(LocationName parent, Dataset dataset)
public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(LocationName parent, Dataset dataset)
Creates a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Dataset dataset = Dataset.newBuilder().build();
Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get();
}
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the Location to create the Dataset in. Format:
|
dataset | Dataset Required. The Dataset to create. |
Returns | |
---|---|
Type | Description |
OperationFuture<Dataset,CreateDatasetOperationMetadata> |
createDatasetAsync(String parent, Dataset dataset)
public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(String parent, Dataset dataset)
Creates a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Dataset dataset = Dataset.newBuilder().build();
Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get();
}
Parameters | |
---|---|
Name | Description |
parent | String Required. The resource name of the Location to create the Dataset in. Format:
|
dataset | Dataset Required. The Dataset to create. |
Returns | |
---|---|
Type | Description |
OperationFuture<Dataset,CreateDatasetOperationMetadata> |
createDatasetCallable()
public final UnaryCallable<CreateDatasetRequest,Operation> createDatasetCallable()
Creates a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
CreateDatasetRequest request =
CreateDatasetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataset(Dataset.newBuilder().build())
.build();
ApiFuture<Operation> future =
datasetServiceClient.createDatasetCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateDatasetRequest,Operation> |
createDatasetOperationCallable()
public final OperationCallable<CreateDatasetRequest,Dataset,CreateDatasetOperationMetadata> createDatasetOperationCallable()
Creates a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
CreateDatasetRequest request =
CreateDatasetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataset(Dataset.newBuilder().build())
.build();
OperationFuture<Dataset, CreateDatasetOperationMetadata> future =
datasetServiceClient.createDatasetOperationCallable().futureCall(request);
// Do something.
Dataset response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateDatasetRequest,Dataset,CreateDatasetOperationMetadata> |
createDatasetVersionAsync(CreateDatasetVersionRequest request)
public final OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> createDatasetVersionAsync(CreateDatasetVersionRequest request)
Create a version from a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
CreateDatasetVersionRequest request =
CreateDatasetVersionRequest.newBuilder()
.setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setDatasetVersion(DatasetVersion.newBuilder().build())
.build();
DatasetVersion response = datasetServiceClient.createDatasetVersionAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | CreateDatasetVersionRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> |
createDatasetVersionAsync(DatasetName parent, DatasetVersion datasetVersion)
public final OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> createDatasetVersionAsync(DatasetName parent, DatasetVersion datasetVersion)
Create a version from a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
DatasetVersion datasetVersion = DatasetVersion.newBuilder().build();
DatasetVersion response =
datasetServiceClient.createDatasetVersionAsync(parent, datasetVersion).get();
}
Parameters | |
---|---|
Name | Description |
parent | DatasetName Required. The name of the Dataset resource. Format:
|
datasetVersion | DatasetVersion Required. The version to be created. The same CMEK policies with the original Dataset will be applied the dataset version. So here we don't need to specify the EncryptionSpecType here. |
Returns | |
---|---|
Type | Description |
OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> |
createDatasetVersionAsync(String parent, DatasetVersion datasetVersion)
public final OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> createDatasetVersionAsync(String parent, DatasetVersion datasetVersion)
Create a version from a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
DatasetVersion datasetVersion = DatasetVersion.newBuilder().build();
DatasetVersion response =
datasetServiceClient.createDatasetVersionAsync(parent, datasetVersion).get();
}
Parameters | |
---|---|
Name | Description |
parent | String Required. The name of the Dataset resource. Format:
|
datasetVersion | DatasetVersion Required. The version to be created. The same CMEK policies with the original Dataset will be applied the dataset version. So here we don't need to specify the EncryptionSpecType here. |
Returns | |
---|---|
Type | Description |
OperationFuture<DatasetVersion,CreateDatasetVersionOperationMetadata> |
createDatasetVersionCallable()
public final UnaryCallable<CreateDatasetVersionRequest,Operation> createDatasetVersionCallable()
Create a version from a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
CreateDatasetVersionRequest request =
CreateDatasetVersionRequest.newBuilder()
.setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setDatasetVersion(DatasetVersion.newBuilder().build())
.build();
ApiFuture<Operation> future =
datasetServiceClient.createDatasetVersionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateDatasetVersionRequest,Operation> |
createDatasetVersionOperationCallable()
public final OperationCallable<CreateDatasetVersionRequest,DatasetVersion,CreateDatasetVersionOperationMetadata> createDatasetVersionOperationCallable()
Create a version from a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
CreateDatasetVersionRequest request =
CreateDatasetVersionRequest.newBuilder()
.setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.setDatasetVersion(DatasetVersion.newBuilder().build())
.build();
OperationFuture<DatasetVersion, CreateDatasetVersionOperationMetadata> future =
datasetServiceClient.createDatasetVersionOperationCallable().futureCall(request);
// Do something.
DatasetVersion response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateDatasetVersionRequest,DatasetVersion,CreateDatasetVersionOperationMetadata> |
deleteDatasetAsync(DatasetName name)
public final OperationFuture<Empty,DeleteOperationMetadata> deleteDatasetAsync(DatasetName name)
Deletes a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
datasetServiceClient.deleteDatasetAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name | DatasetName Required. The resource name of the Dataset to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteDatasetAsync(DeleteDatasetRequest request)
public final OperationFuture<Empty,DeleteOperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request)
Deletes a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DeleteDatasetRequest request =
DeleteDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.build();
datasetServiceClient.deleteDatasetAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | DeleteDatasetRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteDatasetAsync(String name)
public final OperationFuture<Empty,DeleteOperationMetadata> deleteDatasetAsync(String name)
Deletes a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
datasetServiceClient.deleteDatasetAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name | String Required. The resource name of the Dataset to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteDatasetCallable()
public final UnaryCallable<DeleteDatasetRequest,Operation> deleteDatasetCallable()
Deletes a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DeleteDatasetRequest request =
DeleteDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.build();
ApiFuture<Operation> future =
datasetServiceClient.deleteDatasetCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteDatasetRequest,Operation> |
deleteDatasetOperationCallable()
public final OperationCallable<DeleteDatasetRequest,Empty,DeleteOperationMetadata> deleteDatasetOperationCallable()
Deletes a Dataset.
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 (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DeleteDatasetRequest request =
DeleteDatasetRequest.newBuilder()
.setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
datasetServiceClient.deleteDatasetOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteDatasetRequest,Empty,DeleteOperationMetadata> |
deleteDatasetVersionAsync(DatasetVersionName name)
public final OperationFuture<Empty,DeleteOperationMetadata> deleteDatasetVersionAsync(DatasetVersionName name)
Deletes a Dataset version.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DatasetVersionName name =
DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]");
datasetServiceClient.deleteDatasetVersionAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name | DatasetVersionName Required. The resource name of the Dataset version to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteDatasetVersionAsync(DeleteDatasetVersionRequest request)
public final OperationFuture<Empty,DeleteOperationMetadata> deleteDatasetVersionAsync(DeleteDatasetVersionRequest request)
Deletes a Dataset version.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
DeleteDatasetVersionRequest request =
DeleteDatasetVersionRequest.newBuilder()
.setName(
DatasetVersionName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATASET_VERSION]")
.toString())
.build();
datasetServiceClient.deleteDatasetVersionAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | DeleteDatasetVersionRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
|