orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

no possibility to query list of existing clusters via REST API

Open langhha opened this issue 10 years ago • 6 comments

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

langhha avatar Aug 01 '16 11:08 langhha

+1

StarpTech avatar Aug 01 '16 11:08 StarpTech

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

smolinari avatar Aug 01 '16 14:08 smolinari

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();
  }

} }

langhha avatar Aug 02 '16 09:08 langhha

@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 ?

langhha avatar Oct 19 '16 10:10 langhha

Hi @rdelangh

I think it will be included in 3.0, but right now I don't have an ETA for this

Thanks

Luigi

luigidellaquila avatar Oct 24 '16 11:10 luigidellaquila

It's already available in 3.0 by querying the metadata:storage

lvca avatar Aug 05 '17 04:08 lvca