Provides a Haskell client for the Opsgenie REST API based on a http-client backend. To keep the size reasonable, a partial swagger definition is generated from the [Opsgenie Open API Specification]). Currently, only the Alert API is generated.
The nix-shell provides all necessary Node, Java, and Haskell dependencies to regenerate the project.
To start developing, install Nix and run nix-shell
.
For convenience, there is a direnv wrapper around the nix-shell.
To regenerate the client, run make test
. This will:
- Generate a swagger.json into
gen
from the Opsgenie OpenAPI Specification. - Generate the haskell client into
gen/opsgenie-rest
. - Apply patches to upgrade the LTS in the generated build
- Run
stack test
to compile and test the code. At present, the generated code has no tests.
If the test passes, you can commit all the changes in the gen
directory.
Generation of the swagger.json requires several Node dependencies.
To avoid npm, we use node2nix.
Run make node2nix
to refresh the Node environment.
The generated files go into nix/
.
Please be sure to run make test
and commit the contents of gen/
along with nix/
.
Run niv update
to get the latest version of the Opsgenie OpenAPI Specification or er-nix.
Please be sure to run make test
and commit the contents of gen/
along with nix/sources.json
.