class Diplomat::Agent
Agent
API endpoint methods @see www.consul.io/docs/agent/http/agent.html
Public Instance Methods
Source
# File lib/diplomat/agent.rb, line 24 def checks(options = {}) ret = send_get_request(@conn, ['/v1/agent/checks'], options) JSON.parse(ret.body).tap { |node| OpenStruct.new node } end
Get local agent checks @param options [Hash] options parameter hash @return [OpenStruct] all agent checks
Source
# File lib/diplomat/agent.rb, line 40 def members(options = {}) ret = send_get_request(@conn, ['/v1/agent/members'], options) JSON.parse(ret.body).map { |node| OpenStruct.new node } end
Get cluster members (as seen by the agent) @param options [Hash] options parameter hash @return [OpenStruct] all members
Source
# File lib/diplomat/agent.rb, line 16 def self(options = {}) ret = send_get_request(@conn, ['/v1/agent/self'], options) JSON.parse(ret.body).tap { |node| OpenStruct.new node } end
Get agent configuration @param options [Hash] options parameter hash @return [OpenStruct] all data associated with the node
Source
# File lib/diplomat/agent.rb, line 32 def services(options = {}) ret = send_get_request(@conn, ['/v1/agent/services'], options) JSON.parse(ret.body).tap { |node| OpenStruct.new node } end
Get local agent services @param options [Hash] options parameter hash @return [OpenStruct] all agent services