class Serverspec::Type::ConsulNodeList

Public Instance Methods

has_node?(node) click to toggle source
# File lib/serverspec_extra_types/types/consul_node_list.rb, line 18
def has_node?(node)
  nodes.include? node
end
inspection() click to toggle source
# File lib/serverspec_extra_types/types/consul_node_list.rb, line 26
def inspection
  @inspection ||= ::MultiJson.load(get_inspection.stdout)
end
nodes() click to toggle source
# File lib/serverspec_extra_types/types/consul_node_list.rb, line 22
def nodes
  inspection.map { |node| node['Node'] }
end
to_s() click to toggle source
# File lib/serverspec_extra_types/types/consul_node_list.rb, line 12
def to_s
  msg = 'Consul Node List'
  msg << %( with acl token: "#{@token}") if @token
  msg
end
url() click to toggle source
# File lib/serverspec_extra_types/types/consul_node_list.rb, line 8
def url
  "#{@url_base}/v1/catalog/nodes"
end