Class: Diplomat::Autopilot

Inherits:
RestClient show all
Defined in:
lib/diplomat/autopilot.rb

Overview

Methods for interacting with the Consul operator autopilot API endpoint

Instance Method Summary collapse

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

Parameters:

  • options (Hash) (defaults to: {})

    options parameter hash

Returns:

  • (OpenStruct)

    all data associated with the autopilot configuration


11
12
13
14
15
16
17
# File 'lib/diplomat/autopilot.rb', line 11

def get_configuration(options = {})
  custom_params = []
  custom_params << use_named_parameter('dc', options[:dc]) if options[:dc]

  ret = send_get_request(@conn, ['/v1/operator/autopilot/configuration'], options, custom_params)
  JSON.parse(ret.body)
end

#get_health(options = {}) ⇒ OpenStruct

Get health status from the autopilot

Parameters:

  • options (Hash) (defaults to: {})

    options parameter hash

Returns:

  • (OpenStruct)

    all data associated with the health of the autopilot


22
23
24
25
26
27
28
# File 'lib/diplomat/autopilot.rb', line 22

def get_health(options = {})
  custom_params = []
  custom_params << use_named_parameter('dc', options[:dc]) if options[:dc]

  ret = send_get_request(@conn, ['/v1/operator/autopilot/health'], options, custom_params)
  JSON.parse(ret.body)
end