Cachet API Library Wrapper

Travis CI Code Climate Test Coverage Issue Count Inline docs Gem Gem

Ruby library wrapper for CachetHQ.io

Installation

Add this line to your application's Gemfile:

gem 'cachet_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cachet_api

Usage

# Under your profile in Cachet, get your api_key from the API Token section. Base url is https://demo.cachethq.io/api/v1/ or https://cachet.yourdomain.com/api/v1/

require 'cachet' # have an issue open to fix this, will force v2.0.0

CachetClient = CachetClient.new(api_key, base_url)
CachetComponents = CachetComponents.new(api_key, base_url)
CachetIncidents = CachetIncidents.new(api_key, base_url)
CachetMetrics = CachetMetrics.new(api_key, base_url)
CachetSubscribers = CachetSubscribers.new(api_key, base_url)

View the last release API documentation at: https://docs.cachethq.io/

Library to API Quick Reference

See RubyDoc for more in-depth documentation

Ping

Cachet API Ruby Library Options/Params
get/ping CachetClient.ping N/A

Components

Cachet API Ruby Library Options/Params (R) == Required
get/components CachetComponents.list Options (hash) : id, name, status, group_id, enabled
get/components/:id CachetComponents.list_id Options (hash) : id
post/components CachetComponents.create Options (hash) : name(R), status(R), description, link, order, group_id, enabled
put/components/:id CachetComponents.update Options (hash) : id(R), status(R), name(R), link, order, group_id, enabled
delete/components/:id CachetComponents.delete Options (hash) : id(R)
get/components/groups CachetComponents.groups_list N/A
get/components/groups/:id CachetComponents.groups_list_id Options (hash) : id(R)
post/components/groups CachetComponents.groups_create Options (hash) : name(R), order, collapsed(R)
put/components/groups/:id CachetComponents.groups_update Options (hash) : id(R), name, order, collapsed
delete/components/groups/:id CachetComponents.groups_delete Options (hash) : id(R)

Incidents

Cachet API Ruby Library Options/Params (R) == Required
get/incidents CachetIncidents.list Options (hash) : id, component_id, name, status, visible
get/incidents/:id CachetIncidents.list_id Options (hash) : id
post/incidents CachetIncidents.create Options (hash) : name(R), message(R), status(R), visible(R), component_id, component_status, notify
put/incidents/:id CachetIncidents.update Options (hash) : id(R), name, message, status, visible, component_id, component_status, notify
delete/incidents/:id CachetIncidents.delete Options (hash) : id

Metrics

Cachet API Ruby Library Options/Params (R) == Required
get/metrics CachetMetrics.list N/A
post/metrics CachetMetrics.create Options (hash) : name(R), suffix(R), description(R), default_value(R), display_chart(R)
get/metrics/:id CachetMetrics.list_id Options (hash) : id(R)
delete/metrics/:id CachetMetrics.delete Options (hash) : id(R)
get/metrics/:id/points CachetMetrics.point_list Options (hash) : id (R)
post/metrics/:id/points CachetMetrics.point_add Options (hash) : id(R), value(R), timestamp
delete/metrics/:id/points/:point_id CachetMetrics.point_delete Options (hash) : id(R), point_id(R)

Subscribers

Cachet API Ruby Library Options/Params (R) == Required
get/subscribers CachetSubscribers.list N/A
post/subscribers CachetSubscribers.create Options (hash) : email(R), verify
delete/subscribers/:id CachetSubscribers.delete Options (hash) : id(R)

Development

After checking out the repo

  • Run bin/setup
  • To run IRB with quick configuration, rake console
  • To install this gem onto your local machine, run bundle exec rake install

Contribute

Fork this repo

  • Make your changes
  • Create/Update RSPEC Tests
  • Document changes inline (if needed, aka new options)
  • Document readme with changes
  • Submit pull request