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



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

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

#GetCountries(region) ⇒ Object



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

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

#GetDcProviders(dc) ⇒ Object



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

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

#GetDcsObject



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

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

#GetDcsEnabled(region, service) ⇒ Object



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

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

#GetHandlerObject



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

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

#GetIpLabel(ip) ⇒ Object



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

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

#GetIPs(provider) ⇒ Object



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

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

#GetIpWeight(ip, region) ⇒ Object



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

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

#GetProvidersObject



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

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

#GetProvierIP(provider) ⇒ Object



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

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

#GetRegionsObject



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

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

#SetConfFileObject



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

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