Vector Search V1 API - Class Google::Cloud::VectorSearch::V1::VectorSearchService::Client (v0.1.0)

Reference documentation and code samples for the Vector Search V1 API class Google::Cloud::VectorSearch::V1::VectorSearchService::Client.

Client for the VectorSearchService service.

VectorSearchService provides methods for managing Collection resources, and Collection Index resources. The primary resources offered by this service are Collections which are a container for a set of related JSON data objects, and Collection Indexes which enable efficient ANN search across data objects within a Collection.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the VectorSearchService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all VectorSearchService clients
::Google::Cloud::VectorSearch::V1::VectorSearchService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the VectorSearchService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_collection

def create_collection(request, options = nil) -> ::Gapic::Operation
def create_collection(parent: nil, collection_id: nil, collection: nil, request_id: nil) -> ::Gapic::Operation

Creates a new Collection in a given project and location.

Overloads
def create_collection(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_collection via a request object, either of type CreateCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::CreateCollectionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_collection(parent: nil, collection_id: nil, collection: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_collection via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Value for parent.
  • collection_id (::String) — Required. ID of the Collection to create. The id must be 1-63 characters long, and comply with RFC1035. Specifically, it must be 1-63 characters long and match the regular expression [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?.
  • collection (::Google::Cloud::VectorSearch::V1::Collection, ::Hash) — Required. The resource being created
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::CreateCollectionRequest.new

# Call the create_collection method.
result = client.create_collection request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_index

def create_index(request, options = nil) -> ::Gapic::Operation
def create_index(parent: nil, index_id: nil, index: nil, request_id: nil) -> ::Gapic::Operation

Creates a new Index in a given project and location.

Overloads
def create_index(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_index via a request object, either of type CreateIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::CreateIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_index(parent: nil, index_id: nil, index: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the Collection for which to create the Index. Format: projects/{project}/locations/{location}/collections/{collection}
  • index_id (::String) — Required. ID of the Index to create. The id must be 1-63 characters long, and comply with RFC1035. Specifically, it must be 1-63 characters long and match the regular expression [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?.
  • index (::Google::Cloud::VectorSearch::V1::Index, ::Hash) — Required. The resource being created
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::CreateIndexRequest.new

# Call the create_index method.
result = client.create_index request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_collection

def delete_collection(request, options = nil) -> ::Gapic::Operation
def delete_collection(name: nil, request_id: nil, force: nil) -> ::Gapic::Operation

Deletes a single Collection.

Overloads
def delete_collection(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_collection via a request object, either of type DeleteCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::DeleteCollectionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_collection(name: nil, request_id: nil, force: nil) -> ::Gapic::Operation
Pass arguments to delete_collection via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the resource
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • force (::Boolean) — Optional. If set to true, any Indexes and DataObjects from this Collection will also be deleted. (Otherwise, the request will only work if the Collection has no Indexes and DataObjects.)
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::DeleteCollectionRequest.new

# Call the delete_collection method.
result = client.delete_collection request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_index

def delete_index(request, options = nil) -> ::Gapic::Operation
def delete_index(name: nil, request_id: nil) -> ::Gapic::Operation

Deletes a single Index.

Overloads
def delete_index(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_index via a request object, either of type DeleteIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::DeleteIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_index(name: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to delete_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name of the Index to delete. Format: projects/{project}/locations/{location}/collections/{collection}/indexes/{index}
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::DeleteIndexRequest.new

# Call the delete_index method.
result = client.delete_index request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#export_data_objects

def export_data_objects(request, options = nil) -> ::Gapic::Operation
def export_data_objects(gcs_destination: nil, name: nil, field_filter: nil) -> ::Gapic::Operation

Initiates a Long-Running Operation to export DataObjects from a Collection.

Overloads
def export_data_objects(request, options = nil) -> ::Gapic::Operation
Pass arguments to export_data_objects via a request object, either of type ExportDataObjectsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::ExportDataObjectsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def export_data_objects(gcs_destination: nil, name: nil, field_filter: nil) -> ::Gapic::Operation
Pass arguments to export_data_objects via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • gcs_destination (::Google::Cloud::VectorSearch::V1::ExportDataObjectsRequest::GcsExportDestination, ::Hash) — The Cloud Storage location where user wants to export Data Objects.
  • name (::String) — Required. The resource name of the Collection from which we want to export Data Objects. Format: projects/{project}/locations/{location}/collections/{collection}.
  • field_filter (::Google::Cloud::VectorSearch::V1::ExportDataObjectsRequest::FieldFilter, ::Hash) — Optional. Restricts which top-level Data Object fields appear in each exported JSONL record. If unset, every field is exported (the existing behavior). The primary use case is excluding the per-object etag so that the exported records can be imported into a Collection in a different region without optimistic-concurrency conflicts.

    Allowed field names are id, data, vectors, etag.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::ExportDataObjectsRequest.new

# Call the export_data_objects method.
result = client.export_data_objects request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#get_collection

def get_collection(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::Collection
def get_collection(name: nil) -> ::Google::Cloud::VectorSearch::V1::Collection

Gets details of a single Collection.

Overloads
def get_collection(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::Collection
Pass arguments to get_collection via a request object, either of type GetCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::GetCollectionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_collection(name: nil) -> ::Google::Cloud::VectorSearch::V1::Collection
Pass arguments to get_collection via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the resource
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::GetCollectionRequest.new

# Call the get_collection method.
result = client.get_collection request

# The returned object is of type Google::Cloud::VectorSearch::V1::Collection.
p result

#get_index

def get_index(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::Index
def get_index(name: nil) -> ::Google::Cloud::VectorSearch::V1::Index

Gets details of a single Index.

Overloads
def get_index(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::Index
Pass arguments to get_index via a request object, either of type GetIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::GetIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_index(name: nil) -> ::Google::Cloud::VectorSearch::V1::Index
Pass arguments to get_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the resource
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::GetIndexRequest.new

# Call the get_index method.
result = client.get_index request

# The returned object is of type Google::Cloud::VectorSearch::V1::Index.
p result

#import_data_objects

def import_data_objects(request, options = nil) -> ::Gapic::Operation
def import_data_objects(gcs_import: nil, name: nil) -> ::Gapic::Operation

Initiates a Long-Running Operation to import DataObjects into a Collection.

Overloads
def import_data_objects(request, options = nil) -> ::Gapic::Operation
Pass arguments to import_data_objects via a request object, either of type ImportDataObjectsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::ImportDataObjectsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def import_data_objects(gcs_import: nil, name: nil) -> ::Gapic::Operation
Pass arguments to import_data_objects via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::ImportDataObjectsRequest.new

# Call the import_data_objects method.
result = client.import_data_objects request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#initialize

def initialize() { |config| ... } -> Client

Create a new VectorSearchService client object.

Yields
  • (config) — Configure the VectorSearchService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new do |config|
  config.timeout = 10.0
end

#list_collections

def list_collections(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>
def list_collections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>

Lists Collections in a given project and location.

Overloads
def list_collections(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>
Pass arguments to list_collections via a request object, either of type ListCollectionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::ListCollectionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_collections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>
Pass arguments to list_collections via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Parent value for ListCollectionsRequest
  • page_size (::Integer) — Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — Optional. A token identifying a page of results the server should return.
  • filter (::String) — Optional. Filtering results
  • order_by (::String) — Optional. Hint for how to order the results
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::ListCollectionsRequest.new

# Call the list_collections method.
result = client.list_collections request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VectorSearch::V1::Collection.
  p item
end

#list_indexes

def list_indexes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>
def list_indexes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>

Lists Indexes in a given project and location.

Overloads
def list_indexes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>
Pass arguments to list_indexes via a request object, either of type ListIndexesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::ListIndexesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_indexes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>
Pass arguments to list_indexes via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Parent value for ListIndexesRequest
  • page_size (::Integer) — Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — Optional. A token identifying a page of results the server should return.
  • filter (::String) — Optional. Filtering results
  • order_by (::String) — Optional. Hint for how to order the results
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::ListIndexesRequest.new

# Call the list_indexes method.
result = client.list_indexes request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VectorSearch::V1::Index.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::VectorSearch::V1::VectorSearchService::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_collection

def update_collection(request, options = nil) -> ::Gapic::Operation
def update_collection(update_mask: nil, collection: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single Collection.

Overloads
def update_collection(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_collection via a request object, either of type UpdateCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::UpdateCollectionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_collection(update_mask: nil, collection: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_collection via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — 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.

  • collection (::Google::Cloud::VectorSearch::V1::Collection, ::Hash) — Required. The resource being updated
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::UpdateCollectionRequest.new

# Call the update_collection method.
result = client.update_collection request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#update_index

def update_index(request, options = nil) -> ::Gapic::Operation
def update_index(index: nil, update_mask: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single Index.

Overloads
def update_index(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_index via a request object, either of type UpdateIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::UpdateIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_index(index: nil, update_mask: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • index (::Google::Cloud::VectorSearch::V1::Index, ::Hash) — Required. The resource being updated.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — 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.

  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vector_search/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VectorSearch::V1::VectorSearchService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VectorSearch::V1::UpdateIndexRequest.new

# Call the update_index method.
result = client.update_index request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end