EncryptedIndex
instance based on its name and key.
Parameters
Parameter | Type | Description |
---|---|---|
index_name | str | Name of an existing index |
index_key | bytes | 32-byte encryption key |
The encryption key must exactly match the key used during index creation.
Exceptions
Error
Error
- Throws if the index doesn’t exist on the server
- Throws if the encryption key is incorrect or invalid
- Throws if the encryption key is not exactly 32 bytes
- Throws if authentication fails (invalid API key)
Network/API Errors
Network/API Errors
- Throws if the API request fails due to network issues
- Throws if the server returns an HTTP error status
- Throws if the server is unreachable or times out
Returns
An instance ofEncryptedIndex
if the index exists and the key is valid.
Exceptions
Error
Error
- Throws if the index doesn’t exist on the server
- Throws if the encryption key is incorrect or invalid
- Throws if the server returns an HTTP error status.
- Throws if authentication fails (invalid API key).
Service Errors
Service Errors
- Throws if the CyborgDB service is unavailable or unreachable.
- Throws if there are internal server errors on the CyborgDB service.
Example Usage
Basic usage of theload_index
method to retrieve an existing index: