Elixir client for V2 of the Pagerduty REST API.
If available in Hex, the package can be installed
by adding pagex
to your list of dependencies in mix.exs
:
def deps do
[
{:pagex, "~> 0.1.0"}
]
end
Configuration pagex for your application is simple, you only need to pass in your API Key and the Pagerduty base URI.
config :pagex,
api_key: "SOME-API-KEY",
uri: "https://api.pagerduty.com"
Configurable URIs are useful for testing.
You can also use the {:system, "ENV_VAR_NAME"}
pattern to force pagex to lookup the value from the environment at run time.
config :pagex,
api_key: {:system, "PAGERDUTY_API_KEY"},
uri: {:system, "PAGERDUTY_URI"}
Creating an incident is simple:
iex> Pagex.Incidents.create("Test Incident!", "MyServiceID", "me@example.org)