@@ -108,6 +108,7 @@ def _create(
108
108
credentials : Optional [auth_credentials .Credentials ] = None ,
109
109
request_metadata : Optional [Sequence [Tuple [str , str ]]] = (),
110
110
sync : bool = True ,
111
+ index_update_method : Optional [str ] = None ,
111
112
) -> "MatchingEngineIndex" :
112
113
"""Creates a MatchingEngineIndex resource.
113
114
@@ -153,27 +154,33 @@ def _create(
153
154
credentials set in aiplatform.init.
154
155
request_metadata (Sequence[Tuple[str, str]]):
155
156
Optional. Strings which should be sent along with the request as metadata.
156
- encryption_spec (str):
157
- Optional. Customer-managed encryption key
158
- spec for data storage. If set, both of the
159
- online and offline data storage will be secured
160
- by this key.
161
157
sync (bool):
162
158
Optional. Whether to execute this creation synchronously. If False, this method
163
159
will be executed in concurrent Future and any downstream object will
164
160
be immediately returned and synced when the Future has completed.
161
+ index_update_method (str):
162
+ Optional. The update method to use with this index. Choose
163
+ stream_update or batch_update. If not set, batch update will be
164
+ used by default.
165
165
166
166
Returns:
167
167
MatchingEngineIndex - Index resource object
168
168
169
169
"""
170
+ index_update_method_enum = None
171
+ if index_update_method in _INDEX_UPDATE_METHOD_TO_ENUM_VALUE :
172
+ index_update_method_enum = _INDEX_UPDATE_METHOD_TO_ENUM_VALUE [
173
+ index_update_method
174
+ ]
175
+
170
176
gapic_index = gca_matching_engine_index .Index (
171
177
display_name = display_name ,
172
178
description = description ,
173
179
metadata = {
174
180
"config" : config .as_dict (),
175
181
"contentsDeltaUri" : contents_delta_uri ,
176
182
},
183
+ index_update_method = index_update_method_enum ,
177
184
)
178
185
179
186
if labels :
@@ -386,6 +393,7 @@ def create_tree_ah_index(
386
393
credentials : Optional [auth_credentials .Credentials ] = None ,
387
394
request_metadata : Optional [Sequence [Tuple [str , str ]]] = (),
388
395
sync : bool = True ,
396
+ index_update_method : Optional [str ] = None ,
389
397
) -> "MatchingEngineIndex" :
390
398
"""Creates a MatchingEngineIndex resource that uses the tree-AH algorithm.
391
399
@@ -456,15 +464,14 @@ def create_tree_ah_index(
456
464
credentials set in aiplatform.init.
457
465
request_metadata (Sequence[Tuple[str, str]]):
458
466
Optional. Strings which should be sent along with the request as metadata.
459
- encryption_spec (str):
460
- Optional. Customer-managed encryption key
461
- spec for data storage. If set, both of the
462
- online and offline data storage will be secured
463
- by this key.
464
467
sync (bool):
465
468
Optional. Whether to execute this creation synchronously. If False, this method
466
469
will be executed in concurrent Future and any downstream object will
467
470
be immediately returned and synced when the Future has completed.
471
+ index_update_method (str):
472
+ Optional. The update method to use with this index. Choose
473
+ STREAM_UPDATE or BATCH_UPDATE. If not set, batch update will be
474
+ used by default.
468
475
469
476
Returns:
470
477
MatchingEngineIndex - Index resource object
@@ -494,6 +501,7 @@ def create_tree_ah_index(
494
501
credentials = credentials ,
495
502
request_metadata = request_metadata ,
496
503
sync = sync ,
504
+ index_update_method = index_update_method ,
497
505
)
498
506
499
507
@classmethod
@@ -512,6 +520,7 @@ def create_brute_force_index(
512
520
credentials : Optional [auth_credentials .Credentials ] = None ,
513
521
request_metadata : Optional [Sequence [Tuple [str , str ]]] = (),
514
522
sync : bool = True ,
523
+ index_update_method : Optional [str ] = None ,
515
524
) -> "MatchingEngineIndex" :
516
525
"""Creates a MatchingEngineIndex resource that uses the brute force algorithm.
517
526
@@ -571,15 +580,14 @@ def create_brute_force_index(
571
580
credentials set in aiplatform.init.
572
581
request_metadata (Sequence[Tuple[str, str]]):
573
582
Optional. Strings which should be sent along with the request as metadata.
574
- encryption_spec (str):
575
- Optional. Customer-managed encryption key
576
- spec for data storage. If set, both of the
577
- online and offline data storage will be secured
578
- by this key.
579
583
sync (bool):
580
584
Optional. Whether to execute this creation synchronously. If False, this method
581
585
will be executed in concurrent Future and any downstream object will
582
586
be immediately returned and synced when the Future has completed.
587
+ index_update_method (str):
588
+ Optional. The update method to use with this index. Choose
589
+ stream_update or batch_update. If not set, batch update will be
590
+ used by default.
583
591
584
592
Returns:
585
593
MatchingEngineIndex - Index resource object
@@ -605,4 +613,11 @@ def create_brute_force_index(
605
613
credentials = credentials ,
606
614
request_metadata = request_metadata ,
607
615
sync = sync ,
616
+ index_update_method = index_update_method ,
608
617
)
618
+
619
+
620
+ _INDEX_UPDATE_METHOD_TO_ENUM_VALUE = {
621
+ "STREAM_UPDATE" : gca_matching_engine_index .Index .IndexUpdateMethod .STREAM_UPDATE ,
622
+ "BATCH_UPDATE" : gca_matching_engine_index .Index .IndexUpdateMethod .BATCH_UPDATE ,
623
+ }
0 commit comments