Manage indexes
An index is a basic unit for organizing and storing video data consisting of video embeddings and metadata. Indexes facilitate information retrieval and processing. The resources.Index
class provides methods to manage your indexes.
Properties
Methods
Create an index
Description: This method creates a new index based on the provided parameters.
Function signature and example:
Parameters
Return value: Returns a models.Index
object representing the newly created index.
API Reference: For a description of each field in the request and response, see the Create an index page.
Related guide: Create indexes.
Retrieve an index
Description: This method retrieves details of a specific index.
Function signature and example:
Parameters
Return value: Returns a models.Index
object representing the retrieved index.
API Reference: For a description of each field in the request and response, see the Retrieve an index page.
List indexes with direct pagination
Description: The list method retrieves a paginated list of indexes based on the provided parameters. Choose this method mainly when the total number of items is manageable or you must fetch a single page of results. By default, the platform returns your indexes sorted by creation date, with the newest at the top of the list.
Function signature and example:
Parameters
Return value: Returns a RootModelList
containing models.Index
objects, representing the list of indexes that match the specified criteria.
API Reference: For a description of each field in the request and response, see the List indexes page.
Related guides:
List indexes with iterative pagination
Description: This method iterates through a paginated list of indexes based on the provided parameters. Choose this method mainly when your application must retrieve a large number of items. By default, the platform returns your indexes sorted by creation date, with the newest at the top of the list.
Function signature and example:
Parameters
Return value: Returns a models.IndexListWithPagination
object, containing the list of indexes that match the specified criteria and pagination information.
Notes
To retrieve subsequent pages of results, use the iterator protocol:
- Invoke the
next
function, passing theIndexListWithPagination
object as a parameter. - Repeat this call until a
StopIteration
exception occurs, indicating no more pages exist.
API Reference: For a description of each field in the request and response, see the List indexes page.
Related guides:
Update an index
Description: This method updates the name of an existing index.
Function signature and example:
Parameters:
Return value: None
. This method doesn’t return any data upon successful completion.
API Reference: Update an index.
Delete an index
Description: This method deletes an existing index.
Function signature and example:
Parameters:
Return value: None
. This method doesn’t return any data upon successful completion.
API Reference: Delete an index