Class: Vayacondios

Inherits:
Object
  • Object
show all
Extended by:
Notifications
Defined in:
lib/vayacondios/server/handlers/event_handler.rb,
lib/vayacondios/version.rb,
lib/vayacondios/legacy_switch.rb,
lib/vayacondios/client/itemset.rb,
lib/vayacondios/client/notifier.rb,
lib/vayacondios/server/rack/path.rb,
lib/vayacondios/client/configliere.rb,
lib/vayacondios/client/cube_client.rb,
lib/vayacondios/client/http_client.rb,
lib/vayacondios/client/legacy_switch.rb,
lib/vayacondios/client/zabbix_client.rb,
lib/vayacondios/server/legacy_switch.rb,
lib/vayacondios/server/errors/not_found.rb,
lib/vayacondios/server/rack/assume_json.rb,
lib/vayacondios/server/errors/bad_request.rb,
lib/vayacondios/server/rack/extract_methods.rb,
lib/vayacondios/server/rack/path_validation.rb,
lib/vayacondios/server/handlers/config_handler.rb,
lib/vayacondios/server/handlers/itemset_handler.rb

Overview

Vayacondios::ItemsetHandler

This handler will accept requests to handle arrays for an organization. These arrays can only contain numbers and strings. GET requests are idempotent POST requests are forbidden PUT requests will clobber an existing array DELETE requests require an array of objects to remove

Direct Known Subclasses

Notifier

Defined Under Namespace

Modules: Configliere, Error, Notifications, Rack Classes: Client, ConfigDocument, ConfigHandler, CubeClient, CubeNotifier, Document, EventDocument, EventHandler, HttpClient, HttpNotifier, ItemsetDocument, ItemsetHandler, LegacyContentsHandler, LogNotifier, Notifier, NotifierFactory, NullNotifier, StandardContentsHandler, ZabbixClient, ZabbixNotifier

Constant Summary collapse

VERSION =
'0.2.6'
@@legacy_switch =
nil

Class Method Summary collapse

Methods included from Notifications

included, notify

Class Method Details

.default_notifier(log = nil) ⇒ Object



95
# File 'lib/vayacondios/client/notifier.rb', line 95

def self.default_notifier(log = nil) NotifierFactory.receive(type: 'log', log: log) ; end

.force_legacy_mode(on) ⇒ Object



36
37
38
39
# File 'lib/vayacondios/legacy_switch.rb', line 36

def self.force_legacy_mode on
  Log.info("forcing #{on ? 'legacy' : 'standard'} mode")
  @@legacy_switch = get_legacy_switch on
end

.get_legacy_switch(on) ⇒ Object



43
44
45
# File 'lib/vayacondios/legacy_switch.rb', line 43

def self.get_legacy_switch on
  (on ? LegacyContentsHandler : StandardContentsHandler).new
end

.legacy_switchObject



27
28
29
30
31
32
33
34
# File 'lib/vayacondios/legacy_switch.rb', line 27

def self.legacy_switch
  if @@legacy_switch.nil?
    legacy_mode_on = Settings[:vayacondios][:legacy]
    @@legacy_switch = get_legacy_switch(legacy_mode_on)
    Log.info("using #{legacy_mode_on ? 'legacy' : 'standard'} mode")
  end
  @@legacy_switch
end