Skip to content

Commit f908dfa

Browse files
committed
Reinstate support for GET _cluster/stats?timeout=...
Relates elastic#112478
1 parent 21ccde5 commit f908dfa

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cluster.stats/10_basic.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
- is_true: nodes.plugins
3131
- is_true: nodes.network_types
3232

33+
---
34+
"cluster stats accepts timeout param":
35+
- do:
36+
cluster.stats:
37+
timeout: 24h
38+
39+
- is_true: timestamp
40+
- is_true: cluster_name
41+
3342
---
3443
"cluster stats with human flag returns docs as human readable size":
3544
- requires:

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStatsAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.Set;
2626

2727
import static org.elasticsearch.rest.RestRequest.Method.GET;
28+
import static org.elasticsearch.rest.RestUtils.REST_TIMEOUT_PARAM;
2829
import static org.elasticsearch.rest.RestUtils.getTimeout;
2930

3031
@ServerlessScope(Scope.INTERNAL)
@@ -46,7 +47,7 @@ public String getName() {
4647

4748
@Override
4849
public Set<String> supportedQueryParameters() {
49-
return Set.of("include_remotes", "nodeId");
50+
return Set.of("include_remotes", "nodeId", REST_TIMEOUT_PARAM);
5051
}
5152

5253
@Override

0 commit comments

Comments
 (0)