How to high level rest client request request nodes stats URGENT!

Hi,
I want to use high rest client for metric collector on java. There is a url (http://172.****:9200//_nodes/172.28../stats/os). Response about metric data and I read here . How can ı do request? Which can ı use any method? can you help me?

Actually, I want to do;
For example with Java low level Rest client

RestClient restClient = RestClient.builder(new HttpHost(remoteIp, 9200)).build();
Request request = new Request("GET", "/_nodes/172.28.25.239/stats/os");
Response response = restClient.performRequest(request);
String body = EntityUtils.toString(response.getEntity());

How can ı do with Java highlevel Rest client?

I don't think this API has been exposed yet in the HLClient.
So falling back to the Low Level Client as you did seems to me the right solution.

BTW I don't think it will be supported according to:

I think ı use LLClient as seems to the right solution. Maven file use two dependencies so doesn't look good at all. :slight_smile:

		<dependency>
			<groupId>org.elasticsearch.client</groupId>
			<artifactId>elasticsearch-rest-high-level-client</artifactId>
			<version>6.6.1</version>
		</dependency>
		
		<dependency>
			<groupId>org.elasticsearch.client</groupId>
			<artifactId>elasticsearch-rest-client</artifactId>
			<version>6.6.1</version>
		</dependency>

When I say fallback to the low level does not mean that you can not use the HLClient for the other APIs.

And you don't have to declare both deps in you code.

<dependency>
  <groupId>org.elasticsearch.client</groupId>
  <artifactId>elasticsearch-rest-high-level-client</artifactId>
  <version>6.6.1</version>
</dependency>

is enough.

Hi David,
Thank you for response :grinning:
Best regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.