summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/viptela.rb
blob: f08e1b4b384c9a5bc801dfb898e23901c9a457fc (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
class Viptela < Oxidized::Model
  # Cisco Vipetla

  prompt /[-\w]+#\s$/
  comment  '! '

  cmd :all do |cfg|
    cfg.each_line.to_a[1..-2].join
  end

  cmd :secret do |cfg|
    cfg.gsub! /(^\s+secret-key|password|auth-password|priv-password)\s+.*$/, '\\1 <secret hidden>'
    cfg.gsub! /(^\s+community)\s.*$/, '\\1 <secret hidden>'
    cfg
  end

  cmd 'show running-config' do |cfg|
    cfg
  end

  cmd 'show version' do |cfg|
    comment cfg
  end

  cfg :ssh do
    post_login 'paginate false'
    pre_logout 'exit'
  end
end