Class: Naminori::Service::Http
- Defined in:
- lib/naminori/service/http.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
event, event_ip, health_check, #initialize
Constructor Details
This class inherits a constructor from Naminori::Service::Base
Instance Method Details
#default_config ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/naminori/service/http.rb', line 17 def default_config { role: "http", port: "80", protocols: ["tcp"], vip: "192.168.77.9", method: "nat", query: "index.html", retry: 3, timeout: 3 } end |
#healty?(ip) ⇒ Boolean
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/naminori/service/http.rb', line 6 def healty?(ip) http = Net::HTTP.new(ip, config.port) http.open_timeout = config.timeout begin http.get("/#{@query}") rescue => e false end end |