summaryrefslogtreecommitdiff
path: root/lib/oxidized/model/cambium.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2018-05-30 19:30:50 +0300
committerSaku Ytti <saku@ytti.fi>2018-05-30 19:30:50 +0300
commitc511a212c1388db35f0f42af2a33241986846e04 (patch)
tree833eff9264275822e8058d73b855c325127015ee /lib/oxidized/model/cambium.rb
parent42bf10b7bce34ff577c469f6c2f659f3913cbf4a (diff)
Add support for Cambium
Initial HTTP support
Diffstat (limited to 'lib/oxidized/model/cambium.rb')
-rw-r--r--lib/oxidized/model/cambium.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/oxidized/model/cambium.rb b/lib/oxidized/model/cambium.rb
new file mode 100644
index 0000000..230282c
--- /dev/null
+++ b/lib/oxidized/model/cambium.rb
@@ -0,0 +1,23 @@
+class Cambium < Oxidized::Model
+
+ cfg_cb = lambda do
+ c_page = @m.click @m_page.link_with(text: "Configuration")
+ u_page = @m.click c_page.link_with(text: "Unit Settings")
+ cfg = @m.click u_page.link_with(text: /\.cfg$/)
+ cfg.body
+ end
+
+ cmd cfg_cb do |cfg|
+ cfg
+ end
+
+ cfg :http do
+ @main_page = "/main.cgi"
+ define_singleton_method :login do
+ @m_page = @m_page.form_with(action: "login.cgi") do |form|
+ form.CanopyUsername = @node.auth[:username]
+ form.CanopyPassword = @node.auth[:password]
+ end.submit
+ end
+ end
+end