Class: Rbeapi::Eapilib::HttpEapiConnection

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

Overview

The HttpEapiConnection provides a class for building an HTTP eAPI connection to a Arista EOS devices.

Instance Attribute Summary

Attributes inherited from EapiConnection

#error

Instance Method Summary collapse

Methods inherited from EapiConnection

#authentication, #execute, #get_timeouts, #request, #send, #timeouts

Constructor Details

#initialize(opts = {}) ⇒ HttpEapiConnection

Returns a new instance of HttpEapiConnection.



337
338
339
340
341
342
343
344
345
346
# File 'lib/rbeapi/eapilib.rb', line 337

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)

  authentication(opts)
  timeouts(opts)
end