Class: Rbeapi::Eapilib::HttpLocalEapiConnection

Inherits:
EapiConnection show all
Defined in:
lib/rbeapi/eapilib.rb

Instance Attribute Summary

Attributes inherited from EapiConnection

#error

Instance Method Summary collapse

Methods inherited from EapiConnection

#authentication, #execute, #request, #send

Constructor Details

#initialize(opts = {}) ⇒ HttpLocalEapiConnection

Returns a new instance of HttpLocalEapiConnection.


307
308
309
310
311
312
313
314
315
# File 'lib/rbeapi/eapilib.rb', line 307

def initialize(opts = {})
  port = opts.fetch(:port, DEFAULT_HTTP_LOCAL_PORT)
  transport = Net::HTTP.new('localhost', port)
  super(transport)

  user = opts.fetch(:username, 'admin')
  pass = opts.fetch(:password, '')
  authentication(user, pass)
end