Class: NetScaler

Inherits:
Oxidized::Model show all
Defined in:
lib/oxidized/model/netscaler.rb

Instance Attribute Summary

Attributes inherited from Oxidized::Model

#input, #node

Instance Method Summary collapse

Methods inherited from Oxidized::Model

cfg, #cfg, cfgs, cmd, #cmd, cmds, comment, #comment, expect, #expect, expects, #expects, #get, inherited, #output, post, pre, prompt, #prompt, #screenscrape, #send, #xmlcomment

Methods included from Oxidized::Config::Vars

#vars

Instance Method Details

#multiple_partitionObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oxidized/model/netscaler.rb', line 48

def multiple_partition
  # Multiple partition mode
  cmd 'show partition' do |cfg|
    allcfg = ""
    partitions = [["default"]] + cfg.scan(/Name: (\S+)$/)
    partitions.each do |part|
      allcfg = allcfg + "\n\n####################### [ partition " + part.join(" ") + " ] #######################\n\n"
      cmd "switch ns partition " + part.join(" ") + "; show ns ns.conf; switch ns partition default" do |cfgpartition|
        allcfg += cfgpartition
      end
    end
    allcfg
  end
end

#single_partitionObject



41
42
43
44
45
46
# File 'lib/oxidized/model/netscaler.rb', line 41

def single_partition
  # Single partition mode
  cmd 'show ns ns.conf' do |cfg|
    cfg
  end
end