Class: SmartProxyDynflowCore::Callback::Request
- Inherits:
-
Object
- Object
- SmartProxyDynflowCore::Callback::Request
- Defined in:
- lib/smart_proxy_dynflow_core/callback.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.send_to_foreman_tasks(callback_info, data) ⇒ Object
29 30 31 |
# File 'lib/smart_proxy_dynflow_core/callback.rb', line 29 def self.send_to_foreman_tasks(callback_info, data) self.new.callback(self.prepare_payload(callback_info, data)) end |
Instance Method Details
#callback(payload) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/smart_proxy_dynflow_core/callback.rb', line 21 def callback(payload) response = callback_resource.post(payload, :content_type => :json) if response.code.to_s != "200" raise "Failed performing callback to Foreman server: #{response.code} #{response.body}" end response end |