in.ashwanthkumar.notify.pagerduty.SimplePDNotifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of notify-pagerduty Show documentation
Show all versions of notify-pagerduty Show documentation
Notify events in your application as Triggers in Pager Duty
package in.ashwanthkumar.notify.pagerduty;
import com.squareup.pagerduty.incidents.PagerDuty;
import com.squareup.pagerduty.incidents.Trigger;
import in.ashwanthkumar.notify.Notifier;
public class SimplePDNotifier implements Notifier {
private String apiKey;
public SimplePDNotifier(String apiKey) {
this.apiKey = apiKey;
}
@Override
public void notify(String message) {
PagerDuty pd = PagerDuty.create(apiKey);
pd.notify(new Trigger.Builder(message).build());
}
}