/
ep_checks.go
1053 lines (916 loc) · 50.2 KB
/
ep_checks.go
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
package upapi
import (
"context"
"fmt"
"net/http"
"time"
"github.com/shopspring/decimal"
)
type CheckSSLCertConfig struct {
Protocol string `json:"ssl_cert_protocol,omitempty" flag:"sslcert.protocol"`
CRL bool `json:"ssl_cert_crl" flag:"sslcert.crl"`
FirstElementOnly bool `json:"ssl_cert_first_element_only" flag:"sslcert.first-element-only"`
Match string `json:"ssl_cert_match,omitempty" flag:"sslcert.match"`
Issuer string `json:"ssl_cert_issuer,omitempty" flag:"sslcert.issuer"`
MinVersion string `json:"ssl_cert_minimum_ssl_tls_version,omitempty" flag:"sslcert.min-version"`
Fingerprint string `json:"ssl_cert_fingerprint,omitempty" flag:"sslcert.fingerprint"`
SelfSigned bool `json:"ssl_cert_selfsigned,omitempty" flag:"sslcert.self-signed"`
URL string `json:"ssl_cert_file,omitempty" flag:"sslcert.url"`
}
type CheckPageSpeedConfig struct {
EmulatedDevice string `json:"emulated_device,omitempty"`
ConnectionThrottling string `json:"connection_throttling,omitempty"`
ExcludeURLs string `json:"exclude_urls,omitempty"`
UptimeGradeThreshold string `json:"uptime_grade_threshold,omitempty"`
}
type CheckGroupConfig struct {
CheckServices []string `json:"group_check_services,omitempty"`
CheckTags []string `json:"group_check_tags,omitempty"`
CheckDownCondition string `json:"group_check_down_condition,omitempty"`
UptimePercentCalculation string `json:"group_uptime_percent_calculation,omitempty"`
ResponseTimeCalculationMode string `json:"group_response_time_calculation_mode,omitempty"`
ResponseTimeCheckType string `json:"group_response_time_check_type,omitempty"`
ResponseTimeSingleCheck string `json:"group_response_time_single_check,omitempty"`
}
// Check represents a check in Uptime.com.
type Check struct {
PK int64 `json:"pk,omitempty"`
URL string `json:"url,omitempty"`
StatsURL string `json:"stats_url,omitempty"`
AlertsURL string `json:"alerts_url,omitempty"`
Name string `json:"name,omitempty"`
CachedResponseTime float64 `json:"cached_response_time,omitempty"`
ContactGroups []string `json:"contact_groups"`
CreatedAt time.Time `json:"created_at,omitempty"`
ModifiedAt time.Time `json:"modified_at,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
CheckType string `json:"check_type,omitempty"`
Escalations string `json:"-,omitempty"` // TODO
Maintenance string `json:"-,omitempty"` // TODO
MonitoringServiceType string `json:"monitoring_service_type,omitempty"`
IsPaused bool `json:"is_paused,omitempty"`
IsUnderMaintenance bool `json:"is_under_maintenance,omitempty"`
StateIsUp bool `json:"state_is_up,omitempty"`
StateChangedAt time.Time `json:"state_changed_at,omitempty"`
HeartbeatURL string `json:"heartbeat_url,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
Protocol string `json:"msp_protocol,omitempty"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
Username string `json:"msp_username,omitempty"`
Password string `json:"msp_password,omitempty"`
Proxy string `json:"msp_proxy,omitempty"`
DNSServer string `json:"msp_dns_server,omitempty"`
DNSRecordType string `json:"msp_dns_record_type,omitempty"`
StatusCode string `json:"msp_status_code,omitempty"`
SendString string `json:"msp_send_string,omitempty"`
ExpectString string `json:"msp_expect_string,omitempty"`
ExpectStringType string `json:"msp_expect_string_type,omitempty"`
Encryption string `json:"msp_encryption,omitempty"`
Threshold int64 `json:"msp_threshold,omitempty"`
Headers string `json:"msp_headers,omitempty"`
Script string `json:"msp_script,omitempty"`
Version int64 `json:"msp_version,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIPVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics,omitempty"`
SSLConfig *CheckSSLCertConfig `json:"sslconfig,omitempty"`
PageSpeedConfig *CheckPageSpeedConfig `json:"pagespeedconfig,omitempty"`
GroupConfig *CheckGroupConfig `json:"groupcheckconfig,omitempty"`
}
func (c Check) PrimaryKey() PrimaryKey {
return PrimaryKey(c.PK)
}
type CheckGetResponse Check
func (c CheckGetResponse) Item() Check {
return Check(c)
}
type CheckListResponse struct {
Count int64 `json:"count,omitempty"`
Results []Check `json:"results,omitempty"`
}
func (r CheckListResponse) List() []Check {
return r.Results
}
// CheckListOptions specifies the optional parameters to the CheckService.List method.
type CheckListOptions struct {
Page int64 `url:"page,omitempty"`
PageSize int64 `url:"page_size,omitempty"`
Search string `url:"search,omitempty"`
Ordering string `url:"ordering,omitempty"`
MonitoringServiceType string `url:"monitoring_service_type,omitempty"`
IsPaused bool `url:"is_paused"`
StateIsUp bool `url:"state_is_up,omitempty"`
Tag []string `url:"tag,omitempty"`
}
type CheckCreateUpdateResponse struct {
Messages map[string]interface{} `json:"messages,omitempty"`
Results Check `json:"results,omitempty"`
}
func (r CheckCreateUpdateResponse) Item() Check {
return r.Results
}
// CheckStatsOptions specifies the parameters to /api/v1/checks/{pk}/stats/ endpoint
type CheckStatsOptions struct {
StartDate string `url:"start_date,omitempty"`
EndDate string `url:"end_date,omitempty"`
Location string `url:"location,omitempty"`
LocationsResponseTimes bool `url:"locations_response_times,omitempty"`
IncludeAlerts bool `url:"include_alerts,omitempty"`
Download bool `url:"download,omitempty"`
PDF bool `url:"pdf,omitempty"`
}
// CheckStatsResponse represents the API response to a Stats query
type CheckStatsResponse struct {
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
Totals struct {
Outages int64 `json:"outages,omitempty"`
DowntimeSecs int64 `json:"downtime_secs,omitempty"`
} `json:"totals"`
Statistics []CheckStats `json:"statistics"`
}
func (c CheckStatsResponse) List() []CheckStats {
return c.Statistics
}
type CheckStats struct {
Date string `json:"date"`
Outages int64 `json:"outages"`
DowntimeSecs int64 `json:"downtime_secs"`
Uptime *float64 `json:"uptime,omitempty"`
ResponseTime *float64 `json:"response_time,omitempty"`
ResponseTimeDatapoints [][]any `json:"response_time_datapoints,omitempty"`
}
type ChecksEndpoint interface {
List(context.Context, CheckListOptions) ([]Check, error)
Get(context.Context, PrimaryKeyable) (*Check, error)
Delete(context.Context, PrimaryKeyable) error
Stats(context.Context, PrimaryKeyable, CheckStatsOptions) ([]CheckStats, error)
CreateAPI(context.Context, CheckAPI) (*Check, error)
UpdateAPI(context.Context, PrimaryKeyable, CheckAPI) (*Check, error)
CreateBlacklist(context.Context, CheckBlacklist) (*Check, error)
UpdateBlacklist(context.Context, PrimaryKeyable, CheckBlacklist) (*Check, error)
CreateDNS(context.Context, CheckDNS) (*Check, error)
UpdateDNS(context.Context, PrimaryKeyable, CheckDNS) (*Check, error)
CreateGroup(context.Context, CheckGroup) (*Check, error)
UpdateGroup(context.Context, PrimaryKeyable, CheckGroup) (*Check, error)
CreateHeartbeat(context.Context, CheckHeartbeat) (*Check, error)
UpdateHeartbeat(context.Context, PrimaryKeyable, CheckHeartbeat) (*Check, error)
CreateHTTP(context.Context, CheckHTTP) (*Check, error)
UpdateHTTP(context.Context, PrimaryKeyable, CheckHTTP) (*Check, error)
CreateICMP(context.Context, CheckICMP) (*Check, error)
UpdateICMP(context.Context, PrimaryKeyable, CheckICMP) (*Check, error)
CreateIMAP(context.Context, CheckIMAP) (*Check, error)
UpdateIMAP(context.Context, PrimaryKeyable, CheckIMAP) (*Check, error)
CreateMalware(context.Context, CheckMalware) (*Check, error)
UpdateMalware(context.Context, PrimaryKeyable, CheckMalware) (*Check, error)
CreateNTP(context.Context, CheckNTP) (*Check, error)
UpdateNTP(context.Context, PrimaryKeyable, CheckNTP) (*Check, error)
CreatePOP(context.Context, CheckPOP) (*Check, error)
UpdatePOP(context.Context, PrimaryKeyable, CheckPOP) (*Check, error)
CreateRUM(context.Context, CheckRUM) (*Check, error)
UpdateRUM(context.Context, PrimaryKeyable, CheckRUM) (*Check, error)
CreateRUM2(context.Context, CheckRUM2) (*Check, error)
UpdateRUM2(context.Context, PrimaryKeyable, CheckRUM2) (*Check, error)
CreateSMTP(context.Context, CheckSMTP) (*Check, error)
UpdateSMTP(context.Context, PrimaryKeyable, CheckSMTP) (*Check, error)
CreateSSH(context.Context, CheckSSH) (*Check, error)
UpdateSSH(context.Context, PrimaryKeyable, CheckSSH) (*Check, error)
CreateSSLCert(context.Context, CheckSSLCert) (*Check, error)
UpdateSSLCert(context.Context, PrimaryKeyable, CheckSSLCert) (*Check, error)
CreateTCP(context.Context, CheckTCP) (*Check, error)
UpdateTCP(context.Context, PrimaryKeyable, CheckTCP) (*Check, error)
CreateTransaction(context.Context, CheckTransaction) (*Check, error)
UpdateTransaction(context.Context, PrimaryKeyable, CheckTransaction) (*Check, error)
CreateUDP(context.Context, CheckUDP) (*Check, error)
UpdateUDP(context.Context, PrimaryKeyable, CheckUDP) (*Check, error)
CreateWebhook(context.Context, CheckWebhook) (*Check, error)
UpdateWebhook(context.Context, PrimaryKeyable, CheckWebhook) (*Check, error)
CreateWHOIS(context.Context, CheckWHOIS) (*Check, error)
UpdateWHOIS(context.Context, PrimaryKeyable, CheckWHOIS) (*Check, error)
CreatePageSpeed(context.Context, CheckPageSpeed) (*Check, error)
UpdatePageSpeed(context.Context, PrimaryKeyable, CheckPageSpeed) (*Check, error)
}
func NewChecksEndpoint(cbd CBD) ChecksEndpoint {
endpoint := "checks"
return &checksEndpointImpl{
checksEndpointAPIImpl: checksEndpointAPIImpl{
EndpointCreator: NewEndpointCreator[CheckAPI, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-api"),
EndpointUpdater: NewEndpointUpdater[CheckAPI, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointBlacklistImpl: checksEndpointBlacklistImpl{
EndpointCreator: NewEndpointCreator[CheckBlacklist, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-blacklist"),
EndpointUpdater: NewEndpointUpdater[CheckBlacklist, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointDNSImpl: checksEndpointDNSImpl{
EndpointCreator: NewEndpointCreator[CheckDNS, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-dns"),
EndpointUpdater: NewEndpointUpdater[CheckDNS, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointGroupImpl: checksEndpointGroupImpl{
EndpointCreator: NewEndpointCreator[CheckGroup, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-group"),
EndpointUpdater: NewEndpointUpdater[CheckGroup, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointHeartbeatImpl: checksEndpointHeartbeatImpl{
EndpointCreator: NewEndpointCreator[CheckHeartbeat, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-heartbeat"),
EndpointUpdater: NewEndpointUpdater[CheckHeartbeat, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointHTTPImpl: checksEndpointHTTPImpl{
EndpointCreator: NewEndpointCreator[CheckHTTP, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-http"),
EndpointUpdater: NewEndpointUpdater[CheckHTTP, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointICMPImpl: checksEndpointICMPImpl{
EndpointCreator: NewEndpointCreator[CheckICMP, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-icmp"),
EndpointUpdater: NewEndpointUpdater[CheckICMP, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointIMAPImpl: checksEndpointIMAPImpl{
EndpointCreator: NewEndpointCreator[CheckIMAP, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-imap"),
EndpointUpdater: NewEndpointUpdater[CheckIMAP, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointMalwareImpl: checksEndpointMalwareImpl{
EndpointCreator: NewEndpointCreator[CheckMalware, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-malware"),
EndpointUpdater: NewEndpointUpdater[CheckMalware, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointNTPImpl: checksEndpointNTPImpl{
EndpointCreator: NewEndpointCreator[CheckNTP, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-ntp"),
EndpointUpdater: NewEndpointUpdater[CheckNTP, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointPOPImpl: checksEndpointPOPImpl{
EndpointCreator: NewEndpointCreator[CheckPOP, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-pop"),
EndpointUpdater: NewEndpointUpdater[CheckPOP, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointRUMImpl: checksEndpointRUMImpl{
EndpointCreator: NewEndpointCreator[CheckRUM, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-rum"),
EndpointUpdater: NewEndpointUpdater[CheckRUM, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointRUM2Impl: checksEndpointRUM2Impl{
EndpointCreator: NewEndpointCreator[CheckRUM2, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-rum2"),
EndpointUpdater: NewEndpointUpdater[CheckRUM2, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointSMTPImpl: checksEndpointSMTPImpl{
EndpointCreator: NewEndpointCreator[CheckSMTP, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-smtp"),
EndpointUpdater: NewEndpointUpdater[CheckSMTP, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointSSHImpl: checksEndpointSSHImpl{
EndpointCreator: NewEndpointCreator[CheckSSH, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-ssh"),
EndpointUpdater: NewEndpointUpdater[CheckSSH, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointSSLCertImpl: checksEndpointSSLCertImpl{
EndpointCreator: NewEndpointCreator[CheckSSLCert, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-ssl-cert"),
EndpointUpdater: NewEndpointUpdater[CheckSSLCert, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointTCPImpl: checksEndpointTCPImpl{
EndpointCreator: NewEndpointCreator[CheckTCP, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-tcp"),
EndpointUpdater: NewEndpointUpdater[CheckTCP, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointTransactionImpl: checksEndpointTransactionImpl{
EndpointCreator: NewEndpointCreator[CheckTransaction, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-transaction"),
EndpointUpdater: NewEndpointUpdater[CheckTransaction, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointUDPImpl: checksEndpointUDPImpl{
EndpointCreator: NewEndpointCreator[CheckUDP, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-udp"),
EndpointUpdater: NewEndpointUpdater[CheckUDP, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointWebhookImpl: checksEndpointWebhookImpl{
EndpointCreator: NewEndpointCreator[CheckWebhook, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-webhook"),
EndpointUpdater: NewEndpointUpdater[CheckWebhook, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksEndpointWHOISImpl: checksEndpointWHOISImpl{
EndpointCreator: NewEndpointCreator[CheckWHOIS, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-whois"),
EndpointUpdater: NewEndpointUpdater[CheckWHOIS, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
checksStatsEndpointImpl: checksStatsEndpointImpl{
endpoint: NewEndpointLister[CheckStatsResponse, CheckStats, CheckStatsOptions](&checksStatsEndpointCBD{cbd}, endpoint+"/%d/stats"),
},
checksEndpointPageSpeedImpl: checksEndpointPageSpeedImpl{
EndpointCreator: NewEndpointCreator[CheckPageSpeed, CheckCreateUpdateResponse, Check](cbd, endpoint+"/add-pagespeed"),
EndpointUpdater: NewEndpointUpdater[CheckPageSpeed, CheckCreateUpdateResponse, Check](cbd, endpoint),
},
EndpointLister: NewEndpointLister[CheckListResponse, Check, CheckListOptions](cbd, endpoint),
EndpointGetter: NewEndpointGetter[CheckGetResponse, Check](cbd, endpoint),
EndpointDeleter: NewEndpointDeleter(cbd, endpoint),
}
}
type checksEndpointImpl struct {
checksEndpointAPIImpl
checksEndpointBlacklistImpl
checksEndpointDNSImpl
checksEndpointGroupImpl
checksEndpointHeartbeatImpl
checksEndpointHTTPImpl
checksEndpointICMPImpl
checksEndpointIMAPImpl
checksEndpointMalwareImpl
checksEndpointNTPImpl
checksEndpointPOPImpl
checksEndpointRUMImpl
checksEndpointRUM2Impl
checksEndpointSMTPImpl
checksEndpointSSHImpl
checksEndpointSSLCertImpl
checksEndpointTCPImpl
checksEndpointTransactionImpl
checksEndpointUDPImpl
checksEndpointWebhookImpl
checksEndpointWHOISImpl
checksStatsEndpointImpl
checksEndpointPageSpeedImpl
EndpointLister[CheckListResponse, Check, CheckListOptions]
EndpointGetter[CheckCreateUpdateResponse, Check]
EndpointUpdater[Check, CheckCreateUpdateResponse, Check]
EndpointDeleter
}
type checksStatsCtxKey struct{}
type checksStatsEndpointImpl struct {
endpoint EndpointLister[CheckStatsResponse, CheckStats, CheckStatsOptions]
}
func (c *checksEndpointImpl) Stats(ctx context.Context, pk PrimaryKeyable, opts CheckStatsOptions) ([]CheckStats, error) {
ctx = context.WithValue(ctx, checksStatsCtxKey{}, pk)
return c.endpoint.List(ctx, opts)
}
type checksStatsEndpointCBD struct {
CBD
}
func (c checksStatsEndpointCBD) BuildRequest(ctx context.Context, method string, endpoint string, args any, data any) (*http.Request, error) {
pk := ctx.Value(checksStatsCtxKey{}).(PrimaryKey)
endpoint = fmt.Sprintf(endpoint, pk.PrimaryKey())
return c.CBD.BuildRequest(ctx, method, endpoint, args, data)
}
type CheckAPI struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Threshold int64 `json:"msp_threshold,omitempty"`
Script string `json:"msp_script,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIPVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointAPIImpl struct {
EndpointCreator[CheckAPI, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckAPI, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointAPIImpl) CreateAPI(ctx context.Context, check CheckAPI) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointAPIImpl) UpdateAPI(ctx context.Context, pk PrimaryKeyable, check CheckAPI) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckBlacklist struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Address string `json:"msp_address"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
}
type checksEndpointBlacklistImpl struct {
EndpointCreator[CheckBlacklist, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckBlacklist, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointBlacklistImpl) CreateBlacklist(ctx context.Context, check CheckBlacklist) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointBlacklistImpl) UpdateBlacklist(ctx context.Context, pk PrimaryKeyable, check CheckBlacklist) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckDNS struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
DNSServer string `json:"msp_dns_server,omitempty"`
DNSRecordType string `json:"msp_dns_record_type,omitempty"`
ExpectString string `json:"msp_expect_string,omitempty"`
Threshold int64 `json:"msp_threshold,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointDNSImpl struct {
EndpointCreator[CheckDNS, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckDNS, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointDNSImpl) CreateDNS(ctx context.Context, check CheckDNS) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointDNSImpl) UpdateDNS(ctx context.Context, pk PrimaryKeyable, check CheckDNS) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckGroup struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
Config CheckGroupConfig `json:"groupcheckconfig,omitempty"`
}
type checksEndpointGroupImpl struct {
EndpointCreator[CheckGroup, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckGroup, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointGroupImpl) CreateGroup(ctx context.Context, check CheckGroup) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointGroupImpl) UpdateGroup(ctx context.Context, pk PrimaryKeyable, check CheckGroup) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckHeartbeat struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
HeartbeatURL string `json:"heartbeat_url,omitempty"`
}
type checksEndpointHeartbeatImpl struct {
EndpointCreator[CheckHeartbeat, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckHeartbeat, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointHeartbeatImpl) CreateHeartbeat(ctx context.Context, check CheckHeartbeat) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointHeartbeatImpl) UpdateHeartbeat(ctx context.Context, pk PrimaryKeyable, check CheckHeartbeat) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckHTTP struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
Username string `json:"msp_username,omitempty"`
Password string `json:"msp_password,omitempty"`
Proxy string `json:"msp_proxy,omitempty"`
StatusCode string `json:"msp_status_code,omitempty"`
SendString string `json:"msp_send_string,omitempty"`
ExpectString string `json:"msp_expect_string,omitempty"`
ExpectStringType string `json:"msp_expect_string_type,omitempty"`
Encryption string `json:"msp_encryption,omitempty"`
Threshold int64 `json:"msp_threshold,omitempty"`
Headers string `json:"msp_headers,omitempty"`
Version int64 `json:"msp_version,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIPVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointHTTPImpl struct {
EndpointCreator[CheckHTTP, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckHTTP, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointHTTPImpl) CreateHTTP(ctx context.Context, check CheckHTTP) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointHTTPImpl) UpdateHTTP(ctx context.Context, pk PrimaryKeyable, check CheckHTTP) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckICMP struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIPVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointICMPImpl struct {
EndpointCreator[CheckICMP, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckICMP, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointICMPImpl) CreateICMP(ctx context.Context, check CheckICMP) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointICMPImpl) UpdateICMP(ctx context.Context, pk PrimaryKeyable, check CheckICMP) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckIMAP struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
ExpectString string `json:"msp_expect_string,omitempty"`
Encryption string `json:"msp_encryption,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIPVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointIMAPImpl struct {
EndpointCreator[CheckIMAP, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckIMAP, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointIMAPImpl) CreateIMAP(ctx context.Context, check CheckIMAP) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointIMAPImpl) UpdateIMAP(ctx context.Context, pk PrimaryKeyable, check CheckIMAP) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckMalware struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Address string `json:"msp_address"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
}
type checksEndpointMalwareImpl struct {
EndpointCreator[CheckMalware, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckMalware, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointMalwareImpl) CreateMalware(ctx context.Context, check CheckMalware) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointMalwareImpl) UpdateMalware(ctx context.Context, pk PrimaryKeyable, check CheckMalware) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckNTP struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
Threshold int64 `json:"msp_threshold,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIPVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointNTPImpl struct {
EndpointCreator[CheckNTP, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckNTP, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointNTPImpl) CreateNTP(ctx context.Context, check CheckNTP) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointNTPImpl) UpdateNTP(ctx context.Context, pk PrimaryKeyable, check CheckNTP) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckPOP struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
ExpectString string `json:"msp_expect_string,omitempty"`
Encryption string `json:"msp_encryption,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIPVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointPOPImpl struct {
EndpointCreator[CheckPOP, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckPOP, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointPOPImpl) CreatePOP(ctx context.Context, check CheckPOP) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointPOPImpl) UpdatePOP(ctx context.Context, pk PrimaryKeyable, check CheckPOP) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckRUM struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Address string `json:"msp_address"`
Threshold int64 `json:"msp_threshold,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointRUMImpl struct {
EndpointCreator[CheckRUM, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckRUM, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointRUMImpl) CreateRUM(ctx context.Context, check CheckRUM) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointRUMImpl) UpdateRUM(ctx context.Context, pk PrimaryKeyable, check CheckRUM) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckRUM2 struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Address string `json:"msp_address"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointRUM2Impl struct {
EndpointCreator[CheckRUM2, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckRUM2, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointRUM2Impl) CreateRUM2(ctx context.Context, check CheckRUM2) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointRUM2Impl) UpdateRUM2(ctx context.Context, pk PrimaryKeyable, check CheckRUM2) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckSMTP struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
Username string `json:"msp_username,omitempty"`
Password string `json:"msp_password,omitempty"`
ExpectString string `json:"msp_expect_string,omitempty"`
Encryption string `json:"msp_encryption,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIpVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointSMTPImpl struct {
EndpointCreator[CheckSMTP, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckSMTP, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointSMTPImpl) CreateSMTP(ctx context.Context, check CheckSMTP) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointSMTPImpl) UpdateSMTP(ctx context.Context, pk PrimaryKeyable, check CheckSMTP) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckSSH struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIpVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointSSHImpl struct {
EndpointCreator[CheckSSH, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckSSH, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointSSHImpl) CreateSSH(ctx context.Context, check CheckSSH) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointSSHImpl) UpdateSSH(ctx context.Context, pk PrimaryKeyable, check CheckSSH) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckSSLCert struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Protocol string `json:"msp_protocol,omitempty"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
Threshold int64 `json:"msp_threshold"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
SSLConfig CheckSSLCertConfig `json:"sslconfig,omitempty"`
}
type checksEndpointSSLCertImpl struct {
EndpointCreator[CheckSSLCert, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckSSLCert, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointSSLCertImpl) CreateSSLCert(ctx context.Context, check CheckSSLCert) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointSSLCertImpl) UpdateSSLCert(ctx context.Context, pk PrimaryKeyable, check CheckSSLCert) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckTCP struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
SendString string `json:"msp_send_string,omitempty"`
ExpectString string `json:"msp_expect_string,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIpVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointTCPImpl struct {
EndpointCreator[CheckTCP, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckTCP, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointTCPImpl) CreateTCP(ctx context.Context, check CheckTCP) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointTCPImpl) UpdateTCP(ctx context.Context, pk PrimaryKeyable, check CheckTCP) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckTransaction struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Threshold int64 `json:"msp_threshold,omitempty"`
Script string `json:"msp_script,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointTransactionImpl struct {
EndpointCreator[CheckTransaction, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckTransaction, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointTransactionImpl) CreateTransaction(ctx context.Context, check CheckTransaction) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointTransactionImpl) UpdateTransaction(ctx context.Context, pk PrimaryKeyable, check CheckTransaction) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckUDP struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
Interval int64 `json:"msp_interval,omitempty"`
Address string `json:"msp_address"`
Port int64 `json:"msp_port,omitempty"`
SendString string `json:"msp_send_string,omitempty"`
ExpectString string `json:"msp_expect_string,omitempty"`
Sensitivity int64 `json:"msp_sensitivity,omitempty"`
NumRetries int64 `json:"msp_num_retries,omitempty"`
UseIpVersion string `json:"msp_use_ip_version,omitempty"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
}
type checksEndpointUDPImpl struct {
EndpointCreator[CheckUDP, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckUDP, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointUDPImpl) CreateUDP(ctx context.Context, check CheckUDP) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointUDPImpl) UpdateUDP(ctx context.Context, pk PrimaryKeyable, check CheckUDP) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckWebhook struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`
Locations []string `json:"locations,omitempty"`
Tags []string `json:"tags,omitempty"`
IsPaused bool `json:"is_paused"`
UptimeSLA decimal.Decimal `json:"msp_uptime_sla,omitempty"`
ResponseTimeSLA decimal.Decimal `json:"msp_response_time_sla,omitempty"`
Notes string `json:"msp_notes,omitempty"`
IncludeInGlobalMetrics bool `json:"msp_include_in_global_metrics"`
WebhookUrl string `json:"webhook_url,omitempty"`
}
type checksEndpointWebhookImpl struct {
EndpointCreator[CheckWebhook, CheckCreateUpdateResponse, Check]
EndpointUpdater[CheckWebhook, CheckCreateUpdateResponse, Check]
}
func (c checksEndpointWebhookImpl) CreateWebhook(ctx context.Context, check CheckWebhook) (*Check, error) {
return c.Create(ctx, check)
}
func (c checksEndpointWebhookImpl) UpdateWebhook(ctx context.Context, pk PrimaryKeyable, check CheckWebhook) (*Check, error) {
return c.Update(ctx, pk, check)
}
type CheckWHOIS struct {
Name string `json:"name,omitempty"`
ContactGroups []string `json:"contact_groups,omitempty"`