From ae2d1a202cdfa3c8dd488b8be045e025234913ae Mon Sep 17 00:00:00 2001 From: Brad Searle Date: Sun, 1 Jul 2018 19:57:38 +1000 Subject: Add Viptela model (closes #1376) (#1427) --- CHANGELOG.md | 1 + docs/Model-Notes/README.md | 1 + docs/Model-Notes/Viptela.md | 10 ++++++++++ lib/oxidized/model/viptela.rb | 29 +++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 docs/Model-Notes/Viptela.md create mode 100644 lib/oxidized/model/viptela.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index d99f71f..3500c0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * BUGFIX: xos model should not modify config on legacy Extreme Networks devices (sq9mev) * BUGFIX: model edgecos, ciscosmb * MISC: bump Dockerfile phusion/baseimage:0.10.0 -> 0.10.1 +* FEATURE: add viptela model (@bobthebutcher) ## 0.24.0 diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md index bf3c5f6..fba31d7 100644 --- a/docs/Model-Notes/README.md +++ b/docs/Model-Notes/README.md @@ -14,6 +14,7 @@ Cumulus|[Cumulus](Cumulus.md)|11 Jun 2018 Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017 Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018 Netgear|[Netgear](Netgear.md)|11 Apr 2018 +Viptela|[Viptela](Viptela.md)|1 Jul 2018 Zyxel|[XGS4600 Series](XGS4600-Zyxel.md)|1 Feb 2018 If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues. diff --git a/docs/Model-Notes/Viptela.md b/docs/Model-Notes/Viptela.md new file mode 100644 index 0000000..4b4bab1 --- /dev/null +++ b/docs/Model-Notes/Viptela.md @@ -0,0 +1,10 @@ +# Viptela + +This model collects running config and other desired commands from Viptela devices. +Pagination is disabled post login. + +## Supported Commands +- show running-config +- show version + +Back to [Model-Notes](README.md) \ No newline at end of file diff --git a/lib/oxidized/model/viptela.rb b/lib/oxidized/model/viptela.rb new file mode 100644 index 0000000..f08e1b4 --- /dev/null +++ b/lib/oxidized/model/viptela.rb @@ -0,0 +1,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