Module: Elasticsearch::API::Nodes::Actions

Defined in:
lib/elasticsearch/api/actions/nodes/info.rb,
lib/elasticsearch/api/actions/nodes/stats.rb,
lib/elasticsearch/api/actions/nodes/usage.rb,
lib/elasticsearch/api/actions/nodes/hot_threads.rb,
lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb,
lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb,
lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb

Instance Method Summary collapse

Instance Method Details

#clear_repositories_metering_archive(arguments = {}) ⇒ Object

Clear the archived repositories metering. Clear the archived repositories metering information in the cluster. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :node_id (String, Array)

    Comma-separated list of node IDs or names used to limit returned information. (Required)

  • :max_archive_version (Integer)

    Specifies the maximum archive_version to be cleared from the archive. (Required)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb', line 38

def clear_repositories_metering_archive(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'nodes.clear_repositories_metering_archive' }

  defined_params = [:node_id, :max_archive_version].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'node_id' missing" unless arguments[:node_id]

  unless arguments[:max_archive_version]
    raise ArgumentError,
          "Required argument 'max_archive_version' missing"
  end

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _node_id = arguments.delete(:node_id)

  _max_archive_version = arguments.delete(:max_archive_version)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_nodes/#{Utils.listify(_node_id)}/_repositories_metering/#{Utils.listify(_max_archive_version)}"
  params = {}

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

#get_repositories_metering_info(arguments = {}) ⇒ Object

Get cluster repositories metering. Get repositories metering information for a cluster. This API exposes monotonically non-decreasing counters and it is expected that clients would durably store the information needed to compute aggregations over a period of time. Additionally, the information exposed by this API is volatile, meaning that it will not be present after node restarts. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :node_id (String, Array)

    Comma-separated list of node IDs or names used to limit returned information. (Required)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb', line 39

