Class: Imperium::Events
Overview
A client for the Events API.
Constant Summary
Constants inherited from Client
Instance Attribute Summary
Attributes inherited from Client
Class Method Summary collapse
-
.fire(name, payload = nil, dc: nil, node: nil, service: nil, tag: nil) ⇒ Object
fire an event using the Client.default_client.
Instance Method Summary collapse
-
#fire(name, payload = nil, dc: nil, node: nil, service: nil, tag: nil) ⇒ EventResponse
Fire the event.
Methods inherited from Client
default_client, inherited, #initialize, #path_prefix, reset_default_client, reset_default_clients
Constructor Details
This class inherits a constructor from Imperium::Client
Class Method Details
.fire(name, payload = nil, dc: nil, node: nil, service: nil, tag: nil) ⇒ Object
fire an event using the Client.default_client
8 9 10 |
# File 'lib/imperium/events.rb', line 8 def self.fire(name, payload = nil, dc: nil, node: nil, service: nil, tag: nil) default_client.fire(name, payload, dc: dc, node: node, service: service, tag: tag) end |
Instance Method Details
#fire(name, payload = nil, dc: nil, node: nil, service: nil, tag: nil) ⇒ EventResponse
Fire the event
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/imperium/events.rb', line 24 def fire(name, payload = nil, dc: nil, node: nil, service: nil, tag: nil) query = {} query[:dc] = dc if dc query[:node] = node if node query[:service] = service if service query[:tag] = tag if tag response = @http_client.put(prefix_path("fire/#{name}"), payload, query: query) EventFireResponse.new(response) end |