Skip to content

Commit d5cdff2

Browse files
Google APIscopybara-github
authored andcommitted
feat: add ImportIndex to IndexService
PiperOrigin-RevId: 762570246
1 parent 8cf16d3 commit d5cdff2

1 file changed

Lines changed: 129 additions & 0 deletions

File tree

google/cloud/aiplatform/v1beta1/index_service.proto

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ service IndexService {
6161
option (google.api.method_signature) = "name";
6262
}
6363

64+
// Imports an Index from an external source (e.g., BigQuery).
65+
rpc ImportIndex(ImportIndexRequest) returns (google.longrunning.Operation) {
66+
option (google.api.http) = {
67+
post: "/v1beta1/{name=projects/*/locations/*/indexes/*}:import"
68+
body: "*"
69+
};
70+
option (google.longrunning.operation_info) = {
71+
response_type: "Index"
72+
metadata_type: "ImportIndexOperationMetadata"
73+
};
74+
}
75+
6476
// Lists Indexes in a Location.
6577
rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) {
6678
option (google.api.http) = {
@@ -223,6 +235,117 @@ message UpdateIndexOperationMetadata {
223235
nearest_neighbor_search_operation_metadata = 2;
224236
}
225237

238+
// Request message for
239+
// [IndexService.ImportIndex][google.cloud.aiplatform.v1beta1.IndexService.ImportIndex].
240+
message ImportIndexRequest {
241+
// Configuration for importing data from an external source.
242+
message ConnectorConfig {
243+
// Mapping of datapoint fields to column names for columnar data sources.
244+
message DatapointFieldMapping {
245+
// Restrictions on string values.
246+
message Restrict {
247+
// Required. The namespace of the restrict in the index.
248+
string namespace = 1 [(google.api.field_behavior) = REQUIRED];
249+
250+
// Optional. The columns containing the allow values.
251+
repeated string allow_column = 2
252+
[(google.api.field_behavior) = OPTIONAL];
253+
254+
// Optional. The columns containing the deny values.
255+
repeated string deny_column = 3
256+
[(google.api.field_behavior) = OPTIONAL];
257+
}
258+
259+
// Restrictions on numeric values.
260+
message NumericRestrict {
261+
// The type of numeric value for the restrict.
262+
enum ValueType {
263+
// Should not be used.
264+
VALUE_TYPE_UNSPECIFIED = 0;
265+
266+
// Represents 64 bit integer.
267+
INT = 1;
268+
269+
// Represents 32 bit float.
270+
FLOAT = 2;
271+
272+
// Represents 64 bit float.
273+
DOUBLE = 3;
274+
}
275+
276+
// Required. The namespace of the restrict.
277+
string namespace = 1 [(google.api.field_behavior) = REQUIRED];
278+
279+
// Optional. The column containing the numeric value.
280+
string value_column = 2 [(google.api.field_behavior) = OPTIONAL];
281+
282+
// Required. Numeric type of the restrict. Must be consistent for
283+
// all datapoints within the namespace.
284+
ValueType value_type = 3 [(google.api.field_behavior) = REQUIRED];
285+
}
286+
287+
// Required. The column with unique identifiers for each data point.
288+
string id_column = 1 [(google.api.field_behavior) = REQUIRED];
289+
290+
// Required. The column with the vector embeddings for each data point.
291+
string embedding_column = 2 [(google.api.field_behavior) = REQUIRED];
292+
293+
// Optional. List of restricts for string values.
294+
repeated Restrict restricts = 3 [(google.api.field_behavior) = OPTIONAL];
295+
296+
// Optional. List of restricts for numeric values.
297+
repeated NumericRestrict numeric_restricts = 4
298+
[(google.api.field_behavior) = OPTIONAL];
299+
300+
// Optional. List of columns containing metadata to be included in the
301+
// index.
302+
repeated string metadata_columns = 5
303+
[(google.api.field_behavior) = OPTIONAL];
304+
}
305+
306+
// Configuration for importing data from a BigQuery table.
307+
message BigQuerySourceConfig {
308+
// Required. The path to the BigQuery table containing the index data, in
309+
// the format of `bq://<project_id>.<dataset_id>.<table>`.
310+
string table_path = 1 [(google.api.field_behavior) = REQUIRED];
311+
312+
// Required. Mapping of datapoint fields to BigQuery column names.
313+
DatapointFieldMapping datapoint_field_mapping = 2
314+
[(google.api.field_behavior) = REQUIRED];
315+
}
316+
317+
// The source of the data to import.
318+
oneof source {
319+
// Configuration for importing data from a BigQuery table.
320+
BigQuerySourceConfig big_query_source_config = 1;
321+
}
322+
}
323+
324+
// Required. The name of the Index resource to import data to.
325+
// Format:
326+
// `projects/{project}/locations/{location}/indexes/{index}`
327+
string name = 1 [
328+
(google.api.field_behavior) = REQUIRED,
329+
(google.api.resource_reference) = {
330+
type: "aiplatform.googleapis.com/Index"
331+
}
332+
];
333+
334+
// Optional. If true, completely replace existing index data. Must be true for
335+
// streaming update indexes.
336+
bool is_complete_overwrite = 2 [(google.api.field_behavior) = OPTIONAL];
337+
338+
// Required. Configuration for importing data from an external source.
339+
ConnectorConfig config = 3 [(google.api.field_behavior) = REQUIRED];
340+
}
341+
342+
// Runtime operation information for
343+
// [IndexService.ImportIndex][google.cloud.aiplatform.v1beta1.IndexService.ImportIndex].
344+
message ImportIndexOperationMetadata {
345+
// The operation generic information.
346+
GenericOperationMetadata generic_metadata = 1;
347+
}
348+
226349
// Request message for
227350
// [IndexService.DeleteIndex][google.cloud.aiplatform.v1beta1.IndexService.DeleteIndex].
228351
message DeleteIndexRequest {
@@ -348,6 +471,12 @@ message NearestNeighborSearchOperationMetadata {
348471

349472
// Invalid dense embedding.
350473
INVALID_EMBEDDING = 17;
474+
475+
// Invalid embedding metadata.
476+
INVALID_EMBEDDING_METADATA = 18;
477+
478+
// Embedding metadata exceeds size limit.
479+
EMBEDDING_METADATA_EXCEEDS_SIZE_LIMIT = 19;
351480
}
352481

353482
// The error type of this record.

0 commit comments

Comments
 (0)