Permalink
Browse files

first few return blocks

  • Loading branch information...
1 parent 094535a commit 78df0efac37d6a0ac1e86cac9c6ce1b09a816e81 @ali-graham ali-graham committed Sep 19, 2012
Showing with 41 additions and 6 deletions.
  1. +41 −6 README.md
View
@@ -32,18 +32,19 @@ Return a list of monitored entities, and their statuses for all associated check
Flapjack::Diner.entities
```
-The data is returned as a JSON list where each element is an associative array representing an entity:
+The data is returned as a JSON list where each element is an associative array representing an entity.
-```json
-// ID is an integer, to hold e.g. database id from an external system
-// NAME is a string
-// CHECK is as defined under Flapjack::Diner.status(entity, check)
+```
+// ID is an integer, to hold e.g. database id from an external system
+// NAME is a string
+// STATUS is an associative array with the format returned from Flapjack::Diner.status(entity, check)
[{"id" : ID,
"name" : NAME,
- "checks" : [CHECK, CHECK, ...]},
+ "checks" : [STATUS, STATUS, ...]},
{},
...]
```
+
---
Return a list of checks for an entity:
@@ -52,6 +53,13 @@ Return a list of checks for an entity:
Flapjack::Diner.checks('example.com')
```
+The data is returned as a JSON list of strings, where each element is a check name for the provided entity.
+
+```
+// CHECK is a string, e.g. 'ssh', 'ping'
+[CHECK, CHECK, ...]
+```
+
---
Return the statuses for all checks on an entity
@@ -60,12 +68,23 @@ Return the statuses for all checks on an entity
Flapjack::Diner.status('example.com')
```
+The data is returned as a JSON list of checks, where each element is an associative array with the format returned from Flapjack::Diner.status(entity, check)
+
+```
+// STATUS is an associative array with the format returned from Flapjack::Diner.status(entity, check)
+[STATUS, STATUS, ...]
+```
+
+---
+
Return the status for a check on an entity
```ruby
Flapjack::Diner.status('example.com', 'ping')
```
+---
+
Return lists of scheduled maintenance periods for all checks on an entity:
```ruby
@@ -74,6 +93,8 @@ Return lists of scheduled maintenance periods for all checks on an entity:
Flapjack::Diner.scheduled_maintenances('example.com', :start_time => "2012-09-01T00:00:00+09:30", :end_time => "2012-10-01T00:00:00+09:30")
```
+---
+
Return a list of scheduled maintenance periods for a check on an entity:
```ruby
@@ -82,6 +103,8 @@ Return a list of scheduled maintenance periods for a check on an entity:
Flapjack::Diner.scheduled_maintenances('example.com', 'ping', :start_time => "2012-09-01T00:00:00+09:30", :end_time => "2012-10-01T00:00:00+09:30")
```
+---
+
Return lists of unscheduled maintenance periods for all checks on an entity:
```ruby
@@ -90,6 +113,8 @@ Return lists of unscheduled maintenance periods for all checks on an entity:
Flapjack::Diner.unscheduled_maintenances('example.com', :start_time => "2012-09-01T00:00:00+09:30", :end_time => "2012-10-01T00:00:00+09:30")
```
+---
+
Return a list of unscheduled maintenance periods for a check on an entity:
```ruby
@@ -98,13 +123,16 @@ Return a list of unscheduled maintenance periods for a check on an entity:
Flapjack::Diner.unscheduled_maintenances('example.com', 'ping', :start_time => "2012-09-01T00:00:00+09:30", :end_time => "2012-10-01T00:00:00+09:30")
```
+---
+
Return lists of outages for all checks on an entity (all times for which said checks failed):
```ruby
# start time (ISO 8601-formatted String, optional)
# end time (ISO 8601-formatted String, optional)
Flapjack::Diner.outages('example.com', :start_time => "2012-09-01T00:00:00+09:30", :end_time => "2012-10-01T00:00:00+09:30")
```
+---
Return a list of outages for a check on an entity (all times for which the check failed):
@@ -114,6 +142,8 @@ Return a list of outages for a check on an entity (all times for which the check
Flapjack::Diner.outages('example.com', 'ping', :start_time => "2012-09-01T00:00:00+09:30", :end_time => "2012-10-01T00:00:00+09:30")
```
+---
+
Return a list of downtimes for all checks on an entity (outages outside of scheduled maintenance periods):
```ruby
@@ -122,13 +152,16 @@ Return a list of downtimes for all checks on an entity (outages outside of sched
Flapjack::Diner.downtime('example.com', :start_time => "2012-09-01T00:00:00+09:30", :end_time => "2012-10-01T00:00:00+09:30")
```
+---
+
Return a list of downtimes for a check on an entity (outages outside of scheduled maintenance periods):
```ruby
# start time (ISO 8601-formatted String, optional)
# end time (ISO 8601-formatted String, optional)
Flapjack::Diner.downtime('example.com', 'ping', :start_time => "2012-09-01T00:00:00+09:30", :end_time => "2012-10-01T00:00:00+09:30")
```
+---
Acknowledge the current state for a check on an entity:
@@ -137,6 +170,8 @@ Acknowledge the current state for a check on an entity:
Flapjack::Diner.acknowledge!('example.com', 'ping', :summary => 'ack')
```
+---
+
Create a scheduled maintenance period for a check on an entity:
```ruby

0 comments on commit 78df0ef

Please sign in to comment.