summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/vrp.rb
blob: 12a9ca3cdb8b6c137e3a6cdf77fd7b2e9dbcb400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class VRP < Oxidized::Model
  # Huawei VRP
  
  prompt /^(<[\w.-]+>)$/
  comment '# '

  cmd :all do |cfg|
    cfg.each_line.to_a[1..-2].join
  end
 
  cfg :telnet do
    username /^Username:$/
    password /^Password:$/
  end

  cfg :telnet, :ssh do 
    post_login 'screen-length 0 temporary'
    pre_logout 'quit'
  end

  cmd 'display version' do |cfg|
    cfg = cfg.each_line.select {|l| not l.match /uptime/ }.join
    comment cfg
  end

  cmd 'display device' do |cfg|
    comment cfg
  end

  cmd 'display current-configuration all' do |cfg|
    cfg
  end
  
end