Class: NodeHeartbeat::GetPrivateIP
- Defined in:
- lib/node_heartbeat/get_private_ip.rb
Constant Summary collapse
- URL =
'http://169.254.169.254/latest/meta-data/local-ipv4'.freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 |
# File 'lib/node_heartbeat/get_private_ip.rb', line 8 def call response = Excon.get(URL, expects: [200], connect_timeout: 10, read_timeout: 10, write_timeout: 10, tcp_nodelay: true) OpenStruct.new( private_ip: response.body ) end |