Search in sources :

Example 1 with ClusterStatsRequest

use of org.opensearch.action.admin.cluster.stats.ClusterStatsRequest in project OpenSearch by opensearch-project.

the class RestClusterStatsAction method prepareRequest.

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    ClusterStatsRequest clusterStatsRequest = new ClusterStatsRequest().nodesIds(request.paramAsStringArray("nodeId", null));
    clusterStatsRequest.timeout(request.param("timeout"));
    return channel -> client.admin().cluster().clusterStats(clusterStatsRequest, new NodesResponseRestListener<>(channel));
}
Also used : List(java.util.List) ClusterStatsRequest(org.opensearch.action.admin.cluster.stats.ClusterStatsRequest) NodeClient(org.opensearch.client.node.NodeClient) Collections.unmodifiableList(java.util.Collections.unmodifiableList) GET(org.opensearch.rest.RestRequest.Method.GET) RestRequest(org.opensearch.rest.RestRequest) Arrays.asList(java.util.Arrays.asList) IOException(java.io.IOException) BaseRestHandler(org.opensearch.rest.BaseRestHandler) NodesResponseRestListener(org.opensearch.rest.action.RestActions.NodesResponseRestListener) ClusterStatsRequest(org.opensearch.action.admin.cluster.stats.ClusterStatsRequest)

Aggregations

IOException (java.io.IOException)1 Arrays.asList (java.util.Arrays.asList)1 Collections.unmodifiableList (java.util.Collections.unmodifiableList)1 List (java.util.List)1 ClusterStatsRequest (org.opensearch.action.admin.cluster.stats.ClusterStatsRequest)1 NodeClient (org.opensearch.client.node.NodeClient)1 BaseRestHandler (org.opensearch.rest.BaseRestHandler)1 RestRequest (org.opensearch.rest.RestRequest)1 GET (org.opensearch.rest.RestRequest.Method.GET)1 NodesResponseRestListener (org.opensearch.rest.action.RestActions.NodesResponseRestListener)1