Class: Rbeapi::Eapilib::HttpEapiConnection

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 = {}) ⇒ HttpEapiConnection

Returns a new instance of HttpEapiConnection.


293
294
295
296
297
298
299
300
301
302
303
# File 'lib/rbeapi/eapilib.rb', line 293

def initialize(opts = {})
  port = opts.fetch(:port, DEFAULT_HTTP_PORT)
  host = opts.fetch(:host, 'localhost')

  transport = Net::HTTP.new(host, port.to_i)
  super(transport)

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