spec/pacts/flapjack-diner-flapjack.json in flapjack-diner-1.3.0 vs spec/pacts/flapjack-diner-flapjack.json in flapjack-diner-1.4.0

- old
+ new

@@ -5,1069 +5,1835 @@ "consumer": { "name": "flapjack-diner" }, "interactions": [ { - "description": "a time limited GET request for a outage report on one entity", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for a single notification rule", + "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists", "request": { "method": "get", - "path": "/outage_report/entities/1234", - "query": "start_time=2014-12-02T10%3A31%3A27%2B10%3A30&end_time=2014-12-02T22%3A31%3A27%2B10%3A30" + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "outage_reports": [ + "notification_rules": [ { - "outages": [ + "id": "05983623-fcef-42da-af44-ed6990b500fa", + "tags": [ ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "regex_tags": [ + + ], + "entities": [ + + ], + "regex_entities": [ + + ], + "time_restrictions": [ + + ], + "warning_media": [ + "email" + ], + "critical_media": [ + "sms", + "email" + ], + "warning_blackhole": false, + "critical_blackhole": false } ] } } }, { - "description": "a GET request for a downtime report on all entities", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for a single notification rule", + "provider_state": "no notification rule exists", "request": { "method": "get", - "path": "/downtime_report/entities" + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa" }, "response": { - "status": 200, + "status": 404, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "downtime_reports": [ - { - } + "errors": [ + "could not find notification rules '05983623-fcef-42da-af44-ed6990b500fa'" ] } } }, { - "description": "a GET request for a status report on all entities", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for all notification rules", + "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists", "request": { "method": "get", - "path": "/status_report/entities" + "path": "/notification_rules" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "status_reports": [ + "notification_rules": [ { + "id": "05983623-fcef-42da-af44-ed6990b500fa", + "tags": [ + + ], + "regex_tags": [ + + ], + "entities": [ + + ], + "regex_entities": [ + + ], + "time_restrictions": [ + + ], + "warning_media": [ + "email" + ], + "critical_media": [ + "sms", + "email" + ], + "warning_blackhole": false, + "critical_blackhole": false } ] } } }, { - "description": "a GET request for a downtime report on one entity", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for two notification rules", + "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists", "request": { "method": "get", - "path": "/downtime_report/entities/1234" + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "downtime_reports": [ + "notification_rules": [ { + "id": "05983623-fcef-42da-af44-ed6990b500fa", + "tags": [ + + ], + "regex_tags": [ + + ], + "entities": [ + + ], + "regex_entities": [ + + ], + "time_restrictions": [ + + ], + "warning_media": [ + "email" + ], + "critical_media": [ + "sms", + "email" + ], + "warning_blackhole": false, + "critical_blackhole": false + }, + { + "id": "20f182fc-6e32-4794-9007-97366d162c51", + "tags": [ + "physical" + ], + "regex_tags": [ + + ], + "entities": [ + "example.com" + ], + "regex_entities": [ + + ], + "time_restrictions": [ + + ], + "warning_media": [ + "email" + ], + "critical_media": [ + "sms", + "email" + ], + "warning_blackhole": true, + "critical_blackhole": true } ] } } }, { - "description": "a GET request for a downtime report on two entities", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a DELETE request for a single notification rule", + "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists", "request": { - "method": "get", - "path": "/downtime_report/entities/1234,5678" + "method": "delete", + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa", + "body": null }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a DELETE request for two notification rules", + "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists", + "request": { + "method": "delete", + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51", + "body": null + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a DELETE request for a single notification rule", + "provider_state": "no notification rule exists", + "request": { + "method": "delete", + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa", + "body": null + }, + "response": { + "status": 404, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "downtime_reports": [ - { - }, - { - } + "errors": [ + "could not find notification rule '05983623-fcef-42da-af44-ed6990b500fa'" ] } } }, { - "description": "a GET request for a outage report on one entity", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one notification rule", + "provider_state": "a contact with id 'abc' exists", "request": { - "method": "get", - "path": "/outage_report/entities/1234" + "method": "post", + "path": "/contacts/abc/notification_rules", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "notification_rules": [ + { + "entity_tags": [ + "database", + "physical" + ], + "entities": [ + "foo-app-01.example.com" + ], + "time_restrictions": null, + "warning_media": [ + "email" + ], + "critical_media": [ + "sms", + "email" + ], + "warning_blackhole": false, + "critical_blackhole": false + } + ] + } }, "response": { - "status": 200, + "status": 201, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, + "body": [ + { + "json_class": "Pact::Term", + "data": { + "generate": "05983623-fcef-42da-af44-ed6990b500fa", + "matcher": {"json_class":"Regexp","o":0,"s":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"} + } + } + ] + } + }, + { + "description": "a POST request with two notification rules", + "provider_state": "a contact with id 'abc' exists", + "request": { + "method": "post", + "path": "/contacts/abc/notification_rules", + "headers": { + "Content-Type": "application/vnd.api+json" + }, "body": { - "outage_reports": [ + "notification_rules": [ { - "outages": [ - + "entity_tags": [ + "database", + "physical" ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "entities": [ + "foo-app-01.example.com" + ], + "time_restrictions": null, + "warning_media": [ + "email" + ], + "critical_media": [ + "sms", + "email" + ], + "warning_blackhole": false, + "critical_blackhole": false + }, + { + "entity_tags": null, + "entities": [ + "foo-app-02.example.com" + ], + "time_restrictions": null, + "warning_media": [ + "email" + ], + "critical_media": [ + "sms", + "email" + ], + "warning_blackhole": true, + "critical_blackhole": false } ] } + }, + "response": { + "status": 201, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, + "body": [ + { + "json_class": "Pact::Term", + "data": { + "generate": "05983623-fcef-42da-af44-ed6990b500fa", + "matcher": {"json_class":"Regexp","o":0,"s":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"} + } + }, + { + "json_class": "Pact::Term", + "data": { + "generate": "20f182fc-6e32-4794-9007-97366d162c51", + "matcher": {"json_class":"Regexp","o":0,"s":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"} + } + } + ] } }, { - "description": "a time limited GET request for a downtime report on all entities", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one notification rule", + "provider_state": "no contact exists", "request": { - "method": "get", - "path": "/downtime_report/entities", - "query": "start_time=2014-12-02T10%3A31%3A27%2B10%3A30&end_time=2014-12-02T22%3A31%3A27%2B10%3A30" + "method": "post", + "path": "/contacts/abc/notification_rules", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "notification_rules": [ + { + "entity_tags": [ + "database", + "physical" + ], + "entities": [ + "foo-app-01.example.com" + ], + "time_restrictions": null, + "warning_media": [ + "email" + ], + "critical_media": [ + "sms", + "email" + ], + "warning_blackhole": false, + "critical_blackhole": false + } + ] + } }, "response": { - "status": 200, + "status": 404, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "downtime_reports": [ - { - } + "errors": [ + "could not find contact 'abc'" ] } } }, { - "description": "a GET request for a scheduled_maintenance report on a single check", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a PATCH request to change properties for a single notification rule", + "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists", "request": { - "method": "get", - "path": "/scheduled_maintenance_report/checks/www.example.com:SSH" + "method": "patch", + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/notification_rules/0/warning_blackhole", + "value": false + } + ] }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a PATCH request to change properties for two notification rules", + "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists", + "request": { + "method": "patch", + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51", "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/notification_rules/0/warning_blackhole", + "value": false + } + ] + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a PATCH request to change properties for a single notification rule", + "provider_state": "no notification rule exists", + "request": { + "method": "patch", + "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/notification_rules/0/warning_blackhole", + "value": false + } + ] + }, + "response": { + "status": 404, + "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenance_reports": [ - { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } - } + "errors": [ + "could not find notification rule '05983623-fcef-42da-af44-ed6990b500fa'" ] } } }, { - "description": "a time-limited GET request for a downtime report on two checks", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a GET request for sms media", + "provider_state": "a contact with id 'abc' has email and sms media", "request": { "method": "get", - "path": "/downtime_report/checks/www.example.com:SSH,www2.example.com:PING", - "query": "start_time=2014-12-02T10%3A31%3A27%2B10%3A30&end_time=2014-12-02T22%3A31%3A27%2B10%3A30" + "path": "/media/abc_sms" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "downtime_reports": [ + "media": [ { - }, - { + "type": "sms", + "address": "0123456789", + "interval": 300, + "rollup_threshold": 5, + "links": { + "contacts": [ + "abc" + ] + } } ] } } }, { - "description": "a time limited GET request for a outage report on all checks", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for sms media", + "provider_state": "no contact exists", "request": { "method": "get", - "path": "/outage_report/checks", - "query": "start_time=2014-12-02T10%3A31%3A27%2B10%3A30&end_time=2014-12-02T22%3A31%3A27%2B10%3A30" + "path": "/media/abc_sms" }, "response": { - "status": 200, + "status": 404, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "outage_reports": [ - { - "outages": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } - } + "errors": [ + "could not find contact 'abc'" ] } } }, { - "description": "a GET request for a scheduled_maintenance report on all entities", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for all media", + "provider_state": "a contact with id 'abc' has email and sms media", "request": { "method": "get", - "path": "/scheduled_maintenance_report/entities" + "path": "/media" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenance_reports": [ + "media": [ { - "scheduled_maintenances": [ - - ], + "type": "email", + "address": "ablated@example.org", + "interval": 180, + "rollup_threshold": 3, "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" + "contacts": [ + "abc" ] } + }, + { + "type": "sms", + "address": "0123456789", + "interval": 300, + "rollup_threshold": 5, + "links": { + "contacts": [ + "abc" + ] + } } ] } } }, { - "description": "a GET request for a outage report on two checks", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a GET request for email and sms media", + "provider_state": "a contact with id 'abc' has email and sms media", "request": { "method": "get", - "path": "/outage_report/checks/www.example.com:SSH,www2.example.com:PING" + "path": "/media/abc_email,abc_sms" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "outage_reports": [ + "media": [ { - "outages": [ - - ], + "type": "email", + "address": "ablated@example.org", + "interval": 180, + "rollup_threshold": 3, "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" + "contacts": [ + "abc" ] } }, { - "outages": [ - - ], + "type": "sms", + "address": "0123456789", + "interval": 300, + "rollup_threshold": 5, "links": { - "entity": [ - "5678" - ], - "check": [ - "www2.example.com:PING" + "contacts": [ + "abc" ] } } ] } } }, { - "description": "a time limited GET request for a downtime report on a single check", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a DELETE request for one medium", + "provider_state": "a contact with id 'abc' has email and sms media", "request": { - "method": "get", - "path": "/downtime_report/checks/www.example.com:SSH", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "method": "delete", + "path": "/media/abc_email", + "body": null }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a DELETE request for two media", + "provider_state": "a contact with id 'abc' has email and sms media", + "request": { + "method": "delete", + "path": "/media/abc_email,abc_sms", + "body": null + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a DELETE request for one medium", + "provider_state": "no contact exists", + "request": { + "method": "delete", + "path": "/media/abc_email", + "body": null + }, + "response": { + "status": 404, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "downtime_reports": [ - { - } + "errors": [ + "could not find contact 'abc'" ] } } }, { - "description": "a GET request for a unscheduled_maintenance report on two checks", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a POST request with one medium", + "provider_state": "a contact with id 'abc' exists", "request": { - "method": "get", - "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING" + "method": "post", + "path": "/contacts/abc/media", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "media": [ + { + "type": "sms", + "address": "0123456789", + "interval": 300, + "rollup_threshold": 5 + } + ] + } }, "response": { - "status": 200, + "status": 201, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, + "body": [ + "abc_sms" + ] + } + }, + { + "description": "a POST request with two media", + "provider_state": "a contact with id 'abc' exists", + "request": { + "method": "post", + "path": "/contacts/abc/media", + "headers": { + "Content-Type": "application/vnd.api+json" + }, "body": { - "unscheduled_maintenance_reports": [ + "media": [ { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "type": "sms", + "address": "0123456789", + "interval": 300, + "rollup_threshold": 5 }, { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "5678" - ], - "check": [ - "www2.example.com:PING" - ] - } + "type": "email", + "address": "ablated@example.org", + "interval": 180, + "rollup_threshold": 3 } ] } + }, + "response": { + "status": 201, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, + "body": [ + "abc_sms", + "abc_email" + ] } }, { - "description": "a GET request for a scheduled_maintenance report on all checks", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one medium", + "provider_state": "no contact exists", "request": { - "method": "get", - "path": "/scheduled_maintenance_report/checks" + "method": "post", + "path": "/contacts/abc/media", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "media": [ + { + "type": "sms", + "address": "0123456789", + "interval": 300, + "rollup_threshold": 5 + } + ] + } }, "response": { - "status": 200, + "status": 422, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenance_reports": [ - { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } - } + "errors": [ + "Contact id: 'abc' could not be loaded" ] } } }, { - "description": "a GET request for a unscheduled_maintenance report on one entity", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a PATCH request for email media", + "provider_state": "a contact with id 'abc' has email and sms media", "request": { - "method": "get", - "path": "/unscheduled_maintenance_report/entities/1234" + "method": "patch", + "path": "/media/abc_email", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/media/0/interval", + "value": 50 + }, + { + "op": "replace", + "path": "/media/0/rollup_threshold", + "value": 3 + } + ] }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a PATCH request for email and sms media", + "provider_state": "a contact with id 'abc' has email and sms media", + "request": { + "method": "patch", + "path": "/media/abc_email,abc_sms", "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/media/0/interval", + "value": 50 + }, + { + "op": "replace", + "path": "/media/0/rollup_threshold", + "value": 3 + } + ] + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a PATCH request for email media", + "provider_state": "no contact exists", + "request": { + "method": "patch", + "path": "/media/abc_email", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/media/0/interval", + "value": 50 + } + ] + }, + "response": { + "status": 404, + "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenance_reports": [ + "errors": [ + "could not find contact 'abc'" + ] + } + } + }, + { + "description": "a POST request with one test notification", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "request": { + "method": "post", + "path": "/test_notifications/checks/www.example.com:SSH,www2.example.com:PING", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "test_notifications": [ { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "summary": "testing" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a time limited GET request for a scheduled_maintenance report on all checks", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one test notification", + "provider_state": "no check exists", "request": { - "method": "get", - "path": "/scheduled_maintenance_report/checks", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "method": "post", + "path": "/test_notifications/checks/www.example.com:SSH", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "test_notifications": [ + { + "summary": "testing" + } + ] + } }, "response": { - "status": 200, + "status": 404, + "body": { + "errors": [ + "could not find entity 'www.example.com'" + ] + } + } + }, + { + "description": "a POST request with one test notification", + "provider_state": "a check 'www.example.com:SSH' exists", + "request": { + "method": "post", + "path": "/test_notifications/checks/www.example.com:SSH", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "scheduled_maintenance_reports": [ + "test_notifications": [ { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "summary": "testing" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a status report on two checks", + "description": "a POST request with two test notifications", "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "get", - "path": "/status_report/checks/www.example.com:SSH,www2.example.com:PING" - }, - "response": { - "status": 200, + "method": "post", + "path": "/test_notifications/checks/www.example.com:SSH,www2.example.com:PING", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "status_reports": [ + "test_notifications": [ { + "summary": "testing" }, { + "summary": "more tests" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a time limited GET request for a unscheduled_maintenance report on a single check", + "description": "a POST request with two test notifications", "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "get", - "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "method": "post", + "path": "/test_notifications/checks/www.example.com:SSH", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "test_notifications": [ + { + "summary": "testing" + }, + { + "summary": "more tests" + } + ] + } }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a POST request with one test notification", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", + "request": { + "method": "post", + "path": "/test_notifications/entities/1234,5678", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenance_reports": [ + "test_notifications": [ { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "summary": "testing" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a unscheduled_maintenance report on all entities", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one test notification", + "provider_state": "no entity exists", "request": { - "method": "get", - "path": "/unscheduled_maintenance_report/entities" + "method": "post", + "path": "/test_notifications/entities/1234", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "test_notifications": [ + { + "summary": "testing" + } + ] + } }, "response": { - "status": 200, + "status": 404, + "body": { + "errors": [ + "could not find entity '1234'" + ] + } + } + }, + { + "description": "a POST request with one test notification", + "provider_state": "an entity 'www.example.com' with id '1234' exists", + "request": { + "method": "post", + "path": "/test_notifications/entities/1234", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenance_reports": [ + "test_notifications": [ { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a time limited GET request for a unscheduled_maintenance report on all entities", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with two test notifications", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", "request": { - "method": "get", - "path": "/unscheduled_maintenance_report/entities", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "method": "post", + "path": "/test_notifications/entities/1234,5678", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "test_notifications": [ + { + "summary": "testing" + }, + { + "summary": "more tests" + } + ] + } }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a POST request with two test notifications", + "provider_state": "an entity 'www.example.com' with id '1234' exists", + "request": { + "method": "post", + "path": "/test_notifications/entities/1234", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenance_reports": [ + "test_notifications": [ { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "summary": "testing" + }, + { + "summary": "more tests" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a outage report on all entities", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one unscheduled maintenance period", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "get", - "path": "/outage_report/entities" + "method": "post", + "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "unscheduled_maintenances": [ + { + "duration": 3600, + "summary": "working" + } + ] + } }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a POST request with one unscheduled maintenance period", + "provider_state": "no check exists", + "request": { + "method": "post", + "path": "/unscheduled_maintenances/checks/www.example.com:SSH", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "outage_reports": [ + "unscheduled_maintenances": [ { - "outages": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "duration": 3600, + "summary": "working" } ] } + }, + "response": { + "status": 404, + "body": { + "errors": [ + "could not find entity 'www.example.com'" + ] + } } }, { - "description": "a GET request for a status report on a single check", + "description": "a POST request with one unscheduled maintenance period", "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "get", - "path": "/status_report/checks/www.example.com:SSH" - }, - "response": { - "status": 200, + "method": "post", + "path": "/unscheduled_maintenances/checks/www.example.com:SSH", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "status_reports": [ + "unscheduled_maintenances": [ { + "duration": 3600, + "summary": "working" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a time-limited GET request for a scheduled_maintenance report on two checks", + "description": "a POST request with two unscheduled maintenance periods", "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "get", - "path": "/scheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "method": "post", + "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "unscheduled_maintenances": [ + { + "duration": 3600, + "summary": "working" + }, + { + "duration": 3600, + "summary": "more work" + } + ] + } }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a POST request with two unscheduled maintenance periods", + "provider_state": "a check 'www.example.com:SSH' exists", + "request": { + "method": "post", + "path": "/unscheduled_maintenances/checks/www.example.com:SSH", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "scheduled_maintenance_reports": [ + "unscheduled_maintenances": [ { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "duration": 3600, + "summary": "working" }, { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "5678" - ], - "check": [ - "www2.example.com:PING" - ] - } + "duration": 3600, + "summary": "more work" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a status report on two entities", + "description": "a POST request with one scheduled maintenance period", "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "get", - "path": "/status_report/entities/1234,5678" + "method": "post", + "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "scheduled_maintenances": [ + { + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" + } + ] + } }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a POST request with one scheduled maintenance period", + "provider_state": "no check exists", + "request": { + "method": "post", + "path": "/scheduled_maintenances/checks/www.example.com:SSH", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "status_reports": [ + "scheduled_maintenances": [ { - }, - { + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" } ] } + }, + "response": { + "status": 404, + "body": { + "errors": [ + "could not find entity 'www.example.com'" + ] + } } }, { - "description": "a GET request for a scheduled_maintenance report on two entities", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a POST request with one scheduled maintenance period", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "get", - "path": "/scheduled_maintenance_report/entities/1234,5678" + "method": "post", + "path": "/scheduled_maintenances/checks/www.example.com:SSH", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "scheduled_maintenances": [ + { + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" + } + ] + } }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a POST request with two scheduled maintenance periods", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "request": { + "method": "post", + "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "scheduled_maintenance_reports": [ + "scheduled_maintenances": [ { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" }, { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "5678" - ], - "check": [ - "www2.example.com:PING" - ] - } + "start_time": "2015-10-30T17:13:12+10:30", + "duration": 3600, + "summary": "more work" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a time limited GET request for a scheduled_maintenance report on all entities", + "description": "a POST request with two scheduled maintenance periods", "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "get", - "path": "/scheduled_maintenance_report/entities", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" - }, - "response": { - "status": 200, + "method": "post", + "path": "/scheduled_maintenances/checks/www.example.com:SSH", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "scheduled_maintenance_reports": [ + "scheduled_maintenances": [ { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" + }, + { + "start_time": "2015-10-30T17:13:12+10:30", + "duration": 3600, + "summary": "more work" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a status report on one entity", + "description": "a PATCH request for an unscheduled maintenance period", "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "get", - "path": "/status_report/entities/1234" + "method": "patch", + "path": "/unscheduled_maintenances/checks/www.example.com:SSH", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/unscheduled_maintenances/0/end_time", + "value": "2015-10-30T15:13:12+10:30" + } + ] }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a PATCH request for an unscheduled maintenance period", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "request": { + "method": "patch", + "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/json-patch+json" }, + "body": [ + { + "op": "replace", + "path": "/unscheduled_maintenances/0/end_time", + "value": "2015-10-30T15:13:12+10:30" + } + ] + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a PATCH request for an unscheduled maintenance period", + "provider_state": "no check exists", + "request": { + "method": "patch", + "path": "/unscheduled_maintenances/checks/www.example.com:SSH", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/unscheduled_maintenances/0/end_time", + "value": "2015-10-30T15:13:12+10:30" + } + ] + }, + "response": { + "status": 404, "body": { - "status_reports": [ - { - } + "errors": [ + "could not find entity 'www.example.com'" ] } } }, { - "description": "a time limited GET request for a outage report on all entities", + "description": "a DELETE request for a scheduled maintenance period", "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "get", - "path": "/outage_report/entities", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "method": "delete", + "path": "/scheduled_maintenances/checks/www.example.com:SSH", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30" }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a DELETE request for a scheduled maintenance period", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "request": { + "method": "delete", + "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30" + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a DELETE request for a scheduled maintenance period", + "provider_state": "no check exists", + "request": { + "method": "delete", + "path": "/scheduled_maintenances/checks/www.example.com:SSH", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30" + }, + "response": { + "status": 404, + "body": { + "errors": [ + "could not find entity 'www.example.com'" + ] + } + } + }, + { + "description": "a POST request with one unscheduled maintenance period", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", + "request": { + "method": "post", + "path": "/unscheduled_maintenances/entities/1234,5678", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "outage_reports": [ + "unscheduled_maintenances": [ { - "outages": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "duration": 3600, + "summary": "working" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a downtime report on a single check", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one unscheduled maintenance period", + "provider_state": "no entity exists", "request": { - "method": "get", - "path": "/downtime_report/checks/www.example.com:SSH" - }, - "response": { - "status": 200, + "method": "post", + "path": "/unscheduled_maintenances/entities/1234", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "downtime_reports": [ + "unscheduled_maintenances": [ { + "duration": 3600, + "summary": "working" } ] } + }, + "response": { + "status": 404, + "body": { + "errors": [ + "could not find entity '1234'" + ] + } } }, { - "description": "a time limited GET request for a unscheduled_maintenance report on two entities", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a POST request with one unscheduled maintenance period", + "provider_state": "an entity 'www.example.com' with id '1234' exists", "request": { - "method": "get", - "path": "/unscheduled_maintenance_report/entities/1234,5678", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "method": "post", + "path": "/unscheduled_maintenances/entities/1234", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "unscheduled_maintenances": [ + { + "duration": 3600, + "summary": "working" + } + ] + } }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a POST request with two unscheduled maintenance periods", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", + "request": { + "method": "post", + "path": "/unscheduled_maintenances/entities/1234,5678", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenance_reports": [ + "unscheduled_maintenances": [ { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "duration": 3600, + "summary": "working" }, { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "5678" - ], - "check": [ - "www2.example.com:PING" - ] - } + "duration": 3600, + "summary": "more work" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a scheduled_maintenance report on two checks", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a POST request with two unscheduled maintenance periods", + "provider_state": "an entity 'www.example.com' with id '1234' exists", "request": { - "method": "get", - "path": "/scheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING" - }, - "response": { - "status": 200, + "method": "post", + "path": "/unscheduled_maintenances/entities/1234", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "scheduled_maintenance_reports": [ + "unscheduled_maintenances": [ { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "duration": 3600, + "summary": "working" }, { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "5678" - ], - "check": [ - "www2.example.com:PING" - ] - } + "duration": 3600, + "summary": "more work" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a time limited GET request for a outage report on a single check", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one scheduled maintenance period", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", "request": { - "method": "get", - "path": "/outage_report/checks/www.example.com:SSH", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" - }, - "response": { - "status": 200, + "method": "post", + "path": "/scheduled_maintenances/entities/1234,5678", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "outage_reports": [ + "scheduled_maintenances": [ { - "outages": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a time limited GET request for a scheduled_maintenance report on one entity", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one scheduled maintenance period", + "provider_state": "no entity exists", "request": { - "method": "get", - "path": "/scheduled_maintenance_report/entities/1234", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "method": "post", + "path": "/scheduled_maintenances/entities/1234", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "scheduled_maintenances": [ + { + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" + } + ] + } }, "response": { - "status": 200, + "status": 404, + "body": { + "errors": [ + "could not find entity '1234'" + ] + } + } + }, + { + "description": "a POST request with one scheduled maintenance period", + "provider_state": "an entity 'www.example.com' with id '1234' exists", + "request": { + "method": "post", + "path": "/scheduled_maintenances/entities/1234", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "scheduled_maintenance_reports": [ + "scheduled_maintenances": [ { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a downtime report on two checks", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a POST request with two scheduled maintenance periods", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", "request": { - "method": "get", - "path": "/downtime_report/checks/www.example.com:SSH,www2.example.com:PING" + "method": "post", + "path": "/scheduled_maintenances/entities/1234,5678", + "headers": { + "Content-Type": "application/vnd.api+json" + }, + "body": { + "scheduled_maintenances": [ + { + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" + }, + { + "start_time": "2015-10-30T17:13:12+10:30", + "duration": 3600, + "summary": "more work" + } + ] + } }, "response": { - "status": 200, + "status": 204, + "body": "" + } + }, + { + "description": "a POST request with two scheduled maintenance periods", + "provider_state": "an entity 'www.example.com' with id '1234' exists", + "request": { + "method": "post", + "path": "/scheduled_maintenances/entities/1234", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "downtime_reports": [ + "scheduled_maintenances": [ { + "start_time": "2015-10-30T15:13:12+10:30", + "duration": 3600, + "summary": "working" }, { + "start_time": "2015-10-30T17:13:12+10:30", + "duration": 3600, + "summary": "more work" } ] } + }, + "response": { + "status": 204, + "body": "" } }, { - "description": "a GET request for a outage report on a single check", + "description": "a PATCH request for an unscheduled maintenance period", + "provider_state": "an entity 'www.example.com' with id '1234' exists", + "request": { + "method": "patch", + "path": "/unscheduled_maintenances/entities/1234", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/unscheduled_maintenances/0/end_time", + "value": "2015-10-30T15:13:12+10:30" + } + ] + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a PATCH request for an unscheduled maintenance period", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", + "request": { + "method": "patch", + "path": "/unscheduled_maintenances/entities/1234,5678", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/unscheduled_maintenances/0/end_time", + "value": "2015-10-30T15:13:12+10:30" + } + ] + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a PATCH request for an unscheduled maintenance period", + "provider_state": "no entity exists", + "request": { + "method": "patch", + "path": "/unscheduled_maintenances/entities/1234", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/unscheduled_maintenances/0/end_time", + "value": "2015-10-30T15:13:12+10:30" + } + ] + }, + "response": { + "status": 404, + "body": { + "errors": [ + "could not find entity '1234'" + ] + } + } + }, + { + "description": "a DELETE request for a scheduled maintenance period", + "provider_state": "an entity 'www.example.com' with id '1234' exists", + "request": { + "method": "delete", + "path": "/scheduled_maintenances/entities/1234", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30" + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a DELETE request for a scheduled maintenance period", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", + "request": { + "method": "delete", + "path": "/scheduled_maintenances/entities/1234,5678", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30" + }, + "response": { + "status": 204, + "body": "" + } + }, + { + "description": "a DELETE request for a scheduled maintenance period", + "provider_state": "no entity exists", + "request": { + "method": "delete", + "path": "/scheduled_maintenances/entities/1234", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30" + }, + "response": { + "status": 404, + "body": { + "errors": [ + "could not find entity '1234'" + ] + } + } + }, + { + "description": "a time limited GET request for a scheduled_maintenance report on one entity", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/outage_report/checks/www.example.com:SSH" + "path": "/scheduled_maintenance_report/entities/1234", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30&end_time=2015-10-31T03%3A13%3A12%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "outage_reports": [ + "scheduled_maintenance_reports": [ { - "outages": [ + "scheduled_maintenances": [ ], "links": { "entity": [ "1234" @@ -1080,57 +1846,70 @@ ] } } }, { - "description": "a GET request for a unscheduled_maintenance report on all checks", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a time limited GET request for a outage report on two entities", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/unscheduled_maintenance_report/checks" + "path": "/outage_report/entities/1234,5678", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30&end_time=2015-10-31T03%3A13%3A12%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenance_reports": [ + "outage_reports": [ { - "unscheduled_maintenances": [ + "outages": [ ], "links": { "entity": [ "1234" ], "check": [ "www.example.com:SSH" ] } + }, + { + "outages": [ + + ], + "links": { + "entity": [ + "5678" + ], + "check": [ + "www2.example.com:PING" + ] + } } ] } } }, { - "description": "a time-limited GET request for a outage report on two checks", + "description": "a GET request for a unscheduled_maintenance report on two checks", "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/outage_report/checks/www.example.com:SSH,www2.example.com:PING", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "outage_reports": [ + "unscheduled_maintenance_reports": [ { - "outages": [ + "unscheduled_maintenances": [ ], "links": { "entity": [ "1234" @@ -1139,11 +1918,11 @@ "www.example.com:SSH" ] } }, { - "outages": [ + "unscheduled_maintenances": [ ], "links": { "entity": [ "5678" @@ -1156,25 +1935,26 @@ ] } } }, { - "description": "a GET request for a outage report on all checks", + "description": "a time limited GET request for a unscheduled_maintenance report on one entity", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/outage_report/checks" + "path": "/unscheduled_maintenance_report/entities/1234", + "query": "start_time=2015-10-30T15%3A13%3A12%2B10%3A30&end_time=2015-10-31T03%3A13%3A12%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "outage_reports": [ + "unscheduled_maintenance_reports": [ { - "outages": [ + "unscheduled_maintenances": [ ], "links": { "entity": [ "1234" @@ -1187,58 +1967,67 @@ ] } } }, { - "description": "a time limited GET request for a scheduled_maintenance report on a single check", + "description": "a GET request for a status report on all entities", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/scheduled_maintenance_report/checks/www.example.com:SSH", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "path": "/status_report/entities" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenance_reports": [ + "status_reports": [ { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } } ] } } }, { - "description": "a time limited GET request for a unscheduled_maintenance report on all checks", + "description": "a GET request for a status report on two entities", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "request": { + "method": "get", + "path": "/status_report/entities/1234,5678" + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, + "body": { + "status_reports": [ + { + }, + { + } + ] + } + } + }, + { + "description": "a GET request for a outage report on all checks", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/unscheduled_maintenance_report/checks", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "path": "/outage_report/checks" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenance_reports": [ + "outage_reports": [ { - "unscheduled_maintenances": [ + "outages": [ ], "links": { "entity": [ "1234" @@ -1251,67 +2040,69 @@ ] } } }, { - "description": "a time limited GET request for a downtime report on all checks", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a time-limited GET request for a downtime report on two checks", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/downtime_report/checks", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "path": "/downtime_report/checks/www.example.com:SSH,www2.example.com:PING", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { "downtime_reports": [ { + }, + { } ] } } }, { - "description": "a GET request for a downtime report on all checks", + "description": "a GET request for a status report on one entity", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/downtime_report/checks" + "path": "/status_report/entities/1234" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "downtime_reports": [ + "status_reports": [ { } ] } } }, { - "description": "a time limited GET request for a outage report on two entities", + "description": "a time-limited GET request for a unscheduled_maintenance report on two checks", "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/outage_report/entities/1234,5678", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "outage_reports": [ + "unscheduled_maintenance_reports": [ { - "outages": [ + "unscheduled_maintenances": [ ], "links": { "entity": [ "1234" @@ -1320,11 +2111,11 @@ "www.example.com:SSH" ] } }, { - "outages": [ + "unscheduled_maintenances": [ ], "links": { "entity": [ "5678" @@ -1337,90 +2128,79 @@ ] } } }, { - "description": "a time limited GET request for a scheduled_maintenance report on two entities", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a time limited GET request for a outage report on all checks", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/scheduled_maintenance_report/entities/1234,5678", - "query": "start_time=2014-12-02T10%3A31%3A28%2B10%3A30&end_time=2014-12-02T22%3A31%3A28%2B10%3A30" + "path": "/outage_report/checks", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenance_reports": [ + "outage_reports": [ { - "scheduled_maintenances": [ + "outages": [ ], "links": { "entity": [ "1234" ], "check": [ "www.example.com:SSH" ] } - }, - { - "scheduled_maintenances": [ - - ], - "links": { - "entity": [ - "5678" - ], - "check": [ - "www2.example.com:PING" - ] - } } ] } } }, { - "description": "a GET request for a status report on all checks", + "description": "a time limited GET request for a downtime report on one entity", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/status_report/checks" + "path": "/downtime_report/entities/1234", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "status_reports": [ + "downtime_reports": [ { } ] } } }, { - "description": "a GET request for a scheduled_maintenance report on one entity", + "description": "a time limited GET request for a outage report on all entities", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/scheduled_maintenance_report/entities/1234" + "path": "/outage_report/entities", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenance_reports": [ + "outage_reports": [ { - "scheduled_maintenances": [ + "outages": [ ], "links": { "entity": [ "1234" @@ -1433,15 +2213,16 @@ ] } } }, { - "description": "a GET request for a outage report on two entities", + "description": "a time-limited GET request for a outage report on two checks", "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/outage_report/entities/1234,5678" + "path": "/outage_report/checks/www.example.com:SSH,www2.example.com:PING", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" @@ -1477,156 +2258,123 @@ ] } } }, { - "description": "a GET request for a unscheduled_maintenance report on a single check", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a time limited GET request for a downtime report on two entities", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH" + "path": "/downtime_report/entities/1234,5678", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenance_reports": [ + "downtime_reports": [ { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + }, + { } ] } } }, { - "description": "a time limited GET request for a unscheduled_maintenance report on one entity", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for a downtime report on two entities", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/unscheduled_maintenance_report/entities/1234", - "query": "start_time=2014-12-02T10%3A31%3A29%2B10%3A30&end_time=2014-12-02T22%3A31%3A29%2B10%3A30" + "path": "/downtime_report/entities/1234,5678" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenance_reports": [ + "downtime_reports": [ { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "1234" - ], - "check": [ - "www.example.com:SSH" - ] - } + }, + { } ] } } }, { - "description": "a time limited GET request for a downtime report on two entities", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a GET request for a status report on a single check", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/downtime_report/entities/1234,5678", - "query": "start_time=2014-12-02T10%3A31%3A29%2B10%3A30&end_time=2014-12-02T22%3A31%3A29%2B10%3A30" + "path": "/status_report/checks/www.example.com:SSH" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "downtime_reports": [ + "status_reports": [ { - }, - { } ] } } }, { - "description": "a time-limited GET request for a unscheduled_maintenance report on two checks", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a time limited GET request for a outage report on one entity", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING", - "query": "start_time=2014-12-02T10%3A31%3A29%2B10%3A30&end_time=2014-12-02T22%3A31%3A29%2B10%3A30" + "path": "/outage_report/entities/1234", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenance_reports": [ + "outage_reports": [ { - "unscheduled_maintenances": [ + "outages": [ ], "links": { "entity": [ "1234" ], "check": [ "www.example.com:SSH" ] } - }, - { - "unscheduled_maintenances": [ - - ], - "links": { - "entity": [ - "5678" - ], - "check": [ - "www2.example.com:PING" - ] - } } ] } } }, { - "description": "a GET request for a unscheduled_maintenance report on two entities", + "description": "a time limited GET request for a scheduled_maintenance report on two entities", "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/unscheduled_maintenance_report/entities/1234,5678" + "path": "/scheduled_maintenance_report/entities/1234,5678", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenance_reports": [ + "scheduled_maintenance_reports": [ { - "unscheduled_maintenances": [ + "scheduled_maintenances": [ ], "links": { "entity": [ "1234" @@ -1635,11 +2383,11 @@ "www.example.com:SSH" ] } }, { - "unscheduled_maintenances": [ + "scheduled_maintenances": [ ], "links": { "entity": [ "5678" @@ -1652,16 +2400,16 @@ ] } } }, { - "description": "a time limited GET request for a downtime report on one entity", + "description": "a time limited GET request for a downtime report on a single check", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/downtime_report/entities/1234", - "query": "start_time=2014-12-02T10%3A31%3A29%2B10%3A30&end_time=2014-12-02T22%3A31%3A29%2B10%3A30" + "path": "/downtime_report/checks/www.example.com:SSH", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" @@ -1673,1627 +2421,1101 @@ ] } } }, { - "description": "a POST request with one medium", - "provider_state": "a contact with id 'abc' exists", + "description": "a GET request for a unscheduled_maintenance report on one entity", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "post", - "path": "/contacts/abc/media", + "method": "get", + "path": "/unscheduled_maintenance_report/entities/1234" + }, + "response": { + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "media": [ + "unscheduled_maintenance_reports": [ { - "type": "sms", - "address": "0123456789", - "interval": 300, - "rollup_threshold": 5 + "unscheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } } ] } - }, - "response": { - "status": 201, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": [ - "abc_sms" - ] } }, { - "description": "a POST request with two media", - "provider_state": "a contact with id 'abc' exists", + "description": "a GET request for a downtime report on two checks", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "post", - "path": "/contacts/abc/media", + "method": "get", + "path": "/downtime_report/checks/www.example.com:SSH,www2.example.com:PING" + }, + "response": { + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "media": [ + "downtime_reports": [ { - "type": "sms", - "address": "0123456789", - "interval": 300, - "rollup_threshold": 5 }, { - "type": "email", - "address": "ablated@example.org", - "interval": 180, - "rollup_threshold": 3 } ] } - }, - "response": { - "status": 201, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": [ - "abc_sms", - "abc_email" - ] } }, { - "description": "a POST request with one medium", - "provider_state": "no contact exists", + "description": "a GET request for a downtime report on all entities", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "post", - "path": "/contacts/abc/media", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "media": [ - { - "type": "sms", - "address": "0123456789", - "interval": 300, - "rollup_threshold": 5 - } - ] - } + "method": "get", + "path": "/downtime_report/entities" }, "response": { - "status": 422, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "Contact id: 'abc' could not be loaded" + "downtime_reports": [ + { + } ] } } }, { - "description": "a GET request for all media", - "provider_state": "a contact with id 'abc' has email and sms media", + "description": "a GET request for a unscheduled_maintenance report on all entities", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/media" + "path": "/unscheduled_maintenance_report/entities" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "media": [ + "unscheduled_maintenance_reports": [ { - "type": "email", - "address": "ablated@example.org", - "interval": 180, - "rollup_threshold": 3, + "unscheduled_maintenances": [ + + ], "links": { - "contacts": [ - "abc" + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" ] } - }, - { - "type": "sms", - "address": "0123456789", - "interval": 300, - "rollup_threshold": 5, - "links": { - "contacts": [ - "abc" - ] - } } ] } } }, { - "description": "a GET request for sms media", - "provider_state": "a contact with id 'abc' has email and sms media", + "description": "a GET request for a outage report on one entity", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/media/abc_sms" + "path": "/outage_report/entities/1234" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "media": [ + "outage_reports": [ { - "type": "sms", - "address": "0123456789", - "interval": 300, - "rollup_threshold": 5, + "outages": [ + + ], "links": { - "contacts": [ - "abc" + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" ] } } ] } } }, { - "description": "a GET request for email and sms media", - "provider_state": "a contact with id 'abc' has email and sms media", + "description": "a time limited GET request for a unscheduled_maintenance report on all entities", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/media/abc_email,abc_sms" + "path": "/unscheduled_maintenance_report/entities", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "media": [ + "unscheduled_maintenance_reports": [ { - "type": "email", - "address": "ablated@example.org", - "interval": 180, - "rollup_threshold": 3, + "unscheduled_maintenances": [ + + ], "links": { - "contacts": [ - "abc" + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" ] } - }, - { - "type": "sms", - "address": "0123456789", - "interval": 300, - "rollup_threshold": 5, - "links": { - "contacts": [ - "abc" - ] - } } ] } } }, { - "description": "a GET request for sms media", - "provider_state": "no contact exists", + "description": "a GET request for a unscheduled_maintenance report on a single check", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/media/abc_sms" + "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH" }, "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find contact 'abc'" + "unscheduled_maintenance_reports": [ + { + "unscheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + } ] } } }, { - "description": "a PATCH request for email media", - "provider_state": "a contact with id 'abc' has email and sms media", + "description": "a time limited GET request for a unscheduled_maintenance report on two entities", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "patch", - "path": "/media/abc_email", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/media/0/interval", - "value": 50 - }, - { - "op": "replace", - "path": "/media/0/rollup_threshold", - "value": 3 - } - ] + "method": "get", + "path": "/unscheduled_maintenance_report/entities/1234,5678", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH request for email and sms media", - "provider_state": "a contact with id 'abc' has email and sms media", - "request": { - "method": "patch", - "path": "/media/abc_email,abc_sms", + "status": 200, "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/media/0/interval", - "value": 50 - }, - { - "op": "replace", - "path": "/media/0/rollup_threshold", - "value": 3 - } - ] - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH request for email media", - "provider_state": "no contact exists", - "request": { - "method": "patch", - "path": "/media/abc_email", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/media/0/interval", - "value": 50 - } - ] - }, - "response": { - "status": 404, - "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find contact 'abc'" + "unscheduled_maintenance_reports": [ + { + "unscheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + }, + { + "unscheduled_maintenances": [ + + ], + "links": { + "entity": [ + "5678" + ], + "check": [ + "www2.example.com:PING" + ] + } + } ] } } }, { - "description": "a DELETE request for one medium", - "provider_state": "a contact with id 'abc' has email and sms media", + "description": "a time limited GET request for a unscheduled_maintenance report on all checks", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "delete", - "path": "/media/abc_email", - "body": null + "method": "get", + "path": "/unscheduled_maintenance_report/checks", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for two media", - "provider_state": "a contact with id 'abc' has email and sms media", - "request": { - "method": "delete", - "path": "/media/abc_email,abc_sms", - "body": null - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for one medium", - "provider_state": "no contact exists", - "request": { - "method": "delete", - "path": "/media/abc_email", - "body": null - }, - "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find contact 'abc'" + "unscheduled_maintenance_reports": [ + { + "unscheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + } ] } } }, { - "description": "a POST request with one notification rule", - "provider_state": "a contact with id 'abc' exists", + "description": "a GET request for a outage report on two checks", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "post", - "path": "/contacts/abc/notification_rules", + "method": "get", + "path": "/outage_report/checks/www.example.com:SSH,www2.example.com:PING" + }, + "response": { + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "notification_rules": [ + "outage_reports": [ { - "entity_tags": [ - "database", - "physical" + "outages": [ + ], - "entities": [ - "foo-app-01.example.com" + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + }, + { + "outages": [ + ], - "time_restrictions": null, - "warning_media": [ - "email" - ], - "critical_media": [ - "sms", - "email" - ], - "warning_blackhole": false, - "critical_blackhole": false + "links": { + "entity": [ + "5678" + ], + "check": [ + "www2.example.com:PING" + ] + } } ] } - }, - "response": { - "status": 201, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": [ - { - "json_class": "Pact::Term", - "data": { - "generate": "05983623-fcef-42da-af44-ed6990b500fa", - "matcher": {"json_class":"Regexp","o":0,"s":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"} - } - } - ] } }, { - "description": "a POST request with two notification rules", - "provider_state": "a contact with id 'abc' exists", + "description": "a GET request for a unscheduled_maintenance report on two entities", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "post", - "path": "/contacts/abc/notification_rules", + "method": "get", + "path": "/unscheduled_maintenance_report/entities/1234,5678" + }, + "response": { + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "notification_rules": [ + "unscheduled_maintenance_reports": [ { - "entity_tags": [ - "database", - "physical" + "unscheduled_maintenances": [ + ], - "entities": [ - "foo-app-01.example.com" - ], - "time_restrictions": null, - "warning_media": [ - "email" - ], - "critical_media": [ - "sms", - "email" - ], - "warning_blackhole": false, - "critical_blackhole": false + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } }, { - "entity_tags": null, - "entities": [ - "foo-app-02.example.com" + "unscheduled_maintenances": [ + ], - "time_restrictions": null, - "warning_media": [ - "email" - ], - "critical_media": [ - "sms", - "email" - ], - "warning_blackhole": true, - "critical_blackhole": false + "links": { + "entity": [ + "5678" + ], + "check": [ + "www2.example.com:PING" + ] + } } ] } - }, - "response": { - "status": 201, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": [ - { - "json_class": "Pact::Term", - "data": { - "generate": "05983623-fcef-42da-af44-ed6990b500fa", - "matcher": {"json_class":"Regexp","o":0,"s":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"} - } - }, - { - "json_class": "Pact::Term", - "data": { - "generate": "20f182fc-6e32-4794-9007-97366d162c51", - "matcher": {"json_class":"Regexp","o":0,"s":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"} - } - } - ] } }, { - "description": "a POST request with one notification rule", - "provider_state": "no contact exists", + "description": "a GET request for a status report on two checks", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "post", - "path": "/contacts/abc/notification_rules", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "notification_rules": [ - { - "entity_tags": [ - "database", - "physical" - ], - "entities": [ - "foo-app-01.example.com" - ], - "time_restrictions": null, - "warning_media": [ - "email" - ], - "critical_media": [ - "sms", - "email" - ], - "warning_blackhole": false, - "critical_blackhole": false - } - ] - } + "method": "get", + "path": "/status_report/checks/www.example.com:SSH,www2.example.com:PING" }, "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find contact 'abc'" + "status_reports": [ + { + }, + { + } ] } } }, { - "description": "a GET request for all notification rules", - "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists", + "description": "a GET request for a scheduled_maintenance report on all checks", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/notification_rules" + "path": "/scheduled_maintenance_report/checks" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "notification_rules": [ + "scheduled_maintenance_reports": [ { - "id": "05983623-fcef-42da-af44-ed6990b500fa", - "tags": [ + "scheduled_maintenances": [ ], - "regex_tags": [ - - ], - "entities": [ - - ], - "regex_entities": [ - - ], - "time_restrictions": [ - - ], - "warning_media": [ - "email" - ], - "critical_media": [ - "sms", - "email" - ], - "warning_blackhole": false, - "critical_blackhole": false + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } } ] } } }, { - "description": "a GET request for a single notification rule", - "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists", + "description": "a GET request for a scheduled_maintenance report on one entity", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa" + "path": "/scheduled_maintenance_report/entities/1234" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "notification_rules": [ + "scheduled_maintenance_reports": [ { - "id": "05983623-fcef-42da-af44-ed6990b500fa", - "tags": [ + "scheduled_maintenances": [ ], - "regex_tags": [ - - ], - "entities": [ - - ], - "regex_entities": [ - - ], - "time_restrictions": [ - - ], - "warning_media": [ - "email" - ], - "critical_media": [ - "sms", - "email" - ], - "warning_blackhole": false, - "critical_blackhole": false + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } } ] } } }, { - "description": "a GET request for two notification rules", - "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists", + "description": "a time-limited GET request for a scheduled_maintenance report on two checks", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51" + "path": "/scheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "notification_rules": [ + "scheduled_maintenance_reports": [ { - "id": "05983623-fcef-42da-af44-ed6990b500fa", - "tags": [ + "scheduled_maintenances": [ ], - "regex_tags": [ - - ], - "entities": [ - - ], - "regex_entities": [ - - ], - "time_restrictions": [ - - ], - "warning_media": [ - "email" - ], - "critical_media": [ - "sms", - "email" - ], - "warning_blackhole": false, - "critical_blackhole": false + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } }, { - "id": "20f182fc-6e32-4794-9007-97366d162c51", - "tags": [ - "physical" - ], - "regex_tags": [ + "scheduled_maintenances": [ ], - "entities": [ - "example.com" - ], - "regex_entities": [ - - ], - "time_restrictions": [ - - ], - "warning_media": [ - "email" - ], - "critical_media": [ - "sms", - "email" - ], - "warning_blackhole": true, - "critical_blackhole": true + "links": { + "entity": [ + "5678" + ], + "check": [ + "www2.example.com:PING" + ] + } } ] } } }, { - "description": "a GET request for a single notification rule", - "provider_state": "no notification rule exists", + "description": "a GET request for a downtime report on a single check", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa" + "path": "/downtime_report/checks/www.example.com:SSH" }, "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find notification rules '05983623-fcef-42da-af44-ed6990b500fa'" + "downtime_reports": [ + { + } ] } } }, { - "description": "a PATCH request to change properties for a single notification rule", - "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists", + "description": "a GET request for a scheduled_maintenance report on all entities", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "patch", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/notification_rules/0/warning_blackhole", - "value": false - } - ] + "method": "get", + "path": "/scheduled_maintenance_report/entities" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH request to change properties for two notification rules", - "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists", - "request": { - "method": "patch", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51", + "status": 200, "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/notification_rules/0/warning_blackhole", - "value": false - } - ] - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH request to change properties for a single notification rule", - "provider_state": "no notification rule exists", - "request": { - "method": "patch", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/notification_rules/0/warning_blackhole", - "value": false - } - ] - }, - "response": { - "status": 404, - "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find notification rule '05983623-fcef-42da-af44-ed6990b500fa'" + "scheduled_maintenance_reports": [ + { + "scheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + } ] } } }, { - "description": "a DELETE request for a single notification rule", - "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists", + "description": "a GET request for a downtime report on all checks", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "delete", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa", - "body": null + "method": "get", + "path": "/downtime_report/checks" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for two notification rules", - "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists", - "request": { - "method": "delete", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51", - "body": null - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for a single notification rule", - "provider_state": "no notification rule exists", - "request": { - "method": "delete", - "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa", - "body": null - }, - "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find notification rule '05983623-fcef-42da-af44-ed6990b500fa'" - ] - } - } - }, - { - "description": "a POST request with one test notification", - "provider_state": "no entity exists", - "request": { - "method": "post", - "path": "/test_notifications/entities/1234", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "test_notifications": [ + "downtime_reports": [ { - "summary": "testing" } ] } - }, - "response": { - "status": 404, - "body": { - "errors": [ - "could not find entity '1234'" - ] - } } }, { - "description": "a POST request with one test notification", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a time limited GET request for a downtime report on all checks", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "post", - "path": "/test_notifications/entities/1234", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "test_notifications": [ - { - } - ] - } + "method": "get", + "path": "/downtime_report/checks", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a POST request with one test notification", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", - "request": { - "method": "post", - "path": "/test_notifications/entities/1234,5678", + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "test_notifications": [ + "downtime_reports": [ { - "summary": "testing" } ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a POST request with two test notifications", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a GET request for a outage report on two entities", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "post", - "path": "/test_notifications/entities/1234", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "test_notifications": [ - { - "summary": "testing" - }, - { - "summary": "more tests" - } - ] - } + "method": "get", + "path": "/outage_report/entities/1234,5678" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a POST request with two test notifications", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", - "request": { - "method": "post", - "path": "/test_notifications/entities/1234,5678", + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "test_notifications": [ + "outage_reports": [ { - "summary": "testing" + "outages": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } }, { - "summary": "more tests" + "outages": [ + + ], + "links": { + "entity": [ + "5678" + ], + "check": [ + "www2.example.com:PING" + ] + } } ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a POST request with one test notification", - "provider_state": "no check exists", - "request": { - "method": "post", - "path": "/test_notifications/checks/www.example.com:SSH", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "test_notifications": [ - { - "summary": "testing" - } - ] - } - }, - "response": { - "status": 404, - "body": { - "errors": [ - "could not find entity 'www.example.com'" - ] - } - } - }, - { - "description": "a POST request with one test notification", + "description": "a time limited GET request for a scheduled_maintenance report on all checks", "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "post", - "path": "/test_notifications/checks/www.example.com:SSH", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "test_notifications": [ - { - "summary": "testing" - } - ] - } + "method": "get", + "path": "/scheduled_maintenance_report/checks", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a POST request with one test notification", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", - "request": { - "method": "post", - "path": "/test_notifications/checks/www.example.com:SSH,www2.example.com:PING", + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "test_notifications": [ + "scheduled_maintenance_reports": [ { - "summary": "testing" + "scheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } } ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a POST request with two test notifications", + "description": "a time limited GET request for a unscheduled_maintenance report on a single check", "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "post", - "path": "/test_notifications/checks/www.example.com:SSH", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "test_notifications": [ - { - "summary": "testing" - }, - { - "summary": "more tests" - } - ] - } + "method": "get", + "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a POST request with two test notifications", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", - "request": { - "method": "post", - "path": "/test_notifications/checks/www.example.com:SSH,www2.example.com:PING", + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "test_notifications": [ + "unscheduled_maintenance_reports": [ { - "summary": "testing" - }, - { - "summary": "more tests" + "unscheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } } ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a POST request with one contact", - "provider_state": "no contact exists", + "description": "a GET request for a outage report on all entities", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "post", - "path": "/contacts", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "contacts": [ - { - "id": "abc", - "first_name": "Jim", - "last_name": "Smith", - "email": "jims@example.com", - "timezone": "UTC" - } - ] - } + "method": "get", + "path": "/outage_report/entities" }, "response": { - "status": 201, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, - "body": [ - "abc" - ] - } - }, - { - "description": "a POST request with two contacts", - "provider_state": "no contact exists", - "request": { - "method": "post", - "path": "/contacts", - "headers": { - "Content-Type": "application/vnd.api+json" - }, "body": { - "contacts": [ + "outage_reports": [ { - "id": "abc", - "first_name": "Jim", - "last_name": "Smith", - "email": "jims@example.com", - "timezone": "UTC" - }, - { - "id": "def", - "first_name": "Joan", - "last_name": "Smith", - "email": "joans@example.com" + "outages": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } } ] } - }, - "response": { - "status": 201, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": [ - "abc", - "def" - ] } }, { - "description": "a POST request with one contact", - "provider_state": "a contact with id 'abc' exists", + "description": "a time limited GET request for a downtime report on all entities", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "post", - "path": "/contacts", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "contacts": [ - { - "id": "abc", - "first_name": "Jim", - "last_name": "Smith", - "email": "jims@example.com", - "timezone": "UTC" - } - ] - } + "method": "get", + "path": "/downtime_report/entities", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { - "status": 409, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "Contacts already exist with the following IDs: abc" + "downtime_reports": [ + { + } ] } } }, { - "description": "a GET request for all contacts", - "provider_state": "a contact with id 'abc' exists", + "description": "a time limited GET request for a outage report on a single check", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/contacts" + "path": "/outage_report/checks/www.example.com:SSH", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "contacts": [ + "outage_reports": [ { - "id": "abc", - "first_name": "Jim", - "last_name": "Smith", - "email": "jims@example.com", - "timezone": "UTC" + "outages": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } } ] } } }, { - "description": "a GET request for all contacts", - "provider_state": "no contact exists", + "description": "a time limited GET request for a scheduled_maintenance report on all entities", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/contacts" + "path": "/scheduled_maintenance_report/entities", + "query": "start_time=2015-10-30T15%3A13%3A13%2B10%3A30&end_time=2015-10-31T03%3A13%3A13%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "contacts": [ + "scheduled_maintenance_reports": [ + { + "scheduled_maintenances": [ + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + } ] } } }, { - "description": "a GET request for a single contact", - "provider_state": "a contact with id 'abc' exists", + "description": "a GET request for a scheduled_maintenance report on a single check", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/contacts/abc" + "path": "/scheduled_maintenance_report/checks/www.example.com:SSH" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "contacts": [ + "scheduled_maintenance_reports": [ { - "id": "abc", - "first_name": "Jim", - "last_name": "Smith", - "email": "jims@example.com", - "timezone": "UTC" + "scheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } } ] } } }, { - "description": "a GET request for a single contact", - "provider_state": "no contact exists", + "description": "a GET request for a unscheduled_maintenance report on all checks", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/contacts/abc" + "path": "/unscheduled_maintenance_report/checks" }, "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find contacts 'abc'" + "unscheduled_maintenance_reports": [ + { + "unscheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + } ] } } }, { - "description": "a PATCH request to change properties for a single contact", - "provider_state": "no contact exists", + "description": "a GET request for a outage report on a single check", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "patch", - "path": "/contacts/323", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/contacts/0/timezone", - "value": "UTC" - } - ] + "method": "get", + "path": "/outage_report/checks/www.example.com:SSH" }, "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find contacts '323'" + "outage_reports": [ + { + "outages": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + } ] } } }, { - "description": "a PATCH request to change properties for a single contact", - "provider_state": "a contact with id 'abc' exists", + "description": "a GET request for a scheduled_maintenance report on two entities", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { - "method": "patch", - "path": "/contacts/abc", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/contacts/0/timezone", - "value": "UTC" - } - ] + "method": "get", + "path": "/scheduled_maintenance_report/entities/1234,5678" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH request to change properties for two contacts", - "provider_state": "contacts with ids 'abc' and '872' exist", - "request": { - "method": "patch", - "path": "/contacts/abc,872", + "status": 200, "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/contacts/0/timezone", - "value": "UTC" - } - ] - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH requestto change a link for a single contact", - "provider_state": "a contact with id '872' exists", - "request": { - "method": "patch", - "path": "/contacts/872", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "add", - "path": "/contacts/0/links/entities/-", - "value": "1234" - } - ] - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH request to change links for two contacts", - "provider_state": "contacts with ids 'abc' and '872' exist", - "request": { - "method": "patch", - "path": "/contacts/abc,872", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "add", - "path": "/contacts/0/links/entities/-", - "value": "1234" - } - ] - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for a single contact", - "provider_state": "a contact with id 'abc' exists", - "request": { - "method": "delete", - "path": "/contacts/abc", - "body": null - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for two contacts", - "provider_state": "contacts with ids 'abc' and '872' exist", - "request": { - "method": "delete", - "path": "/contacts/abc,872", - "body": null - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for a single contact", - "provider_state": "no contact exists", - "request": { - "method": "delete", - "path": "/contacts/abc", - "body": null - }, - "response": { - "status": 404, - "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find contacts 'abc'" + "scheduled_maintenance_reports": [ + { + "scheduled_maintenances": [ + + ], + "links": { + "entity": [ + "1234" + ], + "check": [ + "www.example.com:SSH" + ] + } + }, + { + "scheduled_maintenances": [ + + ], + "links": { + "entity": [ + "5678" + ], + "check": [ + "www2.example.com:PING" + ] + } + } ] } } }, { - "description": "a POST request with one check", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a GET request for a downtime report on one entity", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { - "method": "post", - "path": "/checks", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "checks": [ - { - "name": "SSH", - "entity_id": "1234" - } - ] - } + "method": "get", + "path": "/downtime_report/entities/1234" }, "response": { - "status": 201, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, - "body": [ - "www.example.com:SSH" - ] - } - }, - { - "description": "a POST request with two checks", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", - "request": { - "method": "post", - "path": "/checks", - "headers": { - "Content-Type": "application/vnd.api+json" - }, "body": { - "checks": [ + "downtime_reports": [ { - "name": "SSH", - "entity_id": "1234" - }, - { - "name": "PING", - "entity_id": "5678" } ] } - }, - "response": { - "status": 201, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": [ - "www.example.com:SSH", - "www2.example.com:PING" - ] } }, { - "description": "a GET request for all checks", - "provider_state": "no entity exists", + "description": "a GET request for a status report on all checks", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/checks" + "path": "/status_report/checks" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "checks": [ - + "status_reports": [ + { + } ] } } }, { - "description": "a GET request for all checks", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for a scheduled_maintenance report on two checks", + "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", "request": { "method": "get", - "path": "/checks" + "path": "/scheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "checks": [ + "scheduled_maintenance_reports": [ { - "id": "www.example.com:SSH", - "name": "SSH", - "entity_name": "www.example.com", + "scheduled_maintenances": [ + + ], "links": { - "entities": [ + "entity": [ "1234" + ], + "check": [ + "www.example.com:SSH" ] } + }, + { + "scheduled_maintenances": [ + + ], + "links": { + "entity": [ + "5678" + ], + "check": [ + "www2.example.com:PING" + ] + } } ] } } }, { - "description": "a GET request for check 'www.example.com:SSH'", + "description": "a time limited GET request for a scheduled_maintenance report on a single check", "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/checks/www.example.com:SSH" + "path": "/scheduled_maintenance_report/checks/www.example.com:SSH", + "query": "start_time=2015-10-30T15%3A13%3A14%2B10%3A30&end_time=2015-10-31T03%3A13%3A14%2B10%3A30" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "checks": [ + "scheduled_maintenance_reports": [ { - "id": "www.example.com:SSH", - "name": "SSH", - "entity_name": "www.example.com", + "scheduled_maintenances": [ + + ], "links": { - "entities": [ + "entity": [ "1234" + ], + "check": [ + "www.example.com:SSH" ] } } ] } } }, { - "description": "a GET request for check 'www.example.com:SSH'", + "description": "a POST request with two entities", "provider_state": "no entity exists", "request": { - "method": "get", - "path": "/checks/www.example.com:SSH" - }, - "response": { - "status": 404, + "method": "post", + "path": "/entities", "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" + "Content-Type": "application/vnd.api+json" }, "body": { - "errors": [ - "could not find entity checks: 'www.example.com:SSH'" + "entities": [ + { + "name": "example.org", + "id": "57_example" + }, + { + "name": "example2.org", + "id": "58" + } ] } - } - }, - { - "description": "a PATCH request for a single check", - "provider_state": "a check 'www.example.com:SSH' exists", - "request": { - "method": "patch", - "path": "/checks/www.example.com:SSH", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/checks/0/enabled", - "value": false - } - ] }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH request for a single check", - "provider_state": "no entity exists", - "request": { - "method": "patch", - "path": "/checks/www.example.com:SSH", + "status": 201, "headers": { - "Content-Type": "application/json-patch+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": [ - { - "op": "replace", - "path": "/checks/0/enabled", - "value": false - } + "57_example", + "58" ] - }, - "response": { - "status": 404, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": { - "errors": [ - "could not find entity 'www.example.com'" - ] - } } }, { "description": "a POST request with one entity", "provider_state": "no entity exists", @@ -3321,48 +3543,34 @@ "57_example" ] } }, { - "description": "a POST request with two entities", + "description": "a GET request for a single entity", "provider_state": "no entity exists", "request": { - "method": "post", - "path": "/entities", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "entities": [ - { - "name": "example.org", - "id": "57_example" - }, - { - "name": "example2.org", - "id": "58" - } - ] - } + "method": "get", + "path": "/entities/1234" }, "response": { - "status": 201, + "status": 404, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, - "body": [ - "57_example", - "58" - ] + "body": { + "errors": [ + "could not find entities: '1234'" + ] + } } }, { - "description": "a GET request for all entities", + "description": "a GET request for a single entity", "provider_state": "an entity 'www.example.com' with id '1234' exists", "request": { "method": "get", - "path": "/entities" + "path": "/entities/1234" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" @@ -3395,15 +3603,15 @@ ] } } }, { - "description": "a GET request for a single entity", + "description": "a GET request for all entities", "provider_state": "an entity 'www.example.com' with id '1234' exists", "request": { "method": "get", - "path": "/entities/1234" + "path": "/entities" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" @@ -3417,24 +3625,34 @@ ] } } }, { - "description": "a GET request for a single entity", + "description": "a PATCH request for a single entity", "provider_state": "no entity exists", "request": { - "method": "get", - "path": "/entities/1234" + "method": "patch", + "path": "/entities/1234", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "replace", + "path": "/entities/0/name", + "value": "example3.com" + } + ] }, "response": { "status": 404, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { "errors": [ - "could not find entities: '1234'" + "could not find entity '1234'" ] } } }, { @@ -3458,1061 +3676,837 @@ "status": 204, "body": "" } }, { - "description": "a PATCH request for a single entity", - "provider_state": "no entity exists", + "description": "a GET request for one set of pagerduty credentials", + "provider_state": "a contact with id 'abc' has pagerduty credentials", "request": { - "method": "patch", - "path": "/entities/1234", - "headers": { - "Content-Type": "application/json-patch+json" - }, - "body": [ - { - "op": "replace", - "path": "/entities/0/name", - "value": "example3.com" - } - ] + "method": "get", + "path": "/pagerduty_credentials/abc" }, "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find entity '1234'" + "pagerduty_credentials": [ + { + "service_key": "abc", + "subdomain": "def", + "token": "ghi" + } ] } } }, { - "description": "a POST request with one scheduled maintenance period", - "provider_state": "no entity exists", + "description": "a GET request for one set of pagerduty credentials", + "provider_state": "no contact exists", "request": { - "method": "post", - "path": "/scheduled_maintenances/entities/1234", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "scheduled_maintenances": [ - { - "start_time": "2014-12-02T10:31:31+10:30", - "duration": 3600, - "summary": "working" - } - ] - } + "method": "get", + "path": "/pagerduty_credentials/abc" }, "response": { "status": 404, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, "body": { "errors": [ - "could not find entity '1234'" + "could not find contact 'abc'" ] } } }, { - "description": "a POST request with one scheduled maintenance period", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a GET request for all pagerduty credentials", + "provider_state": "a contact with id 'abc' has pagerduty credentials", "request": { - "method": "post", - "path": "/scheduled_maintenances/entities/1234", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "scheduled_maintenances": [ - { - "start_time": "2014-12-02T10:31:31+10:30", - "duration": 3600, - "summary": "working" - } - ] - } + "method": "get", + "path": "/pagerduty_credentials" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a POST request with one scheduled maintenance period", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", - "request": { - "method": "post", - "path": "/scheduled_maintenances/entities/1234,5678", + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenances": [ + "pagerduty_credentials": [ { - "start_time": "2014-12-02T10:31:31+10:30", - "duration": 3600, - "summary": "working" + "service_key": "abc", + "subdomain": "def", + "token": "ghi" } ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a POST request with two scheduled maintenance periods", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a GET request for two sets of pagerduty credentials", + "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials", "request": { - "method": "post", - "path": "/scheduled_maintenances/entities/1234", + "method": "get", + "path": "/pagerduty_credentials/abc,872" + }, + "response": { + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenances": [ + "pagerduty_credentials": [ { - "start_time": "2014-12-02T10:31:31+10:30", - "duration": 3600, - "summary": "working" + "service_key": "abc", + "subdomain": "def", + "token": "ghi" }, { - "start_time": "2014-12-02T12:31:31+10:30", - "duration": 3600, - "summary": "more work" + "service_key": "mno", + "subdomain": "pqr", + "token": "stu" } ] } + } + }, + { + "description": "a DELETE request for one set of pagerduty credentials", + "provider_state": "a contact with id 'abc' has pagerduty credentials", + "request": { + "method": "delete", + "path": "/pagerduty_credentials/abc", + "body": null }, "response": { "status": 204, "body": "" } }, { - "description": "a POST request with two scheduled maintenance periods", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", + "description": "a DELETE request for two sets of pagerduty credentials", + "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials", "request": { - "method": "post", - "path": "/scheduled_maintenances/entities/1234,5678", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "scheduled_maintenances": [ - { - "start_time": "2014-12-02T10:31:31+10:30", - "duration": 3600, - "summary": "working" - }, - { - "start_time": "2014-12-02T12:31:31+10:30", - "duration": 3600, - "summary": "more work" - } - ] - } + "method": "delete", + "path": "/pagerduty_credentials/abc,872", + "body": null }, "response": { "status": 204, "body": "" } }, { - "description": "a POST request with one unscheduled maintenance period", - "provider_state": "no entity exists", + "description": "a DELETE request for one set of pagerduty credentials", + "provider_state": "no contact exists", "request": { - "method": "post", - "path": "/unscheduled_maintenances/entities/1234", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "unscheduled_maintenances": [ - { - "duration": 3600, - "summary": "working" - } - ] - } + "method": "delete", + "path": "/pagerduty_credentials/abc", + "body": null }, "response": { "status": 404, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, "body": { "errors": [ - "could not find entity '1234'" + "could not find contact 'abc'" ] } } }, { - "description": "a POST request with one unscheduled maintenance period", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a POST request with one set of pagerduty credentials", + "provider_state": "no contact exists", "request": { "method": "post", - "path": "/unscheduled_maintenances/entities/1234", + "path": "/contacts/abc/pagerduty_credentials", "headers": { "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenances": [ + "pagerduty_credentials": [ { - "duration": 3600, - "summary": "working" + "service_key": "abc", + "subdomain": "def", + "token": "ghi" } ] } }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a POST request with one unscheduled maintenance period", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", - "request": { - "method": "post", - "path": "/unscheduled_maintenances/entities/1234,5678", + "status": 422, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenances": [ - { - "duration": 3600, - "summary": "working" - } + "errors": [ + "Contact id: 'abc' could not be loaded" ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a POST request with two unscheduled maintenance periods", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a POST request with one set of pagerduty credentials", + "provider_state": "a contact with id 'abc' exists", "request": { "method": "post", - "path": "/unscheduled_maintenances/entities/1234", + "path": "/contacts/abc/pagerduty_credentials", "headers": { "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenances": [ + "pagerduty_credentials": [ { - "duration": 3600, - "summary": "working" - }, - { - "duration": 3600, - "summary": "more work" + "service_key": "abc", + "subdomain": "def", + "token": "ghi" } ] } }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a POST request with two unscheduled maintenance periods", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", - "request": { - "method": "post", - "path": "/unscheduled_maintenances/entities/1234,5678", + "status": 201, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, - "body": { - "unscheduled_maintenances": [ - { - "duration": 3600, - "summary": "working" - }, - { - "duration": 3600, - "summary": "more work" - } - ] - } - }, - "response": { - "status": 204, - "body": "" + "body": [ + "abc" + ] } }, { - "description": "a PATCH request for an unscheduled maintenance period", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a PATCH request for pagerduty credentials", + "provider_state": "a contact with id 'abc' has pagerduty credentials", "request": { "method": "patch", - "path": "/unscheduled_maintenances/entities/1234", + "path": "/pagerduty_credentials/abc", "headers": { "Content-Type": "application/json-patch+json" }, "body": [ { "op": "replace", - "path": "/unscheduled_maintenances/0/end_time", - "value": "2014-12-02T10:31:31+10:30" + "path": "/pagerduty_credentials/0/token", + "value": "token123" } ] }, "response": { "status": 204, "body": "" } }, { - "description": "a PATCH request for an unscheduled maintenance period", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", + "description": "a PATCH request for pagerduty credentials", + "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials", "request": { "method": "patch", - "path": "/unscheduled_maintenances/entities/1234,5678", + "path": "/pagerduty_credentials/abc,872", "headers": { "Content-Type": "application/json-patch+json" }, "body": [ { "op": "replace", - "path": "/unscheduled_maintenances/0/end_time", - "value": "2014-12-02T10:31:31+10:30" + "path": "/pagerduty_credentials/0/token", + "value": "token123" } ] }, "response": { "status": 204, "body": "" } }, { - "description": "a PATCH request for an unscheduled maintenance period", - "provider_state": "no entity exists", + "description": "a PATCH request for pagerduty credentials", + "provider_state": "no contact exists", "request": { "method": "patch", - "path": "/unscheduled_maintenances/entities/1234", + "path": "/pagerduty_credentials/abc", "headers": { "Content-Type": "application/json-patch+json" }, "body": [ { "op": "replace", - "path": "/unscheduled_maintenances/0/end_time", - "value": "2014-12-02T10:31:32+10:30" + "path": "/pagerduty_credentials/0/token", + "value": "token123" } ] }, "response": { "status": 404, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, "body": { "errors": [ - "could not find entity '1234'" + "could not find contact 'abc'" ] } } }, { - "description": "a DELETE request for a scheduled maintenance period", - "provider_state": "an entity 'www.example.com' with id '1234' exists", + "description": "a GET request for a single contact", + "provider_state": "no contact exists", "request": { - "method": "delete", - "path": "/scheduled_maintenances/entities/1234", - "query": "start_time=2014-12-02T10%3A31%3A32%2B10%3A30" + "method": "get", + "path": "/contacts/abc" }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for a scheduled maintenance period", - "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", - "request": { - "method": "delete", - "path": "/scheduled_maintenances/entities/1234,5678", - "query": "start_time=2014-12-02T10%3A31%3A32%2B10%3A30" - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for a scheduled maintenance period", - "provider_state": "no entity exists", - "request": { - "method": "delete", - "path": "/scheduled_maintenances/entities/1234", - "query": "start_time=2014-12-02T10%3A31%3A32%2B10%3A30" - }, - "response": { "status": 404, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, "body": { "errors": [ - "could not find entity '1234'" + "could not find contacts 'abc'" ] } } }, { - "description": "a POST request with one scheduled maintenance period", - "provider_state": "no check exists", + "description": "a GET request for a single contact", + "provider_state": "a contact with id 'abc' exists", "request": { - "method": "post", - "path": "/scheduled_maintenances/checks/www.example.com:SSH", + "method": "get", + "path": "/contacts/abc" + }, + "response": { + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenances": [ + "contacts": [ { - "start_time": "2014-12-02T10:31:32+10:30", - "duration": 3600, - "summary": "working" + "id": "abc", + "first_name": "Jim", + "last_name": "Smith", + "email": "jims@example.com", + "timezone": "UTC" } ] } - }, - "response": { - "status": 404, - "body": { - "errors": [ - "could not find entity 'www.example.com'" - ] - } } }, { - "description": "a POST request with one scheduled maintenance period", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a GET request for all contacts", + "provider_state": "no contact exists", "request": { - "method": "post", - "path": "/scheduled_maintenances/checks/www.example.com:SSH", + "method": "get", + "path": "/contacts" + }, + "response": { + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenances": [ - { - "start_time": "2014-12-02T10:31:32+10:30", - "duration": 3600, - "summary": "working" - } + "contacts": [ + ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a POST request with one scheduled maintenance period", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a GET request for all contacts", + "provider_state": "a contact with id 'abc' exists", "request": { - "method": "post", - "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", + "method": "get", + "path": "/contacts" + }, + "response": { + "status": 200, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "scheduled_maintenances": [ + "contacts": [ { - "start_time": "2014-12-02T10:31:32+10:30", - "duration": 3600, - "summary": "working" + "id": "abc", + "first_name": "Jim", + "last_name": "Smith", + "email": "jims@example.com", + "timezone": "UTC" } ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a POST request with two scheduled maintenance periods", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a DELETE request for a single contact", + "provider_state": "a contact with id 'abc' exists", "request": { - "method": "post", - "path": "/scheduled_maintenances/checks/www.example.com:SSH", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "scheduled_maintenances": [ - { - "start_time": "2014-12-02T10:31:32+10:30", - "duration": 3600, - "summary": "working" - }, - { - "start_time": "2014-12-02T12:31:32+10:30", - "duration": 3600, - "summary": "more work" - } - ] - } + "method": "delete", + "path": "/contacts/abc", + "body": null }, "response": { "status": 204, "body": "" } }, { - "description": "a POST request with two scheduled maintenance periods", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a DELETE request for two contacts", + "provider_state": "contacts with ids 'abc' and '872' exist", "request": { - "method": "post", - "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "scheduled_maintenances": [ - { - "start_time": "2014-12-02T10:31:32+10:30", - "duration": 3600, - "summary": "working" - }, - { - "start_time": "2014-12-02T12:31:32+10:30", - "duration": 3600, - "summary": "more work" - } - ] - } + "method": "delete", + "path": "/contacts/abc,872", + "body": null }, "response": { "status": 204, "body": "" } }, { - "description": "a POST request with one unscheduled maintenance period", - "provider_state": "no check exists", + "description": "a DELETE request for a single contact", + "provider_state": "no contact exists", "request": { - "method": "post", - "path": "/unscheduled_maintenances/checks/www.example.com:SSH", - "headers": { - "Content-Type": "application/vnd.api+json" - }, - "body": { - "unscheduled_maintenances": [ - { - "duration": 3600, - "summary": "working" - } - ] - } + "method": "delete", + "path": "/contacts/abc", + "body": null }, "response": { "status": 404, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, "body": { "errors": [ - "could not find entity 'www.example.com'" + "could not find contacts 'abc'" ] } } }, { - "description": "a POST request with one unscheduled maintenance period", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one contact", + "provider_state": "no contact exists", "request": { "method": "post", - "path": "/unscheduled_maintenances/checks/www.example.com:SSH", + "path": "/contacts", "headers": { "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenances": [ + "contacts": [ { - "duration": 3600, - "summary": "working" + "id": "abc", + "first_name": "Jim", + "last_name": "Smith", + "email": "jims@example.com", + "timezone": "UTC" } ] } }, "response": { - "status": 204, - "body": "" + "status": 201, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, + "body": [ + "abc" + ] } }, { - "description": "a POST request with one unscheduled maintenance period", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a POST request with two contacts", + "provider_state": "no contact exists", "request": { "method": "post", - "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", + "path": "/contacts", "headers": { "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenances": [ + "contacts": [ { - "duration": 3600, - "summary": "working" + "id": "abc", + "first_name": "Jim", + "last_name": "Smith", + "email": "jims@example.com", + "timezone": "UTC" + }, + { + "id": "def", + "first_name": "Joan", + "last_name": "Smith", + "email": "joans@example.com" } ] } }, "response": { - "status": 204, - "body": "" + "status": 201, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, + "body": [ + "abc", + "def" + ] } }, { - "description": "a POST request with two unscheduled maintenance periods", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a POST request with one contact", + "provider_state": "a contact with id 'abc' exists", "request": { "method": "post", - "path": "/unscheduled_maintenances/checks/www.example.com:SSH", + "path": "/contacts", "headers": { "Content-Type": "application/vnd.api+json" }, "body": { - "unscheduled_maintenances": [ + "contacts": [ { - "duration": 3600, - "summary": "working" - }, - { - "duration": 3600, - "summary": "more work" + "id": "abc", + "first_name": "Jim", + "last_name": "Smith", + "email": "jims@example.com", + "timezone": "UTC" } ] } }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a POST request with two unscheduled maintenance periods", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", - "request": { - "method": "post", - "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", + "status": 409, "headers": { - "Content-Type": "application/vnd.api+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "unscheduled_maintenances": [ - { - "duration": 3600, - "summary": "working" - }, - { - "duration": 3600, - "summary": "more work" - } + "errors": [ + "Contacts already exist with the following IDs: abc" ] } - }, - "response": { - "status": 204, - "body": "" } }, { - "description": "a PATCH request for an unscheduled maintenance period", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a PATCH request to change properties for two contacts", + "provider_state": "contacts with ids 'abc' and '872' exist", "request": { "method": "patch", - "path": "/unscheduled_maintenances/checks/www.example.com:SSH", + "path": "/contacts/abc,872", "headers": { "Content-Type": "application/json-patch+json" }, "body": [ { "op": "replace", - "path": "/unscheduled_maintenances/0/end_time", - "value": "2014-12-02T10:31:32+10:30" + "path": "/contacts/0/timezone", + "value": "UTC" } ] }, "response": { "status": 204, "body": "" } }, { - "description": "a PATCH request for an unscheduled maintenance period", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a PATCH request to change properties for a single contact", + "provider_state": "no contact exists", "request": { "method": "patch", - "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", + "path": "/contacts/323", "headers": { "Content-Type": "application/json-patch+json" }, "body": [ { "op": "replace", - "path": "/unscheduled_maintenances/0/end_time", - "value": "2014-12-02T10:31:32+10:30" + "path": "/contacts/0/timezone", + "value": "UTC" } ] }, "response": { - "status": 204, - "body": "" + "status": 404, + "headers": { + "Content-Type": "application/vnd.api+json; charset=utf-8" + }, + "body": { + "errors": [ + "could not find contacts '323'" + ] + } } }, { - "description": "a PATCH request for an unscheduled maintenance period", - "provider_state": "no check exists", + "description": "a PATCH request to change properties for a single contact", + "provider_state": "a contact with id 'abc' exists", "request": { "method": "patch", - "path": "/unscheduled_maintenances/checks/www.example.com:SSH", + "path": "/contacts/abc", "headers": { "Content-Type": "application/json-patch+json" }, "body": [ { "op": "replace", - "path": "/unscheduled_maintenances/0/end_time", - "value": "2014-12-02T10:31:32+10:30" + "path": "/contacts/0/timezone", + "value": "UTC" } ] }, "response": { - "status": 404, - "body": { - "errors": [ - "could not find entity 'www.example.com'" - ] - } + "status": 204, + "body": "" } }, { - "description": "a DELETE request for a scheduled maintenance period", - "provider_state": "a check 'www.example.com:SSH' exists", + "description": "a PATCH request to change links for two contacts", + "provider_state": "contacts with ids 'abc' and '872' exist", "request": { - "method": "delete", - "path": "/scheduled_maintenances/checks/www.example.com:SSH", - "query": "start_time=2014-12-02T10%3A31%3A32%2B10%3A30" + "method": "patch", + "path": "/contacts/abc,872", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "add", + "path": "/contacts/0/links/entities/-", + "value": "1234" + } + ] }, "response": { "status": 204, "body": "" } }, { - "description": "a DELETE request for a scheduled maintenance period", - "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist", + "description": "a PATCH requestto change a link for a single contact", + "provider_state": "a contact with id '872' exists", "request": { - "method": "delete", - "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING", - "query": "start_time=2014-12-02T10%3A31%3A32%2B10%3A30" + "method": "patch", + "path": "/contacts/872", + "headers": { + "Content-Type": "application/json-patch+json" + }, + "body": [ + { + "op": "add", + "path": "/contacts/0/links/entities/-", + "value": "1234" + } + ] }, "response": { "status": 204, "body": "" } }, { - "description": "a DELETE request for a scheduled maintenance period", - "provider_state": "no check exists", + "description": "a POST request with two checks", + "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist", "request": { - "method": "delete", - "path": "/scheduled_maintenances/checks/www.example.com:SSH", - "query": "start_time=2014-12-02T10%3A31%3A32%2B10%3A30" - }, - "response": { - "status": 404, - "body": { - "errors": [ - "could not find entity 'www.example.com'" - ] - } - } - }, - { - "description": "a POST request with one set of pagerduty credentials", - "provider_state": "a contact with id 'abc' exists", - "request": { "method": "post", - "path": "/contacts/abc/pagerduty_credentials", + "path": "/checks", "headers": { "Content-Type": "application/vnd.api+json" }, "body": { - "pagerduty_credentials": [ + "checks": [ { - "service_key": "abc", - "subdomain": "def", - "username": "ghi", - "password": "jkl" + "name": "SSH", + "entity_id": "1234" + }, + { + "name": "PING", + "entity_id": "5678" } ] } }, "response": { "status": 201, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": [ - "abc" + "www.example.com:SSH", + "www2.example.com:PING" ] } }, { - "description": "a POST request with one set of pagerduty credentials", - "provider_state": "no contact exists", + "description": "a POST request with one check", + "provider_state": "an entity 'www.example.com' with id '1234' exists", "request": { "method": "post", - "path": "/contacts/abc/pagerduty_credentials", + "path": "/checks", "headers": { "Content-Type": "application/vnd.api+json" }, "body": { - "pagerduty_credentials": [ + "checks": [ { - "service_key": "abc", - "subdomain": "def", - "username": "ghi", - "password": "jkl" + "name": "SSH", + "entity_id": "1234" } ] } }, "response": { - "status": 422, + "status": 201, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, - "body": { - "errors": [ - "Contact id: 'abc' could not be loaded" - ] - } + "body": [ + "www.example.com:SSH" + ] } }, { - "description": "a GET request for all pagerduty credentials", - "provider_state": "a contact with id 'abc' has pagerduty credentials", + "description": "a GET request for check 'www.example.com:SSH'", + "provider_state": "no entity exists", "request": { "method": "get", - "path": "/pagerduty_credentials" + "path": "/checks/www.example.com:SSH" }, "response": { - "status": 200, + "status": 404, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "pagerduty_credentials": [ - { - "service_key": "abc", - "subdomain": "def", - "username": "ghi", - "password": "jkl" - } + "errors": [ + "could not find entity checks: 'www.example.com:SSH'" ] } } }, { - "description": "a GET request for one set of pagerduty credentials", - "provider_state": "a contact with id 'abc' has pagerduty credentials", + "description": "a GET request for check 'www.example.com:SSH'", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/pagerduty_credentials/abc" + "path": "/checks/www.example.com:SSH" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "pagerduty_credentials": [ + "checks": [ { - "service_key": "abc", - "subdomain": "def", - "username": "ghi", - "password": "jkl" + "id": "www.example.com:SSH", + "name": "SSH", + "entity_name": "www.example.com", + "links": { + "entities": [ + "1234" + ] + } } ] } } }, { - "description": "a GET request for two sets of pagerduty credentials", - "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials", + "description": "a GET request for all checks", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "get", - "path": "/pagerduty_credentials/abc,872" + "path": "/checks" }, "response": { "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "pagerduty_credentials": [ + "checks": [ { - "service_key": "abc", - "subdomain": "def", - "username": "ghi", - "password": "jkl" - }, - { - "service_key": "mno", - "subdomain": "pqr", - "username": "stu", - "password": "vwx" + "id": "www.example.com:SSH", + "name": "SSH", + "entity_name": "www.example.com", + "links": { + "entities": [ + "1234" + ] + } } ] } } }, { - "description": "a GET request for one set of pagerduty credentials", - "provider_state": "no contact exists", + "description": "a GET request for all checks", + "provider_state": "no entity exists", "request": { "method": "get", - "path": "/pagerduty_credentials/abc" + "path": "/checks" }, "response": { - "status": 404, + "status": 200, "headers": { "Content-Type": "application/vnd.api+json; charset=utf-8" }, "body": { - "errors": [ - "could not find contact 'abc'" + "checks": [ + ] } } }, { - "description": "a PATCH request for pagerduty credentials", - "provider_state": "a contact with id 'abc' has pagerduty credentials", + "description": "a PATCH request for a single check", + "provider_state": "no entity exists", "request": { "method": "patch", - "path": "/pagerduty_credentials/abc", + "path": "/checks/www.example.com:SSH", "headers": { "Content-Type": "application/json-patch+json" }, "body": [ { "op": "replace", - "path": "/pagerduty_credentials/0/password", - "value": "pswrd" + "path": "/checks/0/enabled", + "value": false } ] }, "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a PATCH request for pagerduty credentials", - "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials", - "request": { - "method": "patch", - "path": "/pagerduty_credentials/abc,872", + "status": 404, "headers": { - "Content-Type": "application/json-patch+json" + "Content-Type": "application/vnd.api+json; charset=utf-8" }, - "body": [ - { - "op": "replace", - "path": "/pagerduty_credentials/0/password", - "value": "pswrd" - } - ] - }, - "response": { - "status": 204, - "body": "" + "body": { + "errors": [ + "could not find entity 'www.example.com'" + ] + } } }, { - "description": "a PATCH request for pagerduty credentials", - "provider_state": "no contact exists", + "description": "a PATCH request for a single check", + "provider_state": "a check 'www.example.com:SSH' exists", "request": { "method": "patch", - "path": "/pagerduty_credentials/abc", + "path": "/checks/www.example.com:SSH", "headers": { "Content-Type": "application/json-patch+json" }, "body": [ { "op": "replace", - "path": "/pagerduty_credentials/0/password", - "value": "pswrd" + "path": "/checks/0/enabled", + "value": false } ] }, "response": { - "status": 404, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": { - "errors": [ - "could not find contact 'abc'" - ] - } - } - }, - { - "description": "a DELETE request for one set of pagerduty credentials", - "provider_state": "a contact with id 'abc' has pagerduty credentials", - "request": { - "method": "delete", - "path": "/pagerduty_credentials/abc", - "body": null - }, - "response": { "status": 204, "body": "" - } - }, - { - "description": "a DELETE request for two sets of pagerduty credentials", - "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials", - "request": { - "method": "delete", - "path": "/pagerduty_credentials/abc,872", - "body": null - }, - "response": { - "status": 204, - "body": "" - } - }, - { - "description": "a DELETE request for one set of pagerduty credentials", - "provider_state": "no contact exists", - "request": { - "method": "delete", - "path": "/pagerduty_credentials/abc", - "body": null - }, - "response": { - "status": 404, - "headers": { - "Content-Type": "application/vnd.api+json; charset=utf-8" - }, - "body": { - "errors": [ - "could not find contact 'abc'" - ] - } } } ], "metadata": { "pactSpecificationVersion": "1.0.0" \ No newline at end of file