Module: Zabbix
- Extended by:
- WrAPI::Configuration, WrAPI::RespondTo
- Defined in:
- lib/zabbix.rb,
lib/zabbix/api.rb,
lib/zabbix/error.rb,
lib/zabbix/client.rb,
lib/zabbix/request.rb,
lib/zabbix/version.rb,
lib/zabbix/authentication.rb
Overview
This module provides a Ruby API wrapper for Zabbix. It includes configuration options and creates client instances for interacting with the Zabbix API.
Defined Under Namespace
Modules: Authentication, Request Classes: API, AuthenticationError, Client, ConfigurationError, RPCError, ZabbixError
Constant Summary collapse
- DEFAULT_UA =
Default User-Agent string for API requests.
"Ruby Zabbix API wrapper #{Zabbix::VERSION}"- VERSION =
'0.3.4'
Class Method Summary collapse
-
.client(options = {}) ⇒ Zabbix::Client
Creates and returns a new Zabbix client instance.
-
.reset ⇒ void
Resets the Zabbix module configuration to its default state.
Class Method Details
.client(options = {}) ⇒ Zabbix::Client
Creates and returns a new Zabbix client instance. Merges default client settings with any user-provided options.
33 34 35 36 37 38 39 |
# File 'lib/zabbix.rb', line 33 def self.client( = {}) # Ensure that the options argument is a Hash to prevent merge errors = .is_a?(Hash) ? : {} Zabbix::Client.new({ user_agent: DEFAULT_UA }.merge()) end |
.reset ⇒ void
This method returns an undefined value.
Resets the Zabbix module configuration to its default state.
This method sets the default endpoint and User-Agent string.
46 47 48 49 50 |
# File 'lib/zabbix.rb', line 46 def self.reset super self.endpoint = nil self.user_agent = DEFAULT_UA end |