Class VectorSearchServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) {
CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
Collection response = vectorSearchServiceClient.getCollection(name);
}
Note: close() needs to be called on the VectorSearchServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListCollections |
Lists Collections in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetCollection |
Gets details of a single Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateCollection |
Creates a new Collection in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateCollection |
Updates the parameters of a single Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteCollection |
Deletes a single Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListIndexes |
Lists Indexes in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIndex |
Gets details of a single Index. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateIndex |
Creates a new Index in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateIndex |
Updates the parameters of a single Index. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteIndex |
Deletes a single Index. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportDataObjects |
Initiates a Long-Running Operation to import DataObjects into a Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportDataObjects |
Initiates a Long-Running Operation to export DataObjects from a Collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field: * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project. For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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 VectorSearchServiceSettings 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
VectorSearchServiceSettings vectorSearchServiceSettings =
VectorSearchServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
VectorSearchServiceClient vectorSearchServiceClient =
VectorSearchServiceClient.create(vectorSearchServiceSettings);
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
VectorSearchServiceSettings vectorSearchServiceSettings =
VectorSearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
VectorSearchServiceClient vectorSearchServiceClient =
VectorSearchServiceClient.create(vectorSearchServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// 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
VectorSearchServiceSettings vectorSearchServiceSettings =
VectorSearchServiceSettings.newHttpJsonBuilder().build();
VectorSearchServiceClient vectorSearchServiceClient =
VectorSearchServiceClient.create(vectorSearchServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedConstructs an instance of VectorSearchServiceClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final VectorSearchServiceClientcreate()Constructs an instance of VectorSearchServiceClient with default settings.static final VectorSearchServiceClientConstructs an instance of VectorSearchServiceClient, using the given stub for making calls.static final VectorSearchServiceClientcreate(VectorSearchServiceSettings settings) Constructs an instance of VectorSearchServiceClient, using the given settings.Creates a new Collection in a given project and location.createCollectionAsync(LocationName parent, Collection collection, String collectionId) Creates a new Collection in a given project and location.createCollectionAsync(String parent, Collection collection, String collectionId) Creates a new Collection in a given project and location.Creates a new Collection in a given project and location.Creates a new Collection in a given project and location.createIndexAsync(CollectionName parent, Index index, String indexId) Creates a new Index in a given project and location.createIndexAsync(CreateIndexRequest request) Creates a new Index in a given project and location.createIndexAsync(String parent, Index index, String indexId) Creates a new Index in a given project and location.Creates a new Index in a given project and location.Creates a new Index in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Collection.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Collection.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteCollectionAsync(String name) Deletes a single Collection.Deletes a single Collection.final OperationCallable<DeleteCollectionRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Collection.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(DeleteIndexRequest request) Deletes a single Index.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(IndexName name) Deletes a single Index.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(String name) Deletes a single Index.Deletes a single Index.final OperationCallable<DeleteIndexRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Index.Initiates a Long-Running Operation to export DataObjects from a Collection.Initiates a Long-Running Operation to export DataObjects from a Collection.final OperationCallable<ExportDataObjectsRequest,ExportDataObjectsResponse, ExportDataObjectsMetadata> Initiates a Long-Running Operation to export DataObjects from a Collection.final CollectiongetCollection(CollectionName name) Gets details of a single Collection.final CollectiongetCollection(GetCollectionRequest request) Gets details of a single Collection.final CollectiongetCollection(String name) Gets details of a single Collection.Gets details of a single Collection.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final IndexgetIndex(GetIndexRequest request) Gets details of a single Index.final IndexGets details of a single Index.final IndexGets details of a single Index.final UnaryCallable<GetIndexRequest,Index> Gets details of a single Index.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.getStub()Initiates a Long-Running Operation to import DataObjects into a Collection.Initiates a Long-Running Operation to import DataObjects into a Collection.final OperationCallable<ImportDataObjectsRequest,ImportDataObjectsResponse, ImportDataObjectsMetadata> Initiates a Long-Running Operation to import DataObjects into a Collection.booleanbooleanlistCollections(ListCollectionsRequest request) Lists Collections in a given project and location.listCollections(LocationName parent) Lists Collections in a given project and location.listCollections(String parent) Lists Collections in a given project and location.Lists Collections in a given project and location.Lists Collections in a given project and location.listIndexes(CollectionName parent) Lists Indexes in a given project and location.listIndexes(ListIndexesRequest request) Lists Indexes in a given project and location.listIndexes(String parent) Lists Indexes in a given project and location.Lists Indexes in a given project and location.Lists Indexes in a given project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.voidshutdown()voidupdateCollectionAsync(Collection collection, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Collection.Updates the parameters of a single Collection.Updates the parameters of a single Collection.Updates the parameters of a single Collection.updateIndexAsync(Index index, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Index.updateIndexAsync(UpdateIndexRequest request) Updates the parameters of a single Index.Updates the parameters of a single Index.Updates the parameters of a single Index.
-
Constructor Details
-
VectorSearchServiceClient
Constructs an instance of VectorSearchServiceClient, 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
-
VectorSearchServiceClient
-
-
Method Details
-
create
Constructs an instance of VectorSearchServiceClient with default settings.- Throws:
IOException
-
create
public static final VectorSearchServiceClient create(VectorSearchServiceSettings settings) throws IOException Constructs an instance of VectorSearchServiceClient, 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
Constructs an instance of VectorSearchServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(VectorSearchServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listCollections
public final VectorSearchServiceClient.ListCollectionsPagedResponse listCollections(LocationName parent) Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Collection element : vectorSearchServiceClient.listCollections(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListCollectionsRequest- Throws:
ApiException- if the remote call fails
-
listCollections
Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Collection element : vectorSearchServiceClient.listCollections(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListCollectionsRequest- Throws:
ApiException- if the remote call fails
-
listCollections
public final VectorSearchServiceClient.ListCollectionsPagedResponse listCollections(ListCollectionsRequest request) Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListCollectionsRequest request = ListCollectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Collection element : vectorSearchServiceClient.listCollections(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listCollectionsPagedCallable
public final UnaryCallable<ListCollectionsRequest,VectorSearchServiceClient.ListCollectionsPagedResponse> listCollectionsPagedCallable()Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListCollectionsRequest request = ListCollectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Collection> future = vectorSearchServiceClient.listCollectionsPagedCallable().futureCall(request); // Do something. for (Collection element : future.get().iterateAll()) { // doThingsWith(element); } } -
listCollectionsCallable
public final UnaryCallable<ListCollectionsRequest,ListCollectionsResponse> listCollectionsCallable()Lists Collections in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListCollectionsRequest request = ListCollectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListCollectionsResponse response = vectorSearchServiceClient.listCollectionsCallable().call(request); for (Collection element : response.getCollectionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getCollection
Gets details of a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]"); Collection response = vectorSearchServiceClient.getCollection(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getCollection
Gets details of a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { String name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString(); Collection response = vectorSearchServiceClient.getCollection(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getCollection
Gets details of a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { GetCollectionRequest request = GetCollectionRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .build(); Collection response = vectorSearchServiceClient.getCollection(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getCollectionCallable
Gets details of a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { GetCollectionRequest request = GetCollectionRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .build(); ApiFuture<Collection> future = vectorSearchServiceClient.getCollectionCallable().futureCall(request); // Do something. Collection response = future.get(); } -
createCollectionAsync
public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(LocationName parent, Collection collection, String collectionId) Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Collection collection = Collection.newBuilder().build(); String collectionId = "collectionId1636075609"; Collection response = vectorSearchServiceClient.createCollectionAsync(parent, collection, collectionId).get(); }- Parameters:
parent- Required. Value for parent.collection- Required. The resource being createdcollectionId- Required. ID of the Collection to create. The id must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, it must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.- Throws:
ApiException- if the remote call fails
-
createCollectionAsync
public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(String parent, Collection collection, String collectionId) Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Collection collection = Collection.newBuilder().build(); String collectionId = "collectionId1636075609"; Collection response = vectorSearchServiceClient.createCollectionAsync(parent, collection, collectionId).get(); }- Parameters:
parent- Required. Value for parent.collection- Required. The resource being createdcollectionId- Required. ID of the Collection to create. The id must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, it must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.- Throws:
ApiException- if the remote call fails
-
createCollectionAsync
public final OperationFuture<Collection,OperationMetadata> createCollectionAsync(CreateCollectionRequest request) Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CreateCollectionRequest request = CreateCollectionRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCollectionId("collectionId1636075609") .setCollection(Collection.newBuilder().build()) .setRequestId("requestId693933066") .build(); Collection response = vectorSearchServiceClient.createCollectionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createCollectionOperationCallable
public final OperationCallable<CreateCollectionRequest,Collection, createCollectionOperationCallable()OperationMetadata> Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CreateCollectionRequest request = CreateCollectionRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCollectionId("collectionId1636075609") .setCollection(Collection.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Collection, OperationMetadata> future = vectorSearchServiceClient.createCollectionOperationCallable().futureCall(request); // Do something. Collection response = future.get(); } -
createCollectionCallable
Creates a new Collection in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CreateCollectionRequest request = CreateCollectionRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCollectionId("collectionId1636075609") .setCollection(Collection.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vectorSearchServiceClient.createCollectionCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateCollectionAsync
public final OperationFuture<Collection,OperationMetadata> updateCollectionAsync(Collection collection, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { Collection collection = Collection.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Collection response = vectorSearchServiceClient.updateCollectionAsync(collection, updateMask).get(); }- Parameters:
collection- Required. The resource being updatedupdateMask- Optional. Field mask is used to specify the fields to be overwritten in the Collection resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request will be overwritten.The following fields support update: `display_name`, `description`, `labels`, `data_schema`, `vector_schema`. For `data_schema` and `vector_schema`, fields can only be added, not deleted, but `vertex_embedding_config` in `vector_schema` can be added or removed. Partial updates for `data_schema` and `vector_schema` are also supported by using sub-field paths in `update_mask`, e.g. `data_schema.properties.foo` or `vector_schema.my_vector_field`.
If `*` is provided in the update_mask, full replacement will be performed.
- Throws:
ApiException- if the remote call fails
-
updateCollectionAsync
public final OperationFuture<Collection,OperationMetadata> updateCollectionAsync(UpdateCollectionRequest request) Updates the parameters of a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { UpdateCollectionRequest request = UpdateCollectionRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCollection(Collection.newBuilder().build()) .setRequestId("requestId693933066") .build(); Collection response = vectorSearchServiceClient.updateCollectionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateCollectionOperationCallable
public final OperationCallable<UpdateCollectionRequest,Collection, updateCollectionOperationCallable()OperationMetadata> Updates the parameters of a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { UpdateCollectionRequest request = UpdateCollectionRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCollection(Collection.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Collection, OperationMetadata> future = vectorSearchServiceClient.updateCollectionOperationCallable().futureCall(request); // Do something. Collection response = future.get(); } -
updateCollectionCallable
Updates the parameters of a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { UpdateCollectionRequest request = UpdateCollectionRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCollection(Collection.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vectorSearchServiceClient.updateCollectionCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteCollectionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteCollectionAsync(CollectionName name) Deletes a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CollectionName name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]"); vectorSearchServiceClient.deleteCollectionAsync(name).get(); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
deleteCollectionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteCollectionAsync(String name) Deletes a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { String name = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString(); vectorSearchServiceClient.deleteCollectionAsync(name).get(); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
deleteCollectionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteCollectionAsync(DeleteCollectionRequest request) Deletes a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { DeleteCollectionRequest request = DeleteCollectionRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setRequestId("requestId693933066") .build(); vectorSearchServiceClient.deleteCollectionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteCollectionOperationCallable
public final OperationCallable<DeleteCollectionRequest,com.google.protobuf.Empty, deleteCollectionOperationCallable()OperationMetadata> Deletes a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { DeleteCollectionRequest request = DeleteCollectionRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = vectorSearchServiceClient.deleteCollectionOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteCollectionCallable
Deletes a single Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { DeleteCollectionRequest request = DeleteCollectionRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vectorSearchServiceClient.deleteCollectionCallable().futureCall(request); // Do something. future.get(); } -
listIndexes
Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]"); for (Index element : vectorSearchServiceClient.listIndexes(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListIndexesRequest- Throws:
ApiException- if the remote call fails
-
listIndexes
Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString(); for (Index element : vectorSearchServiceClient.listIndexes(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListIndexesRequest- Throws:
ApiException- if the remote call fails
-
listIndexes
public final VectorSearchServiceClient.ListIndexesPagedResponse listIndexes(ListIndexesRequest request) Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListIndexesRequest request = ListIndexesRequest.newBuilder() .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Index element : vectorSearchServiceClient.listIndexes(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listIndexesPagedCallable
public final UnaryCallable<ListIndexesRequest,VectorSearchServiceClient.ListIndexesPagedResponse> listIndexesPagedCallable()Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListIndexesRequest request = ListIndexesRequest.newBuilder() .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Index> future = vectorSearchServiceClient.listIndexesPagedCallable().futureCall(request); // Do something. for (Index element : future.get().iterateAll()) { // doThingsWith(element); } } -
listIndexesCallable
Lists Indexes in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListIndexesRequest request = ListIndexesRequest.newBuilder() .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListIndexesResponse response = vectorSearchServiceClient.listIndexesCallable().call(request); for (Index element : response.getIndexesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getIndex
Gets details of a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { IndexName name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]"); Index response = vectorSearchServiceClient.getIndex(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getIndex
Gets details of a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { String name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString(); Index response = vectorSearchServiceClient.getIndex(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getIndex
Gets details of a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { GetIndexRequest request = GetIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString()) .build(); Index response = vectorSearchServiceClient.getIndex(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIndexCallable
Gets details of a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { GetIndexRequest request = GetIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString()) .build(); ApiFuture<Index> future = vectorSearchServiceClient.getIndexCallable().futureCall(request); // Do something. Index response = future.get(); } -
createIndexAsync
public final OperationFuture<Index,OperationMetadata> createIndexAsync(CollectionName parent, Index index, String indexId) Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]"); Index index = Index.newBuilder().build(); String indexId = "indexId1943291277"; Index response = vectorSearchServiceClient.createIndexAsync(parent, index, indexId).get(); }- Parameters:
parent- Required. The resource name of the Collection for which to create the Index. Format: `projects/{project}/locations/{location}/collections/{collection}`index- Required. The resource being createdindexId- Required. ID of the Index to create. The id must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, it must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.- Throws:
ApiException- if the remote call fails
-
createIndexAsync
public final OperationFuture<Index,OperationMetadata> createIndexAsync(String parent, Index index, String indexId) Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString(); Index index = Index.newBuilder().build(); String indexId = "indexId1943291277"; Index response = vectorSearchServiceClient.createIndexAsync(parent, index, indexId).get(); }- Parameters:
parent- Required. The resource name of the Collection for which to create the Index. Format: `projects/{project}/locations/{location}/collections/{collection}`index- Required. The resource being createdindexId- Required. ID of the Index to create. The id must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). Specifically, it must be 1-63 characters long and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.- Throws:
ApiException- if the remote call fails
-
createIndexAsync
Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CreateIndexRequest request = CreateIndexRequest.newBuilder() .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setIndexId("indexId1943291277") .setIndex(Index.newBuilder().build()) .setRequestId("requestId693933066") .build(); Index response = vectorSearchServiceClient.createIndexAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createIndexOperationCallable
public final OperationCallable<CreateIndexRequest,Index, createIndexOperationCallable()OperationMetadata> Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CreateIndexRequest request = CreateIndexRequest.newBuilder() .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setIndexId("indexId1943291277") .setIndex(Index.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Index, OperationMetadata> future = vectorSearchServiceClient.createIndexOperationCallable().futureCall(request); // Do something. Index response = future.get(); } -
createIndexCallable
Creates a new Index in a given project and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { CreateIndexRequest request = CreateIndexRequest.newBuilder() .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .setIndexId("indexId1943291277") .setIndex(Index.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vectorSearchServiceClient.createIndexCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateIndexAsync
public final OperationFuture<Index,OperationMetadata> updateIndexAsync(Index index, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { Index index = Index.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Index response = vectorSearchServiceClient.updateIndexAsync(index, updateMask).get(); }- Parameters:
index- Required. The resource being updated.updateMask- Optional. Specifies the fields to be overwritten in the Index resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request with non-empty values will be overwritten.The following fields support update: * `display_name` * `description` * `labels` * `dedicated_infrastructure.autoscaling_spec.min_replica_count` * `dedicated_infrastructure.autoscaling_spec.max_replica_count`
If `*` is provided in the `update_mask`, full replacement of mutable fields will be performed.
- Throws:
ApiException- if the remote call fails
-
updateIndexAsync
Updates the parameters of a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { UpdateIndexRequest request = UpdateIndexRequest.newBuilder() .setIndex(Index.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); Index response = vectorSearchServiceClient.updateIndexAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateIndexOperationCallable
public final OperationCallable<UpdateIndexRequest,Index, updateIndexOperationCallable()OperationMetadata> Updates the parameters of a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { UpdateIndexRequest request = UpdateIndexRequest.newBuilder() .setIndex(Index.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Index, OperationMetadata> future = vectorSearchServiceClient.updateIndexOperationCallable().futureCall(request); // Do something. Index response = future.get(); } -
updateIndexCallable
Updates the parameters of a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { UpdateIndexRequest request = UpdateIndexRequest.newBuilder() .setIndex(Index.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vectorSearchServiceClient.updateIndexCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteIndexAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(IndexName name) Deletes a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { IndexName name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]"); vectorSearchServiceClient.deleteIndexAsync(name).get(); }- Parameters:
name- Required. The resource name of the Index to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`- Throws:
ApiException- if the remote call fails
-
deleteIndexAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(String name) Deletes a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { String name = IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString(); vectorSearchServiceClient.deleteIndexAsync(name).get(); }- Parameters:
name- Required. The resource name of the Index to delete. Format: `projects/{project}/locations/{location}/collections/{collection}/indexes/{index}`- Throws:
ApiException- if the remote call fails
-
deleteIndexAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteIndexAsync(DeleteIndexRequest request) Deletes a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { DeleteIndexRequest request = DeleteIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString()) .setRequestId("requestId693933066") .build(); vectorSearchServiceClient.deleteIndexAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteIndexOperationCallable
public final OperationCallable<DeleteIndexRequest,com.google.protobuf.Empty, deleteIndexOperationCallable()OperationMetadata> Deletes a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { DeleteIndexRequest request = DeleteIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = vectorSearchServiceClient.deleteIndexOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteIndexCallable
Deletes a single Index.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { DeleteIndexRequest request = DeleteIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[INDEX]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vectorSearchServiceClient.deleteIndexCallable().futureCall(request); // Do something. future.get(); } -
importDataObjectsAsync
public final OperationFuture<ImportDataObjectsResponse,ImportDataObjectsMetadata> importDataObjectsAsync(ImportDataObjectsRequest request) Initiates a Long-Running Operation to import DataObjects into a Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ImportDataObjectsRequest request = ImportDataObjectsRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .build(); ImportDataObjectsResponse response = vectorSearchServiceClient.importDataObjectsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importDataObjectsOperationCallable
public final OperationCallable<ImportDataObjectsRequest,ImportDataObjectsResponse, importDataObjectsOperationCallable()ImportDataObjectsMetadata> Initiates a Long-Running Operation to import DataObjects into a Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ImportDataObjectsRequest request = ImportDataObjectsRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .build(); OperationFuture<ImportDataObjectsResponse, ImportDataObjectsMetadata> future = vectorSearchServiceClient.importDataObjectsOperationCallable().futureCall(request); // Do something. ImportDataObjectsResponse response = future.get(); } -
importDataObjectsCallable
Initiates a Long-Running Operation to import DataObjects into a Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ImportDataObjectsRequest request = ImportDataObjectsRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .build(); ApiFuture<Operation> future = vectorSearchServiceClient.importDataObjectsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
exportDataObjectsAsync
public final OperationFuture<ExportDataObjectsResponse,ExportDataObjectsMetadata> exportDataObjectsAsync(ExportDataObjectsRequest request) Initiates a Long-Running Operation to export DataObjects from a Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ExportDataObjectsRequest request = ExportDataObjectsRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .build(); ExportDataObjectsResponse response = vectorSearchServiceClient.exportDataObjectsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
exportDataObjectsOperationCallable
public final OperationCallable<ExportDataObjectsRequest,ExportDataObjectsResponse, exportDataObjectsOperationCallable()ExportDataObjectsMetadata> Initiates a Long-Running Operation to export DataObjects from a Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ExportDataObjectsRequest request = ExportDataObjectsRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .build(); OperationFuture<ExportDataObjectsResponse, ExportDataObjectsMetadata> future = vectorSearchServiceClient.exportDataObjectsOperationCallable().futureCall(request); // Do something. ExportDataObjectsResponse response = future.get(); } -
exportDataObjectsCallable
Initiates a Long-Running Operation to export DataObjects from a Collection.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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ExportDataObjectsRequest request = ExportDataObjectsRequest.newBuilder() .setName(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString()) .build(); ApiFuture<Operation> future = vectorSearchServiceClient.exportDataObjectsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listLocations
public final VectorSearchServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : vectorSearchServiceClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,VectorSearchServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = vectorSearchServiceClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
* **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and 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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = vectorSearchServiceClient.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
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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = vectorSearchServiceClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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 (VectorSearchServiceClient vectorSearchServiceClient = VectorSearchServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = vectorSearchServiceClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-