Skip to content

jakedavis/hinoki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hinoki

A programmatic interface to the Sensu API. Named after the Japanese tree which were (are?) once used for Japanese hand fans (Sensu).

Usage

This gem is designed to be easy to use and programmatic. It is basically just a light Net::HTTP wrapper. Things are namespaced by API endpoint first, and then by a DSL-like logical description of the desired task. Where appropriate, the same terminology is used across endpoints.

Configuration

Hinoki looks for a config file in ~/.hinoki. If it does not find this configuration file, it will assume it should contact localhost:4567 for all requests. The config file is JSON format and accepts the following parameters:

  • host - Host of the Sensu API
  • port - Port of the Sensu API
  • user - HTTP basic auth username
  • password - HTTP basic auth password
{
  "host": "sensu.example.com",
  "port": 5000
}

Examples

require 'hinoki'
h = Hinoki.new

h.checks.all
h.checks.by_name('check_flux_capacitor')
h.checks.request('check_flux_capacitor', ['my_client'])

h.events.all
h.events.for_client('my_client')
h.events.resolve('my_client', 'check_flux_capacitor')

h.clients.all
h.clients.by_name('my_client')
h.clients.history('my_client')
h.clients.delete('my_client')

h.stashes.all
h.stashes.create('/test', {reason: 'because reasons'}}
h.stashes.by_name('/test')
h.stashes.delete('/test')

h.aggregates.all
h.aggregates.by_name('my_aggregate')
h.aggregates.summarize('my_aggregate')
h.aggregates.delete('my_aggregate')

Author and License

Jake Davis <jake.davis5989@gmail.com>

Apache License, Version 2.0

About

Sensu API client in Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages