Class: Diplomat::Autopilot
- Inherits:
-
RestClient
- Object
- RestClient
- Diplomat::Autopilot
- Defined in:
- lib/diplomat/autopilot.rb
Overview
Methods for interacting with the Consul operator autopilot API endpoint
Instance Method Summary collapse
-
#get_configuration(options = {}) ⇒ OpenStruct
Get autopilot configuration.
-
#get_health(options = {}) ⇒ OpenStruct
Get health status from the autopilot.
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_configuration(options = {}) ⇒ OpenStruct
Get autopilot configuration
11 12 13 14 15 16 17 |
# File 'lib/diplomat/autopilot.rb', line 11 def get_configuration( = {}) custom_params = [] custom_params << use_named_parameter('dc', [:dc]) if [:dc] ret = send_get_request(@conn, ['/v1/operator/autopilot/configuration'], , custom_params) JSON.parse(ret.body) end |
#get_health(options = {}) ⇒ OpenStruct
Get health status from the autopilot
22 23 24 25 26 27 28 |
# File 'lib/diplomat/autopilot.rb', line 22 def get_health( = {}) custom_params = [] custom_params << use_named_parameter('dc', [:dc]) if [:dc] ret = send_get_request(@conn, ['/v1/operator/autopilot/health'], , custom_params) JSON.parse(ret.body) end |