flapjack-diner 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +21 -0
  4. data/.rubocop_todo.yml +135 -0
  5. data/Gemfile +7 -0
  6. data/README.md +86 -20
  7. data/flapjack-diner.gemspec +11 -15
  8. data/lib/flapjack-diner.rb +23 -548
  9. data/lib/flapjack-diner/argument_validator.rb +31 -22
  10. data/lib/flapjack-diner/resources/checks.rb +58 -0
  11. data/lib/flapjack-diner/resources/contacts.rb +70 -0
  12. data/lib/flapjack-diner/resources/entities.rb +68 -0
  13. data/lib/flapjack-diner/resources/maintenance_periods.rb +82 -0
  14. data/lib/flapjack-diner/resources/media.rb +61 -0
  15. data/lib/flapjack-diner/resources/notification_rules.rb +66 -0
  16. data/lib/flapjack-diner/resources/notifications.rb +27 -0
  17. data/lib/flapjack-diner/resources/pagerduty_credentials.rb +60 -0
  18. data/lib/flapjack-diner/resources/reports.rb +33 -0
  19. data/lib/flapjack-diner/tools.rb +277 -0
  20. data/lib/flapjack-diner/version.rb +1 -1
  21. data/spec/argument_validator_spec.rb +15 -15
  22. data/spec/flapjack-diner_spec.rb +58 -1275
  23. data/spec/pacts/flapjack-diner-flapjack.json +4522 -0
  24. data/spec/resources/checks_spec.rb +171 -0
  25. data/spec/resources/contacts_spec.rb +297 -0
  26. data/spec/resources/entities_spec.rb +181 -0
  27. data/spec/resources/maintenance_periods_spec.rb +603 -0
  28. data/spec/resources/media_spec.rb +277 -0
  29. data/spec/resources/notification_rules_spec.rb +341 -0
  30. data/spec/resources/notifications_spec.rb +210 -0
  31. data/spec/resources/pagerduty_credentials_spec.rb +243 -0
  32. data/spec/resources/reports_spec.rb +255 -0
  33. data/spec/spec_helper.rb +14 -2
  34. metadata +35 -72
