-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.raml
1977 lines (1930 loc) · 73.8 KB
/
core.raml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#%RAML 1.0
title: Hund API
version: v1
baseUri: https://{domain}/api/v1
baseUriParameters:
domain:
description: |
The domain of the status page or global dashboard to access the API from.
By default this uses the generic `api.hund.io` domain, which requires the
use of the `Hund-Context` header to set the context of the API request.
Without this header, the global context is assumed.
default: api.hund.io
description: !include /documentation/topLevel.md
uses:
core: /libraries/core.raml
specs: /libraries/specs.raml
group: /libraries/group.raml
component: /libraries/component.raml
component-expansionary: /libraries/component/expansionary.raml
event: /libraries/event.raml
issue: /libraries/issue.raml
issue_template: /libraries/issue_template.raml
invitation: /libraries/invitation.raml
metric_provider: /libraries/metric_provider.raml
metric_definition: /libraries/metric_definition.raml
notifier: /libraries/notifier.raml
reason-expansionary: /libraries/reason/expansionary.raml
request_log: /libraries/request_log.raml
role: /libraries/role.raml
semantic: /libraries/semantic.raml
service: /libraries/service.raml
status: /libraries/status.raml
subscription: /libraries/subscription.raml
timeline: /libraries/timeline.raml
update: /libraries/update.raml
update-expansionary: /libraries/update/expansionary.raml
user: /libraries/user.raml
watchdog: /libraries/watchdog.raml
securedBy: [basic, bearer]
securitySchemes:
basic:
description: |
This API supports HTTP Basic Authentication, with the API key given as the
username. No password should be given.
type: Basic Authentication
bearer:
description: |
The API supports token authentication via the `Authorization: Bearer` header.
type: Pass Through
describedBy:
headers:
Authorization:
type: string
pattern: ^Bearer [A-Za-z0-9_]+$
(core.logo):
url: https://d3sn9fxf3jyih3.cloudfront.net/misc/logo-dark.svg
altText: Hund
href: https://hund.io/help
(core.tags):
- name: component
x-displayName: Components
- name: watchdog
x-displayName: Watchdogs
- name: semantic
x-displayName: Semantics
- name: status
x-displayName: Statuses
- name: reason
x-displayName: Reasons
- name: metric_provider
x-displayName: MetricProviders
- name: metric_definition
x-displayName: MetricDefinitions
- name: group
x-displayName: Groups
- name: issue
x-displayName: Issues
- name: update
x-displayName: Issue Updates
- name: issue_template
x-displayName: IssueTemplates
- name: notifier
x-displayName: Notifiers
- name: subscription
x-displayName: Subscriptions
- name: event
description: |
Events are immutable objects representing various things that have happened
on your status page, such as Issue creation/update/resolution, new Watchdog
Statuses, object lifecycles, and more.
x-displayName: Events
- name: timeline
description: |
The Timeline is a global/Component-wise history of Issues and Statuses
across your Status Page. Any Timeline is a PagedArray of TimelineItems in
reverse-chronological order (i.e. descending). A TimelineItem can
represent either a Status or Issue, or the interactions between them.
A Timeline can be pulled from this API for the entire Status Page (the
default behavior), or one or more Components (or Group of Components).
For more information on the mechanics of the Timeline, please read [this
knowledgebase article](https://hund.io/help/documentation/the-timeline).
x-displayName: Timeline
- name: user
x-displayName: Users
- name: role
x-displayName: Roles
- name: invitation
x-displayName: Invitations
- name: request_log
x-displayName: RequestLogs
(core.tagGroups):
- name: Monitoring
tags: [component, group, metric_provider, metric_definition, watchdog, status, reason, semantic]
- name: Incident Reporting
tags: [issue, update, issue_template]
- name: Communication
tags: [notifier, subscription]
- name: History
tags: [event, timeline]
- name: Administration
tags: [user, role, invitation, request_log]
/:
get:
displayName: Get HAL Directory
description: |
Returns the HAL directory for the entire API. This root endpoint can be used
to discover the rest of the top-level collection API endpoints within a HAL client.
responses:
200:
description: |
Successfully retrieved directory.
body:
application/hal+json:
type: core.HAL/Linkable
properties:
_links:
properties:
self: core.HAL/Link
components: core.HAL/Link
groups: core.HAL/Link
metric_providers: core.HAL/Link
metric_definitions: core.HAL/Link
issues: core.HAL/Link
issue_templates: core.HAL/Link
notifiers: core.HAL/Link
subscriptions: core.HAL/Link
events: core.HAL/Link
statuses: core.HAL/Link
reasons: core.HAL/Link
semantics: core.HAL/Link
timeline: core.HAL/Link
users: core.HAL/Link
roles: core.HAL/Link
invitations: core.HAL/Link
request_logs: core.HAL/Link
watchdogs: core.HAL/Link
/components:
(core.tags): [component]
type:
core.collection:
itemType: component-expansionary.Component-Expansionary
postParamsType: component.Component/Form/Create
getResponseExample: !include /examples/components/collection.json
postRequestExample: !include /examples/components/collection/postRequest.json
postResponseExample: !include /examples/components/collection/postResponse.json
postErrorExample: !include /examples/components/error/validation.json
errorNotAuthorizedExample: !include /examples/components/error/notAuthorized.json
get:
queryParameters:
group?:
description: |
Return the Components for the provided Group ObjectId.
type: core.ObjectId
issue?:
description: |
Return the Components for the provided Issue ObjectId.
type: core.ObjectId
event?:
description: |
Return the Components of the provided Event's `context.component_ids`.
type: core.ObjectId
timeline_item?:
description: |
Return the Components for the provided TimelineItem UUID.
type: core.UUID
post:
responses:
201:
(specs.exhaustiveRequestBodies):
source: watchdog.service
factory: watchdog
mergePath: watchdog
/{component_id}:
(core.tags): [component]
type:
core.collection-item:
idPrefix: component
itemType: component-expansionary.Component-Expansionary
putParamsType: component.Component/Form/Update
getResponseExample: !include /examples/components/collection-item.json
putRequestExample: !include /examples/components/collection-item/putRequest.json
putResponseExample: !include /examples/components/collection-item/putResponse.json
errorNotFoundExample: !include /examples/components/error/notFound.json
errorNotAuthorizedExample: !include /examples/components/error/notAuthorized.json
putErrorExample: !include /examples/components/error/validation.json
put:
responses:
400:
(specs.requestBody): '{ "name": "" }'
delete:
/watchdogs:
(core.tags): [watchdog]
type:
core.read-collection:
getResponseExample: !include /examples/watchdogs/collection.json
itemType: watchdog.Watchdog
get:
queryParameters:
service.type?:
description: |
Return Watchdogs of the given `service.type`.
**Note:** This field is ignored when `service.method` is given.
type: string
service.method?:
description: |
Return Native Monitoring Watchdogs of the given `service.method`. If
this parameter is given, `service.type` is ignored, and assumed to be
`native`.
type: string
high_frequency?:
description: |
When true, returns Watchdogs where `high_frequency` is true. When false,
returns Watchdogs where `high_frequency` is false.
type: boolean
/preview:
(core.tags): [watchdog]
type:
core.collection-preview:
itemName: watchdog
itemType: watchdog.Watchdog
postParamsType: watchdog.Watchdog/Form/BaseCreate
postRequestExample: !include /examples/watchdogs/collection/postRequest.json
postResponseExample: !include /examples/watchdogs/collection/postResponse.json
postErrorExample: !include /examples/watchdogs/error/validation.json
errorNotAuthorizedExample: !include /examples/watchdogs/error/notAuthorized.json
/service_options:
(core.tags): [watchdog]
is:
- core.not-authorized-failable:
permissionLevel: write
errorNotAuthorizedExample: !include /examples/watchdogs/error/notAuthorized.json
- core.bad-request-failable:
description: Service type does not support option enumeration.
errorBadRequestExample: !include /examples/watchdogs/error/serviceOptionsUnsupported.json
- core.not-found-failable:
errorNotFoundExample: !include /examples/watchdogs/error/notFound.json
post:
displayName: Enumerate Watchdog Service Options
description: |
For supported Watchdog service types, returns a service-specific document
enumerating the options available for the service, with respect to the
given service credentials.
Service credentials can either be provided directly to this endpoint, or
the credentials of an existing Watchdog can be used, by providing the
respective ID.
queryParameters:
watchdog?:
description: |
When given, uses the credentials of this Watchdog to perform service
option enumeration, if supported.
type: core.ObjectId
type?:
description: |
Selects the Watchdog service type to perform service option enumeration.
If this field is given, then you should also pass appropriate service
credentials.
**Note:** this field is ignored when `watchdog` is given.
type: string
enum: [pingdom, pagerduty, updown]
body:
application/json:
type: service.Form/Services/Options
examples:
"POST /watchdogs/service_options": !include /examples/watchdogs/collection/service_options/postRequest.json
responses:
200:
(specs.requestBody): "{}"
(specs.exhaustiveRequestBodies):
source: "."
factory: service
vcr: [pingdom, pagerduty, updown]
excludeBaseCase: true
description: |
Successfully enumerated Watchdog service options.
body:
application/hal+json:
examples:
"POST /watchdogs/service_options (200)": !include /examples/watchdogs/collection/service_options/postResponse.json
type: service.Services/Options
400:
(specs.requestBody): '{ "type": "manual" }'
403:
description: |
Not authorized to write Watchdogs.
404:
(specs.requestBody): '{ "watchdog": "nonexistent" }'
description: |
Watchdog not found.
/{watchdog_id}:
(core.tags): [watchdog]
type:
core.collection-item:
idPrefix: watchdog
itemType: watchdog.Watchdog
putParamsType: watchdog.Watchdog/Form/Update
getResponseExample: !include /examples/watchdogs/collection-item.json
putRequestExample: !include /examples/watchdogs/collection-item/putRequest.json
putResponseExample: !include /examples/watchdogs/collection-item/putResponse.json
errorNotFoundExample: !include /examples/watchdogs/error/notFound.json
errorNotAuthorizedExample: !include /examples/watchdogs/error/notAuthorized.json
putErrorExample: !include /examples/watchdogs/error/validation.json
get:
is:
- core.not-authorized-failable:
permissionLevel: read
errorNotAuthorizedExample: !include /examples/watchdogs/error/notAuthorized.json
responses:
403:
(specs.bindIds):
watchdog: auto
put:
responses:
400:
(specs.requestBody): '{ "service": { "state": nil } }'
/convert:
(core.tags): [watchdog]
type:
core.action:
displayName: Convert a Watchdog's Service Type
description: |
Convert the service type of a watchdog to another service type. This
operation does not affect the component, nor the watchdog's statuses nor
metrics (unless specified). Useful for switching status providers in a
single low-friction request.
idPrefix: watchdog
itemType: watchdog.Watchdog
paramsType: watchdog.Watchdog/Form/Convert
successDescription: |
Successfully converted watchdog service.
notFoundDescription: |
Watchdog not found.
requestExample: !include /examples/watchdogs/convert/putRequest.json
responseExample: !include /examples/watchdogs/convert/putResponse.json
errorNotFoundExample: !include /examples/watchdogs/error/notFound.json
errorNotAuthorizedExample: !include /examples/watchdogs/error/notAuthorized.json
put:
is:
- core.validation-failable:
errorExample: !include /examples/watchdogs/error/validation.json
responses:
200:
(specs.requestBody): '{ "service": { "type": "manual", "state": 1 } }'
400:
(specs.bindIds):
watchdog: auto
(specs.requestBody): '{ "service": { "type": "manual", "state": nil } }'
description: |
Failed to convert Watchdog service.
403:
description: |
Not authorized to write Watchdogs.
/semantics:
(core.tags): [semantic]
type:
core.collection:
itemType: semantic.Semantic
postParamsType: semantic.Semantic/Form/Create
getResponseExample: !include /examples/semantics/collection.json
postRequestExample: !include /examples/semantics/collection/postRequest.json
postResponseExample: !include /examples/semantics/collection/postResponse.json
postErrorExample: !include /examples/semantics/error/validation.json
errorNotAuthorizedExample: !include /examples/semantics/error/notAuthorized.json
/{semantic_id}:
(core.tags): [semantic]
type:
core.collection-item:
idPrefix: semantic
itemType: semantic.Semantic
putParamsType: semantic.Semantic/Form/Update
getResponseExample: !include /examples/semantics/collection-item.json
putRequestExample: !include /examples/semantics/collection-item/putRequest.json
putResponseExample: !include /examples/semantics/collection-item/putResponse.json
errorNotFoundExample: !include /examples/semantics/error/notFound.json
errorNotAuthorizedExample: !include /examples/semantics/error/notAuthorized.json
putErrorExample: !include /examples/semantics/error/validation.json
put:
responses:
400:
(specs.requestBody): '{ "color": "invalid" }'
delete:
/statuses:
(core.tags): [status]
(specs.factoryStrategy): create
type:
core.read-collection:
getResponseExample: !include /examples/statuses/collection.json
itemType: status.Status
get:
queryParameters:
watchdog?:
description: |
Return the Statuses for the provided Watchdog ObjectId.
type: core.ObjectId
timeline_item?:
description: |
Return the Statuses for the provided TimelineItem UUID.
type: core.UUID
/{status_id}:
(core.tags): [status]
(specs.factoryStrategy): create
type:
core.read-collection-item:
errorNotFoundExample: !include /examples/statuses/error/notFound.json
getResponseExample: !include /examples/statuses/collection-item.json
idPrefix: status
itemType: status.Status
/correct:
(core.tags): [status]
(specs.factoryStrategy): create
type:
core.action:
displayName: Correct a Status
description: |
Revises the state of the given sub-operational Status. Often helpful
for marking previous downtime streaks as Operational again, in case
the automated downtime should be considered incorrect.
A sub-operational Status can be changed to any given state. If the
Status borders another Status object with the same state, it will be
merged accordingly. This operation *will* mutate at least one Status,
if not the given one. This operation *may* result in the deletion of
one or more Status objects (including the given one), depending on
the state of bordering Status objects.
idPrefix: status
itemType: status.Status
paramsType: status.Status/Form/Correct
successDescription: |
Successfully corrected Status.
notFoundDescription: |
Status not found.
requestExample: !include /examples/statuses/collection-item/correct/request.json
responseExample: !include /examples/statuses/collection-item/correct/response.json
errorNotFoundExample: !include /examples/statuses/error/notFound.json
errorNotAuthorizedExample: !include /examples/statuses/error/notAuthorized.json
put:
is:
- core.bad-request-failable:
description: |
Status is not sub-operational.
errorBadRequestExample: !include /examples/statuses/error/notSubOperational.json
responses:
200:
(specs.bindIds):
status: auto:outage:ended
(specs.requestBody): '{ state: 1 }'
400:
(specs.bindIds):
status: auto:operational
(specs.requestBody): '{ state: 0 }'
403:
description: |
Not authorized to write Statuses.
/reasons:
(core.tags): [reason]
(specs.factoryStrategy): create
type:
core.read-collection:
getResponseExample: !include /examples/reasons/collection.json
itemType: reason-expansionary.Reason-Expansionary
get:
is:
- core.not-authorized-failable:
permissionLevel: read
errorNotAuthorizedExample: !include /examples/reasons/error/notAuthorized.json
queryParameters:
fingerprint?:
description: |
Return Reasons whose `fingerprint` matches the given one.
type: string
subject?:
description: |
Return Reasons whose `subject` matches the given one.
type: string
description?:
description: |
Return Reasons whose `description` matches the given one.
type: string
status?:
description: |
Return the Reasons for the provided Status ObjectId.
type: core.ObjectId
watchdog?:
description: |
Return the Reasons for the provided Watchdog ObjectId.
type: core.ObjectId
region?:
description: |
Return Reasons whose `region` matches the given one.
type: string
/{reason_id}:
(core.tags): [reason]
(specs.factoryStrategy): create
type:
core.read-collection-item:
errorNotFoundExample: !include /examples/reasons/error/notFound.json
getResponseExample: !include /examples/reasons/collection-item.json
idPrefix: reason
itemType: reason-expansionary.Reason-Expansionary
get:
is:
- core.not-authorized-failable:
permissionLevel: read
errorNotAuthorizedExample: !include /examples/reasons/error/notAuthorized.json
responses:
403:
(specs.bindIds):
reason: auto
/groups:
(core.tags): [group]
type:
core.collection:
itemType: group.Group
postParamsType: group.Group/Form/Create
getResponseExample: !include /examples/groups/collection.json
postRequestExample: !include /examples/groups/collection/postRequest.json
postResponseExample: !include /examples/groups/collection/postResponse.json
postErrorExample: !include /examples/groups/error/validation.json
errorNotAuthorizedExample: !include /examples/groups/error/notAuthorized.json
/{group_id}:
(core.tags): [group]
type:
core.collection-item:
idPrefix: group
itemType: group.Group
putParamsType: group.Group/Form/Update
getResponseExample: !include /examples/groups/collection-item.json
putRequestExample: !include /examples/groups/collection-item/putRequest.json
putResponseExample: !include /examples/groups/collection-item/putResponse.json
errorNotFoundExample: !include /examples/groups/error/notFound.json
errorNotAuthorizedExample: !include /examples/groups/error/notAuthorized.json
putErrorExample: !include /examples/groups/error/validation.json
put:
responses:
400:
(specs.requestBody): '{ "name": "" }'
delete:
is:
- core.bad-request-failable:
description: |
Group is not empty.
errorBadRequestExample: !include /examples/groups/error/nonempty.json
responses:
400:
(specs.bindIds):
group: auto:nonempty
/reorder:
(core.tags): [group]
type:
core.action:
displayName: Reorder a Group's Components
description: |
Reorder the components of the given group by listing the complete
new ordering of component ObjectIds. The listing must not remove nor
add components.
idPrefix: group
itemType: group.Group
paramsType: core.ObjectId[]
successDescription: |
Successfully reordered group components.
notFoundDescription: |
Group not found.
requestExample: !include /examples/groups/collection-item/reorder/putRequest.json
responseExample: !include /examples/groups/collection-item/reorder/putResponse.json
errorNotFoundExample: !include /examples/groups/error/notFound.json
errorNotAuthorizedExample: !include /examples/groups/error/notAuthorized.json
put:
is:
- core.bad-request-failable:
description: |
Incomplete listing of group components given.
errorBadRequestExample: !include /examples/groups/error/incompleteComponentListing.json
responses:
200:
(specs.bindIds):
group: auto:nonempty
(specs.requestBody): 'State::Group.find(group_id).component_ids.map(&:to_s).shuffle'
400:
(specs.bindIds):
group: auto:nonempty
(specs.requestBody): '["5e16ee938fbb652ab878cacc", "5e16ee938fbb652ab878caee"]'
403:
description: |
Not authorized to write Groups.
/metric_providers:
(core.tags): [metric_provider]
type:
core.collection:
itemType: metric_provider.MetricProvider
postParamsType: metric_provider.MetricProvider/Form/Create
getResponseExample: !include /examples/metric_providers/collection.json
postRequestExample: !include /examples/metric_providers/collection/postRequest.json
postResponseExample: !include /examples/metric_providers/collection/postResponse.json
postErrorExample: !include /examples/metric_providers/error/postValidation.json
errorNotAuthorizedExample: !include /examples/metric_providers/error/notAuthorized.json
get:
is:
- core.not-authorized-failable:
permissionLevel: read
errorNotAuthorizedExample: !include /examples/metric_providers/error/notAuthorized.json
queryParameters:
watchdog?:
description: |
ObjectId for a particular Watchdog to retrieve MetricProviders on.
type: core.ObjectId
default?:
description: |
When true, returns only MetricProviders for which `default` is true (i.e.
returns MetricProviders that are considered the "default" for their
respective Watchdogs).
When used in conjunction with the `watchdog` parameter, returns the
*single* default MetricProvider of that Watchdog, if it exists.
type: boolean
default: false
responses:
200:
(specs.createModels):
metric_provider:
count: 3
traits: builtin
post:
is:
- core.not-found-failable:
errorNotFoundExample: !include /examples/metric_providers/error/watchdogNotFound.json
responses:
201:
(specs.requestBody): auto:metric_provider:builtin
(specs.exhaustiveRequestBodies):
source: service
factory: metric_provider
400:
(specs.bindIds):
watchdog: auto
(specs.requestBody): '{ watchdog: watchdog_id }'
404:
(specs.requestBody): '{ service: { type: "builtin" }, watchdog: "nonexistent" }'
description: |
Watchdog not found.
/{metric_provider_id}:
(core.tags): [metric_provider]
type:
core.collection-item:
idPrefix: metric_provider
itemType: metric_provider.MetricProvider
putParamsType: metric_provider.MetricProvider/Form/Update
getResponseExample: !include /examples/metric_providers/collection-item.json
putRequestExample: !include /examples/metric_providers/collection-item/putRequest.json
putResponseExample: !include /examples/metric_providers/collection-item/putResponse.json
errorNotFoundExample: !include /examples/metric_providers/error/notFound.json
errorNotAuthorizedExample: !include /examples/metric_providers/error/notAuthorized.json
putErrorExample: !include /examples/metric_providers/error/putValidation.json
get:
is:
- core.not-authorized-failable:
permissionLevel: read
errorNotAuthorizedExample: !include /examples/metric_providers/error/notAuthorized.json
responses:
200:
(specs.bindIds):
metric_provider: auto:builtin
403:
(specs.bindIds):
metric_provider: auto
put:
responses:
200:
(specs.bindIds):
metric_provider: auto:builtin
(specs.requestBody): '{ instances: [{ id: State::MetricProvider.find(metric_provider_id).metric_instances.first.id.to_s, enabled: false }] }'
400:
(specs.requestBody): '{ instances: [{ definition_slug: "unprovided" }] }'
delete:
is:
- core.bad-request-failable:
description: |
Cannot delete a Watchdog's default MetricProvider.
errorBadRequestExample: !include /examples/metric_providers/error/defaultForWatchdog.json
responses:
400:
(specs.bindIds):
metric_provider: auto:webhook:default
/metric_definitions:
(core.tags): [metric_definition]
(specs.factoryStrategy): create
type:
core.read-collection:
itemType: metric_definition.MetricDefinition
getResponseExample: !include /examples/metric_definitions/collection.json
get:
is:
- core.not-authorized-failable:
permissionLevel: read
errorNotAuthorizedExample: !include /examples/metric_definitions/error/notAuthorized.json
/{metric_definition_id}:
(core.tags): [metric_definition]
(specs.factoryStrategy): create
type:
core.read-collection-item:
errorNotFoundExample: !include /examples/metric_definitions/error/notFound.json
getResponseExample: !include /examples/metric_definitions/collection-item.json
idPrefix: metric_definition
itemType: metric_definition.MetricDefinition
get:
is:
- core.not-authorized-failable:
permissionLevel: read
errorNotAuthorizedExample: !include /examples/metric_definitions/error/notAuthorized.json
responses:
403:
(specs.bindIds):
metric_definition: auto
/issues:
(core.tags): [issue]
type:
core.collection:
itemType: issue.Issue
postParamsType: issue.Issue/Form/Create
getResponseExample: !include /examples/issues/collection.json
postRequestExample: !include /examples/issues/collection/postRequest.json
postResponseExample: !include /examples/issues/collection/postResponse.json
postErrorExample: !include /examples/issues/error/validation.json
errorNotAuthorizedExample: !include /examples/issues/error/notAuthorized.json
get:
queryParameters:
components[]?:
description: |
One or more Components to return Issues for. To use this query parameter,
supply `components[]={component_id}` for each `{component_id}` you are
requesting Issues for.
type: core.ObjectId[]
component?:
description: |
A single Component to return Issues for. This field is ignored if
`components[]` is supplied.
type: core.ObjectId
standing?:
description: |
When true, returns only ongoing Issues.
type: boolean
default: false
upcoming?:
description: |
When true, returns only upcoming scheduled Issues.
type: boolean
default: false
resolved?:
description: |
When true, returns only resolved Issues.
type: boolean
default: false
post:
responses:
201:
(specs.exhaustiveRequestBodies):
source: template
factory: issue_with_template
/preview:
(core.tags): [issue]
type:
core.collection-preview:
itemName: issue
itemType: issue.Issue
postParamsType: issue.Issue/Form/Create
postRequestExample: !include /examples/issues/collection/postRequest.json
postResponseExample: !include /examples/issues/collection/postResponse.json
postErrorExample: !include /examples/issues/error/validation.json
errorNotAuthorizedExample: !include /examples/issues/error/notAuthorized.json
/{issue_id}:
(core.tags): [issue]
type:
core.collection-item:
idPrefix: issue
itemType: issue.Issue
putParamsType: issue.Issue/Form/Update
getResponseExample: !include /examples/issues/collection-item.json
putRequestExample: !include /examples/issues/collection-item/putRequest.json
putResponseExample: !include /examples/issues/collection-item/putResponse.json
errorNotFoundExample: !include /examples/issues/error/notFound.json
putErrorExample: !include /examples/issues/error/validation.json
errorNotAuthorizedExample: !include /examples/issues/error/notAuthorized.json
put:
displayName: Revise an Issue
description: |
Revise an Issue by ObjectId.
**Note:** this endpoint does not create Issue Updates, but merely revises
the properties of the original Issue.
responses:
400:
(specs.requestBody): '{ body: "" }'
delete:
/cancel:
(core.tags): [issue]
type:
core.action:
displayName: Cancel a Scheduled Issue
description: |
Cancel a scheduled issue, before or after it starts. Scheduled issues
that have already ended cannot be cancelled.
idPrefix: issue
itemType: issue.Issue
paramsType: issue.Issue/Form/Cancel
successDescription: |
Successfully cancelled issue.
notFoundDescription: |
Issue not found.
requestExample: !include /examples/issues/collection-item/cancel/request.json
responseExample: !include /examples/issues/collection-item/cancel/response.json
errorNotFoundExample: !include /examples/issues/error/notFound.json
errorNotAuthorizedExample: !include /examples/issues/error/notAuthorized.json
put:
is:
- core.bad-request-failable:
description: |
Invalid update body or unscheduled issue.
errorBadRequestExample: !include /examples/issues/error/unscheduledIssue.json
responses:
200:
(specs.bindIds):
issue: auto:scheduled
(specs.requestBody): '{ body: "cancellation body" }'
400:
(specs.bindIds):
issue: auto
(specs.requestBody): '{}'
403:
description: |
Not authorized to write Issues.
/updates:
(core.tags): [update]
(specs.bindIds):
issue: auto
is:
- core.not-found-failable:
errorNotFoundExample: !include /examples/issues/error/notFound.json
uriParameters:
issue_id:
description: |
The ObjectId of the of the Issue.
type: core.ObjectId
type:
core.collection:
itemType: update-expansionary.Update-Expansionary
postParamsType: update.Update/Form/Create
getResponseExample: !include /examples/updates/collection.json
postRequestExample: !include /examples/updates/collection/postRequest.json
postResponseExample: !include /examples/updates/collection/postResponse.json
postErrorExample: !include /examples/updates/error/validation.json
errorNotAuthorizedExample: !include /examples/updates/error/notAuthorized.json
get:
responses:
200:
(specs.createModels):
update:
options:
issue: "State::Issue.find(issue_id)"
404:
(specs.bindIds):
issue: nonexistent
description: |
Issue not found.
post:
responses:
201:
(specs.exhaustiveRequestBodies):
source: template
factory: update_with_template
404:
(specs.bindIds):
issue: nonexistent
(specs.requestBody): '{}'
description: |
Issue not found.
/preview:
(core.tags): [update]
(specs.bindIds):
issue: auto
is:
- core.not-found-failable:
errorNotFoundExample: !include /examples/issues/error/notFound.json
type:
core.collection-preview:
itemName: update
itemType: update-expansionary.Update-Expansionary
postParamsType: update.Update/Form/Create
postRequestExample: !include /examples/updates/collection/postRequest.json
postResponseExample: !include /examples/updates/collection/postResponse.json
postErrorExample: !include /examples/updates/error/validation.json
errorNotAuthorizedExample: !include /examples/updates/error/notAuthorized.json
post:
responses:
404:
(specs.bindIds):
issue: nonexistent
(specs.requestBody): '{}'
description: |
Issue not found.
/{update_id}:
(core.tags): [update]
(specs.bindIds):
issue: '#{State::Issue.where("updates._id": BSON::ObjectId(update_id)).first.id}'
uriParameters:
issue_id:
description: |
The ObjectId of the of the Issue that this Update pertains to.
type: core.ObjectId
type:
core.collection-item:
idPrefix: update
itemType: update-expansionary.Update-Expansionary
putParamsType: update.Update/Form/Update
getResponseExample: !include /examples/updates/collection-item.json
putRequestExample: !include /examples/updates/collection-item/putRequest.json
putResponseExample: !include /examples/updates/collection-item/putResponse.json
errorNotFoundExample: !include /examples/updates/error/notFound.json
errorNotAuthorizedExample: !include /examples/updates/error/notAuthorized.json
putErrorExample: !include /examples/updates/error/validation.json
get:
responses:
404:
(specs.bindIds):
issue: auto
put:
displayName: Revise an Update
description: |
Revise an Update by ObjectId.
responses:
200:
description: |
Successfully revised Update.
400:
(specs.requestBody): '{ body: "" }'
description: |
Failed to revise Update.
404:
(specs.bindIds):
issue: auto
delete:
responses:
404:
(specs.bindIds):
issue: auto
/issue_templates:
(core.tags): [issue_template]
(specs.factoryName): issue_template_v2
type:
core.collection:
itemType: issue_template.IssueTemplate
postParamsType: issue_template.IssueTemplate/Form/Create
getResponseExample: !include /examples/issue_templates/collection.json
postRequestExample: !include /examples/issue_templates/collection/postRequest.json
postResponseExample: !include /examples/issue_templates/collection/postResponse.json
postErrorExample: !include /examples/issue_templates/error/validation.json
errorNotAuthorizedExample: !include /examples/issue_templates/error/notAuthorized.json
get:
is:
- core.not-authorized-failable: