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



717
718
719
720
721
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 717

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

.clazzesObject



702
703
704
705
706
707
708
709
710
711
712
713
714
715
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 702

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



723
724
725
726
727
728
729
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 723

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



731
732
733
734
735
736
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 731

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

.dialectsObject



11
12
13
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 11

def self.dialects
  @dialects
end

.nameObject



4
5
6
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 4

def self.name
  'ciscian'
end