class Diplomat::Agent

Agent API endpoint methods @see www.consul.io/docs/agent/http/agent.html

Public Instance Methods

checks(options = {}) click to toggle source

Get local agent checks @param options [Hash] options parameter hash @return [OpenStruct] all agent checks

# File lib/diplomat/agent.rb, line 21
def checks(options = {})
  ret = send_get_request(@conn, ['/v1/agent/checks'], options)
  JSON.parse(ret.body).tap { |node| OpenStruct.new node }
end
members(options = {}) click to toggle source

Get cluster members (as seen by the agent) @param options [Hash] options parameter hash @return [OpenStruct] all members

# File lib/diplomat/agent.rb, line 37
def members(options = {})
  ret = send_get_request(@conn, ['/v1/agent/members'], options)
  JSON.parse(ret.body).map { |node| OpenStruct.new node }
end
self(options = {}) click to toggle source

Get agent configuration @param options [Hash] options parameter hash @return [OpenStruct] all data associated with the node

# File lib/diplomat/agent.rb, line 13
def self(options = {})
  ret = send_get_request(@conn, ['/v1/agent/self'], options)
  JSON.parse(ret.body).tap { |node| OpenStruct.new node }
end
services(options = {}) click to toggle source

Get local agent services @param options [Hash] options parameter hash @return [OpenStruct] all agent services

# File lib/diplomat/agent.rb, line 29
def services(options = {})
  ret = send_get_request(@conn, ['/v1/agent/services'], options)
  JSON.parse(ret.body).tap { |node| OpenStruct.new node }
end