Skip to main content

indexes

Creates, updates, deletes, gets or lists an indexes resource.

Overview

Nameindexes
TypeResource
Idgoogle.aiplatform.indexes

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the Index.
createTimestring (google-datetime)Output only. Timestamp when this Index was created.
deployedIndexesarrayOutput only. The pointers to DeployedIndexes created from this Index. An Index can be only deleted if all its DeployedIndexes had been undeployed first.
descriptionstringThe description of the Index.
displayNamestringRequired. The display name of the Index. The name can be up to 128 characters long and can consist of any UTF-8 characters.
encryptionSpecobjectImmutable. Customer-managed encryption key spec for an Index. If set, this Index and all sub-resources of this Index will be secured by this key. (id: GoogleCloudAiplatformV1EncryptionSpec)
etagstringUsed to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.
indexStatsobjectOutput only. Stats of the index resource. (id: GoogleCloudAiplatformV1IndexStats)
indexUpdateMethodstringImmutable. The update method to use with this Index. If not set, BATCH_UPDATE will be used by default.
labelsobjectThe labels with user-defined metadata to organize your Indexes. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
metadataanyAn additional information about the Index; the schema of the metadata can be found in metadata_schema.
metadataSchemaUristringImmutable. Points to a YAML file stored on Google Cloud Storage describing additional information about the Index, that is specific to it. Unset if the Index does not have any additional information. The schema is defined as an OpenAPI 3.0.2 Schema Object. Note: The URI given on output will be immutable and probably different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
updateTimestring (google-datetime)Output only. Timestamp when this Index was most recently updated. This also includes any update to the contents of the Index. Note that Operations working on this Index may have their Operations.metadata.generic_metadata.update_time a little after the value of this timestamp, yet that does not mean their results are not already reflected in the Index. Result of any successfully completed Operation on the Index is reflected in it.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, indexesIdGets an Index.
listselectprojectsId, locationsIdfilter, pageSize, pageToken, readMaskLists Indexes in a Location.
createinsertprojectsId, locationsIdCreates an Index.
patchupdateprojectsId, locationsId, indexesIdupdateMaskUpdates an Index.
deletedeleteprojectsId, locationsId, indexesIdDeletes an Index. An Index can only be deleted when all its DeployedIndexes had been undeployed.
upsert_datapointsexecprojectsId, locationsId, indexesIdAdd/update Datapoints into an Index.
remove_datapointsexecprojectsId, locationsId, indexesIdRemove Datapoints from an Index.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
indexesIdstring
locationsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
readMaskstring (google-fieldmask)
updateMaskstring (google-fieldmask)

SELECT examples

Gets an Index.

SELECT
name,
createTime,
deployedIndexes,
description,
displayName,
encryptionSpec,
etag,
indexStats,
indexUpdateMethod,
labels,
metadata,
metadataSchemaUri,
satisfiesPzi,
satisfiesPzs,
updateTime
FROM google.aiplatform.indexes
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND indexesId = '{{ indexesId }}' -- required;

INSERT examples

Creates an Index.

INSERT INTO google.aiplatform.indexes (
data__displayName,
data__description,
data__metadataSchemaUri,
data__metadata,
data__etag,
data__labels,
data__indexUpdateMethod,
data__encryptionSpec,
projectsId,
locationsId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ metadataSchemaUri }}',
'{{ metadata }}',
'{{ etag }}',
'{{ labels }}',
'{{ indexUpdateMethod }}',
'{{ encryptionSpec }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an Index.

UPDATE google.aiplatform.indexes
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__metadataSchemaUri = '{{ metadataSchemaUri }}',
data__metadata = '{{ metadata }}',
data__etag = '{{ etag }}',
data__labels = '{{ labels }}',
data__indexUpdateMethod = '{{ indexUpdateMethod }}',
data__encryptionSpec = '{{ encryptionSpec }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND indexesId = '{{ indexesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an Index. An Index can only be deleted when all its DeployedIndexes had been undeployed.

DELETE FROM google.aiplatform.indexes
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND indexesId = '{{ indexesId }}' --required;

Lifecycle Methods

Add/update Datapoints into an Index.

EXEC google.aiplatform.indexes.upsert_datapoints 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@indexesId='{{ indexesId }}' --required
@@json=
'{
"datapoints": "{{ datapoints }}",
"updateMask": "{{ updateMask }}"
}';