Class: AlertLogic::Client

Inherits:
Object
  • Object
show all
Includes:
RestMethods, Utils
Defined in:
lib/alert_logic/client/base_client.rb

Overview

JSON parsing HTTP client with some helper methods

Constant Summary collapse

DEFAULT_ENDPOINT =
'https://publicapi.alertlogic.net/api/tm/v1/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RestMethods

#create, #delete, #get, #list, #post, #put

Constructor Details

#initialize(secret_key = nil, endpoint = nil) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
16
# File 'lib/alert_logic/client/base_client.rb', line 11

def initialize(secret_key = nil, endpoint = nil)
  @secret_key = secret_key  || AlertLogic.secret_key
  @endpoint   = endpoint    || DEFAULT_ENDPOINT
  @logger     = AlertLogic.logger
  init
end

Instance Attribute Details

#endpointObject

Returns the value of attribute endpoint.



7
8
9
# File 'lib/alert_logic/client/base_client.rb', line 7

def endpoint
  @endpoint
end

#secret_keyObject

Returns the value of attribute secret_key.



7
8
9
# File 'lib/alert_logic/client/base_client.rb', line 7

def secret_key
  @secret_key
end

Instance Method Details

#reload!Object



30
31
32
33
# File 'lib/alert_logic/client/base_client.rb', line 30

def reload!
  @connection = nil
  init
end