Updown

A wrapper for the Updown.io API

Installation

Add this line to your application's Gemfile:

gem 'updown'

And then execute:

$ bundle

Or install it yourself as:

$ gem install updown

Configuration

Set your API key

# config/initializers/updown.rb
Updown.configure do |config|
  config.api_key = 'your_api_key'
end
# or
Updown.configuration.api_key = 'your_api_key'

Or set the UPDOWN_API_KEY environment variable

Usage

List all your checks:

Updown::Check.all

See downtimes for a specific check:

check.downtimes

Create a new check:

Updown::Check.create 'https://google.com'

You can also set period and published:

Updown::Check.create 'https://google.com', period: 30, published: true

Update a specific check:

check.update period: 30

See more details about the options here: https://updown.io/api

Delete a specific check:

check.destroy

Command Line

This gem also comes with a few commands

First, configure your API key:

$ updown configure YOUR_API_KEY

See the status of your checks:

$ updown status
[up] https://google.com
[up] https://bing.com

Add a new check:

$ updown add https://google.com

Todo

  • Write tests!
  • Error handling

Contributing

  1. Fork it ( https://github.com/askehansen/updown-ruby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request