Module: Construqt::Flavour::Ciscian
- Defined in:
- lib/construqt/flavour/ciscian/ciscian.rb,
lib/construqt/flavour/ciscian/dialect_hp-2510g.rb,
lib/construqt/flavour/ciscian/dialect_dlink-dgs15xx.rb
Defined Under Namespace
Modules: DlinkDgs15xx
Classes: Bond, Device, Host, Hp2510g, MultiValueVerb, NestedSection, NotImplemented, PatternBasedVerb, RangeVerb, Result, SingleValueVerb, Vlan
Class Method Summary
collapse
Class Method Details
.add_dialect(dialect) ⇒ Object
15
16
17
|
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 15
def self.add_dialect(dialect)
@dialects[dialect.name] = dialect
end
|
.clazz(name) ⇒ Object
665
666
667
668
669
|
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 665
def self.clazz(name)
ret = self.clazzes[name]
throw "class not found #{name}" unless ret
ret
end
|
.clazzes ⇒ Object
650
651
652
653
654
655
656
657
658
659
660
661
662
663
|
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 650
def self.clazzes
{
"opvn" => NotImplemented,
"bond" => Bond,
"bridge" => NotImplemented,
"gre" => NotImplemented,
"vrrp" => NotImplemented,
"template" => NotImplemented,
"vlan" => Vlan,
"host" => Host,
"device"=> Device,
"result" => Result
}
end
|
.create_host(name, cfg) ⇒ Object
671
672
673
674
675
676
677
|
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 671
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
679
680
681
682
683
684
|
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 679
def self.create_interface(name, cfg)
cfg['name'] = name
clazz(cfg['clazz']).new(cfg)
end
|
.dialects ⇒ Object
11
12
13
|
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 11
def self.dialects
@dialects
end
|
.name ⇒ Object
4
5
6
|
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 4
def self.name
'ciscian'
end
|