def get_repositories_metering_info(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'nodes.get_repositories_metering_info' }

  defined_params = [:node_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'node_id' missing" unless arguments[:node_id]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _node_id = arguments.delete(:node_id)

  method = Elasticsearch::API::HTTP_GET
  path   = "_nodes/#{Utils.listify(_node_id)}/_repositories_metering"
  params = {}

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

#hot_threads(arguments = {}) ⇒ Object

Get the hot threads for nodes. Get a breakdown of the hot threads on each selected node in the cluster. The output is plain text with a breakdown of the top hot threads for each node.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :node_id (String, Array)

    List of node IDs or names used to limit returned information.

  • :ignore_idle_threads (Boolean)

    If true, known idle threads (e.g. waiting in a socket select, or to get a task from an empty queue) are filtered out. Server default: true.

  • :interval (Time)

    The interval to do the second sampling of threads. Server default: 500ms.

  • :snapshots (Integer)

    Number of samples of thread stacktrace. Server default: 10.

  • :threads (Integer)

    Specifies the number of hot threads to provide information for. Server default: 3.

  • :timeout (Time)

    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.

  • :type (String)

    The type to sample. Server default: cpu.

  • :sort (String)

    The sort order for ‘cpu’ type (default: total)

  • :headers (Hash)

    Custom HTTP headers

See Also:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/elasticsearch/api/actions/nodes/hot_threads.rb', line 43

def hot_threads(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'nodes.hot_threads' }

  defined_params = [:node_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _node_id = arguments.delete(:node_id)

  method = Elasticsearch::API::HTTP_GET
  path   = if _node_id
             "_nodes/#{Utils.listify(_node_id)}/hot_threads"
           else
             '_nodes/hot_threads'
           end
  params = Utils.process_params(arguments)

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

#info(arguments = {}) ⇒ Object

Get node information. By default, the API returns all attributes and core settings for cluster nodes.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :node_id (String, Array)

    Comma-separated list of node IDs or names used to limit returned information.

  • :metric (String, Array<String>)

    Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest.

  • :flat_settings (Boolean)

    If true, returns settings in flat format.

  • :timeout (Time)

    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.

  • :headers (Hash)

    Custom HTTP headers

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/elasticsearch/api/actions/nodes/info.rb', line 36

def info(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'nodes.info' }

  defined_params = [:node_id, :metric].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _node_id = arguments.delete(:node_id)

  _metric = arguments.delete(:metric)

  method = Elasticsearch::API::HTTP_GET
  path   = if _node_id && _metric
             "_nodes/#{Utils.listify(_node_id)}/#{Utils.listify(_metric)}"
           elsif _node_id
             "_nodes/#{Utils.listify(_node_id)}"
           elsif _metric
             "_nodes/#{Utils.listify(_metric)}"
           else
             '_nodes'
           end
  params = Utils.process_params(arguments)

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

#reload_secure_settings(arguments = {}) ⇒ Object

Reload the keystore on nodes in the cluster. Secure settings are stored in an on-disk keystore. Certain of these settings are reloadable. That is, you can change them on disk and reload them without restarting any nodes in the cluster. When you have updated reloadable secure settings in your keystore, you can use this API to reload those settings on each node. When the Elasticsearch keystore is password protected and not simply obfuscated, you must provide the password for the keystore when you reload the secure settings. Reloading the settings for the whole cluster assumes that the keystores for all nodes are protected with the same password; this method is allowed only when inter-node communications are encrypted. Alternatively, you can reload the secure settings on each node by locally accessing the API and passing the node-specific Elasticsearch keystore password.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :node_id (String, Array)

    The names of particular nodes in the cluster to target.

  • :timeout (Time)

    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.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

See Also:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb', line 41

def reload_secure_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'nodes.reload_secure_settings' }

  defined_params = [:node_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _node_id = arguments.delete(:node_id)

  method = Elasticsearch::API::HTTP_POST
  path   = if _node_id
             "_nodes/#{Utils.listify(_node_id)}/reload_secure_settings"
           else
             '_nodes/reload_secure_settings'
           end
  params = Utils.process_params(arguments)

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

#stats(arguments = {}) ⇒ Object

Get node statistics. Get statistics for nodes in a cluster. By default, all stats are returned. You can limit the returned information by using metrics.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :node_id (String, Array)

    Comma-separated list of node IDs or names used to limit returned information.

  • :metric (String, Array<String>)

    Limit the information returned to the specified metrics

  • :index_metric (String, Array<String>)

    Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified.

  • :completion_fields (String, Array<String>)

    Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.

  • :fielddata_fields (String, Array<String>)

    Comma-separated list or wildcard expressions of fields to include in fielddata statistics.

  • :fields (String, Array<String>)

    Comma-separated list or wildcard expressions of fields to include in the statistics.

  • :groups (Boolean)

    Comma-separated list of search groups to include in the search statistics.

  • :include_segment_file_sizes (Boolean)

    If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).

  • :level (String)

    Indicates whether statistics are aggregated at the cluster, index, or shard level.

  • :timeout (Time)

    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.

  • :types (Array<String>)

    A comma-separated list of document types for the indexing index metric.

  • :include_unloaded_segments (Boolean)

    If true, the response includes information from segments that are not loaded into memory.

  • :headers (Hash)

    Custom HTTP headers

See Also:



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/elasticsearch/api/actions/nodes/stats.rb', line 45

def stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'nodes.stats' }

  defined_params = [:node_id, :metric, :index_metric].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _node_id = arguments.delete(:node_id)

  _metric = arguments.delete(:metric)

  _index_metric = arguments.delete(:index_metric)

  method = Elasticsearch::API::HTTP_GET
  path   = if _node_id && _metric && _index_metric
             "_nodes/#{Utils.listify(_node_id)}/stats/#{Utils.listify(_metric)}/#{Utils.listify(_index_metric)}"
           elsif _metric && _index_metric
             "_nodes/stats/#{Utils.listify(_metric)}/#{Utils.listify(_index_metric)}"
           elsif _node_id && _metric
             "_nodes/#{Utils.listify(_node_id)}/stats/#{Utils.listify(_metric)}"
           elsif _node_id
             "_nodes/#{Utils.listify(_node_id)}/stats"
           elsif _metric
             "_nodes/stats/#{Utils.listify(_metric)}"
           else
             '_nodes/stats'
           end
  params = Utils.process_params(arguments)

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

#usage(arguments = {}) ⇒ Object

Get feature usage information.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :node_id (String, Array)

    A comma-separated list of node IDs or names to limit the returned information; use _local to return information from the node you’re connecting to, leave empty to get information from all nodes

  • :metric (String, Array<String>)

    Limits the information returned to the specific metrics. A comma-separated list of the following options: _all, rest_actions.

  • :timeout (Time)

    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.

  • :headers (Hash)

    Custom HTTP headers

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/elasticsearch/api/actions/nodes/usage.rb', line 36

def usage(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'nodes.usage' }

  defined_params = [:node_id, :metric].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _node_id = arguments.delete(:node_id)

  _metric = arguments.delete(:metric)

  method = Elasticsearch::API::HTTP_GET
  path   = if _node_id && _metric
             "_nodes/#{Utils.listify(_node_id)}/usage/#{Utils.listify(_metric)}"
           elsif _node_id
             "_nodes/#{Utils.listify(_node_id)}/usage"
           elsif _metric
             "_nodes/usage/#{Utils.listify(_metric)}"
           else
             '_nodes/usage'
           end
  params = Utils.process_params(arguments)

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