README.md in uptimerobot-0.1.6 vs README.md in uptimerobot-0.2.0
- old
+ new
@@ -1,12 +1,22 @@
# UptimeRobot
-[Uptime Robot](https://uptimerobot.com/) API client for Ruby.
+[Uptime Robot](https://uptimerobot.com/) APIv2 client for Ruby.
[![Gem Version](https://badge.fury.io/rb/uptimerobot.svg)](http://badge.fury.io/rb/uptimerobot)
[![Build Status](https://travis-ci.org/winebarrel/uptimerobot.svg?branch=master)](https://travis-ci.org/winebarrel/uptimerobot)
+### Notice
+
+Currently, this library uses APIv2.
+
+If you want to use APIv1, please specify it as follows:
+
+```
+gem 'uptimerobot', '~> 0.1.6'
+```
+
## Installation
Add this line to your application's Gemfile:
```ruby
@@ -24,30 +34,41 @@
## Usage
```ruby
require 'uptimerobot'
-client = UptimeRobot::Client.new(apiKey: 'u956-afus321g565fghr519')
+client = UptimeRobot::Client.new(api_key: 'u956-afus321g565fghr519')
client.getMonitors
-# => {"stat"=>"ok",
-# "offset"=>"0",
-# "limit"=>"50",
-# "total"=>"2",
-# "monitors"=>
-# {"monitor"=>
-# [{"id"=>"128795",
-# "friendlyname"=>"Yahoo",
-# "url"=>"http://www.yahoo.com/",
-# "type"=>"1",
-# "subtype"=>"",
-# ...
+# {
+# "stat": "ok",
+# "pagination": {
+# "offset": 0,
+# "limit": 50,
+# "total": 2
+# },
+# "monitors": [
+# {
+# "id": 777749809,
+# "friendly_name": "Google",
+# "url": "http://www.google.com",
+# "type": 1,
+# ...
+# },
+# {
+# "id": 777712827,
+# "friendly_name": "My Web Page",
+# "url": "http://mywebpage.com/",
+# "type": 1,
+# ...
+# },
+# ...
client.newMonitor(
- monitorFriendlyName: 'Google',
- monitorURL: 'http://www.google.com',
- monitorType: UptimeRobot::Monitor::Type::HTTP,
- monitorAlertContacts: '448,716'
+ friendly_name: 'Google',
+ url: 'http://www.google.com',
+ type: UptimeRobot::Monitor::Type::HTTP,
+ alert_contacts: '448,716'
)
```
## Test