Class: Zabbix::API
- Inherits:
-
Object
- Object
- Zabbix::API
- Includes:
- WrAPI::Authentication, WrAPI::Connection, WrAPI::Request, Authentication, Request::JSONRPC2
- Defined in:
- lib/zabbix/api.rb
Direct Known Subclasses
Constant Summary
Constants included from Request::JSONRPC2
Request::JSONRPC2::ZABBIX_ENDPOINT
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(options = {}) ⇒ API
constructor
Creates a new API and copies settings from singleton.
-
#zabbix_clock(secs) ⇒ Object
Convert zabbix clock to datetime.
Methods included from Authentication
Methods included from Request::JSONRPC2
Constructor Details
Instance Method Details
#config ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/zabbix/api.rb', line 20 def config conf = {} WrAPI::Configuration::VALID_OPTIONS_KEYS.each do |key| conf[key] = send key end conf end |
#zabbix_clock(secs) ⇒ Object
Convert zabbix clock to datetime
29 30 31 |
# File 'lib/zabbix/api.rb', line 29 def zabbix_clock secs Time.at( secs.to_i ).to_datetime end |