Skip to content

Commit ae6ad7d

Browse files
committed
Adds timeout parameters.
* `timeout`: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. * `master_timeout`: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. Added in the following APIs: indices.create_data_stream - timeout, master_timeout indices.delete_data_stream - master_timeout indices.get_data_lifecycle - master_timeout indices.get_data_stream - master_timeout indices.migrate_to_data_stream - timeout, master_timeout
1 parent 3849f4c commit ae6ad7d

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

lib/elasticsearch-serverless/api/indices/create_data_stream.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ module Actions
3232
# Cannot start with +-+, +_+, +++, or +.ds-+;
3333
# Cannot be +.+ or +..+;
3434
# Cannot be longer than 255 bytes. Multi-byte characters count towards this limit faster. (*Required*)
35+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
36+
# @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
3537
# @option arguments [Hash] :headers Custom HTTP headers
3638
#
3739
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
@@ -56,7 +58,7 @@ def create_data_stream(arguments = {})
5658

5759
method = ElasticsearchServerless::API::HTTP_PUT
5860
path = "_data_stream/#{Utils.listify(_name)}"
59-
params = {}
61+
params = Utils.process_params(arguments)
6062

6163
ElasticsearchServerless::API::Response.new(
6264
perform_request(method, path, params, body, headers, request_opts)

lib/elasticsearch-serverless/api/indices/delete_data_stream.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module Actions
2626
# Deletes one or more data streams and their backing indices.
2727
#
2828
# @option arguments [String, Array<String>] :name Comma-separated list of data streams to delete. Wildcard (+*+) expressions are supported. (*Required*)
29+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
2930
# @option arguments [String, Array<String>] :expand_wildcards Type of data stream that wildcard patterns can match. Supports comma-separated values,such as +open,hidden+. Server default: open.
3031
# @option arguments [Hash] :headers Custom HTTP headers
3132
#

lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module Actions
3232
# Supports comma-separated values, such as +open,hidden+.
3333
# Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open.
3434
# @option arguments [Boolean] :include_defaults If +true+, return all default settings in the response.
35+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
3536
# @option arguments [Hash] :headers Custom HTTP headers
3637
#
3738
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-get-lifecycle.html

lib/elasticsearch-serverless/api/indices/get_data_stream.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module Actions
3030
# @option arguments [String, Array<String>] :expand_wildcards Type of data stream that wildcard patterns can match.
3131
# Supports comma-separated values, such as +open,hidden+. Server default: open.
3232
# @option arguments [Boolean] :include_defaults If true, returns all relevant default configurations for the index template.
33+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
3334
# @option arguments [Hash] :headers Custom HTTP headers
3435
#
3536
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html

lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ module Actions
3535
# The write index for the alias becomes the write index for the stream.
3636
#
3737
# @option arguments [String] :name Name of the index alias to convert to a data stream. (*Required*)
38+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
39+
# @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
3840
# @option arguments [Hash] :headers Custom HTTP headers
3941
#
4042
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html
@@ -59,7 +61,7 @@ def migrate_to_data_stream(arguments = {})
5961

6062
method = ElasticsearchServerless::API::HTTP_POST
6163
path = "_data_stream/_migrate/#{Utils.listify(_name)}"
62-
params = {}
64+
params = Utils.process_params(arguments)
6365

6466
ElasticsearchServerless::API::Response.new(
6567
perform_request(method, path, params, body, headers, request_opts)

0 commit comments

Comments
 (0)