Skip to content

efalkner/sensu-java-api

Repository files navigation

Overview

sensu-java-api is a Java API for the Sensu monitoring framework. Specifically, it provides Java bindings for the Sensu API provided by Sensu itself. It currently uses Feign as the HTTP client.

What does it do?

It provides bindings for the following functionality:

  • Reading information about checks
  • Reading information about clients
  • Reading information about events
  • Reading information about stashes
  • Issuing check requests
  • Deleting clients
  • Resolving events
  • Creating/updating/deleting stashes

It does not yet have bindings for:

The following functionality is not provided by the Sensu API, and thus cannot be included (unless it's first added to Sensu):

  • Creating checks
  • Creating clients
  • Creating events

Where do I get it?

Download

Binaries are published to JCenter. To use the library from Gradle, use something like this (substitute latest version):

repositories {
    jcenter()
}
dependencies {
    compile "com.commercehub.sensu:sensu-java-api:VERSION"
}

How do I use it?

Examples below are in Groovy. First, build an instance of SensuApi using SensuApiBuilder:

def api = SensuApiBuilder.builder()
    .authentication(username, password)
    .build(apiUrl)

Then, use its methods to interact with the Sensu API:

println "Current checks: ${api.checks}"
println "Current clients: ${api.clients}"
println "Current events: ${api.events}"
println "Current stashes: ${api.stashes}"

About

Java API for the Sensu monitoring framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published