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
-
#clear_repositories_metering_archive(arguments = {}) ⇒ Object
Clear the archived repositories metering.
-
#get_repositories_metering_info(arguments = {}) ⇒ Object
Get cluster repositories metering.
-
#hot_threads(arguments = {}) ⇒ Object
Get the hot threads for nodes.
-
#info(arguments = {}) ⇒ Object
Get node information.
-
#reload_secure_settings(arguments = {}) ⇒ Object
Reload the keystore on nodes in the cluster.
-
#stats(arguments = {}) ⇒ Object
Get node statistics.
-
#usage(arguments = {}) ⇒ Object
Get feature usage information.
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.
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.
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.
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.
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.
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.
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.
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 |