Skip to content

Commit

Permalink
feat: add new ip family field to the types [sc-20606] (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
umutuzgur committed Jun 21, 2024
1 parent 1f3c832 commit 0ad859d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 6 deletions.
9 changes: 9 additions & 0 deletions checkly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var wantCheck = checkly.Check{
Username: "",
Password: "",
},
IPFamily: "IPv4",
},
Script: "foo",
EnvironmentVariables: []checkly.EnvironmentVariable{
Expand All @@ -86,6 +87,10 @@ var wantCheck = checkly.Check{
Reminders: checkly.Reminders{
Interval: 5,
},
ParallelRunFailureThreshold: checkly.ParallelRunFailureThreshold{
Enabled: false,
Percentage: 10,
},
},
UseGlobalAlertSettings: false,
DegradedResponseTime: 15000,
Expand Down Expand Up @@ -378,6 +383,10 @@ var wantGroup = checkly.Group{
Amount: 0,
Interval: 5,
},
ParallelRunFailureThreshold: checkly.ParallelRunFailureThreshold{
Enabled: false,
Percentage: 10,
},
},
AlertChannelSubscriptions: []checkly.AlertChannelSubscription{
{
Expand Down
7 changes: 6 additions & 1 deletion fixtures/CreateCheck.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"basicAuth": {
"password": "",
"username": ""
}
},
"ipFamily": "IPv4"
},
"frequency": 10,
"muted": false,
Expand Down Expand Up @@ -62,6 +63,10 @@
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
}
},
"script": "foo",
Expand Down
4 changes: 4 additions & 0 deletions fixtures/CreateGroup.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
}
},
"alertChannelSubscriptions": [
Expand Down
7 changes: 6 additions & 1 deletion fixtures/GetCheck.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"basicAuth": {
"password": "",
"username": ""
}
},
"ipFamily": "IPv4"
},
"frequency": 10,
"muted": false,
Expand Down Expand Up @@ -62,6 +63,10 @@
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
}
},
"script": "foo",
Expand Down
7 changes: 6 additions & 1 deletion fixtures/UpdateCheck.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"basicAuth": {
"password": "",
"username": ""
}
},
"ipFamily": "IPv4"
},
"frequency": 10,
"muted": false,
Expand Down Expand Up @@ -62,6 +63,10 @@
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
}
},
"script": "foo",
Expand Down
4 changes: 4 additions & 0 deletions fixtures/UpdateGroup.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
},
"escalationType": "RUN_BASED",
"runBasedEscalation": {
"failedRunThreshold": 1
Expand Down
7 changes: 4 additions & 3 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ type Request struct {
QueryParameters []KeyValue `json:"queryParameters"`
Assertions []Assertion `json:"assertions"`
BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
IPFamily string `json:"ipFamily,omitempty"`
}

// Assertion represents an assertion about an API response, which will be
Expand Down Expand Up @@ -605,14 +606,14 @@ type AlertSettings struct {
Reminders Reminders `json:"reminders,omitempty"`
ParallelRunFailureThreshold ParallelRunFailureThreshold `json:"parallelRunFailureThreshold,omitempty"`
// Deprecated: this property will be removed in future versions.
SSLCertificates SSLCertificates `json:"sslCertificates,omitempty"`
SSLCertificates SSLCertificates `json:"sslCertificates,omitempty"`
}

// ParallelRunFailureThreshold represent an alert escalation based on the number
// of failing regions, only applicable for parallel checks
type ParallelRunFailureThreshold struct {
Enabled bool `json:"enabled,omitempty"`
Percentage int `json:"percentage,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Percentage int `json:"percentage,omitempty"`
}

// RunBasedEscalation represents an alert escalation based on a number of failed
Expand Down

0 comments on commit 0ad859d

Please sign in to comment.