Class: Diplomat::Nodes
- Inherits:
-
RestClient
- Object
- RestClient
- Diplomat::Nodes
- Defined in:
- lib/diplomat/nodes.rb
Overview
Methods for interacting with the Consul nodes API endpoint
Instance Method Summary collapse
-
#get(options = {}) ⇒ OpenStruct
deprecated
Deprecated.
Please use Diplomat::Node instead.
- #get_all(options = {}) ⇒ Object
Methods inherited from RestClient
access_method?, #concat_url, #configuration, #initialize, method_missing, respond_to?, respond_to_missing?, #use_named_parameter
Constructor Details
This class inherits a constructor from Diplomat::RestClient
Instance Method Details
#get(options = {}) ⇒ OpenStruct
Deprecated.
Please use Diplomat::Node instead.
Get all nodes
13 14 15 16 |
# File 'lib/diplomat/nodes.rb', line 13 def get( = {}) ret = send_get_request(@conn, ['/v1/catalog/nodes'], ) JSON.parse(ret.body) end |
#get_all(options = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/diplomat/nodes.rb', line 18 def get_all( = {}) custom_params = [:dc] ? use_named_parameter('dc', [:dc]) : nil ret = send_get_request(@conn, ['/v1/catalog/nodes'], , custom_params) JSON.parse(ret.body).map { |service| OpenStruct.new service } end |