@@ -72,6 +72,13 @@ type Client interface {
72
72
check HeartbeatCheck ,
73
73
) (* HeartbeatCheck , error )
74
74
75
+ // CreateTCPCheck creates a new TCP check with the specified details.
76
+ // It returns the newly-created check, or an error.
77
+ CreateTCPCheck (
78
+ ctx context.Context ,
79
+ check TCPCheck ,
80
+ ) (* TCPCheck , error )
81
+
75
82
// Update updates an existing check with the specified details.
76
83
// It returns the updated check, or an error.
77
84
UpdateCheck (
@@ -88,6 +95,14 @@ type Client interface {
88
95
check HeartbeatCheck ,
89
96
) (* HeartbeatCheck , error )
90
97
98
+ // UpdateTCPCheck updates an existing TCP check with the specified details.
99
+ // It returns the updated check, or an error.
100
+ UpdateTCPCheck (
101
+ ctx context.Context ,
102
+ ID string ,
103
+ check TCPCheck ,
104
+ ) (* TCPCheck , error )
105
+
91
106
// Delete deletes the check with the specified ID.
92
107
DeleteCheck (
93
108
ctx context.Context ,
@@ -101,6 +116,13 @@ type Client interface {
101
116
ID string ,
102
117
) (* Check , error )
103
118
119
+ // Get takes the ID of an existing TCP check, and returns the check
120
+ // parameters, or an error.
121
+ GetTCPCheck (
122
+ ctx context.Context ,
123
+ ID string ,
124
+ ) (* TCPCheck , error )
125
+
104
126
// CreateGroup creates a new check group with the specified details.
105
127
// It returns the newly-created group, or an error.
106
128
CreateGroup (
@@ -412,6 +434,9 @@ const Headers = "HEADERS"
412
434
// ResponseTime identifies the response time as an assertion source.
413
435
const ResponseTime = "RESPONSE_TIME"
414
436
437
+ // ResponseData identifies the response data of a TCP check as an assertion source.
438
+ const ResponseData = "RESPONSE_DATA"
439
+
415
440
// Assertion comparison constants
416
441
417
442
// Equals asserts that the source and target are equal.
@@ -524,6 +549,33 @@ type HeartbeatCheck struct {
524
549
UpdatedAt time.Time `json:"updatedAt"`
525
550
}
526
551
552
+ // TCPCheck represents a TCP check.
553
+ type TCPCheck struct {
554
+ ID string `json:"id,omitempty"`
555
+ Name string `json:"name"`
556
+ Frequency int `json:"frequency,omitempty"`
557
+ FrequencyOffset int `json:"frequencyOffset,omitempty"`
558
+ Activated bool `json:"activated"`
559
+ Muted bool `json:"muted"`
560
+ ShouldFail bool `json:"shouldFail"`
561
+ RunParallel bool `json:"runParallel"`
562
+ Locations []string `json:"locations,omitempty"`
563
+ DegradedResponseTime int `json:"degradedResponseTime,omitempty"`
564
+ MaxResponseTime int `json:"maxResponseTime,omitempty"`
565
+ Tags []string `json:"tags,omitempty"`
566
+ AlertSettings * AlertSettings `json:"alertSettings,omitempty"`
567
+ UseGlobalAlertSettings bool `json:"useGlobalAlertSettings"`
568
+ Request TCPRequest `json:"request"`
569
+ GroupID int64 `json:"groupId,omitempty"`
570
+ GroupOrder int `json:"groupOrder,omitempty"`
571
+ AlertChannelSubscriptions []AlertChannelSubscription `json:"alertChannelSubscriptions,omitempty"`
572
+ PrivateLocations * []string `json:"privateLocations,omitempty"`
573
+ RuntimeID * string `json:"runtimeId"`
574
+ RetryStrategy * RetryStrategy `json:"retryStrategy,omitempty"`
575
+ CreatedAt time.Time `json:"created_at,omitempty"`
576
+ UpdatedAt time.Time `json:"updated_at,omitempty"`
577
+ }
578
+
527
579
// Heartbeat represents the parameter for the heartbeat check.
528
580
type Heartbeat struct {
529
581
Period int `json:"period"`
@@ -575,6 +627,15 @@ type KeyValue struct {
575
627
Locked bool `json:"locked"`
576
628
}
577
629
630
+ // TCPRequest represents the parameters for a TCP check's connection.
631
+ type TCPRequest struct {
632
+ Hostname string `json:"hostname"`
633
+ Port uint16 `json:"port"`
634
+ Data string `json:"data,omitempty"`
635
+ Assertions []Assertion `json:"assertions,omitempty"`
636
+ IPFamily string `json:"ipFamily,omitempty"`
637
+ }
638
+
578
639
// EnvironmentVariable represents a key-value pair for setting environment
579
640
// values during check execution.
580
641
type EnvironmentVariable struct {
0 commit comments