no possibility to query list of existing clusters via REST API
OrientDB Version, operating system, or hardware.
- v2.2.5
Operating System
- [x] Linux
- [ ] MacOSX
- [ ] Windows
- [ ] Other Unix
- [ ] Other, name?
Expected behavior and actual behavior
Possibility to query via REST API the database about its existing clusters, just like console command "clusters" does I need to be able to get the names of all clusters that are associated to a class, and their cluster-ID.
There is possibility to question a class about its clusters ( "http://orientdb.com/docs/2.1/OrientDB-REST.html#get---class" ), but that does return only the cluster-IDs, not the cluster names.
Steps to reproduce the problem
+1
What do you need the cluster ID numbers for?
There was a similar need discussed for the PHP driver, but it turns out, the ID numbers shouldn't be needed.
https://github.com/orientechnologies/orientdb/issues/6258
Scott
while awaiting a functionality via the REST API, I wrote following (probably not optimal, but working) Java program:
import java.util.List; import java.util.Arrays; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx ; import com.orientechnologies.orient.client.remote.OServerAdmin ;
public class listClusters { public static void main(String[] args) { ODatabaseDocumentTx db = new ODatabaseDocumentTx("remote:10.1.2.3/ourdbase"); try { db.open("admin", "admin"); String[] clusterNames = db.getClusterNames().toArray( new String[]{} );
System.out.println("Clusters:");
for(String s: clusterNames) { System.out.println(s); }
} finally {
db.close();
}
} }
@luigidellaquila hi Luigi, is there any planning to include this functionality (being able to request list of existing clusters via REST API) in any upcoming release ?
Hi @rdelangh
I think it will be included in 3.0, but right now I don't have an ETA for this
Thanks
Luigi
It's already available in 3.0 by querying the metadata:storage