Class: LoadConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/dyntool.rb

Overview

class for loading and retrieving configuration from dyn.yml

Instance Method Summary collapse

Instance Method Details

#GetContactsObject



52
53
54
# File 'lib/dyntool.rb', line 52

def GetContacts
	@contacts = @conf['contacts']
end

#GetCountries(region) ⇒ Object



37
38
39
# File 'lib/dyntool.rb', line 37

def GetCountries(region)
	@countries = @conf['regions'][region]
end

#GetDcProviders(dc) ⇒ Object



31
32
33
# File 'lib/dyntool.rb', line 31

def GetDcProviders(dc)
	@dcproviders = @conf['sites'][dc]
end

#GetDcsObject



19
20
21
# File 'lib/dyntool.rb', line 19

def GetDcs
	@dcs = @conf['sites']['names']
end

#GetDcsEnabled(region, service) ⇒ Object



40
41
42
# File 'lib/dyntool.rb', line 40

def GetDcsEnabled(region,service)
	@dcs = @conf[service][region]
end

#GetGraphiteObject



55
56
57
# File 'lib/dyntool.rb', line 55

def GetGraphite
	@graphite_server = @conf['graphite_server']
end

#GetHandlerObject



16
17
18
# File 'lib/dyntool.rb', line 16

def GetHandler
	@conf = YAML.load_file(@confFile)
end

#GetIpLabel(ip) ⇒ Object



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

def GetIpLabel(ip)
	@iplabel = @conf['ips'][ip]['label']
end

#GetIPs(provider) ⇒ Object



25
26
27
# File 'lib/dyntool.rb', line 25

def GetIPs(provider)
	@ips = @conf['providers'][provider]
end

#GetIpTTL(region) ⇒ Object



49
50
51
# File 'lib/dyntool.rb', line 49

def GetIpTTL(region)
	@ttl = @conf['ttls'][region]
end

#GetIpWeight(ip, region) ⇒ Object



46
47
48
# File 'lib/dyntool.rb', line 46

def GetIpWeight(ip,region)
	@weight = @conf['ips'][ip]['weight'][region]
end

#GetNotifyAppsObject



58
59
60
# File 'lib/dyntool.rb', line 58

def GetNotifyApps
	@apps = @conf['notify_apps']
end

#GetProvidersObject



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

def GetProviders
	@providers = @conf['providers']['names']
end

#GetProvierIP(provider) ⇒ Object



34
35
36
# File 'lib/dyntool.rb', line 34

def GetProvierIP(provider)
	@providerip = @conf['providers'][provider]
end

#GetRegionsObject



22
23
24
# File 'lib/dyntool.rb', line 22

def GetRegions
	@regions = @conf['regions']['names']
end

#SetConfFileObject



12
13
14
15
# File 'lib/dyntool.rb', line 12

def SetConfFile
	@pwd = Dir.pwd
	@confFile = "#{@pwd}/dyn.yml"
end