Class: Beeper::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/beeper/client.rb

Constant Summary collapse

COLLECTIONS =
[:incidents, :services, :maintenance_windows].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



10
11
12
# File 'lib/beeper/client.rb', line 10

def initialize
  @use_ssl = true
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



8
9
10
# File 'lib/beeper/client.rb', line 8

def api_key
  @api_key
end

#requester_idObject

Returns the value of attribute requester_id.



8
9
10
# File 'lib/beeper/client.rb', line 8

def requester_id
  @requester_id
end

#subdomainObject

Returns the value of attribute subdomain.



8
9
10
# File 'lib/beeper/client.rb', line 8

def subdomain
  @subdomain
end

#use_sslObject

Returns the value of attribute use_ssl.



8
9
10
# File 'lib/beeper/client.rb', line 8

def use_ssl
  @use_ssl
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/beeper/client.rb', line 14

def configured?
  !@api_key.nil? && !@subdomain.nil?
end

#create_maintenance_window(maintenance_window) ⇒ Object



26
27
28
# File 'lib/beeper/client.rb', line 26

def create_maintenance_window(maintenance_window)
  post(:maintenance_windows, maintenance_window)
end

#delete_maintenance_window(id) ⇒ Object



30
31
32
# File 'lib/beeper/client.rb', line 30

def delete_maintenance_window(id)
  delete(:maintenance_windows, { :id => id })
end