Module: Construqt::Flavour::Unknown

Defined in:
lib/construqt/flavour/unknown/unknown.rb

Defined Under Namespace

Classes: Bgp, Bond, Bridge, Device, Gre, Host, Ipsec, Opvn, Result, Template, Vlan, Vrrp

Class Method Summary collapse

Class Method Details

.bgpObject



118
119
120
# File 'lib/construqt/flavour/unknown/unknown.rb', line 118

def self.bgp
  Bgp
end

.clazz(name) ⇒ Object



135
136
137
138
139
# File 'lib/construqt/flavour/unknown/unknown.rb', line 135

def self.clazz(name)
  ret = self.clazzes[name]
  throw "class not found #{name}" unless ret
  ret
end

.clazzesObject



121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/construqt/flavour/unknown/unknown.rb', line 121

def self.clazzes
  {
    "opvn" => Opvn,
    "gre" => Gre,
    "host" => Host,
    "device"=> Device,
    "vrrp" => Vrrp,
    "bridge" => Bridge,
    "template" => Template,
    "bond" => Bond,
    "vlan" => Vlan,
  }
end

.create_bgp(cfg) ⇒ Object



163
164
165
# File 'lib/construqt/flavour/unknown/unknown.rb', line 163

def self.create_bgp(cfg)
  Bgp.new(cfg)
end

.create_host(name, cfg) ⇒ Object



141
142
143
144
145
146
147
# File 'lib/construqt/flavour/unknown/unknown.rb', line 141

def self.create_host(name, cfg)
  cfg['name'] = name
  cfg['result'] = nil
  host = Host.new(cfg)
  host.result = Result.new(host)
  host
end

.create_interface(name, cfg) ⇒ Object



149
150
151
152
# File 'lib/construqt/flavour/unknown/unknown.rb', line 149

def self.create_interface(name, cfg)
  cfg['name'] = name
  clazz(cfg['clazz']).new(cfg)
end

.create_ipsec(cfg) ⇒ Object



176
177
178
# File 'lib/construqt/flavour/unknown/unknown.rb', line 176

def self.create_ipsec(cfg)
  Ipsec.new(cfg)
end

.ipsecObject

end



115
116
117
# File 'lib/construqt/flavour/unknown/unknown.rb', line 115

def self.ipsec
  Ipsec
end

.nameObject



5
6
7
# File 'lib/construqt/flavour/unknown/unknown.rb', line 5

def self.name
  'unknown'
end