Class: Wazuh::Client

Inherits:
Object
  • Object
show all
Includes:
Sawyer::Connection, Sawyer::Request
Defined in:
lib/wazuh/client.rb

Constant Summary

Constants included from Sawyer::Request

Sawyer::Request::MAX_ITEM_NUM

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Sawyer::Request

#delete, #get, #offset_request, #post, #put

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/wazuh/client.rb', line 8

def initialize(options = {})
  Wazuh::Config::ATTRIBUTES.each do |key|
    send("#{key}=", options[key] || Wazuh.config.send(key))
  end
  @logger ||= Wazuh::Config.logger || Wazuh::Logger.default
  case api_version
  when 3
    extend Api::Endpoints
  when 4
    extend Api::Endpoints::V4
  else
    raise "unsupported api version #{api_version}"
  end
end

Class Method Details

.configObject



28
29
30
# File 'lib/wazuh/client.rb', line 28

def config
  Config
end

.configureObject



24
25
26
# File 'lib/wazuh/client.rb', line 24

def configure
  block_given? ? yield(Config) : Config
end