Module: Wazuh::Api::Endpoints::V4::Agents

Includes:
Agents
Included in:
Wazuh::Api::Endpoints::V4
Defined in:
lib/wazuh/api/endpoints/v4/agents.rb

Instance Method Summary collapse

Methods included from Agents

#add_agent, #add_agent_to_group, #agent_config, #agent_key, #agent_os_summary, #agent_sync_status, #agents_by_no_group, #all_agents, #delete_agents, #distinct_fields_in_agents, #insert_agent, #outdated_agents, #remove_agent_of_group, #remove_all_agent_of_group, #restart_agents, #restart_all_agents, #restart_an_agents, #update_group_ossec_configuration

Instance Method Details

#add_agent_quick(agent_name) ⇒ Object



71
72
73
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 71

def add_agent_quick(agent_name)
  post "/agents/insert/quick/", {}, {agent_name: agent_name}
end

#add_agents_to_group(ids, group_id) ⇒ Object



59
60
61
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 59

def add_agents_to_group(ids, group_id)
  put "/agents/group", {group_id: group_id, agents_list: ids}
end

#agent(agent_id, options = {}) ⇒ Object



23
24
25
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 23

def agent(agent_id, options = {})
  get "/agents", options.merge({ agents_list: agent_id})
end

#agent_by_name(agent_name, options = {}) ⇒ Object



51
52
53
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 51

def agent_by_name(agent_name, options = {})
  get "/agents", options.merge({name: agent_name})
end

#agent_summaryObject



55
56
57
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 55

def agent_summary
  get "/agents/summary/status"
end

#agent_upgrade(agent_id, options = {}) ⇒ Object



63
64
65
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 63

def agent_upgrade(agent_id, options = {})
  put "/agents/upgrade", options.merge({agents_list: agent_id})
end

#agent_upgrade_custom(agent_id, options = {}) ⇒ Object



67
68
69
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 67

def agent_upgrade_custom(agent_id, options = {})
  put "/agents/upgrade_custom", options.merge({agents_list: agent_id})
end

#agents_by_group(group_id, options = {}) ⇒ Object



35
36
37
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 35

def agents_by_group(group_id, options = {})
  offset_request('get', "/groups", options.merge({groups_list: group_id}))
end

#create_group(group_id) ⇒ Object



75
76
77
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 75

def create_group(group_id)
  post "/agents/groups", {group_id: group_id}
end

#delete_agent(agent_ids, options = {}) ⇒ Object



7
8
9
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 7

def delete_agent(agent_ids, options = {})
  delete "/agents", options.merge({ agents_list: agent_ids })
end

#delete_agent_by_group(ids) ⇒ Object



15
16
17
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 15

def delete_agent_by_group(ids)
  delete '/agents/groups', {groups_list: ids}
end

#get_file_in_group(group_id, filename, options = {}) ⇒ Object



47
48
49
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 47

def get_file_in_group(group_id, filename, options = {})
  get "groups/#{group_id}/files/#{filename}", options
end

#group_configuration(group_id, options = {}) ⇒ Object



39
40
41
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 39

def group_configuration(group_id, options = {})
  get "/groups/#{group_id}/configuration", options
end

#group_files(group_id, options = {}) ⇒ Object



43
44
45
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 43

def group_files(group_id, options = {})
  get "/groups/#{group_id}/files", options
end

#groups(options = {}) ⇒ Object



31
32
33
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 31

def groups(options = {})
  get '/groups', options
end

#remove_agents_of_group(ids, group) ⇒ Object



11
12
13
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 11

def remove_agents_of_group(ids, group)
  delete "/agents/group", {group_id: group, agents_list: ids }
end

#remove_group(group_id) ⇒ Object



19
20
21
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 19

def remove_group(group_id)
  delete "/agents/groups", { groups_list: group_id }
end

#upgrade_result_from_agent(agent_id, options = {}) ⇒ Object



27
28
29
# File 'lib/wazuh/api/endpoints/v4/agents.rb', line 27

def upgrade_result_from_agent(agent_id, options = {})
  get "/agents/upgrade_result", options.merge({ agents_list: agent_id})
end