Skip to content

Commit 936e23f

Browse files
committed
[API] Updates streams.logs_disable, streams.logs_enable, streams.status
Adds available parameters to experimental stream namespace APIs: * [Time] :master_timeout The period to wait for a connection to the master node. * [Time] :timeout The period to wait for a response. * [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. * [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. * [Boolean] :human When set to `true` will return statistics in a format suitable for humans. * [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging.
1 parent b038924 commit 936e23f

File tree

3 files changed

+69
-9
lines changed

3 files changed

+69
-9
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/streams/logs_disable.rb

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,31 @@ module Elasticsearch
2222
module API
2323
module Streams
2424
module Actions
25-
# Disable the Logs Streams feature for this cluster
25+
# Disable logs stream
26+
# This disables the logs stream feature for this cluster.
27+
# This functionality is Experimental and may be changed or removed
28+
# completely in a future release. Elastic will take a best effort approach
29+
# to fix any issues, but experimental features are not subject to the
30+
# support SLA of official GA features.
2631
#
32+
# @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
33+
# If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
34+
# @option arguments [Time] :timeout The period to wait for a response.
35+
# If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
36+
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
37+
# when they occur.
38+
# @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
39+
# returned by Elasticsearch.
40+
# @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
41+
# For example `"exists_time": "1h"` for humans and
42+
# `"exists_time_in_millis": 3600000` for computers. When disabled the human
43+
# readable values will be omitted. This makes sense for responses being consumed
44+
# only by machines.
45+
# @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
46+
# this option for debugging only.
2747
# @option arguments [Hash] :headers Custom HTTP headers
2848
#
29-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-disable.html
49+
# @see https://www.elastic.co/docs/api/doc/elasticsearch#TODO
3050
#
3151
def logs_disable(arguments = {})
3252
request_opts = { endpoint: arguments[:endpoint] || 'streams.logs_disable' }
@@ -38,7 +58,7 @@ def logs_disable(arguments = {})
3858

3959
method = Elasticsearch::API::HTTP_POST
4060
path = '_streams/logs/_disable'
41-
params = {}
61+
params = Utils.process_params(arguments)
4262

4363
Elasticsearch::API::Response.new(
4464
perform_request(method, path, params, body, headers, request_opts)

elasticsearch-api/lib/elasticsearch/api/actions/streams/logs_enable.rb

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,34 @@ module Elasticsearch
2222
module API
2323
module Streams
2424
module Actions
25-
# Enable the Logs Streams feature for this cluster
25+
# Enable logs stream
26+
# This enables the logs stream feature for this cluster.
27+
# Note: To protect existing data, this feature can only be enabled on a cluster if
28+
# it does not have existing indices or data streams matching the pattern `logs|logs.*`.
29+
# If this is the case, a `409 - Conflict` response and error will be returned.
30+
# This functionality is Experimental and may be changed or removed
31+
# completely in a future release. Elastic will take a best effort approach
32+
# to fix any issues, but experimental features are not subject to the
33+
# support SLA of official GA features.
2634
#
35+
# @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
36+
# If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
37+
# @option arguments [Time] :timeout The period to wait for a response.
38+
# If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
39+
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
40+
# when they occur.
41+
# @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
42+
# returned by Elasticsearch.
43+
# @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
44+
# For example `"exists_time": "1h"` for humans and
45+
# `"exists_time_in_millis": 3600000` for computers. When disabled the human
46+
# readable values will be omitted. This makes sense for responses being consumed
47+
# only by machines.
48+
# @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
49+
# this option for debugging only.
2750
# @option arguments [Hash] :headers Custom HTTP headers
2851
#
29-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-enable.html
52+
# @see https://www.elastic.co/docs/api/doc/elasticsearch#TODO
3053
#
3154
def logs_enable(arguments = {})
3255
request_opts = { endpoint: arguments[:endpoint] || 'streams.logs_enable' }
@@ -38,7 +61,7 @@ def logs_enable(arguments = {})
3861

3962
method = Elasticsearch::API::HTTP_POST
4063
path = '_streams/logs/_enable'
41-
params = {}
64+
params = Utils.process_params(arguments)
4265

4366
Elasticsearch::API::Response.new(
4467
perform_request(method, path, params, body, headers, request_opts)

elasticsearch-api/lib/elasticsearch/api/actions/streams/status.rb

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,28 @@ module Elasticsearch
2222
module API
2323
module Streams
2424
module Actions
25-
# Return the current status of the streams feature for each streams type
25+
# Get the status of streams
26+
# Gets the current status of all stream types
27+
# This functionality is Experimental and may be changed or removed
28+
# completely in a future release. Elastic will take a best effort approach
29+
# to fix any issues, but experimental features are not subject to the
30+
# support SLA of official GA features.
2631
#
32+
# @option arguments [String] :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.
33+
# @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
34+
# when they occur.
35+
# @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
36+
# returned by Elasticsearch.
37+
# @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
38+
# For example `"exists_time": "1h"` for humans and
39+
# `"exists_time_in_millis": 3600000` for computers. When disabled the human
40+
# readable values will be omitted. This makes sense for responses being consumed
41+
# only by machines.
42+
# @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
43+
# this option for debugging only.
2744
# @option arguments [Hash] :headers Custom HTTP headers
2845
#
29-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-status.html
46+
# @see https://www.elastic.co/docs/api/doc/elasticsearch#TODO
3047
#
3148
def status(arguments = {})
3249
request_opts = { endpoint: arguments[:endpoint] || 'streams.status' }
@@ -38,7 +55,7 @@ def status(arguments = {})
3855

3956
method = Elasticsearch::API::HTTP_GET
4057
path = '_streams/status'
41-
params = {}
58+
params = Utils.process_params(arguments)
4259

4360
Elasticsearch::API::Response.new(
4461
perform_request(method, path, params, body, headers, request_opts)

0 commit comments

Comments
 (0)