Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uplink_olt_model_add #3231

Merged
merged 10 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## [Unreleased]

### Added
- model for uplink EP4440-DP OLT (@AAm-kun)
- model for Siklu Multihaul TG radios (@bdg-robert)
- fortios: variable `fullconfig` to get the configuration with default values. Fixes: #3159 (@robertcheramy)
- model for VMWare NSX DFW (@elmobp)
Expand Down
1 change: 1 addition & 0 deletions docs/Supported-OS-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
| |Edgeos |[edgeos](/lib/oxidized/model/edgeos.rb)
| |EdgeSwitch |[edgeswitch](/lib/oxidized/model/edgeswitch.rb)
| |AirFiber |[airfiber](/lib/oxidized/model/airfiber.rb)
|Uplink |EP4440-DP |[EP4440](/lib/oxidized/model/uplinkolt.rb) | |Might support all EP4440 series
|VMWare |NSX Edge (configuration) |[nsxconfig](/lib/oxidized/model/nsxconfig.rb)
| |NSX Edge (firewall rules) |[nsxfirewall](/lib/oxidized/model/nsxfirewall.rb)
| |NSX Distributed Firewall |[nsxdfw](/lib/oxidized/model/nsxdfw.rb)
Expand Down
51 changes: 51 additions & 0 deletions lib/oxidized/model/uplinkolt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
class UPLINKOLT < Oxidized::Model
prompt /^([\w.@()-]+[#>]\s?)$/
comment '! '

cmd :all do |cfg|
cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
cfg.gsub!(/^show running-config$/, '')
cfg.gsub!(/^.*\s*#\s*$/, '')
# Remove leading and trailing whitespace
cfg.strip!
# Remove empty lines
cfg.gsub!(/^\s*$/, '')
cfg
end

cmd 'configure terminal' do
# Enter configure terminal mode
cmd 'show version' do |cfg|
cfg.gsub! /^show version/, ''
comment cfg
end
end

cmd 'show time' do |cfg|
cfg.gsub! /^show time/, ''
comment cfg
end

cmd 'show running-config' do |cfg|
cfg.gsub! /^Current configuration:/, ''
cfg
end

cfg :telnet, :ssh do
username /^Login:/i
password /^Password:/i
# preferred way to handle additional passwords
post_login do
if vars(:enable) == true
cmd "enable"
elsif vars(:enable)
cmd "enable", /^[pP]assword:/
cmd vars(:enable)
end
end
post_login 'terminal length 0'
pre_logout 'exit'
pre_logout 'disable'
pre_logout 'exit'
end
end
Loading