Is there an API for nodetool
? Especially nodetool tablestats
I saw there is https://github.com/scylladb/scylla/tree/master/api/api-doc. Is this the right place to look for APIs?
The Scylla server indeed has a REST API and it's documentation is at the URL you point to. You can find a Swagger UI when you start the Scylla server as well: https://docs.scylladb.com/operating-scylla/rest/.
But, please note that nodetool
, for example, does not use the API directly. Instead, it talks to the Scylla JMX proxy, which is a Java process that implements Cassandra-compatible JMX API. You can still use the REST API directly, but you have to figure out the mapping between the JMX operations and the REST API yourself.
For something like nodetool tablestats
, the first step is to check what JMX APIs nodetool uses:
The command delegates to TableStatsHolder class:
which uses the ColumnFamilyStoreMBean JMX API for querying table statistics.
You can find the implementation of the JMX API in the scylla-jmx project by finding the ColumnFamilyStore class (without the MBean suffix):
From that class, you can see that, for example, the ColumnFamilyStore.getSSTableCountPerLevel()
method delegates to the column_family/sstables/per_level/<table name>
REST API URL.