Нет описания http://j1x-huginn.herokuapp.com

manual_event_agent.rb 821B

123456789101112131415161718192021222324252627282930313233343536
  1. module Agents
  2. class ManualEventAgent < Agent
  3. cannot_be_scheduled!
  4. cannot_receive_events!
  5. description <<-MD
  6. The Manual Event Agent is used to manually create Events for testing or other purposes.
  7. Do not set options for this Agent. Instead, connect it to other Agents and create Events
  8. using the UI provided on this Agent's Summary page.
  9. MD
  10. event_description "User determined"
  11. def default_options
  12. { "no options" => "are needed" }
  13. end
  14. def handle_details_post(params)
  15. if params['payload']
  16. create_event(:payload => params['payload'])
  17. { :success => true }
  18. else
  19. { :success => false, :error => "You must provide a JSON payload" }
  20. end
  21. end
  22. def working?
  23. true
  24. end
  25. def validate_options
  26. end
  27. end
  28. end