Class: Google::Cloud::VectorSearch::V1::VectorSearchService::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::VectorSearch::V1::VectorSearchService::Rest::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb
Overview
REST 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.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#location_client ⇒ Google::Cloud::Location::Locations::Rest::Client
readonly
Get the associated client for mix-in of the Locations.
-
#operations_client ⇒ ::Google::Cloud::VectorSearch::V1::VectorSearchService::Rest::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the VectorSearchService Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the VectorSearchService Client instance.
-
#create_collection(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Creates a new Collection in a given project and location.
-
#create_index(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Creates a new Index in a given project and location.
-
#delete_collection(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Deletes a single Collection.
-
#delete_index(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Deletes a single Index.
-
#export_data_objects(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Initiates a Long-Running Operation to export DataObjects from a Collection.
-
#get_collection(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::VectorSearch::V1::Collection
Gets details of a single Collection.
-
#get_index(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::VectorSearch::V1::Index
Gets details of a single Index.
-
#import_data_objects(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Initiates a Long-Running Operation to import DataObjects into a Collection.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new VectorSearchService REST client object.
-
#list_collections(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>
Lists Collections in a given project and location.
-
#list_indexes(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>
Lists Indexes in a given project and location.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_collection(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Updates the parameters of a single Collection.
-
#update_index(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Updates the parameters of a single Index.
Methods included from Paths
#collection_path, #crypto_key_path, #index_path, #location_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new VectorSearchService REST client object.
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 181 def initialize # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = ::Google::Cloud::VectorSearch::V1::VectorSearchService::Rest::Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @vector_search_service_stub = ::Google::Cloud::VectorSearch::V1::VectorSearchService::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials, logger: @config.logger ) @vector_search_service_stub.logger(stub: true)&.info do |entry| entry.set_system_name entry.set_service entry. = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @vector_search_service_stub.endpoint config.universe_domain = @vector_search_service_stub.universe_domain config.bindings_override = @config.bindings_override config.logger = @vector_search_service_stub.logger if config.respond_to? :logger= end end |
Instance Attribute Details
#location_client ⇒ Google::Cloud::Location::Locations::Rest::Client (readonly)
Get the associated client for mix-in of the Locations.
251 252 253 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 251 def location_client @location_client end |
#operations_client ⇒ ::Google::Cloud::VectorSearch::V1::VectorSearchService::Rest::Operations (readonly)
Get the associated client for long-running operations.
244 245 246 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 244 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the VectorSearchService Client class.
See Configuration for a description of the configuration fields.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 69 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "VectorSearch", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.list_collections.timeout = 60.0 default_config.rpcs.list_collections.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_collection.timeout = 60.0 default_config.rpcs.get_collection.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_collection.timeout = 60.0 default_config.rpcs.create_collection.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.update_collection.timeout = 60.0 default_config.rpcs.update_collection.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.delete_collection.timeout = 60.0 default_config.rpcs.delete_collection.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_indexes.timeout = 60.0 default_config.rpcs.list_indexes.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_index.timeout = 60.0 default_config.rpcs.get_index.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_index.timeout = 60.0 default_config.rpcs.create_index.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.delete_index.timeout = 60.0 default_config.rpcs.delete_index.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.import_data_objects.timeout = 60.0 default_config.rpcs.import_data_objects.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config end yield @configure if block_given? @configure end |
Instance Method Details
#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 configure.
See Configuration for a description of the configuration fields.
151 152 153 154 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 151 def configure yield @config if block_given? @config end |
#create_collection(request, options = nil) ⇒ ::Gapic::Operation #create_collection(parent: nil, collection_id: nil, collection: nil, request_id: nil) ⇒ ::Gapic::Operation
Creates a new Collection in a given project and location.
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 507 def create_collection request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::CreateCollectionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_collection..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.create_collection.timeout, metadata: , retry_policy: @config.rpcs.create_collection.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.create_collection request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#create_index(request, options = nil) ⇒ ::Gapic::Operation #create_index(parent: nil, index_id: nil, index: nil, request_id: nil) ⇒ ::Gapic::Operation
Creates a new Index in a given project and location.
1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 1013 def create_index request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::CreateIndexRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_index..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.create_index.timeout, metadata: , retry_policy: @config.rpcs.create_index.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.create_index request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_collection(request, options = nil) ⇒ ::Gapic::Operation #delete_collection(name: nil, request_id: nil, force: nil) ⇒ ::Gapic::Operation
Deletes a single Collection.
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 731 def delete_collection request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::DeleteCollectionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_collection..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.delete_collection.timeout, metadata: , retry_policy: @config.rpcs.delete_collection.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.delete_collection request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_index(request, options = nil) ⇒ ::Gapic::Operation #delete_index(name: nil, request_id: nil) ⇒ ::Gapic::Operation
Deletes a single Index.
1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 1233 def delete_index request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::DeleteIndexRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_index..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.delete_index.timeout, metadata: , retry_policy: @config.rpcs.delete_index.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.delete_index request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#export_data_objects(request, options = nil) ⇒ ::Gapic::Operation #export_data_objects(gcs_destination: nil, name: nil, field_filter: nil) ⇒ ::Gapic::Operation
Initiates a Long-Running Operation to export DataObjects from a Collection.
1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 1422 def export_data_objects request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::ExportDataObjectsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.export_data_objects..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.export_data_objects.timeout, metadata: , retry_policy: @config.rpcs.export_data_objects.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.export_data_objects request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_collection(request, options = nil) ⇒ ::Google::Cloud::VectorSearch::V1::Collection #get_collection(name: nil) ⇒ ::Google::Cloud::VectorSearch::V1::Collection
Gets details of a single Collection.
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 400 def get_collection request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::GetCollectionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_collection..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_collection.timeout, metadata: , retry_policy: @config.rpcs.get_collection.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.get_collection request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_index(request, options = nil) ⇒ ::Google::Cloud::VectorSearch::V1::Index #get_index(name: nil) ⇒ ::Google::Cloud::VectorSearch::V1::Index
Gets details of a single Index.
904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 904 def get_index request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::GetIndexRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_index..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_index.timeout, metadata: , retry_policy: @config.rpcs.get_index.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.get_index request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#import_data_objects(request, options = nil) ⇒ ::Gapic::Operation #import_data_objects(gcs_import: nil, name: nil) ⇒ ::Gapic::Operation
Initiates a Long-Running Operation to import DataObjects into a Collection.
1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 1323 def import_data_objects request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::ImportDataObjectsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.import_data_objects..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.import_data_objects.timeout, metadata: , retry_policy: @config.rpcs.import_data_objects.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.import_data_objects request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_collections(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection> #list_collections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Collection>
Lists Collections in a given project and location.
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 320 def list_collections request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::ListCollectionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_collections..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_collections.timeout, metadata: , retry_policy: @config.rpcs.list_collections.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.list_collections request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @vector_search_service_stub, :list_collections, "collections", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_indexes(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index> #list_indexes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VectorSearch::V1::Index>
Lists Indexes in a given project and location.
824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 824 def list_indexes request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::ListIndexesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_indexes..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_indexes.timeout, metadata: , retry_policy: @config.rpcs.list_indexes.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.list_indexes request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @vector_search_service_stub, :list_indexes, "indexes", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
258 259 260 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 258 def logger @vector_search_service_stub.logger end |
#universe_domain ⇒ String
The effective universe domain
161 162 163 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 161 def universe_domain @vector_search_service_stub.universe_domain end |
#update_collection(request, options = nil) ⇒ ::Gapic::Operation #update_collection(update_mask: nil, collection: nil, request_id: nil) ⇒ ::Gapic::Operation
Updates the parameters of a single Collection.
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 626 def update_collection request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::UpdateCollectionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_collection..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_collection.timeout, metadata: , retry_policy: @config.rpcs.update_collection.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.update_collection request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_index(request, options = nil) ⇒ ::Gapic::Operation #update_index(index: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation
Updates the parameters of a single Index.
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 |
# File 'lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb', line 1130 def update_index request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::UpdateIndexRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_index..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_index.timeout, metadata: , retry_policy: @config.rpcs.update_index.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @vector_search_service_stub.update_index request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |