public Either < String , List < String > > dataSources ( Map < String , String > reqHeaders ) { Either < String , Either < JSONArray , JSONObject > > resp = fireCommand ( "druid/coordinator/v1/metadata/datasources" , null , reqHeaders ) ; if ( resp . isLeft ( ) ) { return new Left <> ( resp . left ( ) . get ( ) ) ; } Either < JSONArray , JSONObject > goodResp = resp . right ( ) . get ( ) ; if ( goodResp . isLeft ( ) ) { JSONArray dataSources = goodResp . left ( ) . get ( ) ; List < String > dataSourceList = new ArrayList <> ( ) ; for ( int i = 0 ; i < dataSources . length ( ) ; i ++ ) { dataSourceList . add ( dataSources . getString ( i ) ) ; } return new Right <> ( dataSourceList ) ; } return new Left <> ( resp . left ( ) . get ( ) ) ; }
Retrieve all the datasources provisioned in Druid .