List index names

Tables with the Data API are currently in public preview. Development is ongoing, and the features and functionality are subject to change. Hyper-Converged Database (HCD), and the use of such, is subject to the DataStax Preview Terms.

Gets the names of the indexes for a table.

Ready to write code? See the examples for this method to get started. If you are new to the Data API, check out the quickstart.

Result

  • Python

  • TypeScript

  • Java

  • curl

Returns the index names for a table as an unordered list of strings.

Example response:

['m_vector_index', 'winner_index', 'score_index']

The TypeScript client does not support this method. Use direct HTTP requests instead, as demonstrated on the curl tab.

Returns the index names for a table as an unordered list of strings.

Returns the index names for a table as an unordered list of strings in the status.indexes field of the response.

Example response:

{
  "status": {
    "indexes": [
      "index_name_1",
      "index_name_2"
    ]
  }
}

Parameters

  • Python

  • TypeScript

  • Java

  • curl

Use the list_index_names method, which belongs to the astrapy.Table class.

Method signature
list_index_names(
  *,
  table_admin_timeout_ms: int,
  request_timeout_ms: int,
  timeout_ms: int,
) -> list[str]
Name Type Summary

table_admin_timeout_ms

int

Optional. A timeout, in milliseconds, for the underlying HTTP request. If not provided, the Table defaults apply. This parameter is aliased as request_timeout_ms and timeout_ms for convenience.

The TypeScript client does not support this method. Use direct HTTP requests instead, as demonstrated on the curl tab.

Use the listIndexesNames method, which belongs to the com.datastax.astra.client.tables.Table class.

Method signature
List<String> listIndexesNames()
List<String> listIndexesNames(ListIndexesOptions listIndexesOptions)
Name Type Summary

options

ListIndexesOptions

Optional. Options for the method, including timeout.

Use the listIndexes command.

Command signature
curl -sS -L -X POST "API_ENDPOINT/api/json/v1/KEYSPACE_NAME/TABLE_NAME" \
--header "Token: APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
  "listIndexes": {
    "options": {
      "explain": false
    }
  }
}'
Name Type Summary

options.explain

false

Must be false to return only the index names. Otherwise, index names and metadata are returned.

Examples

The following examples demonstrate how to get the names of the indexes for a table.

List index names

  • Python

  • TypeScript

  • Java

  • curl

from astrapy import DataAPIClient
from astrapy.authentication import UsernamePasswordTokenProvider
from astrapy.constants import Environment

# Get an existing table
client = DataAPIClient(environment=Environment.HCD)
database = client.get_database(
    "API_ENDPOINT",
    token=UsernamePasswordTokenProvider("USERNAME", "PASSWORD"),
)
table = database.get_table("TABLE_NAME", keyspace="KEYSPACE_NAME")

# List index names
result = table.list_index_names()
print(result)

The TypeScript client does not support this method. Use direct HTTP requests instead, as demonstrated on the curl tab.

import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.DataAPIClients;
import com.datastax.astra.client.databases.Database;
import com.datastax.astra.client.tables.Table;
import com.datastax.astra.client.tables.definition.rows.Row;
import java.util.List;

public class Example {

  public static void main(String[] args) {
    // Get an existing table
    DataAPIClient client = DataAPIClients.clientHCD("USERNAME", "PASSWORD");
    Database database = client.getDatabase("API_ENDPOINT", "KEYSPACE_NAME");
    Table<Row> table = database.getTable("TABLE_NAME");

    // List index names
    List<String> result = table.listIndexesNames();

    System.out.println(result);
  }
}
curl -sS -L -X POST "API_ENDPOINT/v1/KEYSPACE_NAME/TABLE_NAME" \
  --header "Token: APPLICATION_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "listIndexes": {
    "options": {
      "explain": false
    }
  }
}'

Client reference

  • Python

  • TypeScript

  • Java

  • curl

For more information, see the client reference.

The TypeScript client does not support this method. Use direct HTTP requests instead, as demonstrated on the curl tab.

For more information, see the client reference.

Client reference documentation is not applicable for HTTP.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax, an IBM Company | Privacy policy | Terms of use | Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com