Class: Zeus::APIClient

Inherits:
Object
  • Object
show all
Includes:
AlertsInterface, LogsInterface, MetricsInterface, TrigalertsInterface
Defined in:
lib/zeus/api_client.rb,
lib/zeus/api_client/version.rb

Overview

API Client for Zeus Service

Constant Summary collapse

VERSION =

package version number

'0.3.1'.freeze

Instance Method Summary collapse

Methods included from AlertsInterface

#create_alert, #delete_alert, #disable_alerts, #enable_alerts, #get_alert, #get_alerts, #modify_alert

Methods included from MetricsInterface

#delete_metrics, #get_metrics, #list_metrics, #send_metrics

Methods included from LogsInterface

#get_logs, #send_logs

Methods included from TrigalertsInterface

#triggered_alerts, #triggered_alerts_last_24_hours

Constructor Details

#initialize(opts = {}) ⇒ APIClient

constructor for Zeus::APIClient

Parameters:

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

    the options to create z Zeus::APIClient instance

Options Hash (opts):

  • :access_token (String)

    The tokens for Zeus Service

  • :endpoint (String)

    The base url for API endpoint



30
31
32
33
34
35
36
# File 'lib/zeus/api_client.rb', line 30

def initialize(opts = {})
  @access_token = opts[:access_token]
  # makes sure its using https
  uri_parts = URI.split(opts[:endpoint])
  uri_parts[0] = 'https://'
  @endpoint = uri_parts.join
end