class Zenduty::EventsApi

Public Class Methods

new(access_token) click to toggle source
# File lib/zenduty/events_api.rb, line 5
def initialize(access_token)
  @api = APIClient.new(access_token)
end

Public Instance Methods

create_event(integration_key,body) click to toggle source
# File lib/zenduty/events_api.rb, line 9
def create_event(integration_key,body)
  #Creates an incident event on zenduty
  #params str integration_key=> unique key provided for your integration
  #params hash body=> contains the details of the event
  #   'message', 'summary' are required fields of the body
  #   'alert_type' is "info" by default
  #   'suppressed' is false by default
  #   if no entity_id is provided, Zenduty provides one automatically
  # Sample body=>
  #          {'message'=>message,
  #         'summary'=>summary,
  #         'alert_type'=>alert_type,
  #         'supressed'=>supressed}
  @api._post("/api/events/#{integration_key}/",body)
end