Project

statuscake

0.13
Repository is archived
No commit activity in last 3 years
No release in over 3 years
It is a StatusCake API client library.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 3.0.0

Runtime

 Project Readme

StatusCake

It is a StatusCake API client library.

Gem Version Build Status

It is a thin library, and methods are dynamically generated.

path.sub(%r|\A/API/|, '').gsub('/', '_').downcase
# "/API/Tests/Details" => "def tests_details"

It supports the following API:

  • /API/Alerts
  • /API/ContactGroups/Update
  • /API/ContactGroups
  • /API/Tests/Checks
  • /API/Tests/Periods
  • /API/Tests
  • /API/Tests/Details
  • /API/Tests/Update
  • /API/Locations/json
  • /API/Locations/txt
  • /API/Locations/xml
  • /API/Auth

see StatusCake::Client::APIs.

Installation

Add this line to your application's Gemfile:

gem 'statuscake'

And then execute:

$ bundle

Or install it yourself as:

$ gem install statuscake

Usage

require 'statuscake'

client = StatusCake::Client.new(API: 'l6OxVJilcD2cETMoNRvn', Username: 'StatusCake')

client.tests_details(TestID: 241)
#=> {"TestID"=>241,
#    "TestType"=>"HTTP",
#    "Paused"=>false,
#    "Affected"=>1,
#    ...

client.tests_update(
  WebsiteName: 'Example Domain',
  WebsiteURL:  'http://example.com',
  CheckRate:   300,
  TestType:    :HTTP)
#=> {"Success"=>true,
#    "Message"=>"Test Inserted",
#    "Issues"=>nil,
#    "Data"=>
#     {"WebsiteName"=>"Example Domain",
#     ...

Deleting a Test

client.tests_details(
  method: :delete,
  TestID: 241)
#=> {"TestID"=>6735,
#    "Affected"=>1,
#    "Success"=>true,
#    "Message"=>"This Check Has Been Deleted. It can not be recovered."}

I think this method call is strange.

This is because the original API is strange.

Test

bundle install
bundle exec rake

StatusCake API reference