Skip to content

Commit d373912

Browse files
committed
[API] Adds return_200_for_cluster_health_timeout param to cluster.health
1 parent b97df82 commit d373912

File tree

1 file changed

+4
-2
lines changed
  • elasticsearch-api/lib/elasticsearch/api/actions/cluster

1 file changed

+4
-2
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/cluster/health.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ module Actions
3333
# @option arguments [Boolean] :wait_for_no_relocating_shards Whether to wait until there are no relocating shards in the cluster
3434
# @option arguments [Boolean] :wait_for_no_initializing_shards Whether to wait until there are no initializing shards in the cluster
3535
# @option arguments [String] :wait_for_status Wait until cluster is in a specific state (options: green, yellow, red)
36+
# @option arguments [Boolean] :return_200_for_cluster_health_timeout Whether to return HTTP 200 instead of 408 in case of a cluster health timeout from the server side
3637
# @option arguments [Hash] :headers Custom HTTP headers
3738
#
38-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/cluster-health.html
39+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.16/cluster-health.html
3940
#
4041
def health(arguments = {})
4142
headers = arguments.delete(:headers) || {}
@@ -70,7 +71,8 @@ def health(arguments = {})
7071
:wait_for_events,
7172
:wait_for_no_relocating_shards,
7273
:wait_for_no_initializing_shards,
73-
:wait_for_status
74+
:wait_for_status,
75+
:return_200_for_cluster_health_timeout
7476
].freeze)
7577
end
7678
end

0 commit comments

Comments
 (0)