org.elasticsearch.action.main.MainResponse Java Examples

The following examples show how to use org.elasticsearch.action.main.MainResponse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InfoApiMain.java    From elasticsearch-pool with Apache License 2.0 6 votes vote down vote up
public static void info() throws IOException {
    try{
        RestHighLevelClient client = HighLevelClient.getInstance();

        MainResponse response = client.info();

        ClusterName clusterName = response.getClusterName();
        String clusterUuid = response.getClusterUuid();
        String nodeName = response.getNodeName();
        Version version = response.getVersion();
        Build build = response.getBuild();

        System.out.println("clusterName: "+clusterName);
        System.out.println("clusterUuid: "+clusterUuid);
        System.out.println("nodeName: "+nodeName);
        System.out.println("version: "+version);
        System.out.println("build: "+build);

    }finally{
        HighLevelClient.close();
    }
}
 
Example #2
Source File: ElasticSearchClient.java    From elasticsearch-pool with Apache License 2.0 5 votes vote down vote up
public MainResponse info(){
    RestHighLevelClient client = null;
    try{
        client = getResource();
        MainResponse result = client.info();
        returnResource(client);
        return result;
    }catch(Exception e){
        returnBrokenResource(client);
        throw new ElasticSearchException(e);
    }
}
 
Example #3
Source File: ReactorElasticSearchClient.java    From james-project with Apache License 2.0 4 votes vote down vote up
public MainResponse info(RequestOptions options) throws IOException {
    return client.info(options);
}
 
Example #4
Source File: EnhancedRestHighLevelClient.java    From super-cloudops with Apache License 2.0 2 votes vote down vote up
/**
 * Get the cluster info otherwise provided when sending an HTTP request to
 * port 9200
 */
public final MainResponse info(Header... headers) throws IOException {
	return (MainResponse) exec((r) -> r.info(headers));
}