notify-pagerduty

Notify events in your application as Triggers in Pager Duty

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

in.ashwanthkumar
ArtifactId

ArtifactId

notify-pagerduty
Last Version

Last Version

1.0-rc3
Release Date

Release Date

Type

Type

jar
Description

Description

notify-pagerduty
Notify events in your application as Triggers in Pager Duty

Download notify-pagerduty

How to add to project

<!-- https://jarcasting.com/artifacts/in.ashwanthkumar/notify-pagerduty/ -->
<dependency>
    <groupId>in.ashwanthkumar</groupId>
    <artifactId>notify-pagerduty</artifactId>
    <version>1.0-rc3</version>
</dependency>
// https://jarcasting.com/artifacts/in.ashwanthkumar/notify-pagerduty/
implementation 'in.ashwanthkumar:notify-pagerduty:1.0-rc3'
// https://jarcasting.com/artifacts/in.ashwanthkumar/notify-pagerduty/
implementation ("in.ashwanthkumar:notify-pagerduty:1.0-rc3")
'in.ashwanthkumar:notify-pagerduty:jar:1.0-rc3'
<dependency org="in.ashwanthkumar" name="notify-pagerduty" rev="1.0-rc3">
  <artifact name="notify-pagerduty" type="jar" />
</dependency>
@Grapes(
@Grab(group='in.ashwanthkumar', module='notify-pagerduty', version='1.0-rc3')
)
libraryDependencies += "in.ashwanthkumar" % "notify-pagerduty" % "1.0-rc3"
[in.ashwanthkumar/notify-pagerduty "1.0-rc3"]

Dependencies

compile (3)

Group / Artifact Type Version
in.ashwanthkumar : notify-core jar 1.0-rc3
com.squareup.pagerduty : pagerduty-incidents jar 1.1.1
com.typesafe : config jar 1.2.1

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : hamcrest-all jar 1.3
org.mockito : mockito-all jar 1.10.19

Project Modules

There are no modules declared in this project.

Notify

Collection of libraries that I used for notification across various means.

Latest Project version - 1.0-rc3 (published on Maven Central)

Integrations and Usage

Add the notify-core to your project and choose the required integration.

<dependency>
    <groupId>in.ashwanthkumar</groupId>
    <artifactId>notify-core</artifactId>
    <version>${project.version}</version>
</dependency>

Slack

<dependency>
    <groupId>in.ashwanthkumar</groupId>
    <artifactId>notify-slack</artifactId>
    <version>${project.version}</version>
</dependency>
Notifier notifier = new BasicSlackNotifier(new Slack("slack_webhook_url").sendToChannel("general"));
notifier.notify("Hello World from Notify :smile:");

or you can initialize from HOCON configurations

# slack-notify.conf
notify {
  type = "slack"
  webhook-url = "https://hooks.slack.com/services/foo/bar/baz"
  # Optional fields
  channel = "general" # or user = "david"
  botname = "notifier"
  icon = ":sunglasses:"
}
Config config = ConfigFactory.parseResources("slack-notify.conf").getConfig("notify");
Notifier notifier = SlackNotifierFactory.load(config);
notifier.notify("Hello World from Notify :smile:");

EMail

<dependency>
    <groupId>in.ashwanthkumar</groupId>
    <artifactId>notify-email</artifactId>
    <version>${project.version}</version>
</dependency>
Notifier notifier = new SimpleEmailNotifier(new GMailConfig("[email protected]", "[email protected]", "Email Subject", "username", "password"));
notifier.notify("Hello World from Notify :smile:");

PagerDuty

Note - As of now, we can only trigger incidents on PagerDuty not resolve them.

<dependency>
    <groupId>in.ashwanthkumar</groupId>
    <artifactId>notify-pagerduty</artifactId>
    <version>${project.version}</version>
</dependency>
Notifier notifier = new SimplePDNotifier("API_KEY");
notifier.notify("Hello World from Notify :smile:");

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Versions

Version
1.0-rc3
1.0-rc2
1.0-rc1