Class: Serverspec::Type::Host

Inherits:
Base
  • Object
show all
Defined in:
lib/serverspec/type/host.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect, #to_ary, #to_s

Constructor Details

This class inherits a constructor from Serverspec::Type::Base

Instance Method Details

#ipaddressObject



11
12
13
# File 'lib/serverspec/type/host.rb', line 11

def ipaddress
  @runner.get_host_ipaddress(@name).stdout.strip
end

#ipv4_addressObject



14
15
16
# File 'lib/serverspec/type/host.rb', line 14

def ipv4_address
  @runner.get_host_ipv4_address(@name).stdout.strip
end

#ipv6_addressObject



17
18
19
# File 'lib/serverspec/type/host.rb', line 17

def ipv6_address
  @runner.get_host_ipv6_address(@name).stdout.strip
end

#reachable?(port, proto, timeout) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/serverspec/type/host.rb', line 7

def reachable?(port, proto, timeout)
  @runner.check_host_is_reachable(@name, port, proto, timeout)
end

#resolvable?(type) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/serverspec/type/host.rb', line 3

def resolvable?(type)
  @runner.check_host_is_resolvable(@name, type)
end