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::ConfigurationConfigure the VectorSearchService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_collection
def create_collection(request, options = nil) -> ::Gapic::Operation
def create_collection(parent: nil, collection_id: nil, collection: nil, request_id: nil) -> ::Gapic::OperationCreates a new Collection in a given project and location.
def create_collection(request, options = nil) -> ::Gapic::Operationcreate_collection via a request object, either of type
CreateCollectionRequest or an equivalent Hash.
- 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::Operationcreate_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).
- 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).
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::OperationCreates a new Index in a given project and location.
def create_index(request, options = nil) -> ::Gapic::Operationcreate_index via a request object, either of type
CreateIndexRequest or an equivalent Hash.
- 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::Operationcreate_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).
-
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).
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::OperationDeletes a single Collection.
def delete_collection(request, options = nil) -> ::Gapic::Operationdelete_collection via a request object, either of type
DeleteCollectionRequest or an equivalent Hash.
- 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::Operationdelete_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).
- 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.)
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::OperationDeletes a single Index.
def delete_index(request, options = nil) -> ::Gapic::Operationdelete_index via a request object, either of type
DeleteIndexRequest or an equivalent Hash.
- 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::Operationdelete_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).
-
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).
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::OperationInitiates a Long-Running Operation to export DataObjects from a Collection.
def export_data_objects(request, options = nil) -> ::Gapic::Operationexport_data_objects via a request object, either of type
ExportDataObjectsRequest or an equivalent Hash.
- 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::Operationexport_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).
- 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
etagso 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::CollectionGets details of a single Collection.
def get_collection(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::Collectionget_collection via a request object, either of type
GetCollectionRequest or an equivalent Hash.
- 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::Collectionget_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).
- name (::String) — Required. Name of the resource
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::VectorSearch::V1::Collection)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::IndexGets details of a single Index.
def get_index(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::Indexget_index via a request object, either of type
GetIndexRequest or an equivalent Hash.
- 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::Indexget_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).
- name (::String) — Required. Name of the resource
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::VectorSearch::V1::Index)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::OperationInitiates a Long-Running Operation to import DataObjects into a Collection.
def import_data_objects(request, options = nil) -> ::Gapic::Operationimport_data_objects via a request object, either of type
ImportDataObjectsRequest or an equivalent Hash.
- 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::Operationimport_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).
- gcs_import (::Google::Cloud::VectorSearch::V1::ImportDataObjectsRequest::GcsImportConfig, ::Hash) — The Cloud Storage location of the input content.
-
name (::String) — Required. The resource name of the Collection to import DataObjects into.
Format:
projects/{project}/locations/{location}/collections/{collection}.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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| ... } -> ClientCreate a new VectorSearchService client object.
- (config) — Configure the VectorSearchService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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.
def list_collections(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>list_collections via a request object, either of type
ListCollectionsRequest or an equivalent Hash.
- 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>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).
- 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
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def list_indexes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>list_indexes via a request object, either of type
ListIndexesRequest or an equivalent Hash.
- 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>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).
- 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
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::VectorSearch::V1::VectorSearchService::OperationsGet the associated client for long-running operations.
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_collection
def update_collection(request, options = nil) -> ::Gapic::Operation
def update_collection(update_mask: nil, collection: nil, request_id: nil) -> ::Gapic::OperationUpdates the parameters of a single Collection.
def update_collection(request, options = nil) -> ::Gapic::Operationupdate_collection via a request object, either of type
UpdateCollectionRequest or an equivalent Hash.
- 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::Operationupdate_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).
-
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. Fordata_schemaandvector_schema, fields can only be added, not deleted, butvertex_embedding_configinvector_schemacan be added or removed. Partial updates fordata_schemaandvector_schemaare also supported by using sub-field paths inupdate_mask, e.g.data_schema.properties.fooorvector_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).
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::OperationUpdates the parameters of a single Index.
def update_index(request, options = nil) -> ::Gapic::Operationupdate_index via a request object, either of type
UpdateIndexRequest or an equivalent Hash.
- 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::Operationupdate_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).
- 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_namedescriptionlabelsdedicated_infrastructure.autoscaling_spec.min_replica_countdedicated_infrastructure.autoscaling_spec.max_replica_count
If
*is provided in theupdate_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).
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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