Class: LoadConfig
- Inherits:
-
Object
- Object
- LoadConfig
- Defined in:
- lib/dyntool.rb
Overview
class for loading and retrieving configuration from dyn.yml
Instance Method Summary collapse
- #GetContacts ⇒ Object
- #GetCountries(region) ⇒ Object
- #GetDcProviders(dc) ⇒ Object
- #GetDcs ⇒ Object
- #GetDcsEnabled(region, service) ⇒ Object
- #GetGraphite ⇒ Object
- #GetHandler ⇒ Object
- #GetIpLabel(ip) ⇒ Object
- #GetIPs(provider) ⇒ Object
- #GetIpTTL(region) ⇒ Object
- #GetIpWeight(ip, region) ⇒ Object
- #GetNotifyApps ⇒ Object
- #GetProviders ⇒ Object
- #GetProvierIP(provider) ⇒ Object
- #GetRegions ⇒ Object
- #SetConfFile ⇒ Object
Instance Method Details
#GetContacts ⇒ Object
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 |
#GetDcs ⇒ Object
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 |
#GetGraphite ⇒ Object
55 56 57 |
# File 'lib/dyntool.rb', line 55 def GetGraphite @graphite_server = @conf['graphite_server'] end |
#GetHandler ⇒ Object
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 |
#GetNotifyApps ⇒ Object
58 59 60 |
# File 'lib/dyntool.rb', line 58 def GetNotifyApps @apps = @conf['notify_apps'] end |
#GetProviders ⇒ Object
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 |
#GetRegions ⇒ Object
22 23 24 |
# File 'lib/dyntool.rb', line 22 def GetRegions @regions = @conf['regions']['names'] end |
#SetConfFile ⇒ Object
12 13 14 15 |
# File 'lib/dyntool.rb', line 12 def SetConfFile @pwd = Dir.pwd @confFile = "#{@pwd}/dyn.yml" end |