@@ -0,0 +1,4522 @@
1
+ {
2
+ "provider": {
3
+ "name": "flapjack"
4
+ },
5
+ "consumer": {
6
+ "name": "flapjack-diner"
7
+ },
8
+ "interactions": [
9
+ {
10
+ "description": "a time limited GET request for a scheduled_maintenance report on one entity",
11
+ "provider_state": "a check 'www.example.com:SSH' exists",
12
+ "request": {
13
+ "method": "get",
14
+ "path": "/scheduled_maintenance_report/entities/1234",
15
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
16
+ },
17
+ "response": {
18
+ "status": 200,
19
+ "headers": {
20
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
21
+ },
22
+ "body": {
23
+ "scheduled_maintenance_reports": [
24
+ {
25
+ "scheduled_maintenances": [
26
+
27
+ ],
28
+ "links": {
29
+ "entity": [
30
+ "1234"
31
+ ],
32
+ "check": [
33
+ "www.example.com:SSH"
34
+ ]
35
+ }
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ },
41
+ {
42
+ "description": "a time limited GET request for a unscheduled_maintenance report on one entity",
43
+ "provider_state": "a check 'www.example.com:SSH' exists",
44
+ "request": {
45
+ "method": "get",
46
+ "path": "/unscheduled_maintenance_report/entities/1234",
47
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
48
+ },
49
+ "response": {
50
+ "status": 200,
51
+ "headers": {
52
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
53
+ },
54
+ "body": {
55
+ "unscheduled_maintenance_reports": [
56
+ {
57
+ "unscheduled_maintenances": [
58
+
59
+ ],
60
+ "links": {
61
+ "entity": [
62
+ "1234"
63
+ ],
64
+ "check": [
65
+ "www.example.com:SSH"
66
+ ]
67
+ }
68
+ }
69
+ ]
70
+ }
71
+ }
72
+ },
73
+ {
74
+ "description": "a time limited GET request for a unscheduled_maintenance report on two entities",
75
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
76
+ "request": {
77
+ "method": "get",
78
+ "path": "/unscheduled_maintenance_report/entities/1234,5678",
79
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
80
+ },
81
+ "response": {
82
+ "status": 200,
83
+ "headers": {
84
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
85
+ },
86
+ "body": {
87
+ "unscheduled_maintenance_reports": [
88
+ {
89
+ "unscheduled_maintenances": [
90
+
91
+ ],
92
+ "links": {
93
+ "entity": [
94
+ "1234"
95
+ ],
96
+ "check": [
97
+ "www.example.com:SSH"
98
+ ]
99
+ }
100
+ },
101
+ {
102
+ "unscheduled_maintenances": [
103
+
104
+ ],
105
+ "links": {
106
+ "entity": [
107
+ "5678"
108
+ ],
109
+ "check": [
110
+ "www2.example.com:PING"
111
+ ]
112
+ }
113
+ }
114
+ ]
115
+ }
116
+ }
117
+ },
118
+ {
119
+ "description": "a time limited GET request for a outage report on one entity",
120
+ "provider_state": "a check 'www.example.com:SSH' exists",
121
+ "request": {
122
+ "method": "get",
123
+ "path": "/outage_report/entities/1234",
124
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
125
+ },
126
+ "response": {
127
+ "status": 200,
128
+ "headers": {
129
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
130
+ },
131
+ "body": {
132
+ "outage_reports": [
133
+ {
134
+ "outages": [
135
+
136
+ ],
137
+ "links": {
138
+ "entity": [
139
+ "1234"
140
+ ],
141
+ "check": [
142
+ "www.example.com:SSH"
143
+ ]
144
+ }
145
+ }
146
+ ]
147
+ }
148
+ }
149
+ },
150
+ {
151
+ "description": "a time limited GET request for a outage report on two entities",
152
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
153
+ "request": {
154
+ "method": "get",
155
+ "path": "/outage_report/entities/1234,5678",
156
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
157
+ },
158
+ "response": {
159
+ "status": 200,
160
+ "headers": {
161
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
162
+ },
163
+ "body": {
164
+ "outage_reports": [
165
+ {
166
+ "outages": [
167
+
168
+ ],
169
+ "links": {
170
+ "entity": [
171
+ "1234"
172
+ ],
173
+ "check": [
174
+ "www.example.com:SSH"
175
+ ]
176
+ }
177
+ },
178
+ {
179
+ "outages": [
180
+
181
+ ],
182
+ "links": {
183
+ "entity": [
184
+ "5678"
185
+ ],
186
+ "check": [
187
+ "www2.example.com:PING"
188
+ ]
189
+ }
190
+ }
191
+ ]
192
+ }
193
+ }
194
+ },
195
+ {
196
+ "description": "a GET request for a status report on a single check",
197
+ "provider_state": "a check 'www.example.com:SSH' exists",
198
+ "request": {
199
+ "method": "get",
200
+ "path": "/status_report/checks/www.example.com:SSH"
201
+ },
202
+ "response": {
203
+ "status": 200,
204
+ "headers": {
205
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
206
+ },
207
+ "body": {
208
+ "status_reports": [
209
+ {
210
+ }
211
+ ]
212
+ }
213
+ }
214
+ },
215
+ {
216
+ "description": "a GET request for a downtime report on two checks",
217
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
218
+ "request": {
219
+ "method": "get",
220
+ "path": "/downtime_report/checks/www.example.com:SSH,www2.example.com:PING"
221
+ },
222
+ "response": {
223
+ "status": 200,
224
+ "headers": {
225
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
226
+ },
227
+ "body": {
228
+ "downtime_reports": [
229
+ {
230
+ },
231
+ {
232
+ }
233
+ ]
234
+ }
235
+ }
236
+ },
237
+ {
238
+ "description": "a GET request for a scheduled_maintenance report on a single check",
239
+ "provider_state": "a check 'www.example.com:SSH' exists",
240
+ "request": {
241
+ "method": "get",
242
+ "path": "/scheduled_maintenance_report/checks/www.example.com:SSH"
243
+ },
244
+ "response": {
245
+ "status": 200,
246
+ "headers": {
247
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
248
+ },
249
+ "body": {
250
+ "scheduled_maintenance_reports": [
251
+ {
252
+ "scheduled_maintenances": [
253
+
254
+ ],
255
+ "links": {
256
+ "entity": [
257
+ "1234"
258
+ ],
259
+ "check": [
260
+ "www.example.com:SSH"
261
+ ]
262
+ }
263
+ }
264
+ ]
265
+ }
266
+ }
267
+ },
268
+ {
269
+ "description": "a GET request for a unscheduled_maintenance report on a single check",
270
+ "provider_state": "a check 'www.example.com:SSH' exists",
271
+ "request": {
272
+ "method": "get",
273
+ "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH"
274
+ },
275
+ "response": {
276
+ "status": 200,
277
+ "headers": {
278
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
279
+ },
280
+ "body": {
281
+ "unscheduled_maintenance_reports": [
282
+ {
283
+ "unscheduled_maintenances": [
284
+
285
+ ],
286
+ "links": {
287
+ "entity": [
288
+ "1234"
289
+ ],
290
+ "check": [
291
+ "www.example.com:SSH"
292
+ ]
293
+ }
294
+ }
295
+ ]
296
+ }
297
+ }
298
+ },
299
+ {
300
+ "description": "a time limited GET request for a unscheduled_maintenance report on all checks",
301
+ "provider_state": "a check 'www.example.com:SSH' exists",
302
+ "request": {
303
+ "method": "get",
304
+ "path": "/unscheduled_maintenance_report/checks",
305
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
306
+ },
307
+ "response": {
308
+ "status": 200,
309
+ "headers": {
310
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
311
+ },
312
+ "body": {
313
+ "unscheduled_maintenance_reports": [
314
+ {
315
+ "unscheduled_maintenances": [
316
+
317
+ ],
318
+ "links": {
319
+ "entity": [
320
+ "1234"
321
+ ],
322
+ "check": [
323
+ "www.example.com:SSH"
324
+ ]
325
+ }
326
+ }
327
+ ]
328
+ }
329
+ }
330
+ },
331
+ {
332
+ "description": "a time limited GET request for a unscheduled_maintenance report on a single check",
333
+ "provider_state": "a check 'www.example.com:SSH' exists",
334
+ "request": {
335
+ "method": "get",
336
+ "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH",
337
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
338
+ },
339
+ "response": {
340
+ "status": 200,
341
+ "headers": {
342
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
343
+ },
344
+ "body": {
345
+ "unscheduled_maintenance_reports": [
346
+ {
347
+ "unscheduled_maintenances": [
348
+
349
+ ],
350
+ "links": {
351
+ "entity": [
352
+ "1234"
353
+ ],
354
+ "check": [
355
+ "www.example.com:SSH"
356
+ ]
357
+ }
358
+ }
359
+ ]
360
+ }
361
+ }
362
+ },
363
+ {
364
+ "description": "a GET request for a downtime report on all entities",
365
+ "provider_state": "a check 'www.example.com:SSH' exists",
366
+ "request": {
367
+ "method": "get",
368
+ "path": "/downtime_report/entities"
369
+ },
370
+ "response": {
371
+ "status": 200,
372
+ "headers": {
373
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
374
+ },
375
+ "body": {
376
+ "downtime_reports": [
377
+ {
378
+ }
379
+ ]
380
+ }
381
+ }
382
+ },
383
+ {
384
+ "description": "a GET request for a unscheduled_maintenance report on two entities",
385
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
386
+ "request": {
387
+ "method": "get",
388
+ "path": "/unscheduled_maintenance_report/entities/1234,5678"
389
+ },
390
+ "response": {
391
+ "status": 200,
392
+ "headers": {
393
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
394
+ },
395
+ "body": {
396
+ "unscheduled_maintenance_reports": [
397
+ {
398
+ "unscheduled_maintenances": [
399
+
400
+ ],
401
+ "links": {
402
+ "entity": [
403
+ "1234"
404
+ ],
405
+ "check": [
406
+ "www.example.com:SSH"
407
+ ]
408
+ }
409
+ },
410
+ {
411
+ "unscheduled_maintenances": [
412
+
413
+ ],
414
+ "links": {
415
+ "entity": [
416
+ "5678"
417
+ ],
418
+ "check": [
419
+ "www2.example.com:PING"
420
+ ]
421
+ }
422
+ }
423
+ ]
424
+ }
425
+ }
426
+ },
427
+ {
428
+ "description": "a time limited GET request for a downtime report on a single check",
429
+ "provider_state": "a check 'www.example.com:SSH' exists",
430
+ "request": {
431
+ "method": "get",
432
+ "path": "/downtime_report/checks/www.example.com:SSH",
433
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
434
+ },
435
+ "response": {
436
+ "status": 200,
437
+ "headers": {
438
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
439
+ },
440
+ "body": {
441
+ "downtime_reports": [
442
+ {
443
+ }
444
+ ]
445
+ }
446
+ }
447
+ },
448
+ {
449
+ "description": "a GET request for a scheduled_maintenance report on one entity",
450
+ "provider_state": "a check 'www.example.com:SSH' exists",
451
+ "request": {
452
+ "method": "get",
453
+ "path": "/scheduled_maintenance_report/entities/1234"
454
+ },
455
+ "response": {
456
+ "status": 200,
457
+ "headers": {
458
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
459
+ },
460
+ "body": {
461
+ "scheduled_maintenance_reports": [
462
+ {
463
+ "scheduled_maintenances": [
464
+
465
+ ],
466
+ "links": {
467
+ "entity": [
468
+ "1234"
469
+ ],
470
+ "check": [
471
+ "www.example.com:SSH"
472
+ ]
473
+ }
474
+ }
475
+ ]
476
+ }
477
+ }
478
+ },
479
+ {
480
+ "description": "a time limited GET request for a scheduled_maintenance report on a single check",
481
+ "provider_state": "a check 'www.example.com:SSH' exists",
482
+ "request": {
483
+ "method": "get",
484
+ "path": "/scheduled_maintenance_report/checks/www.example.com:SSH",
485
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
486
+ },
487
+ "response": {
488
+ "status": 200,
489
+ "headers": {
490
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
491
+ },
492
+ "body": {
493
+ "scheduled_maintenance_reports": [
494
+ {
495
+ "scheduled_maintenances": [
496
+
497
+ ],
498
+ "links": {
499
+ "entity": [
500
+ "1234"
501
+ ],
502
+ "check": [
503
+ "www.example.com:SSH"
504
+ ]
505
+ }
506
+ }
507
+ ]
508
+ }
509
+ }
510
+ },
511
+ {
512
+ "description": "a time limited GET request for a scheduled_maintenance report on two entities",
513
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
514
+ "request": {
515
+ "method": "get",
516
+ "path": "/scheduled_maintenance_report/entities/1234,5678",
517
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
518
+ },
519
+ "response": {
520
+ "status": 200,
521
+ "headers": {
522
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
523
+ },
524
+ "body": {
525
+ "scheduled_maintenance_reports": [
526
+ {
527
+ "scheduled_maintenances": [
528
+
529
+ ],
530
+ "links": {
531
+ "entity": [
532
+ "1234"
533
+ ],
534
+ "check": [
535
+ "www.example.com:SSH"
536
+ ]
537
+ }
538
+ },
539
+ {
540
+ "scheduled_maintenances": [
541
+
542
+ ],
543
+ "links": {
544
+ "entity": [
545
+ "5678"
546
+ ],
547
+ "check": [
548
+ "www2.example.com:PING"
549
+ ]
550
+ }
551
+ }
552
+ ]
553
+ }
554
+ }
555
+ },
556
+ {
557
+ "description": "a GET request for a downtime report on two entities",
558
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
559
+ "request": {
560
+ "method": "get",
561
+ "path": "/downtime_report/entities/1234,5678"
562
+ },
563
+ "response": {
564
+ "status": 200,
565
+ "headers": {
566
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
567
+ },
568
+ "body": {
569
+ "downtime_reports": [
570
+ {
571
+ },
572
+ {
573
+ }
574
+ ]
575
+ }
576
+ }
577
+ },
578
+ {
579
+ "description": "a GET request for a scheduled_maintenance report on all checks",
580
+ "provider_state": "a check 'www.example.com:SSH' exists",
581
+ "request": {
582
+ "method": "get",
583
+ "path": "/scheduled_maintenance_report/checks"
584
+ },
585
+ "response": {
586
+ "status": 200,
587
+ "headers": {
588
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
589
+ },
590
+ "body": {
591
+ "scheduled_maintenance_reports": [
592
+ {
593
+ "scheduled_maintenances": [
594
+
595
+ ],
596
+ "links": {
597
+ "entity": [
598
+ "1234"
599
+ ],
600
+ "check": [
601
+ "www.example.com:SSH"
602
+ ]
603
+ }
604
+ }
605
+ ]
606
+ }
607
+ }
608
+ },
609
+ {
610
+ "description": "a time limited GET request for a scheduled_maintenance report on all checks",
611
+ "provider_state": "a check 'www.example.com:SSH' exists",
612
+ "request": {
613
+ "method": "get",
614
+ "path": "/scheduled_maintenance_report/checks",
615
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
616
+ },
617
+ "response": {
618
+ "status": 200,
619
+ "headers": {
620
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
621
+ },
622
+ "body": {
623
+ "scheduled_maintenance_reports": [
624
+ {
625
+ "scheduled_maintenances": [
626
+
627
+ ],
628
+ "links": {
629
+ "entity": [
630
+ "1234"
631
+ ],
632
+ "check": [
633
+ "www.example.com:SSH"
634
+ ]
635
+ }
636
+ }
637
+ ]
638
+ }
639
+ }
640
+ },
641
+ {
642
+ "description": "a time-limited GET request for a outage report on two checks",
643
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
644
+ "request": {
645
+ "method": "get",
646
+ "path": "/outage_report/checks/www.example.com:SSH,www2.example.com:PING",
647
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
648
+ },
649
+ "response": {
650
+ "status": 200,
651
+ "headers": {
652
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
653
+ },
654
+ "body": {
655
+ "outage_reports": [
656
+ {
657
+ "outages": [
658
+
659
+ ],
660
+ "links": {
661
+ "entity": [
662
+ "1234"
663
+ ],
664
+ "check": [
665
+ "www.example.com:SSH"
666
+ ]
667
+ }
668
+ },
669
+ {
670
+ "outages": [
671
+
672
+ ],
673
+ "links": {
674
+ "entity": [
675
+ "5678"
676
+ ],
677
+ "check": [
678
+ "www2.example.com:PING"
679
+ ]
680
+ }
681
+ }
682
+ ]
683
+ }
684
+ }
685
+ },
686
+ {
687
+ "description": "a GET request for a scheduled_maintenance report on two checks",
688
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
689
+ "request": {
690
+ "method": "get",
691
+ "path": "/scheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING"
692
+ },
693
+ "response": {
694
+ "status": 200,
695
+ "headers": {
696
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
697
+ },
698
+ "body": {
699
+ "scheduled_maintenance_reports": [
700
+ {
701
+ "scheduled_maintenances": [
702
+
703
+ ],
704
+ "links": {
705
+ "entity": [
706
+ "1234"
707
+ ],
708
+ "check": [
709
+ "www.example.com:SSH"
710
+ ]
711
+ }
712
+ },
713
+ {
714
+ "scheduled_maintenances": [
715
+
716
+ ],
717
+ "links": {
718
+ "entity": [
719
+ "5678"
720
+ ],
721
+ "check": [
722
+ "www2.example.com:PING"
723
+ ]
724
+ }
725
+ }
726
+ ]
727
+ }
728
+ }
729
+ },
730
+ {
731
+ "description": "a time limited GET request for a downtime report on all checks",
732
+ "provider_state": "a check 'www.example.com:SSH' exists",
733
+ "request": {
734
+ "method": "get",
735
+ "path": "/downtime_report/checks",
736
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
737
+ },
738
+ "response": {
739
+ "status": 200,
740
+ "headers": {
741
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
742
+ },
743
+ "body": {
744
+ "downtime_reports": [
745
+ {
746
+ }
747
+ ]
748
+ }
749
+ }
750
+ },
751
+ {
752
+ "description": "a GET request for a scheduled_maintenance report on two entities",
753
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
754
+ "request": {
755
+ "method": "get",
756
+ "path": "/scheduled_maintenance_report/entities/1234,5678"
757
+ },
758
+ "response": {
759
+ "status": 200,
760
+ "headers": {
761
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
762
+ },
763
+ "body": {
764
+ "scheduled_maintenance_reports": [
765
+ {
766
+ "scheduled_maintenances": [
767
+
768
+ ],
769
+ "links": {
770
+ "entity": [
771
+ "1234"
772
+ ],
773
+ "check": [
774
+ "www.example.com:SSH"
775
+ ]
776
+ }
777
+ },
778
+ {
779
+ "scheduled_maintenances": [
780
+
781
+ ],
782
+ "links": {
783
+ "entity": [
784
+ "5678"
785
+ ],
786
+ "check": [
787
+ "www2.example.com:PING"
788
+ ]
789
+ }
790
+ }
791
+ ]
792
+ }
793
+ }
794
+ },
795
+ {
796
+ "description": "a GET request for a status report on two checks",
797
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
798
+ "request": {
799
+ "method": "get",
800
+ "path": "/status_report/checks/www.example.com:SSH,www2.example.com:PING"
801
+ },
802
+ "response": {
803
+ "status": 200,
804
+ "headers": {
805
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
806
+ },
807
+ "body": {
808
+ "status_reports": [
809
+ {
810
+ },
811
+ {
812
+ }
813
+ ]
814
+ }
815
+ }
816
+ },
817
+ {
818
+ "description": "a GET request for a status report on one entity",
819
+ "provider_state": "a check 'www.example.com:SSH' exists",
820
+ "request": {
821
+ "method": "get",
822
+ "path": "/status_report/entities/1234"
823
+ },
824
+ "response": {
825
+ "status": 200,
826
+ "headers": {
827
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
828
+ },
829
+ "body": {
830
+ "status_reports": [
831
+ {
832
+ }
833
+ ]
834
+ }
835
+ }
836
+ },
837
+ {
838
+ "description": "a GET request for a unscheduled_maintenance report on one entity",
839
+ "provider_state": "a check 'www.example.com:SSH' exists",
840
+ "request": {
841
+ "method": "get",
842
+ "path": "/unscheduled_maintenance_report/entities/1234"
843
+ },
844
+ "response": {
845
+ "status": 200,
846
+ "headers": {
847
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
848
+ },
849
+ "body": {
850
+ "unscheduled_maintenance_reports": [
851
+ {
852
+ "unscheduled_maintenances": [
853
+
854
+ ],
855
+ "links": {
856
+ "entity": [
857
+ "1234"
858
+ ],
859
+ "check": [
860
+ "www.example.com:SSH"
861
+ ]
862
+ }
863
+ }
864
+ ]
865
+ }
866
+ }
867
+ },
868
+ {
869
+ "description": "a time limited GET request for a downtime report on two entities",
870
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
871
+ "request": {
872
+ "method": "get",
873
+ "path": "/downtime_report/entities/1234,5678",
874
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
875
+ },
876
+ "response": {
877
+ "status": 200,
878
+ "headers": {
879
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
880
+ },
881
+ "body": {
882
+ "downtime_reports": [
883
+ {
884
+ },
885
+ {
886
+ }
887
+ ]
888
+ }
889
+ }
890
+ },
891
+ {
892
+ "description": "a time limited GET request for a unscheduled_maintenance report on all entities",
893
+ "provider_state": "a check 'www.example.com:SSH' exists",
894
+ "request": {
895
+ "method": "get",
896
+ "path": "/unscheduled_maintenance_report/entities",
897
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
898
+ },
899
+ "response": {
900
+ "status": 200,
901
+ "headers": {
902
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
903
+ },
904
+ "body": {
905
+ "unscheduled_maintenance_reports": [
906
+ {
907
+ "unscheduled_maintenances": [
908
+
909
+ ],
910
+ "links": {
911
+ "entity": [
912
+ "1234"
913
+ ],
914
+ "check": [
915
+ "www.example.com:SSH"
916
+ ]
917
+ }
918
+ }
919
+ ]
920
+ }
921
+ }
922
+ },
923
+ {
924
+ "description": "a time limited GET request for a outage report on a single check",
925
+ "provider_state": "a check 'www.example.com:SSH' exists",
926
+ "request": {
927
+ "method": "get",
928
+ "path": "/outage_report/checks/www.example.com:SSH",
929
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
930
+ },
931
+ "response": {
932
+ "status": 200,
933
+ "headers": {
934
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
935
+ },
936
+ "body": {
937
+ "outage_reports": [
938
+ {
939
+ "outages": [
940
+
941
+ ],
942
+ "links": {
943
+ "entity": [
944
+ "1234"
945
+ ],
946
+ "check": [
947
+ "www.example.com:SSH"
948
+ ]
949
+ }
950
+ }
951
+ ]
952
+ }
953
+ }
954
+ },
955
+ {
956
+ "description": "a GET request for a outage report on a single check",
957
+ "provider_state": "a check 'www.example.com:SSH' exists",
958
+ "request": {
959
+ "method": "get",
960
+ "path": "/outage_report/checks/www.example.com:SSH"
961
+ },
962
+ "response": {
963
+ "status": 200,
964
+ "headers": {
965
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
966
+ },
967
+ "body": {
968
+ "outage_reports": [
969
+ {
970
+ "outages": [
971
+
972
+ ],
973
+ "links": {
974
+ "entity": [
975
+ "1234"
976
+ ],
977
+ "check": [
978
+ "www.example.com:SSH"
979
+ ]
980
+ }
981
+ }
982
+ ]
983
+ }
984
+ }
985
+ },
986
+ {
987
+ "description": "a GET request for a outage report on one entity",
988
+ "provider_state": "a check 'www.example.com:SSH' exists",
989
+ "request": {
990
+ "method": "get",
991
+ "path": "/outage_report/entities/1234"
992
+ },
993
+ "response": {
994
+ "status": 200,
995
+ "headers": {
996
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
997
+ },
998
+ "body": {
999
+ "outage_reports": [
1000
+ {
1001
+ "outages": [
1002
+
1003
+ ],
1004
+ "links": {
1005
+ "entity": [
1006
+ "1234"
1007
+ ],
1008
+ "check": [
1009
+ "www.example.com:SSH"
1010
+ ]
1011
+ }
1012
+ }
1013
+ ]
1014
+ }
1015
+ }
1016
+ },
1017
+ {
1018
+ "description": "a time limited GET request for a scheduled_maintenance report on all entities",
1019
+ "provider_state": "a check 'www.example.com:SSH' exists",
1020
+ "request": {
1021
+ "method": "get",
1022
+ "path": "/scheduled_maintenance_report/entities",
1023
+ "query": "start_time=2014-10-23T09%3A42%3A11%2B10%3A30&end_time=2014-10-23T21%3A42%3A11%2B10%3A30"
1024
+ },
1025
+ "response": {
1026
+ "status": 200,
1027
+ "headers": {
1028
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1029
+ },
1030
+ "body": {
1031
+ "scheduled_maintenance_reports": [
1032
+ {
1033
+ "scheduled_maintenances": [
1034
+
1035
+ ],
1036
+ "links": {
1037
+ "entity": [
1038
+ "1234"
1039
+ ],
1040
+ "check": [
1041
+ "www.example.com:SSH"
1042
+ ]
1043
+ }
1044
+ }
1045
+ ]
1046
+ }
1047
+ }
1048
+ },
1049
+ {
1050
+ "description": "a GET request for a downtime report on a single check",
1051
+ "provider_state": "a check 'www.example.com:SSH' exists",
1052
+ "request": {
1053
+ "method": "get",
1054
+ "path": "/downtime_report/checks/www.example.com:SSH"
1055
+ },
1056
+ "response": {
1057
+ "status": 200,
1058
+ "headers": {
1059
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1060
+ },
1061
+ "body": {
1062
+ "downtime_reports": [
1063
+ {
1064
+ }
1065
+ ]
1066
+ }
1067
+ }
1068
+ },
1069
+ {
1070
+ "description": "a time limited GET request for a outage report on all entities",
1071
+ "provider_state": "a check 'www.example.com:SSH' exists",
1072
+ "request": {
1073
+ "method": "get",
1074
+ "path": "/outage_report/entities",
1075
+ "query": "start_time=2014-10-23T09%3A42%3A12%2B10%3A30&end_time=2014-10-23T21%3A42%3A12%2B10%3A30"
1076
+ },
1077
+ "response": {
1078
+ "status": 200,
1079
+ "headers": {
1080
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1081
+ },
1082
+ "body": {
1083
+ "outage_reports": [
1084
+ {
1085
+ "outages": [
1086
+
1087
+ ],
1088
+ "links": {
1089
+ "entity": [
1090
+ "1234"
1091
+ ],
1092
+ "check": [
1093
+ "www.example.com:SSH"
1094
+ ]
1095
+ }
1096
+ }
1097
+ ]
1098
+ }
1099
+ }
1100
+ },
1101
+ {
1102
+ "description": "a time-limited GET request for a scheduled_maintenance report on two checks",
1103
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
1104
+ "request": {
1105
+ "method": "get",
1106
+ "path": "/scheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING",
1107
+ "query": "start_time=2014-10-23T09%3A42%3A12%2B10%3A30&end_time=2014-10-23T21%3A42%3A12%2B10%3A30"
1108
+ },
1109
+ "response": {
1110
+ "status": 200,
1111
+ "headers": {
1112
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1113
+ },
1114
+ "body": {
1115
+ "scheduled_maintenance_reports": [
1116
+ {
1117
+ "scheduled_maintenances": [
1118
+
1119
+ ],
1120
+ "links": {
1121
+ "entity": [
1122
+ "1234"
1123
+ ],
1124
+ "check": [
1125
+ "www.example.com:SSH"
1126
+ ]
1127
+ }
1128
+ },
1129
+ {
1130
+ "scheduled_maintenances": [
1131
+
1132
+ ],
1133
+ "links": {
1134
+ "entity": [
1135
+ "5678"
1136
+ ],
1137
+ "check": [
1138
+ "www2.example.com:PING"
1139
+ ]
1140
+ }
1141
+ }
1142
+ ]
1143
+ }
1144
+ }
1145
+ },
1146
+ {
1147
+ "description": "a time limited GET request for a downtime report on all entities",
1148
+ "provider_state": "a check 'www.example.com:SSH' exists",
1149
+ "request": {
1150
+ "method": "get",
1151
+ "path": "/downtime_report/entities",
1152
+ "query": "start_time=2014-10-23T09%3A42%3A12%2B10%3A30&end_time=2014-10-23T21%3A42%3A12%2B10%3A30"
1153
+ },
1154
+ "response": {
1155
+ "status": 200,
1156
+ "headers": {
1157
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1158
+ },
1159
+ "body": {
1160
+ "downtime_reports": [
1161
+ {
1162
+ }
1163
+ ]
1164
+ }
1165
+ }
1166
+ },
1167
+ {
1168
+ "description": "a GET request for a unscheduled_maintenance report on all entities",
1169
+ "provider_state": "a check 'www.example.com:SSH' exists",
1170
+ "request": {
1171
+ "method": "get",
1172
+ "path": "/unscheduled_maintenance_report/entities"
1173
+ },
1174
+ "response": {
1175
+ "status": 200,
1176
+ "headers": {
1177
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1178
+ },
1179
+ "body": {
1180
+ "unscheduled_maintenance_reports": [
1181
+ {
1182
+ "unscheduled_maintenances": [
1183
+
1184
+ ],
1185
+ "links": {
1186
+ "entity": [
1187
+ "1234"
1188
+ ],
1189
+ "check": [
1190
+ "www.example.com:SSH"
1191
+ ]
1192
+ }
1193
+ }
1194
+ ]
1195
+ }
1196
+ }
1197
+ },
1198
+ {
1199
+ "description": "a GET request for a downtime report on one entity",
1200
+ "provider_state": "a check 'www.example.com:SSH' exists",
1201
+ "request": {
1202
+ "method": "get",
1203
+ "path": "/downtime_report/entities/1234"
1204
+ },
1205
+ "response": {
1206
+ "status": 200,
1207
+ "headers": {
1208
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1209
+ },
1210
+ "body": {
1211
+ "downtime_reports": [
1212
+ {
1213
+ }
1214
+ ]
1215
+ }
1216
+ }
1217
+ },
1218
+ {
1219
+ "description": "a GET request for a outage report on two entities",
1220
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
1221
+ "request": {
1222
+ "method": "get",
1223
+ "path": "/outage_report/entities/1234,5678"
1224
+ },
1225
+ "response": {
1226
+ "status": 200,
1227
+ "headers": {
1228
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1229
+ },
1230
+ "body": {
1231
+ "outage_reports": [
1232
+ {
1233
+ "outages": [
1234
+
1235
+ ],
1236
+ "links": {
1237
+ "entity": [
1238
+ "1234"
1239
+ ],
1240
+ "check": [
1241
+ "www.example.com:SSH"
1242
+ ]
1243
+ }
1244
+ },
1245
+ {
1246
+ "outages": [
1247
+
1248
+ ],
1249
+ "links": {
1250
+ "entity": [
1251
+ "5678"
1252
+ ],
1253
+ "check": [
1254
+ "www2.example.com:PING"
1255
+ ]
1256
+ }
1257
+ }
1258
+ ]
1259
+ }
1260
+ }
1261
+ },
1262
+ {
1263
+ "description": "a time-limited GET request for a unscheduled_maintenance report on two checks",
1264
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
1265
+ "request": {
1266
+ "method": "get",
1267
+ "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING",
1268
+ "query": "start_time=2014-10-23T09%3A42%3A12%2B10%3A30&end_time=2014-10-23T21%3A42%3A12%2B10%3A30"
1269
+ },
1270
+ "response": {
1271
+ "status": 200,
1272
+ "headers": {
1273
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1274
+ },
1275
+ "body": {
1276
+ "unscheduled_maintenance_reports": [
1277
+ {
1278
+ "unscheduled_maintenances": [
1279
+
1280
+ ],
1281
+ "links": {
1282
+ "entity": [
1283
+ "1234"
1284
+ ],
1285
+ "check": [
1286
+ "www.example.com:SSH"
1287
+ ]
1288
+ }
1289
+ },
1290
+ {
1291
+ "unscheduled_maintenances": [
1292
+
1293
+ ],
1294
+ "links": {
1295
+ "entity": [
1296
+ "5678"
1297
+ ],
1298
+ "check": [
1299
+ "www2.example.com:PING"
1300
+ ]
1301
+ }
1302
+ }
1303
+ ]
1304
+ }
1305
+ }
1306
+ },
1307
+ {
1308
+ "description": "a GET request for a outage report on two checks",
1309
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
1310
+ "request": {
1311
+ "method": "get",
1312
+ "path": "/outage_report/checks/www.example.com:SSH,www2.example.com:PING"
1313
+ },
1314
+ "response": {
1315
+ "status": 200,
1316
+ "headers": {
1317
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1318
+ },
1319
+ "body": {
1320
+ "outage_reports": [
1321
+ {
1322
+ "outages": [
1323
+
1324
+ ],
1325
+ "links": {
1326
+ "entity": [
1327
+ "1234"
1328
+ ],
1329
+ "check": [
1330
+ "www.example.com:SSH"
1331
+ ]
1332
+ }
1333
+ },
1334
+ {
1335
+ "outages": [
1336
+
1337
+ ],
1338
+ "links": {
1339
+ "entity": [
1340
+ "5678"
1341
+ ],
1342
+ "check": [
1343
+ "www2.example.com:PING"
1344
+ ]
1345
+ }
1346
+ }
1347
+ ]
1348
+ }
1349
+ }
1350
+ },
1351
+ {
1352
+ "description": "a GET request for a outage report on all entities",
1353
+ "provider_state": "a check 'www.example.com:SSH' exists",
1354
+ "request": {
1355
+ "method": "get",
1356
+ "path": "/outage_report/entities"
1357
+ },
1358
+ "response": {
1359
+ "status": 200,
1360
+ "headers": {
1361
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1362
+ },
1363
+ "body": {
1364
+ "outage_reports": [
1365
+ {
1366
+ "outages": [
1367
+
1368
+ ],
1369
+ "links": {
1370
+ "entity": [
1371
+ "1234"
1372
+ ],
1373
+ "check": [
1374
+ "www.example.com:SSH"
1375
+ ]
1376
+ }
1377
+ }
1378
+ ]
1379
+ }
1380
+ }
1381
+ },
1382
+ {
1383
+ "description": "a time limited GET request for a downtime report on one entity",
1384
+ "provider_state": "a check 'www.example.com:SSH' exists",
1385
+ "request": {
1386
+ "method": "get",
1387
+ "path": "/downtime_report/entities/1234",
1388
+ "query": "start_time=2014-10-23T09%3A42%3A12%2B10%3A30&end_time=2014-10-23T21%3A42%3A12%2B10%3A30"
1389
+ },
1390
+ "response": {
1391
+ "status": 200,
1392
+ "headers": {
1393
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1394
+ },
1395
+ "body": {
1396
+ "downtime_reports": [
1397
+ {
1398
+ }
1399
+ ]
1400
+ }
1401
+ }
1402
+ },
1403
+ {
1404
+ "description": "a GET request for a status report on all entities",
1405
+ "provider_state": "a check 'www.example.com:SSH' exists",
1406
+ "request": {
1407
+ "method": "get",
1408
+ "path": "/status_report/entities"
1409
+ },
1410
+ "response": {
1411
+ "status": 200,
1412
+ "headers": {
1413
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1414
+ },
1415
+ "body": {
1416
+ "status_reports": [
1417
+ {
1418
+ }
1419
+ ]
1420
+ }
1421
+ }
1422
+ },
1423
+ {
1424
+ "description": "a time limited GET request for a outage report on all checks",
1425
+ "provider_state": "a check 'www.example.com:SSH' exists",
1426
+ "request": {
1427
+ "method": "get",
1428
+ "path": "/outage_report/checks",
1429
+ "query": "start_time=2014-10-23T09%3A42%3A12%2B10%3A30&end_time=2014-10-23T21%3A42%3A12%2B10%3A30"
1430
+ },
1431
+ "response": {
1432
+ "status": 200,
1433
+ "headers": {
1434
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1435
+ },
1436
+ "body": {
1437
+ "outage_reports": [
1438
+ {
1439
+ "outages": [
1440
+
1441
+ ],
1442
+ "links": {
1443
+ "entity": [
1444
+ "1234"
1445
+ ],
1446
+ "check": [
1447
+ "www.example.com:SSH"
1448
+ ]
1449
+ }
1450
+ }
1451
+ ]
1452
+ }
1453
+ }
1454
+ },
1455
+ {
1456
+ "description": "a GET request for a unscheduled_maintenance report on all checks",
1457
+ "provider_state": "a check 'www.example.com:SSH' exists",
1458
+ "request": {
1459
+ "method": "get",
1460
+ "path": "/unscheduled_maintenance_report/checks"
1461
+ },
1462
+ "response": {
1463
+ "status": 200,
1464
+ "headers": {
1465
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1466
+ },
1467
+ "body": {
1468
+ "unscheduled_maintenance_reports": [
1469
+ {
1470
+ "unscheduled_maintenances": [
1471
+
1472
+ ],
1473
+ "links": {
1474
+ "entity": [
1475
+ "1234"
1476
+ ],
1477
+ "check": [
1478
+ "www.example.com:SSH"
1479
+ ]
1480
+ }
1481
+ }
1482
+ ]
1483
+ }
1484
+ }
1485
+ },
1486
+ {
1487
+ "description": "a GET request for a status report on two entities",
1488
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
1489
+ "request": {
1490
+ "method": "get",
1491
+ "path": "/status_report/entities/1234,5678"
1492
+ },
1493
+ "response": {
1494
+ "status": 200,
1495
+ "headers": {
1496
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1497
+ },
1498
+ "body": {
1499
+ "status_reports": [
1500
+ {
1501
+ },
1502
+ {
1503
+ }
1504
+ ]
1505
+ }
1506
+ }
1507
+ },
1508
+ {
1509
+ "description": "a GET request for a outage report on all checks",
1510
+ "provider_state": "a check 'www.example.com:SSH' exists",
1511
+ "request": {
1512
+ "method": "get",
1513
+ "path": "/outage_report/checks"
1514
+ },
1515
+ "response": {
1516
+ "status": 200,
1517
+ "headers": {
1518
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1519
+ },
1520
+ "body": {
1521
+ "outage_reports": [
1522
+ {
1523
+ "outages": [
1524
+
1525
+ ],
1526
+ "links": {
1527
+ "entity": [
1528
+ "1234"
1529
+ ],
1530
+ "check": [
1531
+ "www.example.com:SSH"
1532
+ ]
1533
+ }
1534
+ }
1535
+ ]
1536
+ }
1537
+ }
1538
+ },
1539
+ {
1540
+ "description": "a GET request for a scheduled_maintenance report on all entities",
1541
+ "provider_state": "a check 'www.example.com:SSH' exists",
1542
+ "request": {
1543
+ "method": "get",
1544
+ "path": "/scheduled_maintenance_report/entities"
1545
+ },
1546
+ "response": {
1547
+ "status": 200,
1548
+ "headers": {
1549
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1550
+ },
1551
+ "body": {
1552
+ "scheduled_maintenance_reports": [
1553
+ {
1554
+ "scheduled_maintenances": [
1555
+
1556
+ ],
1557
+ "links": {
1558
+ "entity": [
1559
+ "1234"
1560
+ ],
1561
+ "check": [
1562
+ "www.example.com:SSH"
1563
+ ]
1564
+ }
1565
+ }
1566
+ ]
1567
+ }
1568
+ }
1569
+ },
1570
+ {
1571
+ "description": "a GET request for a status report on all checks",
1572
+ "provider_state": "a check 'www.example.com:SSH' exists",
1573
+ "request": {
1574
+ "method": "get",
1575
+ "path": "/status_report/checks"
1576
+ },
1577
+ "response": {
1578
+ "status": 200,
1579
+ "headers": {
1580
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1581
+ },
1582
+ "body": {
1583
+ "status_reports": [
1584
+ {
1585
+ }
1586
+ ]
1587
+ }
1588
+ }
1589
+ },
1590
+ {
1591
+ "description": "a GET request for a unscheduled_maintenance report on two checks",
1592
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
1593
+ "request": {
1594
+ "method": "get",
1595
+ "path": "/unscheduled_maintenance_report/checks/www.example.com:SSH,www2.example.com:PING"
1596
+ },
1597
+ "response": {
1598
+ "status": 200,
1599
+ "headers": {
1600
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1601
+ },
1602
+ "body": {
1603
+ "unscheduled_maintenance_reports": [
1604
+ {
1605
+ "unscheduled_maintenances": [
1606
+
1607
+ ],
1608
+ "links": {
1609
+ "entity": [
1610
+ "1234"
1611
+ ],
1612
+ "check": [
1613
+ "www.example.com:SSH"
1614
+ ]
1615
+ }
1616
+ },
1617
+ {
1618
+ "unscheduled_maintenances": [
1619
+
1620
+ ],
1621
+ "links": {
1622
+ "entity": [
1623
+ "5678"
1624
+ ],
1625
+ "check": [
1626
+ "www2.example.com:PING"
1627
+ ]
1628
+ }
1629
+ }
1630
+ ]
1631
+ }
1632
+ }
1633
+ },
1634
+ {
1635
+ "description": "a time-limited GET request for a downtime report on two checks",
1636
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
1637
+ "request": {
1638
+ "method": "get",
1639
+ "path": "/downtime_report/checks/www.example.com:SSH,www2.example.com:PING",
1640
+ "query": "start_time=2014-10-23T09%3A42%3A12%2B10%3A30&end_time=2014-10-23T21%3A42%3A12%2B10%3A30"
1641
+ },
1642
+ "response": {
1643
+ "status": 200,
1644
+ "headers": {
1645
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1646
+ },
1647
+ "body": {
1648
+ "downtime_reports": [
1649
+ {
1650
+ },
1651
+ {
1652
+ }
1653
+ ]
1654
+ }
1655
+ }
1656
+ },
1657
+ {
1658
+ "description": "a GET request for a downtime report on all checks",
1659
+ "provider_state": "a check 'www.example.com:SSH' exists",
1660
+ "request": {
1661
+ "method": "get",
1662
+ "path": "/downtime_report/checks"
1663
+ },
1664
+ "response": {
1665
+ "status": 200,
1666
+ "headers": {
1667
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1668
+ },
1669
+ "body": {
1670
+ "downtime_reports": [
1671
+ {
1672
+ }
1673
+ ]
1674
+ }
1675
+ }
1676
+ },
1677
+ {
1678
+ "description": "a POST request with one notification rule",
1679
+ "provider_state": "a contact with id 'abc' exists",
1680
+ "request": {
1681
+ "method": "post",
1682
+ "path": "/contacts/abc/notification_rules",
1683
+ "headers": {
1684
+ "Content-Type": "application/vnd.api+json"
1685
+ },
1686
+ "body": {
1687
+ "notification_rules": [
1688
+ {
1689
+ "entity_tags": [
1690
+ "database",
1691
+ "physical"
1692
+ ],
1693
+ "entities": [
1694
+ "foo-app-01.example.com"
1695
+ ],
1696
+ "time_restrictions": null,
1697
+ "warning_media": [
1698
+ "email"
1699
+ ],
1700
+ "critical_media": [
1701
+ "sms",
1702
+ "email"
1703
+ ],
1704
+ "warning_blackhole": false,
1705
+ "critical_blackhole": false
1706
+ }
1707
+ ]
1708
+ }
1709
+ },
1710
+ "response": {
1711
+ "status": 201,
1712
+ "headers": {
1713
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1714
+ },
1715
+ "body": [
1716
+ {
1717
+ "json_class": "Pact::Term",
1718
+ "data": {
1719
+ "generate": "05983623-fcef-42da-af44-ed6990b500fa",
1720
+ "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}$"}
1721
+ }
1722
+ }
1723
+ ]
1724
+ }
1725
+ },
1726
+ {
1727
+ "description": "a POST request with one notification rule",
1728
+ "provider_state": "no contact exists",
1729
+ "request": {
1730
+ "method": "post",
1731
+ "path": "/contacts/abc/notification_rules",
1732
+ "headers": {
1733
+ "Content-Type": "application/vnd.api+json"
1734
+ },
1735
+ "body": {
1736
+ "notification_rules": [
1737
+ {
1738
+ "entity_tags": [
1739
+ "database",
1740
+ "physical"
1741
+ ],
1742
+ "entities": [
1743
+ "foo-app-01.example.com"
1744
+ ],
1745
+ "time_restrictions": null,
1746
+ "warning_media": [
1747
+ "email"
1748
+ ],
1749
+ "critical_media": [
1750
+ "sms",
1751
+ "email"
1752
+ ],
1753
+ "warning_blackhole": false,
1754
+ "critical_blackhole": false
1755
+ }
1756
+ ]
1757
+ }
1758
+ },
1759
+ "response": {
1760
+ "status": 404,
1761
+ "headers": {
1762
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1763
+ },
1764
+ "body": {
1765
+ "errors": [
1766
+ "could not find contact 'abc'"
1767
+ ]
1768
+ }
1769
+ }
1770
+ },
1771
+ {
1772
+ "description": "a POST request with two notification rules",
1773
+ "provider_state": "a contact with id 'abc' exists",
1774
+ "request": {
1775
+ "method": "post",
1776
+ "path": "/contacts/abc/notification_rules",
1777
+ "headers": {
1778
+ "Content-Type": "application/vnd.api+json"
1779
+ },
1780
+ "body": {
1781
+ "notification_rules": [
1782
+ {
1783
+ "entity_tags": [
1784
+ "database",
1785
+ "physical"
1786
+ ],
1787
+ "entities": [
1788
+ "foo-app-01.example.com"
1789
+ ],
1790
+ "time_restrictions": null,
1791
+ "warning_media": [
1792
+ "email"
1793
+ ],
1794
+ "critical_media": [
1795
+ "sms",
1796
+ "email"
1797
+ ],
1798
+ "warning_blackhole": false,
1799
+ "critical_blackhole": false
1800
+ },
1801
+ {
1802
+ "entity_tags": null,
1803
+ "entities": [
1804
+ "foo-app-02.example.com"
1805
+ ],
1806
+ "time_restrictions": null,
1807
+ "warning_media": [
1808
+ "email"
1809
+ ],
1810
+ "critical_media": [
1811
+ "sms",
1812
+ "email"
1813
+ ],
1814
+ "warning_blackhole": true,
1815
+ "critical_blackhole": false
1816
+ }
1817
+ ]
1818
+ }
1819
+ },
1820
+ "response": {
1821
+ "status": 201,
1822
+ "headers": {
1823
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1824
+ },
1825
+ "body": [
1826
+ {
1827
+ "json_class": "Pact::Term",
1828
+ "data": {
1829
+ "generate": "05983623-fcef-42da-af44-ed6990b500fa",
1830
+ "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}$"}
1831
+ }
1832
+ },
1833
+ {
1834
+ "json_class": "Pact::Term",
1835
+ "data": {
1836
+ "generate": "20f182fc-6e32-4794-9007-97366d162c51",
1837
+ "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}$"}
1838
+ }
1839
+ }
1840
+ ]
1841
+ }
1842
+ },
1843
+ {
1844
+ "description": "a PATCH request to change properties for a single notification rule",
1845
+ "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists",
1846
+ "request": {
1847
+ "method": "patch",
1848
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa",
1849
+ "headers": {
1850
+ "Content-Type": "application/json-patch+json"
1851
+ },
1852
+ "body": [
1853
+ {
1854
+ "op": "replace",
1855
+ "path": "/notification_rules/0/warning_blackhole",
1856
+ "value": false
1857
+ }
1858
+ ]
1859
+ },
1860
+ "response": {
1861
+ "status": 204,
1862
+ "body": ""
1863
+ }
1864
+ },
1865
+ {
1866
+ "description": "a PATCH request to change properties for a single notification rule",
1867
+ "provider_state": "no notification rule exists",
1868
+ "request": {
1869
+ "method": "patch",
1870
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa",
1871
+ "headers": {
1872
+ "Content-Type": "application/json-patch+json"
1873
+ },
1874
+ "body": [
1875
+ {
1876
+ "op": "replace",
1877
+ "path": "/notification_rules/0/warning_blackhole",
1878
+ "value": false
1879
+ }
1880
+ ]
1881
+ },
1882
+ "response": {
1883
+ "status": 404,
1884
+ "headers": {
1885
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1886
+ },
1887
+ "body": {
1888
+ "errors": [
1889
+ "could not find notification rule '05983623-fcef-42da-af44-ed6990b500fa'"
1890
+ ]
1891
+ }
1892
+ }
1893
+ },
1894
+ {
1895
+ "description": "a PATCH request to change properties for two notification rules",
1896
+ "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists",
1897
+ "request": {
1898
+ "method": "patch",
1899
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51",
1900
+ "headers": {
1901
+ "Content-Type": "application/json-patch+json"
1902
+ },
1903
+ "body": [
1904
+ {
1905
+ "op": "replace",
1906
+ "path": "/notification_rules/0/warning_blackhole",
1907
+ "value": false
1908
+ }
1909
+ ]
1910
+ },
1911
+ "response": {
1912
+ "status": 204,
1913
+ "body": ""
1914
+ }
1915
+ },
1916
+ {
1917
+ "description": "a DELETE request for a single notification rule",
1918
+ "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists",
1919
+ "request": {
1920
+ "method": "delete",
1921
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa",
1922
+ "body": null
1923
+ },
1924
+ "response": {
1925
+ "status": 204,
1926
+ "body": ""
1927
+ }
1928
+ },
1929
+ {
1930
+ "description": "a DELETE request for a single notification rule",
1931
+ "provider_state": "no notification rule exists",
1932
+ "request": {
1933
+ "method": "delete",
1934
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa",
1935
+ "body": null
1936
+ },
1937
+ "response": {
1938
+ "status": 404,
1939
+ "headers": {
1940
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1941
+ },
1942
+ "body": {
1943
+ "errors": [
1944
+ "could not find notification rule '05983623-fcef-42da-af44-ed6990b500fa'"
1945
+ ]
1946
+ }
1947
+ }
1948
+ },
1949
+ {
1950
+ "description": "a DELETE request for two notification rules",
1951
+ "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists",
1952
+ "request": {
1953
+ "method": "delete",
1954
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51",
1955
+ "body": null
1956
+ },
1957
+ "response": {
1958
+ "status": 204,
1959
+ "body": ""
1960
+ }
1961
+ },
1962
+ {
1963
+ "description": "a GET request for all notification rules",
1964
+ "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists",
1965
+ "request": {
1966
+ "method": "get",
1967
+ "path": "/notification_rules"
1968
+ },
1969
+ "response": {
1970
+ "status": 200,
1971
+ "headers": {
1972
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
1973
+ },
1974
+ "body": {
1975
+ "notification_rules": [
1976
+ {
1977
+ "id": "05983623-fcef-42da-af44-ed6990b500fa",
1978
+ "tags": [
1979
+
1980
+ ],
1981
+ "regex_tags": [
1982
+
1983
+ ],
1984
+ "entities": [
1985
+
1986
+ ],
1987
+ "regex_entities": [
1988
+
1989
+ ],
1990
+ "time_restrictions": [
1991
+
1992
+ ],
1993
+ "warning_media": [
1994
+ "email"
1995
+ ],
1996
+ "critical_media": [
1997
+ "sms",
1998
+ "email"
1999
+ ],
2000
+ "warning_blackhole": false,
2001
+ "critical_blackhole": false
2002
+ }
2003
+ ]
2004
+ }
2005
+ }
2006
+ },
2007
+ {
2008
+ "description": "a GET request for two notification rules",
2009
+ "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' and notification rule '20f182fc-6e32-4794-9007-97366d162c51' exists",
2010
+ "request": {
2011
+ "method": "get",
2012
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa,20f182fc-6e32-4794-9007-97366d162c51"
2013
+ },
2014
+ "response": {
2015
+ "status": 200,
2016
+ "headers": {
2017
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2018
+ },
2019
+ "body": {
2020
+ "notification_rules": [
2021
+ {
2022
+ "id": "05983623-fcef-42da-af44-ed6990b500fa",
2023
+ "tags": [
2024
+
2025
+ ],
2026
+ "regex_tags": [
2027
+
2028
+ ],
2029
+ "entities": [
2030
+
2031
+ ],
2032
+ "regex_entities": [
2033
+
2034
+ ],
2035
+ "time_restrictions": [
2036
+
2037
+ ],
2038
+ "warning_media": [
2039
+ "email"
2040
+ ],
2041
+ "critical_media": [
2042
+ "sms",
2043
+ "email"
2044
+ ],
2045
+ "warning_blackhole": false,
2046
+ "critical_blackhole": false
2047
+ },
2048
+ {
2049
+ "id": "20f182fc-6e32-4794-9007-97366d162c51",
2050
+ "tags": [
2051
+ "physical"
2052
+ ],
2053
+ "regex_tags": [
2054
+
2055
+ ],
2056
+ "entities": [
2057
+ "example.com"
2058
+ ],
2059
+ "regex_entities": [
2060
+
2061
+ ],
2062
+ "time_restrictions": [
2063
+
2064
+ ],
2065
+ "warning_media": [
2066
+ "email"
2067
+ ],
2068
+ "critical_media": [
2069
+ "sms",
2070
+ "email"
2071
+ ],
2072
+ "warning_blackhole": true,
2073
+ "critical_blackhole": true
2074
+ }
2075
+ ]
2076
+ }
2077
+ }
2078
+ },
2079
+ {
2080
+ "description": "a GET request for a single notification rule",
2081
+ "provider_state": "no notification rule exists",
2082
+ "request": {
2083
+ "method": "get",
2084
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa"
2085
+ },
2086
+ "response": {
2087
+ "status": 404,
2088
+ "headers": {
2089
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2090
+ },
2091
+ "body": {
2092
+ "errors": [
2093
+ "could not find notification rules '05983623-fcef-42da-af44-ed6990b500fa'"
2094
+ ]
2095
+ }
2096
+ }
2097
+ },
2098
+ {
2099
+ "description": "a GET request for a single notification rule",
2100
+ "provider_state": "a contact 'abc' with generic notification rule '05983623-fcef-42da-af44-ed6990b500fa' exists",
2101
+ "request": {
2102
+ "method": "get",
2103
+ "path": "/notification_rules/05983623-fcef-42da-af44-ed6990b500fa"
2104
+ },
2105
+ "response": {
2106
+ "status": 200,
2107
+ "headers": {
2108
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2109
+ },
2110
+ "body": {
2111
+ "notification_rules": [
2112
+ {
2113
+ "id": "05983623-fcef-42da-af44-ed6990b500fa",
2114
+ "tags": [
2115
+
2116
+ ],
2117
+ "regex_tags": [
2118
+
2119
+ ],
2120
+ "entities": [
2121
+
2122
+ ],
2123
+ "regex_entities": [
2124
+
2125
+ ],
2126
+ "time_restrictions": [
2127
+
2128
+ ],
2129
+ "warning_media": [
2130
+ "email"
2131
+ ],
2132
+ "critical_media": [
2133
+ "sms",
2134
+ "email"
2135
+ ],
2136
+ "warning_blackhole": false,
2137
+ "critical_blackhole": false
2138
+ }
2139
+ ]
2140
+ }
2141
+ }
2142
+ },
2143
+ {
2144
+ "description": "a POST request with one entity",
2145
+ "provider_state": "no entity exists",
2146
+ "request": {
2147
+ "method": "post",
2148
+ "path": "/entities",
2149
+ "headers": {
2150
+ "Content-Type": "application/vnd.api+json"
2151
+ },
2152
+ "body": {
2153
+ "entities": [
2154
+ {
2155
+ "name": "example.org",
2156
+ "id": "57_example"
2157
+ }
2158
+ ]
2159
+ }
2160
+ },
2161
+ "response": {
2162
+ "status": 201,
2163
+ "headers": {
2164
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2165
+ },
2166
+ "body": [
2167
+ "57_example"
2168
+ ]
2169
+ }
2170
+ },
2171
+ {
2172
+ "description": "a POST request with two entities",
2173
+ "provider_state": "no entity exists",
2174
+ "request": {
2175
+ "method": "post",
2176
+ "path": "/entities",
2177
+ "headers": {
2178
+ "Content-Type": "application/vnd.api+json"
2179
+ },
2180
+ "body": {
2181
+ "entities": [
2182
+ {
2183
+ "name": "example.org",
2184
+ "id": "57_example"
2185
+ },
2186
+ {
2187
+ "name": "example2.org",
2188
+ "id": "58"
2189
+ }
2190
+ ]
2191
+ }
2192
+ },
2193
+ "response": {
2194
+ "status": 201,
2195
+ "headers": {
2196
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2197
+ },
2198
+ "body": [
2199
+ "57_example",
2200
+ "58"
2201
+ ]
2202
+ }
2203
+ },
2204
+ {
2205
+ "description": "a PATCH request for a single entity",
2206
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
2207
+ "request": {
2208
+ "method": "patch",
2209
+ "path": "/entities/1234",
2210
+ "headers": {
2211
+ "Content-Type": "application/json-patch+json"
2212
+ },
2213
+ "body": [
2214
+ {
2215
+ "op": "replace",
2216
+ "path": "/entities/0/name",
2217
+ "value": "example3.com"
2218
+ }
2219
+ ]
2220
+ },
2221
+ "response": {
2222
+ "status": 204,
2223
+ "body": ""
2224
+ }
2225
+ },
2226
+ {
2227
+ "description": "a PATCH request for a single entity",
2228
+ "provider_state": "no entity exists",
2229
+ "request": {
2230
+ "method": "patch",
2231
+ "path": "/entities/1234",
2232
+ "headers": {
2233
+ "Content-Type": "application/json-patch+json"
2234
+ },
2235
+ "body": [
2236
+ {
2237
+ "op": "replace",
2238
+ "path": "/entities/0/name",
2239
+ "value": "example3.com"
2240
+ }
2241
+ ]
2242
+ },
2243
+ "response": {
2244
+ "status": 404,
2245
+ "headers": {
2246
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2247
+ },
2248
+ "body": {
2249
+ "errors": [
2250
+ "could not find entity '1234'"
2251
+ ]
2252
+ }
2253
+ }
2254
+ },
2255
+ {
2256
+ "description": "a GET request for all entities",
2257
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
2258
+ "request": {
2259
+ "method": "get",
2260
+ "path": "/entities"
2261
+ },
2262
+ "response": {
2263
+ "status": 200,
2264
+ "headers": {
2265
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2266
+ },
2267
+ "body": {
2268
+ "entities": [
2269
+ {
2270
+ "name": "www.example.com",
2271
+ "id": "1234"
2272
+ }
2273
+ ]
2274
+ }
2275
+ }
2276
+ },
2277
+ {
2278
+ "description": "a GET request for all entities",
2279
+ "provider_state": "no entity exists",
2280
+ "request": {
2281
+ "method": "get",
2282
+ "path": "/entities"
2283
+ },
2284
+ "response": {
2285
+ "status": 200,
2286
+ "headers": {
2287
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2288
+ },
2289
+ "body": {
2290
+ "entities": [
2291
+
2292
+ ]
2293
+ }
2294
+ }
2295
+ },
2296
+ {
2297
+ "description": "a GET request for a single entity",
2298
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
2299
+ "request": {
2300
+ "method": "get",
2301
+ "path": "/entities/1234"
2302
+ },
2303
+ "response": {
2304
+ "status": 200,
2305
+ "headers": {
2306
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2307
+ },
2308
+ "body": {
2309
+ "entities": [
2310
+ {
2311
+ "name": "www.example.com",
2312
+ "id": "1234"
2313
+ }
2314
+ ]
2315
+ }
2316
+ }
2317
+ },
2318
+ {
2319
+ "description": "a GET request for a single entity",
2320
+ "provider_state": "no entity exists",
2321
+ "request": {
2322
+ "method": "get",
2323
+ "path": "/entities/1234"
2324
+ },
2325
+ "response": {
2326
+ "status": 404,
2327
+ "headers": {
2328
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2329
+ },
2330
+ "body": {
2331
+ "errors": [
2332
+ "could not find entities: '1234'"
2333
+ ]
2334
+ }
2335
+ }
2336
+ },
2337
+ {
2338
+ "description": "a POST request with one set of pagerduty credentials",
2339
+ "provider_state": "a contact with id 'abc' exists",
2340
+ "request": {
2341
+ "method": "post",
2342
+ "path": "/contacts/abc/pagerduty_credentials",
2343
+ "headers": {
2344
+ "Content-Type": "application/vnd.api+json"
2345
+ },
2346
+ "body": {
2347
+ "pagerduty_credentials": [
2348
+ {
2349
+ "service_key": "abc",
2350
+ "subdomain": "def",
2351
+ "username": "ghi",
2352
+ "password": "jkl"
2353
+ }
2354
+ ]
2355
+ }
2356
+ },
2357
+ "response": {
2358
+ "status": 201,
2359
+ "headers": {
2360
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2361
+ },
2362
+ "body": [
2363
+ "abc"
2364
+ ]
2365
+ }
2366
+ },
2367
+ {
2368
+ "description": "a POST request with one set of pagerduty credentials",
2369
+ "provider_state": "no contact exists",
2370
+ "request": {
2371
+ "method": "post",
2372
+ "path": "/contacts/abc/pagerduty_credentials",
2373
+ "headers": {
2374
+ "Content-Type": "application/vnd.api+json"
2375
+ },
2376
+ "body": {
2377
+ "pagerduty_credentials": [
2378
+ {
2379
+ "service_key": "abc",
2380
+ "subdomain": "def",
2381
+ "username": "ghi",
2382
+ "password": "jkl"
2383
+ }
2384
+ ]
2385
+ }
2386
+ },
2387
+ "response": {
2388
+ "status": 422,
2389
+ "headers": {
2390
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2391
+ },
2392
+ "body": {
2393
+ "errors": [
2394
+ "Contact id: 'abc' could not be loaded"
2395
+ ]
2396
+ }
2397
+ }
2398
+ },
2399
+ {
2400
+ "description": "a PATCH request for pagerduty credentials",
2401
+ "provider_state": "a contact with id 'abc' has pagerduty credentials",
2402
+ "request": {
2403
+ "method": "patch",
2404
+ "path": "/pagerduty_credentials/abc",
2405
+ "headers": {
2406
+ "Content-Type": "application/json-patch+json"
2407
+ },
2408
+ "body": [
2409
+ {
2410
+ "op": "replace",
2411
+ "path": "/pagerduty_credentials/0/password",
2412
+ "value": "pswrd"
2413
+ }
2414
+ ]
2415
+ },
2416
+ "response": {
2417
+ "status": 204,
2418
+ "body": ""
2419
+ }
2420
+ },
2421
+ {
2422
+ "description": "a PATCH request for pagerduty credentials",
2423
+ "provider_state": "no contact exists",
2424
+ "request": {
2425
+ "method": "patch",
2426
+ "path": "/pagerduty_credentials/abc",
2427
+ "headers": {
2428
+ "Content-Type": "application/json-patch+json"
2429
+ },
2430
+ "body": [
2431
+ {
2432
+ "op": "replace",
2433
+ "path": "/pagerduty_credentials/0/password",
2434
+ "value": "pswrd"
2435
+ }
2436
+ ]
2437
+ },
2438
+ "response": {
2439
+ "status": 404,
2440
+ "headers": {
2441
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2442
+ },
2443
+ "body": {
2444
+ "errors": [
2445
+ "could not find contact 'abc'"
2446
+ ]
2447
+ }
2448
+ }
2449
+ },
2450
+ {
2451
+ "description": "a PATCH request for pagerduty credentials",
2452
+ "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials",
2453
+ "request": {
2454
+ "method": "patch",
2455
+ "path": "/pagerduty_credentials/abc,872",
2456
+ "headers": {
2457
+ "Content-Type": "application/json-patch+json"
2458
+ },
2459
+ "body": [
2460
+ {
2461
+ "op": "replace",
2462
+ "path": "/pagerduty_credentials/0/password",
2463
+ "value": "pswrd"
2464
+ }
2465
+ ]
2466
+ },
2467
+ "response": {
2468
+ "status": 204,
2469
+ "body": ""
2470
+ }
2471
+ },
2472
+ {
2473
+ "description": "a DELETE request for one set of pagerduty credentials",
2474
+ "provider_state": "a contact with id 'abc' has pagerduty credentials",
2475
+ "request": {
2476
+ "method": "delete",
2477
+ "path": "/pagerduty_credentials/abc",
2478
+ "body": null
2479
+ },
2480
+ "response": {
2481
+ "status": 204,
2482
+ "body": ""
2483
+ }
2484
+ },
2485
+ {
2486
+ "description": "a DELETE request for one set of pagerduty credentials",
2487
+ "provider_state": "no contact exists",
2488
+ "request": {
2489
+ "method": "delete",
2490
+ "path": "/pagerduty_credentials/abc",
2491
+ "body": null
2492
+ },
2493
+ "response": {
2494
+ "status": 404,
2495
+ "headers": {
2496
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2497
+ },
2498
+ "body": {
2499
+ "errors": [
2500
+ "could not find contact 'abc'"
2501
+ ]
2502
+ }
2503
+ }
2504
+ },
2505
+ {
2506
+ "description": "a DELETE request for two sets of pagerduty credentials",
2507
+ "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials",
2508
+ "request": {
2509
+ "method": "delete",
2510
+ "path": "/pagerduty_credentials/abc,872",
2511
+ "body": null
2512
+ },
2513
+ "response": {
2514
+ "status": 204,
2515
+ "body": ""
2516
+ }
2517
+ },
2518
+ {
2519
+ "description": "a GET request for all pagerduty credentials",
2520
+ "provider_state": "a contact with id 'abc' has pagerduty credentials",
2521
+ "request": {
2522
+ "method": "get",
2523
+ "path": "/pagerduty_credentials"
2524
+ },
2525
+ "response": {
2526
+ "status": 200,
2527
+ "headers": {
2528
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2529
+ },
2530
+ "body": {
2531
+ "pagerduty_credentials": [
2532
+ {
2533
+ "service_key": "abc",
2534
+ "subdomain": "def",
2535
+ "username": "ghi",
2536
+ "password": "jkl"
2537
+ }
2538
+ ]
2539
+ }
2540
+ }
2541
+ },
2542
+ {
2543
+ "description": "a GET request for two sets of pagerduty credentials",
2544
+ "provider_state": "contacts with ids 'abc' and '872' have pagerduty credentials",
2545
+ "request": {
2546
+ "method": "get",
2547
+ "path": "/pagerduty_credentials/abc,872"
2548
+ },
2549
+ "response": {
2550
+ "status": 200,
2551
+ "headers": {
2552
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2553
+ },
2554
+ "body": {
2555
+ "pagerduty_credentials": [
2556
+ {
2557
+ "service_key": "abc",
2558
+ "subdomain": "def",
2559
+ "username": "ghi",
2560
+ "password": "jkl"
2561
+ },
2562
+ {
2563
+ "service_key": "mno",
2564
+ "subdomain": "pqr",
2565
+ "username": "stu",
2566
+ "password": "vwx"
2567
+ }
2568
+ ]
2569
+ }
2570
+ }
2571
+ },
2572
+ {
2573
+ "description": "a GET request for one set of pagerduty credentials",
2574
+ "provider_state": "no contact exists",
2575
+ "request": {
2576
+ "method": "get",
2577
+ "path": "/pagerduty_credentials/abc"
2578
+ },
2579
+ "response": {
2580
+ "status": 404,
2581
+ "headers": {
2582
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2583
+ },
2584
+ "body": {
2585
+ "errors": [
2586
+ "could not find contact 'abc'"
2587
+ ]
2588
+ }
2589
+ }
2590
+ },
2591
+ {
2592
+ "description": "a GET request for one set of pagerduty credentials",
2593
+ "provider_state": "a contact with id 'abc' has pagerduty credentials",
2594
+ "request": {
2595
+ "method": "get",
2596
+ "path": "/pagerduty_credentials/abc"
2597
+ },
2598
+ "response": {
2599
+ "status": 200,
2600
+ "headers": {
2601
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2602
+ },
2603
+ "body": {
2604
+ "pagerduty_credentials": [
2605
+ {
2606
+ "service_key": "abc",
2607
+ "subdomain": "def",
2608
+ "username": "ghi",
2609
+ "password": "jkl"
2610
+ }
2611
+ ]
2612
+ }
2613
+ }
2614
+ },
2615
+ {
2616
+ "description": "a POST request with one check",
2617
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
2618
+ "request": {
2619
+ "method": "post",
2620
+ "path": "/checks",
2621
+ "headers": {
2622
+ "Content-Type": "application/vnd.api+json"
2623
+ },
2624
+ "body": {
2625
+ "checks": [
2626
+ {
2627
+ "name": "SSH",
2628
+ "entity_id": "1234"
2629
+ }
2630
+ ]
2631
+ }
2632
+ },
2633
+ "response": {
2634
+ "status": 201,
2635
+ "headers": {
2636
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2637
+ },
2638
+ "body": [
2639
+ "www.example.com:SSH"
2640
+ ]
2641
+ }
2642
+ },
2643
+ {
2644
+ "description": "a POST request with two checks",
2645
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
2646
+ "request": {
2647
+ "method": "post",
2648
+ "path": "/checks",
2649
+ "headers": {
2650
+ "Content-Type": "application/vnd.api+json"
2651
+ },
2652
+ "body": {
2653
+ "checks": [
2654
+ {
2655
+ "name": "SSH",
2656
+ "entity_id": "1234"
2657
+ },
2658
+ {
2659
+ "name": "PING",
2660
+ "entity_id": "5678"
2661
+ }
2662
+ ]
2663
+ }
2664
+ },
2665
+ "response": {
2666
+ "status": 201,
2667
+ "headers": {
2668
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2669
+ },
2670
+ "body": [
2671
+ "www.example.com:SSH",
2672
+ "www2.example.com:PING"
2673
+ ]
2674
+ }
2675
+ },
2676
+ {
2677
+ "description": "a PATCH request for a single check",
2678
+ "provider_state": "a check 'www.example.com:SSH' exists",
2679
+ "request": {
2680
+ "method": "patch",
2681
+ "path": "/checks/www.example.com:SSH",
2682
+ "headers": {
2683
+ "Content-Type": "application/json-patch+json"
2684
+ },
2685
+ "body": [
2686
+ {
2687
+ "op": "replace",
2688
+ "path": "/checks/0/enabled",
2689
+ "value": false
2690
+ }
2691
+ ]
2692
+ },
2693
+ "response": {
2694
+ "status": 204,
2695
+ "body": ""
2696
+ }
2697
+ },
2698
+ {
2699
+ "description": "a PATCH request for a single check",
2700
+ "provider_state": "no entity exists",
2701
+ "request": {
2702
+ "method": "patch",
2703
+ "path": "/checks/www.example.com:SSH",
2704
+ "headers": {
2705
+ "Content-Type": "application/json-patch+json"
2706
+ },
2707
+ "body": [
2708
+ {
2709
+ "op": "replace",
2710
+ "path": "/checks/0/enabled",
2711
+ "value": false
2712
+ }
2713
+ ]
2714
+ },
2715
+ "response": {
2716
+ "status": 404,
2717
+ "headers": {
2718
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2719
+ },
2720
+ "body": {
2721
+ "errors": [
2722
+ "could not find entity 'www.example.com'"
2723
+ ]
2724
+ }
2725
+ }
2726
+ },
2727
+ {
2728
+ "description": "a GET request for all checks",
2729
+ "provider_state": "no entity exists",
2730
+ "request": {
2731
+ "method": "get",
2732
+ "path": "/checks"
2733
+ },
2734
+ "response": {
2735
+ "status": 200,
2736
+ "headers": {
2737
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2738
+ },
2739
+ "body": {
2740
+ "checks": [
2741
+
2742
+ ]
2743
+ }
2744
+ }
2745
+ },
2746
+ {
2747
+ "description": "a GET request for all checks",
2748
+ "provider_state": "a check 'www.example.com:SSH' exists",
2749
+ "request": {
2750
+ "method": "get",
2751
+ "path": "/checks"
2752
+ },
2753
+ "response": {
2754
+ "status": 200,
2755
+ "headers": {
2756
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2757
+ },
2758
+ "body": {
2759
+ "checks": [
2760
+ {
2761
+ "id": "www.example.com:SSH",
2762
+ "name": "SSH",
2763
+ "entity_name": "www.example.com",
2764
+ "links": {
2765
+ "entities": [
2766
+ "1234"
2767
+ ]
2768
+ }
2769
+ }
2770
+ ]
2771
+ }
2772
+ }
2773
+ },
2774
+ {
2775
+ "description": "a GET request for check 'www.example.com:SSH'",
2776
+ "provider_state": "a check 'www.example.com:SSH' exists",
2777
+ "request": {
2778
+ "method": "get",
2779
+ "path": "/checks/www.example.com:SSH"
2780
+ },
2781
+ "response": {
2782
+ "status": 200,
2783
+ "headers": {
2784
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2785
+ },
2786
+ "body": {
2787
+ "checks": [
2788
+ {
2789
+ "id": "www.example.com:SSH",
2790
+ "name": "SSH",
2791
+ "entity_name": "www.example.com",
2792
+ "links": {
2793
+ "entities": [
2794
+ "1234"
2795
+ ]
2796
+ }
2797
+ }
2798
+ ]
2799
+ }
2800
+ }
2801
+ },
2802
+ {
2803
+ "description": "a GET request for check 'www.example.com:SSH'",
2804
+ "provider_state": "no entity exists",
2805
+ "request": {
2806
+ "method": "get",
2807
+ "path": "/checks/www.example.com:SSH"
2808
+ },
2809
+ "response": {
2810
+ "status": 404,
2811
+ "headers": {
2812
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
2813
+ },
2814
+ "body": {
2815
+ "errors": [
2816
+ "could not find entity checks: 'www.example.com:SSH'"
2817
+ ]
2818
+ }
2819
+ }
2820
+ },
2821
+ {
2822
+ "description": "a POST request with one test notification",
2823
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
2824
+ "request": {
2825
+ "method": "post",
2826
+ "path": "/test_notifications/entities/1234",
2827
+ "headers": {
2828
+ "Content-Type": "application/vnd.api+json"
2829
+ },
2830
+ "body": {
2831
+ "test_notifications": [
2832
+ {
2833
+ "summary": "testing"
2834
+ }
2835
+ ]
2836
+ }
2837
+ },
2838
+ "response": {
2839
+ "status": 204,
2840
+ "body": ""
2841
+ }
2842
+ },
2843
+ {
2844
+ "description": "a POST request with one test notification",
2845
+ "provider_state": "no entity exists",
2846
+ "request": {
2847
+ "method": "post",
2848
+ "path": "/test_notifications/entities/1234",
2849
+ "headers": {
2850
+ "Content-Type": "application/vnd.api+json"
2851
+ },
2852
+ "body": {
2853
+ "test_notifications": [
2854
+ {
2855
+ "summary": "testing"
2856
+ }
2857
+ ]
2858
+ }
2859
+ },
2860
+ "response": {
2861
+ "status": 404,
2862
+ "body": {
2863
+ "errors": [
2864
+ "could not find entity '1234'"
2865
+ ]
2866
+ }
2867
+ }
2868
+ },
2869
+ {
2870
+ "description": "a POST request with two test notifications",
2871
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
2872
+ "request": {
2873
+ "method": "post",
2874
+ "path": "/test_notifications/entities/1234",
2875
+ "headers": {
2876
+ "Content-Type": "application/vnd.api+json"
2877
+ },
2878
+ "body": {
2879
+ "test_notifications": [
2880
+ {
2881
+ "summary": "testing"
2882
+ },
2883
+ {
2884
+ "summary": "more tests"
2885
+ }
2886
+ ]
2887
+ }
2888
+ },
2889
+ "response": {
2890
+ "status": 204,
2891
+ "body": ""
2892
+ }
2893
+ },
2894
+ {
2895
+ "description": "a POST request with two test notifications",
2896
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
2897
+ "request": {
2898
+ "method": "post",
2899
+ "path": "/test_notifications/entities/1234,5678",
2900
+ "headers": {
2901
+ "Content-Type": "application/vnd.api+json"
2902
+ },
2903
+ "body": {
2904
+ "test_notifications": [
2905
+ {
2906
+ "summary": "testing"
2907
+ },
2908
+ {
2909
+ "summary": "more tests"
2910
+ }
2911
+ ]
2912
+ }
2913
+ },
2914
+ "response": {
2915
+ "status": 204,
2916
+ "body": ""
2917
+ }
2918
+ },
2919
+ {
2920
+ "description": "a POST request with one test notification",
2921
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
2922
+ "request": {
2923
+ "method": "post",
2924
+ "path": "/test_notifications/entities/1234,5678",
2925
+ "headers": {
2926
+ "Content-Type": "application/vnd.api+json"
2927
+ },
2928
+ "body": {
2929
+ "test_notifications": [
2930
+ {
2931
+ "summary": "testing"
2932
+ }
2933
+ ]
2934
+ }
2935
+ },
2936
+ "response": {
2937
+ "status": 204,
2938
+ "body": ""
2939
+ }
2940
+ },
2941
+ {
2942
+ "description": "a POST request with one test notification",
2943
+ "provider_state": "a check 'www.example.com:SSH' exists",
2944
+ "request": {
2945
+ "method": "post",
2946
+ "path": "/test_notifications/checks/www.example.com:SSH",
2947
+ "headers": {
2948
+ "Content-Type": "application/vnd.api+json"
2949
+ },
2950
+ "body": {
2951
+ "test_notifications": [
2952
+ {
2953
+ "summary": "testing"
2954
+ }
2955
+ ]
2956
+ }
2957
+ },
2958
+ "response": {
2959
+ "status": 204,
2960
+ "body": ""
2961
+ }
2962
+ },
2963
+ {
2964
+ "description": "a POST request with one test notification",
2965
+ "provider_state": "no check exists",
2966
+ "request": {
2967
+ "method": "post",
2968
+ "path": "/test_notifications/checks/www.example.com:SSH",
2969
+ "headers": {
2970
+ "Content-Type": "application/vnd.api+json"
2971
+ },
2972
+ "body": {
2973
+ "test_notifications": [
2974
+ {
2975
+ "summary": "testing"
2976
+ }
2977
+ ]
2978
+ }
2979
+ },
2980
+ "response": {
2981
+ "status": 404,
2982
+ "body": {
2983
+ "errors": [
2984
+ "could not find entity 'www.example.com'"
2985
+ ]
2986
+ }
2987
+ }
2988
+ },
2989
+ {
2990
+ "description": "a POST request with two test notifications",
2991
+ "provider_state": "a check 'www.example.com:SSH' exists",
2992
+ "request": {
2993
+ "method": "post",
2994
+ "path": "/test_notifications/checks/www.example.com:SSH",
2995
+ "headers": {
2996
+ "Content-Type": "application/vnd.api+json"
2997
+ },
2998
+ "body": {
2999
+ "test_notifications": [
3000
+ {
3001
+ "summary": "testing"
3002
+ },
3003
+ {
3004
+ "summary": "more tests"
3005
+ }
3006
+ ]
3007
+ }
3008
+ },
3009
+ "response": {
3010
+ "status": 204,
3011
+ "body": ""
3012
+ }
3013
+ },
3014
+ {
3015
+ "description": "a POST request with two test notifications",
3016
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
3017
+ "request": {
3018
+ "method": "post",
3019
+ "path": "/test_notifications/checks/www.example.com:SSH,www2.example.com:PING",
3020
+ "headers": {
3021
+ "Content-Type": "application/vnd.api+json"
3022
+ },
3023
+ "body": {
3024
+ "test_notifications": [
3025
+ {
3026
+ "summary": "testing"
3027
+ },
3028
+ {
3029
+ "summary": "more tests"
3030
+ }
3031
+ ]
3032
+ }
3033
+ },
3034
+ "response": {
3035
+ "status": 204,
3036
+ "body": ""
3037
+ }
3038
+ },
3039
+ {
3040
+ "description": "a POST request with one test notification",
3041
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
3042
+ "request": {
3043
+ "method": "post",
3044
+ "path": "/test_notifications/checks/www.example.com:SSH,www2.example.com:PING",
3045
+ "headers": {
3046
+ "Content-Type": "application/vnd.api+json"
3047
+ },
3048
+ "body": {
3049
+ "test_notifications": [
3050
+ {
3051
+ "summary": "testing"
3052
+ }
3053
+ ]
3054
+ }
3055
+ },
3056
+ "response": {
3057
+ "status": 204,
3058
+ "body": ""
3059
+ }
3060
+ },
3061
+ {
3062
+ "description": "a POST request with one medium",
3063
+ "provider_state": "a contact with id 'abc' exists",
3064
+ "request": {
3065
+ "method": "post",
3066
+ "path": "/contacts/abc/media",
3067
+ "headers": {
3068
+ "Content-Type": "application/vnd.api+json"
3069
+ },
3070
+ "body": {
3071
+ "media": [
3072
+ {
3073
+ "type": "sms",
3074
+ "address": "0123456789",
3075
+ "interval": 300,
3076
+ "rollup_threshold": 5
3077
+ }
3078
+ ]
3079
+ }
3080
+ },
3081
+ "response": {
3082
+ "status": 201,
3083
+ "headers": {
3084
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3085
+ },
3086
+ "body": [
3087
+ "abc_sms"
3088
+ ]
3089
+ }
3090
+ },
3091
+ {
3092
+ "description": "a POST request with one medium",
3093
+ "provider_state": "no contact exists",
3094
+ "request": {
3095
+ "method": "post",
3096
+ "path": "/contacts/abc/media",
3097
+ "headers": {
3098
+ "Content-Type": "application/vnd.api+json"
3099
+ },
3100
+ "body": {
3101
+ "media": [
3102
+ {
3103
+ "type": "sms",
3104
+ "address": "0123456789",
3105
+ "interval": 300,
3106
+ "rollup_threshold": 5
3107
+ }
3108
+ ]
3109
+ }
3110
+ },
3111
+ "response": {
3112
+ "status": 422,
3113
+ "headers": {
3114
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3115
+ },
3116
+ "body": {
3117
+ "errors": [
3118
+ "Contact id: 'abc' could not be loaded"
3119
+ ]
3120
+ }
3121
+ }
3122
+ },
3123
+ {
3124
+ "description": "a POST request with two media",
3125
+ "provider_state": "a contact with id 'abc' exists",
3126
+ "request": {
3127
+ "method": "post",
3128
+ "path": "/contacts/abc/media",
3129
+ "headers": {
3130
+ "Content-Type": "application/vnd.api+json"
3131
+ },
3132
+ "body": {
3133
+ "media": [
3134
+ {
3135
+ "type": "sms",
3136
+ "address": "0123456789",
3137
+ "interval": 300,
3138
+ "rollup_threshold": 5
3139
+ },
3140
+ {
3141
+ "type": "email",
3142
+ "address": "ablated@example.org",
3143
+ "interval": 180,
3144
+ "rollup_threshold": 3
3145
+ }
3146
+ ]
3147
+ }
3148
+ },
3149
+ "response": {
3150
+ "status": 201,
3151
+ "headers": {
3152
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3153
+ },
3154
+ "body": [
3155
+ "abc_sms",
3156
+ "abc_email"
3157
+ ]
3158
+ }
3159
+ },
3160
+ {
3161
+ "description": "a PATCH request for email media",
3162
+ "provider_state": "a contact with id 'abc' has email and sms media",
3163
+ "request": {
3164
+ "method": "patch",
3165
+ "path": "/media/abc_email",
3166
+ "headers": {
3167
+ "Content-Type": "application/json-patch+json"
3168
+ },
3169
+ "body": [
3170
+ {
3171
+ "op": "replace",
3172
+ "path": "/media/0/interval",
3173
+ "value": 50
3174
+ },
3175
+ {
3176
+ "op": "replace",
3177
+ "path": "/media/0/rollup_threshold",
3178
+ "value": 3
3179
+ }
3180
+ ]
3181
+ },
3182
+ "response": {
3183
+ "status": 204,
3184
+ "body": ""
3185
+ }
3186
+ },
3187
+ {
3188
+ "description": "a PATCH request for email media",
3189
+ "provider_state": "no contact exists",
3190
+ "request": {
3191
+ "method": "patch",
3192
+ "path": "/media/abc_email",
3193
+ "headers": {
3194
+ "Content-Type": "application/json-patch+json"
3195
+ },
3196
+ "body": [
3197
+ {
3198
+ "op": "replace",
3199
+ "path": "/media/0/interval",
3200
+ "value": 50
3201
+ }
3202
+ ]
3203
+ },
3204
+ "response": {
3205
+ "status": 404,
3206
+ "headers": {
3207
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3208
+ },
3209
+ "body": {
3210
+ "errors": [
3211
+ "could not find contact 'abc'"
3212
+ ]
3213
+ }
3214
+ }
3215
+ },
3216
+ {
3217
+ "description": "a PATCH request for email and sms media",
3218
+ "provider_state": "a contact with id 'abc' has email and sms media",
3219
+ "request": {
3220
+ "method": "patch",
3221
+ "path": "/media/abc_email,abc_sms",
3222
+ "headers": {
3223
+ "Content-Type": "application/json-patch+json"
3224
+ },
3225
+ "body": [
3226
+ {
3227
+ "op": "replace",
3228
+ "path": "/media/0/interval",
3229
+ "value": 50
3230
+ },
3231
+ {
3232
+ "op": "replace",
3233
+ "path": "/media/0/rollup_threshold",
3234
+ "value": 3
3235
+ }
3236
+ ]
3237
+ },
3238
+ "response": {
3239
+ "status": 204,
3240
+ "body": ""
3241
+ }
3242
+ },
3243
+ {
3244
+ "description": "a DELETE request for one medium",
3245
+ "provider_state": "a contact with id 'abc' has email and sms media",
3246
+ "request": {
3247
+ "method": "delete",
3248
+ "path": "/media/abc_email",
3249
+ "body": null
3250
+ },
3251
+ "response": {
3252
+ "status": 204,
3253
+ "body": ""
3254
+ }
3255
+ },
3256
+ {
3257
+ "description": "a DELETE request for one medium",
3258
+ "provider_state": "no contact exists",
3259
+ "request": {
3260
+ "method": "delete",
3261
+ "path": "/media/abc_email",
3262
+ "body": null
3263
+ },
3264
+ "response": {
3265
+ "status": 404,
3266
+ "headers": {
3267
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3268
+ },
3269
+ "body": {
3270
+ "errors": [
3271
+ "could not find contact 'abc'"
3272
+ ]
3273
+ }
3274
+ }
3275
+ },
3276
+ {
3277
+ "description": "a DELETE request for two media",
3278
+ "provider_state": "a contact with id 'abc' has email and sms media",
3279
+ "request": {
3280
+ "method": "delete",
3281
+ "path": "/media/abc_email,abc_sms",
3282
+ "body": null
3283
+ },
3284
+ "response": {
3285
+ "status": 204,
3286
+ "body": ""
3287
+ }
3288
+ },
3289
+ {
3290
+ "description": "a GET request for all media",
3291
+ "provider_state": "a contact with id 'abc' has email and sms media",
3292
+ "request": {
3293
+ "method": "get",
3294
+ "path": "/media"
3295
+ },
3296
+ "response": {
3297
+ "status": 200,
3298
+ "headers": {
3299
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3300
+ },
3301
+ "body": {
3302
+ "media": [
3303
+ {
3304
+ "type": "email",
3305
+ "address": "ablated@example.org",
3306
+ "interval": 180,
3307
+ "rollup_threshold": 3,
3308
+ "links": {
3309
+ "contacts": [
3310
+ "abc"
3311
+ ]
3312
+ }
3313
+ },
3314
+ {
3315
+ "type": "sms",
3316
+ "address": "0123456789",
3317
+ "interval": 300,
3318
+ "rollup_threshold": 5,
3319
+ "links": {
3320
+ "contacts": [
3321
+ "abc"
3322
+ ]
3323
+ }
3324
+ }
3325
+ ]
3326
+ }
3327
+ }
3328
+ },
3329
+ {
3330
+ "description": "a GET request for email and sms media",
3331
+ "provider_state": "a contact with id 'abc' has email and sms media",
3332
+ "request": {
3333
+ "method": "get",
3334
+ "path": "/media/abc_email,abc_sms"
3335
+ },
3336
+ "response": {
3337
+ "status": 200,
3338
+ "headers": {
3339
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3340
+ },
3341
+ "body": {
3342
+ "media": [
3343
+ {
3344
+ "type": "email",
3345
+ "address": "ablated@example.org",
3346
+ "interval": 180,
3347
+ "rollup_threshold": 3,
3348
+ "links": {
3349
+ "contacts": [
3350
+ "abc"
3351
+ ]
3352
+ }
3353
+ },
3354
+ {
3355
+ "type": "sms",
3356
+ "address": "0123456789",
3357
+ "interval": 300,
3358
+ "rollup_threshold": 5,
3359
+ "links": {
3360
+ "contacts": [
3361
+ "abc"
3362
+ ]
3363
+ }
3364
+ }
3365
+ ]
3366
+ }
3367
+ }
3368
+ },
3369
+ {
3370
+ "description": "a GET request for sms media",
3371
+ "provider_state": "no contact exists",
3372
+ "request": {
3373
+ "method": "get",
3374
+ "path": "/media/abc_sms"
3375
+ },
3376
+ "response": {
3377
+ "status": 404,
3378
+ "headers": {
3379
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3380
+ },
3381
+ "body": {
3382
+ "errors": [
3383
+ "could not find contact 'abc'"
3384
+ ]
3385
+ }
3386
+ }
3387
+ },
3388
+ {
3389
+ "description": "a GET request for sms media",
3390
+ "provider_state": "a contact with id 'abc' has email and sms media",
3391
+ "request": {
3392
+ "method": "get",
3393
+ "path": "/media/abc_sms"
3394
+ },
3395
+ "response": {
3396
+ "status": 200,
3397
+ "headers": {
3398
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3399
+ },
3400
+ "body": {
3401
+ "media": [
3402
+ {
3403
+ "type": "sms",
3404
+ "address": "0123456789",
3405
+ "interval": 300,
3406
+ "rollup_threshold": 5,
3407
+ "links": {
3408
+ "contacts": [
3409
+ "abc"
3410
+ ]
3411
+ }
3412
+ }
3413
+ ]
3414
+ }
3415
+ }
3416
+ },
3417
+ {
3418
+ "description": "a POST request with one contact",
3419
+ "provider_state": "no contact exists",
3420
+ "request": {
3421
+ "method": "post",
3422
+ "path": "/contacts",
3423
+ "headers": {
3424
+ "Content-Type": "application/vnd.api+json"
3425
+ },
3426
+ "body": {
3427
+ "contacts": [
3428
+ {
3429
+ "id": "abc",
3430
+ "first_name": "Jim",
3431
+ "last_name": "Smith",
3432
+ "email": "jims@example.com",
3433
+ "timezone": "UTC"
3434
+ }
3435
+ ]
3436
+ }
3437
+ },
3438
+ "response": {
3439
+ "status": 201,
3440
+ "headers": {
3441
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3442
+ },
3443
+ "body": [
3444
+ "abc"
3445
+ ]
3446
+ }
3447
+ },
3448
+ {
3449
+ "description": "a POST request with one contact",
3450
+ "provider_state": "a contact with id 'abc' exists",
3451
+ "request": {
3452
+ "method": "post",
3453
+ "path": "/contacts",
3454
+ "headers": {
3455
+ "Content-Type": "application/vnd.api+json"
3456
+ },
3457
+ "body": {
3458
+ "contacts": [
3459
+ {
3460
+ "id": "abc",
3461
+ "first_name": "Jim",
3462
+ "last_name": "Smith",
3463
+ "email": "jims@example.com",
3464
+ "timezone": "UTC"
3465
+ }
3466
+ ]
3467
+ }
3468
+ },
3469
+ "response": {
3470
+ "status": 409,
3471
+ "headers": {
3472
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3473
+ },
3474
+ "body": {
3475
+ "errors": [
3476
+ "Contacts already exist with the following IDs: abc"
3477
+ ]
3478
+ }
3479
+ }
3480
+ },
3481
+ {
3482
+ "description": "a POST request with two contacts",
3483
+ "provider_state": "no contact exists",
3484
+ "request": {
3485
+ "method": "post",
3486
+ "path": "/contacts",
3487
+ "headers": {
3488
+ "Content-Type": "application/vnd.api+json"
3489
+ },
3490
+ "body": {
3491
+ "contacts": [
3492
+ {
3493
+ "id": "abc",
3494
+ "first_name": "Jim",
3495
+ "last_name": "Smith",
3496
+ "email": "jims@example.com",
3497
+ "timezone": "UTC"
3498
+ },
3499
+ {
3500
+ "id": "def",
3501
+ "first_name": "Joan",
3502
+ "last_name": "Smith",
3503
+ "email": "joans@example.com"
3504
+ }
3505
+ ]
3506
+ }
3507
+ },
3508
+ "response": {
3509
+ "status": 201,
3510
+ "headers": {
3511
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3512
+ },
3513
+ "body": [
3514
+ "abc",
3515
+ "def"
3516
+ ]
3517
+ }
3518
+ },
3519
+ {
3520
+ "description": "a PATCH request to change properties for a single contact",
3521
+ "provider_state": "a contact with id 'abc' exists",
3522
+ "request": {
3523
+ "method": "patch",
3524
+ "path": "/contacts/abc",
3525
+ "headers": {
3526
+ "Content-Type": "application/json-patch+json"
3527
+ },
3528
+ "body": [
3529
+ {
3530
+ "op": "replace",
3531
+ "path": "/contacts/0/timezone",
3532
+ "value": "UTC"
3533
+ }
3534
+ ]
3535
+ },
3536
+ "response": {
3537
+ "status": 204,
3538
+ "body": ""
3539
+ }
3540
+ },
3541
+ {
3542
+ "description": "a PATCH request to change properties for a single contact",
3543
+ "provider_state": "no contact exists",
3544
+ "request": {
3545
+ "method": "patch",
3546
+ "path": "/contacts/323",
3547
+ "headers": {
3548
+ "Content-Type": "application/json-patch+json"
3549
+ },
3550
+ "body": [
3551
+ {
3552
+ "op": "replace",
3553
+ "path": "/contacts/0/timezone",
3554
+ "value": "UTC"
3555
+ }
3556
+ ]
3557
+ },
3558
+ "response": {
3559
+ "status": 404,
3560
+ "headers": {
3561
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3562
+ },
3563
+ "body": {
3564
+ "errors": [
3565
+ "could not find contacts '323'"
3566
+ ]
3567
+ }
3568
+ }
3569
+ },
3570
+ {
3571
+ "description": "a PATCH requestto change a link for a single contact",
3572
+ "provider_state": "a contact with id '872' exists",
3573
+ "request": {
3574
+ "method": "patch",
3575
+ "path": "/contacts/872",
3576
+ "headers": {
3577
+ "Content-Type": "application/json-patch+json"
3578
+ },
3579
+ "body": [
3580
+ {
3581
+ "op": "add",
3582
+ "path": "/contacts/0/links/entities/-",
3583
+ "value": "1234"
3584
+ }
3585
+ ]
3586
+ },
3587
+ "response": {
3588
+ "status": 204,
3589
+ "body": ""
3590
+ }
3591
+ },
3592
+ {
3593
+ "description": "a PATCH request to change links for two contacts",
3594
+ "provider_state": "contacts with ids 'abc' and '872' exist",
3595
+ "request": {
3596
+ "method": "patch",
3597
+ "path": "/contacts/abc,872",
3598
+ "headers": {
3599
+ "Content-Type": "application/json-patch+json"
3600
+ },
3601
+ "body": [
3602
+ {
3603
+ "op": "add",
3604
+ "path": "/contacts/0/links/entities/-",
3605
+ "value": "1234"
3606
+ }
3607
+ ]
3608
+ },
3609
+ "response": {
3610
+ "status": 204,
3611
+ "body": ""
3612
+ }
3613
+ },
3614
+ {
3615
+ "description": "a PATCH request to change properties for two contacts",
3616
+ "provider_state": "contacts with ids 'abc' and '872' exist",
3617
+ "request": {
3618
+ "method": "patch",
3619
+ "path": "/contacts/abc,872",
3620
+ "headers": {
3621
+ "Content-Type": "application/json-patch+json"
3622
+ },
3623
+ "body": [
3624
+ {
3625
+ "op": "replace",
3626
+ "path": "/contacts/0/timezone",
3627
+ "value": "UTC"
3628
+ }
3629
+ ]
3630
+ },
3631
+ "response": {
3632
+ "status": 204,
3633
+ "body": ""
3634
+ }
3635
+ },
3636
+ {
3637
+ "description": "a DELETE request for a single contact",
3638
+ "provider_state": "a contact with id 'abc' exists",
3639
+ "request": {
3640
+ "method": "delete",
3641
+ "path": "/contacts/abc",
3642
+ "body": null
3643
+ },
3644
+ "response": {
3645
+ "status": 204,
3646
+ "body": ""
3647
+ }
3648
+ },
3649
+ {
3650
+ "description": "a DELETE request for a single contact",
3651
+ "provider_state": "no contact exists",
3652
+ "request": {
3653
+ "method": "delete",
3654
+ "path": "/contacts/abc",
3655
+ "body": null
3656
+ },
3657
+ "response": {
3658
+ "status": 404,
3659
+ "headers": {
3660
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3661
+ },
3662
+ "body": {
3663
+ "errors": [
3664
+ "could not find contacts 'abc'"
3665
+ ]
3666
+ }
3667
+ }
3668
+ },
3669
+ {
3670
+ "description": "a DELETE request for two contacts",
3671
+ "provider_state": "contacts with ids 'abc' and '872' exist",
3672
+ "request": {
3673
+ "method": "delete",
3674
+ "path": "/contacts/abc,872",
3675
+ "body": null
3676
+ },
3677
+ "response": {
3678
+ "status": 204,
3679
+ "body": ""
3680
+ }
3681
+ },
3682
+ {
3683
+ "description": "a GET request for all contacts",
3684
+ "provider_state": "a contact with id 'abc' exists",
3685
+ "request": {
3686
+ "method": "get",
3687
+ "path": "/contacts"
3688
+ },
3689
+ "response": {
3690
+ "status": 200,
3691
+ "headers": {
3692
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3693
+ },
3694
+ "body": {
3695
+ "contacts": [
3696
+ {
3697
+ "id": "abc",
3698
+ "first_name": "Jim",
3699
+ "last_name": "Smith",
3700
+ "email": "jims@example.com",
3701
+ "timezone": "UTC"
3702
+ }
3703
+ ]
3704
+ }
3705
+ }
3706
+ },
3707
+ {
3708
+ "description": "a GET request for all contacts",
3709
+ "provider_state": "no contact exists",
3710
+ "request": {
3711
+ "method": "get",
3712
+ "path": "/contacts"
3713
+ },
3714
+ "response": {
3715
+ "status": 200,
3716
+ "headers": {
3717
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3718
+ },
3719
+ "body": {
3720
+ "contacts": [
3721
+
3722
+ ]
3723
+ }
3724
+ }
3725
+ },
3726
+ {
3727
+ "description": "a GET request for a single contact",
3728
+ "provider_state": "a contact with id 'abc' exists",
3729
+ "request": {
3730
+ "method": "get",
3731
+ "path": "/contacts/abc"
3732
+ },
3733
+ "response": {
3734
+ "status": 200,
3735
+ "headers": {
3736
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3737
+ },
3738
+ "body": {
3739
+ "contacts": [
3740
+ {
3741
+ "id": "abc",
3742
+ "first_name": "Jim",
3743
+ "last_name": "Smith",
3744
+ "email": "jims@example.com",
3745
+ "timezone": "UTC"
3746
+ }
3747
+ ]
3748
+ }
3749
+ }
3750
+ },
3751
+ {
3752
+ "description": "a GET request for a single contact",
3753
+ "provider_state": "no contact exists",
3754
+ "request": {
3755
+ "method": "get",
3756
+ "path": "/contacts/abc"
3757
+ },
3758
+ "response": {
3759
+ "status": 404,
3760
+ "headers": {
3761
+ "Content-Type": "application/vnd.api+json; charset=utf-8"
3762
+ },
3763
+ "body": {
3764
+ "errors": [
3765
+ "could not find contacts 'abc'"
3766
+ ]
3767
+ }
3768
+ }
3769
+ },
3770
+ {
3771
+ "description": "a POST request with one scheduled maintenance period",
3772
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
3773
+ "request": {
3774
+ "method": "post",
3775
+ "path": "/scheduled_maintenances/entities/1234",
3776
+ "headers": {
3777
+ "Content-Type": "application/vnd.api+json"
3778
+ },
3779
+ "body": {
3780
+ "scheduled_maintenances": [
3781
+ {
3782
+ "start_time": "2014-10-23T09:42:14+10:30",
3783
+ "duration": 3600,
3784
+ "summary": "working"
3785
+ }
3786
+ ]
3787
+ }
3788
+ },
3789
+ "response": {
3790
+ "status": 204,
3791
+ "body": ""
3792
+ }
3793
+ },
3794
+ {
3795
+ "description": "a POST request with one scheduled maintenance period",
3796
+ "provider_state": "no entity exists",
3797
+ "request": {
3798
+ "method": "post",
3799
+ "path": "/scheduled_maintenances/entities/1234",
3800
+ "headers": {
3801
+ "Content-Type": "application/vnd.api+json"
3802
+ },
3803
+ "body": {
3804
+ "scheduled_maintenances": [
3805
+ {
3806
+ "start_time": "2014-10-23T09:42:14+10:30",
3807
+ "duration": 3600,
3808
+ "summary": "working"
3809
+ }
3810
+ ]
3811
+ }
3812
+ },
3813
+ "response": {
3814
+ "status": 404,
3815
+ "body": {
3816
+ "errors": [
3817
+ "could not find entity '1234'"
3818
+ ]
3819
+ }
3820
+ }
3821
+ },
3822
+ {
3823
+ "description": "a POST request with two scheduled maintenance periods",
3824
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
3825
+ "request": {
3826
+ "method": "post",
3827
+ "path": "/scheduled_maintenances/entities/1234",
3828
+ "headers": {
3829
+ "Content-Type": "application/vnd.api+json"
3830
+ },
3831
+ "body": {
3832
+ "scheduled_maintenances": [
3833
+ {
3834
+ "start_time": "2014-10-23T09:42:14+10:30",
3835
+ "duration": 3600,
3836
+ "summary": "working"
3837
+ },
3838
+ {
3839
+ "start_time": "2014-10-23T11:42:14+10:30",
3840
+ "duration": 3600,
3841
+ "summary": "more work"
3842
+ }
3843
+ ]
3844
+ }
3845
+ },
3846
+ "response": {
3847
+ "status": 204,
3848
+ "body": ""
3849
+ }
3850
+ },
3851
+ {
3852
+ "description": "a POST request with two scheduled maintenance periods",
3853
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
3854
+ "request": {
3855
+ "method": "post",
3856
+ "path": "/scheduled_maintenances/entities/1234,5678",
3857
+ "headers": {
3858
+ "Content-Type": "application/vnd.api+json"
3859
+ },
3860
+ "body": {
3861
+ "scheduled_maintenances": [
3862
+ {
3863
+ "start_time": "2014-10-23T09:42:14+10:30",
3864
+ "duration": 3600,
3865
+ "summary": "working"
3866
+ },
3867
+ {
3868
+ "start_time": "2014-10-23T11:42:14+10:30",
3869
+ "duration": 3600,
3870
+ "summary": "more work"
3871
+ }
3872
+ ]
3873
+ }
3874
+ },
3875
+ "response": {
3876
+ "status": 204,
3877
+ "body": ""
3878
+ }
3879
+ },
3880
+ {
3881
+ "description": "a POST request with one scheduled maintenance period",
3882
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
3883
+ "request": {
3884
+ "method": "post",
3885
+ "path": "/scheduled_maintenances/entities/1234,5678",
3886
+ "headers": {
3887
+ "Content-Type": "application/vnd.api+json"
3888
+ },
3889
+ "body": {
3890
+ "scheduled_maintenances": [
3891
+ {
3892
+ "start_time": "2014-10-23T09:42:14+10:30",
3893
+ "duration": 3600,
3894
+ "summary": "working"
3895
+ }
3896
+ ]
3897
+ }
3898
+ },
3899
+ "response": {
3900
+ "status": 204,
3901
+ "body": ""
3902
+ }
3903
+ },
3904
+ {
3905
+ "description": "a POST request with one unscheduled maintenance period",
3906
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
3907
+ "request": {
3908
+ "method": "post",
3909
+ "path": "/unscheduled_maintenances/entities/1234",
3910
+ "headers": {
3911
+ "Content-Type": "application/vnd.api+json"
3912
+ },
3913
+ "body": {
3914
+ "unscheduled_maintenances": [
3915
+ {
3916
+ "duration": 3600,
3917
+ "summary": "working"
3918
+ }
3919
+ ]
3920
+ }
3921
+ },
3922
+ "response": {
3923
+ "status": 204,
3924
+ "body": ""
3925
+ }
3926
+ },
3927
+ {
3928
+ "description": "a POST request with one unscheduled maintenance period",
3929
+ "provider_state": "no entity exists",
3930
+ "request": {
3931
+ "method": "post",
3932
+ "path": "/unscheduled_maintenances/entities/1234",
3933
+ "headers": {
3934
+ "Content-Type": "application/vnd.api+json"
3935
+ },
3936
+ "body": {
3937
+ "unscheduled_maintenances": [
3938
+ {
3939
+ "duration": 3600,
3940
+ "summary": "working"
3941
+ }
3942
+ ]
3943
+ }
3944
+ },
3945
+ "response": {
3946
+ "status": 404,
3947
+ "body": {
3948
+ "errors": [
3949
+ "could not find entity '1234'"
3950
+ ]
3951
+ }
3952
+ }
3953
+ },
3954
+ {
3955
+ "description": "a POST request with two unscheduled maintenance periods",
3956
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
3957
+ "request": {
3958
+ "method": "post",
3959
+ "path": "/unscheduled_maintenances/entities/1234",
3960
+ "headers": {
3961
+ "Content-Type": "application/vnd.api+json"
3962
+ },
3963
+ "body": {
3964
+ "unscheduled_maintenances": [
3965
+ {
3966
+ "duration": 3600,
3967
+ "summary": "working"
3968
+ },
3969
+ {
3970
+ "duration": 3600,
3971
+ "summary": "more work"
3972
+ }
3973
+ ]
3974
+ }
3975
+ },
3976
+ "response": {
3977
+ "status": 204,
3978
+ "body": ""
3979
+ }
3980
+ },
3981
+ {
3982
+ "description": "a POST request with two unscheduled maintenance periods",
3983
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
3984
+ "request": {
3985
+ "method": "post",
3986
+ "path": "/unscheduled_maintenances/entities/1234,5678",
3987
+ "headers": {
3988
+ "Content-Type": "application/vnd.api+json"
3989
+ },
3990
+ "body": {
3991
+ "unscheduled_maintenances": [
3992
+ {
3993
+ "duration": 3600,
3994
+ "summary": "working"
3995
+ },
3996
+ {
3997
+ "duration": 3600,
3998
+ "summary": "more work"
3999
+ }
4000
+ ]
4001
+ }
4002
+ },
4003
+ "response": {
4004
+ "status": 204,
4005
+ "body": ""
4006
+ }
4007
+ },
4008
+ {
4009
+ "description": "a POST request with one unscheduled maintenance period",
4010
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
4011
+ "request": {
4012
+ "method": "post",
4013
+ "path": "/unscheduled_maintenances/entities/1234,5678",
4014
+ "headers": {
4015
+ "Content-Type": "application/vnd.api+json"
4016
+ },
4017
+ "body": {
4018
+ "unscheduled_maintenances": [
4019
+ {
4020
+ "duration": 3600,
4021
+ "summary": "working"
4022
+ }
4023
+ ]
4024
+ }
4025
+ },
4026
+ "response": {
4027
+ "status": 204,
4028
+ "body": ""
4029
+ }
4030
+ },
4031
+ {
4032
+ "description": "a DELETE request for a scheduled maintenance period",
4033
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
4034
+ "request": {
4035
+ "method": "delete",
4036
+ "path": "/scheduled_maintenances/entities/1234",
4037
+ "query": "start_time=2014-10-23T09%3A42%3A14%2B10%3A30"
4038
+ },
4039
+ "response": {
4040
+ "status": 204,
4041
+ "body": ""
4042
+ }
4043
+ },
4044
+ {
4045
+ "description": "a DELETE request for a scheduled maintenance period",
4046
+ "provider_state": "no entity exists",
4047
+ "request": {
4048
+ "method": "delete",
4049
+ "path": "/scheduled_maintenances/entities/1234",
4050
+ "query": "start_time=2014-10-23T09%3A42%3A14%2B10%3A30"
4051
+ },
4052
+ "response": {
4053
+ "status": 404,
4054
+ "body": {
4055
+ "errors": [
4056
+ "could not find entity '1234'"
4057
+ ]
4058
+ }
4059
+ }
4060
+ },
4061
+ {
4062
+ "description": "a DELETE request for a scheduled maintenance period",
4063
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
4064
+ "request": {
4065
+ "method": "delete",
4066
+ "path": "/scheduled_maintenances/entities/1234,5678",
4067
+ "query": "start_time=2014-10-23T09%3A42%3A14%2B10%3A30"
4068
+ },
4069
+ "response": {
4070
+ "status": 204,
4071
+ "body": ""
4072
+ }
4073
+ },
4074
+ {
4075
+ "description": "a PATCH request for an unscheduled maintenance period",
4076
+ "provider_state": "an entity 'www.example.com' with id '1234' exists",
4077
+ "request": {
4078
+ "method": "patch",
4079
+ "path": "/unscheduled_maintenances/entities/1234",
4080
+ "headers": {
4081
+ "Content-Type": "application/json-patch+json"
4082
+ },
4083
+ "body": [
4084
+ {
4085
+ "op": "replace",
4086
+ "path": "/unscheduled_maintenances/0/end_time",
4087
+ "value": "2014-10-23T09:42:14+10:30"
4088
+ }
4089
+ ]
4090
+ },
4091
+ "response": {
4092
+ "status": 204,
4093
+ "body": ""
4094
+ }
4095
+ },
4096
+ {
4097
+ "description": "a PATCH request for an unscheduled maintenance period",
4098
+ "provider_state": "no entity exists",
4099
+ "request": {
4100
+ "method": "patch",
4101
+ "path": "/unscheduled_maintenances/entities/1234",
4102
+ "headers": {
4103
+ "Content-Type": "application/json-patch+json"
4104
+ },
4105
+ "body": [
4106
+ {
4107
+ "op": "replace",
4108
+ "path": "/unscheduled_maintenances/0/end_time",
4109
+ "value": "2014-10-23T09:42:15+10:30"
4110
+ }
4111
+ ]
4112
+ },
4113
+ "response": {
4114
+ "status": 404,
4115
+ "body": {
4116
+ "errors": [
4117
+ "could not find entity '1234'"
4118
+ ]
4119
+ }
4120
+ }
4121
+ },
4122
+ {
4123
+ "description": "a PATCH request for an unscheduled maintenance period",
4124
+ "provider_state": "entities 'www.example.com', id '1234' and 'www2.example.com', id '5678' exist",
4125
+ "request": {
4126
+ "method": "patch",
4127
+ "path": "/unscheduled_maintenances/entities/1234,5678",
4128
+ "headers": {
4129
+ "Content-Type": "application/json-patch+json"
4130
+ },
4131
+ "body": [
4132
+ {
4133
+ "op": "replace",
4134
+ "path": "/unscheduled_maintenances/0/end_time",
4135
+ "value": "2014-10-23T09:42:15+10:30"
4136
+ }
4137
+ ]
4138
+ },
4139
+ "response": {
4140
+ "status": 204,
4141
+ "body": ""
4142
+ }
4143
+ },
4144
+ {
4145
+ "description": "a POST request with one scheduled maintenance period",
4146
+ "provider_state": "a check 'www.example.com:SSH' exists",
4147
+ "request": {
4148
+ "method": "post",
4149
+ "path": "/scheduled_maintenances/checks/www.example.com:SSH",
4150
+ "headers": {
4151
+ "Content-Type": "application/vnd.api+json"
4152
+ },
4153
+ "body": {
4154
+ "scheduled_maintenances": [
4155
+ {
4156
+ "start_time": "2014-10-23T09:42:15+10:30",
4157
+ "duration": 3600,
4158
+ "summary": "working"
4159
+ }
4160
+ ]
4161
+ }
4162
+ },
4163
+ "response": {
4164
+ "status": 204,
4165
+ "body": ""
4166
+ }
4167
+ },
4168
+ {
4169
+ "description": "a POST request with one scheduled maintenance period",
4170
+ "provider_state": "no check exists",
4171
+ "request": {
4172
+ "method": "post",
4173
+ "path": "/scheduled_maintenances/checks/www.example.com:SSH",
4174
+ "headers": {
4175
+ "Content-Type": "application/vnd.api+json"
4176
+ },
4177
+ "body": {
4178
+ "scheduled_maintenances": [
4179
+ {
4180
+ "start_time": "2014-10-23T09:42:15+10:30",
4181
+ "duration": 3600,
4182
+ "summary": "working"
4183
+ }
4184
+ ]
4185
+ }
4186
+ },
4187
+ "response": {
4188
+ "status": 404,
4189
+ "body": {
4190
+ "errors": [
4191
+ "could not find entity 'www.example.com'"
4192
+ ]
4193
+ }
4194
+ }
4195
+ },
4196
+ {
4197
+ "description": "a POST request with two scheduled maintenance periods",
4198
+ "provider_state": "a check 'www.example.com:SSH' exists",
4199
+ "request": {
4200
+ "method": "post",
4201
+ "path": "/scheduled_maintenances/checks/www.example.com:SSH",
4202
+ "headers": {
4203
+ "Content-Type": "application/vnd.api+json"
4204
+ },
4205
+ "body": {
4206
+ "scheduled_maintenances": [
4207
+ {
4208
+ "start_time": "2014-10-23T09:42:15+10:30",
4209
+ "duration": 3600,
4210
+ "summary": "working"
4211
+ },
4212
+ {
4213
+ "start_time": "2014-10-23T11:42:15+10:30",
4214
+ "duration": 3600,
4215
+ "summary": "more work"
4216
+ }
4217
+ ]
4218
+ }
4219
+ },
4220
+ "response": {
4221
+ "status": 204,
4222
+ "body": ""
4223
+ }
4224
+ },
4225
+ {
4226
+ "description": "a POST request with two scheduled maintenance periods",
4227
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
4228
+ "request": {
4229
+ "method": "post",
4230
+ "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING",
4231
+ "headers": {
4232
+ "Content-Type": "application/vnd.api+json"
4233
+ },
4234
+ "body": {
4235
+ "scheduled_maintenances": [
4236
+ {
4237
+ "start_time": "2014-10-23T09:42:15+10:30",
4238
+ "duration": 3600,
4239
+ "summary": "working"
4240
+ },
4241
+ {
4242
+ "start_time": "2014-10-23T11:42:15+10:30",
4243
+ "duration": 3600,
4244
+ "summary": "more work"
4245
+ }
4246
+ ]
4247
+ }
4248
+ },
4249
+ "response": {
4250
+ "status": 204,
4251
+ "body": ""
4252
+ }
4253
+ },
4254
+ {
4255
+ "description": "a POST request with one scheduled maintenance period",
4256
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
4257
+ "request": {
4258
+ "method": "post",
4259
+ "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING",
4260
+ "headers": {
4261
+ "Content-Type": "application/vnd.api+json"
4262
+ },
4263
+ "body": {
4264
+ "scheduled_maintenances": [
4265
+ {
4266
+ "start_time": "2014-10-23T09:42:15+10:30",
4267
+ "duration": 3600,
4268
+ "summary": "working"
4269
+ }
4270
+ ]
4271
+ }
4272
+ },
4273
+ "response": {
4274
+ "status": 204,
4275
+ "body": ""
4276
+ }
4277
+ },
4278
+ {
4279
+ "description": "a POST request with one unscheduled maintenance period",
4280
+ "provider_state": "a check 'www.example.com:SSH' exists",
4281
+ "request": {
4282
+ "method": "post",
4283
+ "path": "/unscheduled_maintenances/checks/www.example.com:SSH",
4284
+ "headers": {
4285
+ "Content-Type": "application/vnd.api+json"
4286
+ },
4287
+ "body": {
4288
+ "unscheduled_maintenances": [
4289
+ {
4290
+ "duration": 3600,
4291
+ "summary": "working"
4292
+ }
4293
+ ]
4294
+ }
4295
+ },
4296
+ "response": {
4297
+ "status": 204,
4298
+ "body": ""
4299
+ }
4300
+ },
4301
+ {
4302
+ "description": "a POST request with one unscheduled maintenance period",
4303
+ "provider_state": "no check exists",
4304
+ "request": {
4305
+ "method": "post",
4306
+ "path": "/unscheduled_maintenances/checks/www.example.com:SSH",
4307
+ "headers": {
4308
+ "Content-Type": "application/vnd.api+json"
4309
+ },
4310
+ "body": {
4311
+ "unscheduled_maintenances": [
4312
+ {
4313
+ "duration": 3600,
4314
+ "summary": "working"
4315
+ }
4316
+ ]
4317
+ }
4318
+ },
4319
+ "response": {
4320
+ "status": 404,
4321
+ "body": {
4322
+ "errors": [
4323
+ "could not find entity 'www.example.com'"
4324
+ ]
4325
+ }
4326
+ }
4327
+ },
4328
+ {
4329
+ "description": "a POST request with two unscheduled maintenance periods",
4330
+ "provider_state": "a check 'www.example.com:SSH' exists",
4331
+ "request": {
4332
+ "method": "post",
4333
+ "path": "/unscheduled_maintenances/checks/www.example.com:SSH",
4334
+ "headers": {
4335
+ "Content-Type": "application/vnd.api+json"
4336
+ },
4337
+ "body": {
4338
+ "unscheduled_maintenances": [
4339
+ {
4340
+ "duration": 3600,
4341
+ "summary": "working"
4342
+ },
4343
+ {
4344
+ "duration": 3600,
4345
+ "summary": "more work"
4346
+ }
4347
+ ]
4348
+ }
4349
+ },
4350
+ "response": {
4351
+ "status": 204,
4352
+ "body": ""
4353
+ }
4354
+ },
4355
+ {
4356
+ "description": "a POST request with two unscheduled maintenance periods",
4357
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
4358
+ "request": {
4359
+ "method": "post",
4360
+ "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING",
4361
+ "headers": {
4362
+ "Content-Type": "application/vnd.api+json"
4363
+ },
4364
+ "body": {
4365
+ "unscheduled_maintenances": [
4366
+ {
4367
+ "duration": 3600,
4368
+ "summary": "working"
4369
+ },
4370
+ {
4371
+ "duration": 3600,
4372
+ "summary": "more work"
4373
+ }
4374
+ ]
4375
+ }
4376
+ },
4377
+ "response": {
4378
+ "status": 204,
4379
+ "body": ""
4380
+ }
4381
+ },
4382
+ {
4383
+ "description": "a POST request with one unscheduled maintenance period",
4384
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
4385
+ "request": {
4386
+ "method": "post",
4387
+ "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING",
4388
+ "headers": {
4389
+ "Content-Type": "application/vnd.api+json"
4390
+ },
4391
+ "body": {
4392
+ "unscheduled_maintenances": [
4393
+ {
4394
+ "duration": 3600,
4395
+ "summary": "working"
4396
+ }
4397
+ ]
4398
+ }
4399
+ },
4400
+ "response": {
4401
+ "status": 204,
4402
+ "body": ""
4403
+ }
4404
+ },
4405
+ {
4406
+ "description": "a DELETE request for a scheduled maintenance period",
4407
+ "provider_state": "a check 'www.example.com:SSH' exists",
4408
+ "request": {
4409
+ "method": "delete",
4410
+ "path": "/scheduled_maintenances/checks/www.example.com:SSH",
4411
+ "query": "start_time=2014-10-23T09%3A42%3A15%2B10%3A30"
4412
+ },
4413
+ "response": {
4414
+ "status": 204,
4415
+ "body": ""
4416
+ }
4417
+ },
4418
+ {
4419
+ "description": "a DELETE request for a scheduled maintenance period",
4420
+ "provider_state": "no check exists",
4421
+ "request": {
4422
+ "method": "delete",
4423
+ "path": "/scheduled_maintenances/checks/www.example.com:SSH",
4424
+ "query": "start_time=2014-10-23T09%3A42%3A15%2B10%3A30"
4425
+ },
4426
+ "response": {
4427
+ "status": 404,
4428
+ "body": {
4429
+ "errors": [
4430
+ "could not find entity 'www.example.com'"
4431
+ ]
4432
+ }
4433
+ }
4434
+ },
4435
+ {
4436
+ "description": "a DELETE request for a scheduled maintenance period",
4437
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
4438
+ "request": {
4439
+ "method": "delete",
4440
+ "path": "/scheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING",
4441
+ "query": "start_time=2014-10-23T09%3A42%3A15%2B10%3A30"
4442
+ },
4443
+ "response": {
4444
+ "status": 204,
4445
+ "body": ""
4446
+ }
4447
+ },
4448
+ {
4449
+ "description": "a PATCH request for an unscheduled maintenance period",
4450
+ "provider_state": "a check 'www.example.com:SSH' exists",
4451
+ "request": {
4452
+ "method": "patch",
4453
+ "path": "/unscheduled_maintenances/checks/www.example.com:SSH",
4454
+ "headers": {
4455
+ "Content-Type": "application/json-patch+json"
4456
+ },
4457
+ "body": [
4458
+ {
4459
+ "op": "replace",
4460
+ "path": "/unscheduled_maintenances/0/end_time",
4461
+ "value": "2014-10-23T09:42:15+10:30"
4462
+ }
4463
+ ]
4464
+ },
4465
+ "response": {
4466
+ "status": 204,
4467
+ "body": ""
4468
+ }
4469
+ },
4470
+ {
4471
+ "description": "a PATCH request for an unscheduled maintenance period",
4472
+ "provider_state": "no check exists",
4473
+ "request": {
4474
+ "method": "patch",
4475
+ "path": "/unscheduled_maintenances/checks/www.example.com:SSH",
4476
+ "headers": {
4477
+ "Content-Type": "application/json-patch+json"
4478
+ },
4479
+ "body": [
4480
+ {
4481
+ "op": "replace",
4482
+ "path": "/unscheduled_maintenances/0/end_time",
4483
+ "value": "2014-10-23T09:42:15+10:30"
4484
+ }
4485
+ ]
4486
+ },
4487
+ "response": {
4488
+ "status": 404,
4489
+ "body": {
4490
+ "errors": [
4491
+ "could not find entity 'www.example.com'"
4492
+ ]
4493
+ }
4494
+ }
4495
+ },
4496
+ {
4497
+ "description": "a PATCH request for an unscheduled maintenance period",
4498
+ "provider_state": "checks 'www.example.com:SSH' and 'www2.example.com:PING' exist",
4499
+ "request": {
4500
+ "method": "patch",
4501
+ "path": "/unscheduled_maintenances/checks/www.example.com:SSH,www2.example.com:PING",
4502
+ "headers": {
4503
+ "Content-Type": "application/json-patch+json"
4504
+ },
4505
+ "body": [
4506
+ {
4507
+ "op": "replace",
4508
+ "path": "/unscheduled_maintenances/0/end_time",
4509
+ "value": "2014-10-23T09:42:15+10:30"
4510
+ }
4511
+ ]
4512
+ },
4513
+ "response": {
4514
+ "status": 204,
4515
+ "body": ""
4516
+ }
4517
+ }
4518
+ ],
4519
+ "metadata": {
4520
+ "pactSpecificationVersion": "1.0.0"
4521
+ }
4522
+ }