Module: Wazuh::Api::Endpoints::Cluster
- Included in:
- Wazuh::Api::Endpoints, V4::Cluster
- Defined in:
- lib/wazuh/api/endpoints/cluster.rb
Instance Method Summary collapse
-
#analysisd_stats(node_id) ⇒ Object
Get node node_id’s analysisd stats.
-
#check_configuration ⇒ Object
Check Wazuh configuration in all cluster nodes.
-
#check_configuration_by_node(node_id) ⇒ Object
Check Wazuh configuration in a cluster node.
-
#cluster_configuration(options = {}) ⇒ Object
Returns the cluster configuration.
-
#cluster_healthcheck(options = {}) ⇒ Object
Show cluster health.
-
#cluster_logs_by_node(node_id, options) ⇒ Object
Get ossec.log from a specific node in cluster.
-
#cluster_logs_summary_by_node(node_id) ⇒ Object
Get summary of ossec.log from a specific node in cluster.
-
#cluster_status ⇒ Object
Get info about cluster status.
-
#component_configuration_by_node(node_id, component, configuration, options = {}) ⇒ Object
Returns the requested configuration in JSON format.
-
#configuration_by_node(node_id, options = {}) ⇒ Object
Returns ossec.conf in JSON format.
-
#delete_remote_file(node_id, options) ⇒ Object
Delete a remote file in a cluster node.
-
#get_remote_file(node_id, options) ⇒ Object
Get local file from any cluster node.
-
#local_node ⇒ Object
Get local node info.
-
#node(node_name) ⇒ Object
Get node info.
-
#node_info(node_id) ⇒ Object
Get node_id’s information.
-
#node_status(node_id) ⇒ Object
Get node node_id’s status.
-
#nodes(options = {}) ⇒ Object
Get nodes info.
-
#nodes_stats(node_id, options) ⇒ Object
Get node node_id’s stats.
-
#nodes_stats_by_hourly(node_id) ⇒ Object
Get node node_id’s stats by hour.
-
#nodes_stats_by_weekly(node_id) ⇒ Object
Get node node_id’s stats by weekly.
-
#remoted_stats(node_id) ⇒ Object
Get node node_id’s remoted stats.
-
#restart_all_node ⇒ Object
Restart all nodes in cluster.
-
#restart_node(node_id) ⇒ Object
Restart a specific node in cluster.
-
#update_remote_file(node_id, options) ⇒ Object
Update local file at any cluster node.
Instance Method Details
#analysisd_stats(node_id) ⇒ Object
Get node node_id’s analysisd stats
163 164 165 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 163 def analysisd_stats(node_id) get "/cluster/#{node_id}/stats/analysisd" end |
#check_configuration ⇒ Object
Check Wazuh configuration in all cluster nodes
37 38 39 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 37 def check_configuration get "/cluster/configuration/validation" end |
#check_configuration_by_node(node_id) ⇒ Object
Check Wazuh configuration in a cluster node
30 31 32 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 30 def check_configuration_by_node(node_id) get "/cluster/#{node_id}/configuration/validation" end |
#cluster_configuration(options = {}) ⇒ Object
Returns the cluster configuration.
23 24 25 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 23 def cluster_configuration( = {}) get "/cluster/config", end |
#cluster_healthcheck(options = {}) ⇒ Object
Show cluster health
98 99 100 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 98 def cluster_healthcheck( = {}) get '/cluster/healthcheck', end |
#cluster_logs_by_node(node_id, options) ⇒ Object
Get ossec.log from a specific node in cluster
118 119 120 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 118 def cluster_logs_by_node(node_id, ) offset_request("get", "/cluster/#{node_id}/logs", ) end |
#cluster_logs_summary_by_node(node_id) ⇒ Object
Get summary of ossec.log from a specific node in cluster
125 126 127 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 125 def cluster_logs_summary_by_node(node_id) get "/cluster/#{node_id}/logs/summary" end |
#cluster_status ⇒ Object
Get info about cluster status
77 78 79 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 77 def cluster_status get '/cluster/status' end |
#component_configuration_by_node(node_id, component, configuration, options = {}) ⇒ Object
Returns the requested configuration in JSON format.
9 10 11 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 9 def component_configuration_by_node(node_id, component, configuration, = {}) get "/cluster/#{node_id}/config/#{component}/#{configuration}", end |
#configuration_by_node(node_id, options = {}) ⇒ Object
Returns ossec.conf in JSON format.
16 17 18 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 16 def configuration_by_node(node_id, = {}) get "/cluster/#{node_id}/configuration", end |
#delete_remote_file(node_id, options) ⇒ Object
Delete a remote file in a cluster node
47 48 49 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 47 def delete_remote_file(node_id, ) delete "/cluster/#{node_id}/files", end |
#get_remote_file(node_id, options) ⇒ Object
Get local file from any cluster node
58 59 60 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 58 def get_remote_file(node_id, ) get "/cluster/#{node_id}/files", end |
#local_node ⇒ Object
Get local node info
131 132 133 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 131 def local_node get '/cluster/node' end |
#node(node_name) ⇒ Object
Get node info
137 138 139 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 137 def node(node_name) get "/cluster/nodes/#{node_name}" end |
#node_info(node_id) ⇒ Object
Get node_id’s information
91 92 93 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 91 def node_info(node_id) get "/cluster/#{node_id}/info" end |
#node_status(node_id) ⇒ Object
Get node node_id’s status
84 85 86 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 84 def node_status(node_id) get "/cluster/#{node_id}/status" end |
#nodes(options = {}) ⇒ Object
Get nodes info
143 144 145 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 143 def nodes( = {}) offset_request('get', '/cluster/nodes', ) end |
#nodes_stats(node_id, options) ⇒ Object
Get node node_id’s stats
179 180 181 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 179 def nodes_stats(node_id, ) get "/cluster/#{node_id}/stats", end |
#nodes_stats_by_hourly(node_id) ⇒ Object
Get node node_id’s stats by hour
186 187 188 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 186 def nodes_stats_by_hourly(node_id) get "/cluster/#{node_id}/stats/hourly" end |
#nodes_stats_by_weekly(node_id) ⇒ Object
Get node node_id’s stats by weekly
193 194 195 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 193 def nodes_stats_by_weekly(node_id) get "/cluster/#{node_id}/stats/weekly" end |
#remoted_stats(node_id) ⇒ Object
Get node node_id’s remoted stats
170 171 172 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 170 def remoted_stats(node_id) get "/cluster/#{node_id}/stats/remoted" end |
#restart_all_node ⇒ Object
Restart all nodes in cluster
156 157 158 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 156 def restart_all_node put '/cluster/restart' end |
#restart_node(node_id) ⇒ Object
Restart a specific node in cluster
150 151 152 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 150 def restart_node(node_id) put "/cluster/#{node_id}/restart" end |
#update_remote_file(node_id, options) ⇒ Object
Update local file at any cluster node
71 72 73 |
# File 'lib/wazuh/api/endpoints/cluster.rb', line 71 def update_remote_file(node_id, ) post "/cluster/#{node_id}/files", end |