Module: Zabbix::Authentication

Included in:
API
Defined in:
lib/zabbix/authentication.rb

Overview

Deals with authentication flow and stores it within global configuration

Instance Method Summary collapse

Instance Method Details

#login(options = {}) ⇒ Object

Authorize to the Zabbix portal using the access_token



8
9
10
11
12
13
14
15
# File 'lib/zabbix/authentication.rb', line 8

def (options = {})
  raise ConfigurationError, "Accesstoken/api-key not set" unless access_token
  # only bearer token needed 
  # will do sanity check if token if valid
  rpc_call('settings.get')
rescue RPCError => e
  raise AuthenticationError, e
end