Skip to content

Commit 749add8

Browse files
greatestusernameBrian Gustafsongreatestusername-splunkbchhay-splunk
authored
Merge changes from Main into V2 (#18)
* SYN-3197: Custom Properties * adds custom properties to integration tests. * add new CLA workflow * update readme and contributing docs * SYN-3798: add lastRunAt and lastRunStatus to GET /tests/ response (#15) --------- Co-authored-by: Brian Gustafson <bgustafson@splunk.com> Co-authored-by: greatestusername-splunk <83726369+greatestusername-splunk@users.noreply.github.com> Co-authored-by: bchhay-splunk <45180137+bchhay-splunk@users.noreply.github.com>
1 parent 198745b commit 749add8

5 files changed

+14
-4
lines changed

syntheticsclientv2/common_models.go

+10
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ type Tests []struct {
150150
Type string `json:"type"`
151151
Updatedat time.Time `json:"updatedAt"`
152152
Customproperties []CustomProperties `json:"customProperties"`
153+
Lastrunstatus string `json:"lastRunStatus"`
154+
Lastrunat time.Time `json:"lastRunAt"`
153155
}
154156

155157
type GetChecksV2Options struct {
@@ -251,6 +253,8 @@ type PortCheckV2Response struct {
251253
Host string `json:"host"`
252254
Port int `json:"port"`
253255
Customproperties []CustomProperties `json:"customProperties"`
256+
Lastrunstatus string `json:"lastRunStatus"`
257+
Lastrunat time.Time `json:"lastRunAt"`
254258
} `json:"test"`
255259
}
256260

@@ -290,6 +294,8 @@ type HttpCheckV2Response struct {
290294
HttpHeaders []HttpHeaders `json:"headers,omitempty"`
291295
Validations []Validations `json:"validations"`
292296
Customproperties []CustomProperties `json:"customProperties"`
297+
Lastrunstatus string `json:"lastRunStatus"`
298+
Lastrunat time.Time `json:"lastRunAt"`
293299
} `json:"test"`
294300
}
295301

@@ -340,6 +346,8 @@ type ApiCheckV2Response struct {
340346
Type string `json:"type,omitempty"`
341347
Updatedat time.Time `json:"updatedAt,omitempty"`
342348
Customproperties []CustomProperties `json:"customProperties"`
349+
Lastrunstatus string `json:"lastRunStatus"`
350+
Lastrunat time.Time `json:"lastRunAt"`
343351
}
344352
}
345353

@@ -374,6 +382,8 @@ type BrowserCheckV2Response struct {
374382
Type string `json:"type"`
375383
Updatedat time.Time `json:"updatedAt"`
376384
Customproperties []CustomProperties `json:"customProperties"`
385+
Lastrunstatus string `json:"lastRunStatus"`
386+
Lastrunat time.Time `json:"lastRunAt"`
377387
} `json:"test"`
378388
}
379389

syntheticsclientv2/get_apicheckv2_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
var (
28-
getApiCheckV2Body = `{"test":{"id":489,"name":"Appinspect login API","active":true, "customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "frequency":5,"scheduling_strategy":"round_robin","created_at":"2022-08-16T15:47:43.730Z","updated_at":"2022-08-16T15:47:43.741Z","location_ids":["aws-us-east-1"],"type":"api","device":{"id":1,"label":"Desktop","user_agent":"Mozilla/5.0 (X11; Linux x86_64; Splunk Synthetics) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36","viewport_width":1366,"viewport_height":768,"network_connection":{"description":"Standard Cable","upload_bandwidth":5000,"download_bandwidth":20000,"latency":28,"packet_loss":null}},"requests":[{"configuration":{"name":"Login","url":"https://api.splunk.com/2.0/rest/login/splunk","requestMethod":"GET","headers":{},"body":null},"setup":[],"validations":[]}]}}`
28+
getApiCheckV2Body = `{"test":{"id":489,"name":"Appinspect login API","active":true, "customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "frequency":5,"scheduling_strategy":"round_robin","created_at":"2022-08-16T15:47:43.730Z","updated_at":"2022-08-16T15:47:43.741Z","lastRunAt":"2024-03-07T00:47:43.741Z","lastRunStatus":"success","location_ids":["aws-us-east-1"],"type":"api","device":{"id":1,"label":"Desktop","user_agent":"Mozilla/5.0 (X11; Linux x86_64; Splunk Synthetics) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36","viewport_width":1366,"viewport_height":768,"network_connection":{"description":"Standard Cable","upload_bandwidth":5000,"download_bandwidth":20000,"latency":28,"packet_loss":null}},"requests":[{"configuration":{"name":"Login","url":"https://api.splunk.com/2.0/rest/login/splunk","requestMethod":"GET","headers":{},"body":null},"setup":[],"validations":[]}]}}`
2929
inputGetApiCheckV2 = verifyApiCheckV2Input(string(getApiCheckV2Body))
3030
)
3131

syntheticsclientv2/get_browsercheckv2_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
var (
28-
getBrowserCheckV2Body = `{"test":{"customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "active":true,"advancedSettings":{"authentication":{"password":"password123","username":"myuser"},"cookies":[{"key":"qux","value":"qux","domain":"splunk.com","path":"/qux"}],"headers":[{"name":"Accept","value":"application/json","domain":"splunk.com"}],"verifyCertificates":true},"createdAt":"2022-09-14T14:35:37.801Z","device":{"id":1,"label":"iPhone","networkConnection":{"description":"Mobile LTE","downloadBandwidth":12000,"latency":70,"packetLoss":0,"uploadBandwidth":12000},"viewportHeight":844,"viewportWidth":375},"frequency":5,"id":1,"locationIds":["na-us-virginia"],"name":"My Test","schedulingStrategy":"round_robin","transactions":[{"name":"Example transaction","steps":[{"name":"element step","selector":".main","selectorType":"css","type":"click_element","waitForNav":true}]}],"type":"browser","updatedAt":"2022-09-14T14:35:38.099Z"}}`
28+
getBrowserCheckV2Body = `{"test":{"customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "active":true,"advancedSettings":{"authentication":{"password":"password123","username":"myuser"},"cookies":[{"key":"qux","value":"qux","domain":"splunk.com","path":"/qux"}],"headers":[{"name":"Accept","value":"application/json","domain":"splunk.com"}],"verifyCertificates":true},"createdAt":"2022-09-14T14:35:37.801Z","device":{"id":1,"label":"iPhone","networkConnection":{"description":"Mobile LTE","downloadBandwidth":12000,"latency":70,"packetLoss":0,"uploadBandwidth":12000},"viewportHeight":844,"viewportWidth":375},"frequency":5,"id":1,"locationIds":["na-us-virginia"],"name":"My Test","schedulingStrategy":"round_robin","transactions":[{"name":"Example transaction","steps":[{"name":"element step","selector":".main","selectorType":"css","type":"click_element","waitForNav":true}]}],"type":"browser","updatedAt":"2022-09-14T14:35:38.099Z","lastRunAt":"2024-03-07T00:47:43.741Z","lastRunStatus":"success"}}`
2929
inputGetBrowserCheckV2 = verifyBrowserCheckV2Input(string(getBrowserCheckV2Body))
3030
)
3131

syntheticsclientv2/get_httpcheckv2_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
var (
28-
getHttpCheckV2Body = `{"test":{"customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "active":true,"advancedSettings":{"authentication":{"password":"password123","username":"myuser"},"cookies":[{"key":"qux","value":"qux","domain":"splunk.com","path":"/qux"}],"headers":[{"name":"Accept","value":"application/json","domain":"splunk.com"}],"verifyCertificates":true},"createdAt":"2022-09-14T14:35:37.801Z","device":{"id":1,"label":"iPhone","networkConnection":{"description":"Mobile LTE","downloadBandwidth":12000,"latency":70,"packetLoss":0,"uploadBandwidth":12000},"viewportHeight":844,"viewportWidth":375},"frequency":5,"id":1,"locationIds":["na-us-virginia"],"name":"My Test","schedulingStrategy":"round_robin","transactions":[{"name":"Example transaction","steps":[{"name":"element step","selector":".main","selectorType":"css","type":"click_element","waitForNav":true}]}],"type":"browser","updatedAt":"2022-09-14T14:35:38.099Z"}}`
28+
getHttpCheckV2Body = `{"test":{"customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "active":true,"advancedSettings":{"authentication":{"password":"password123","username":"myuser"},"cookies":[{"key":"qux","value":"qux","domain":"splunk.com","path":"/qux"}],"headers":[{"name":"Accept","value":"application/json","domain":"splunk.com"}],"verifyCertificates":true},"createdAt":"2022-09-14T14:35:37.801Z","device":{"id":1,"label":"iPhone","networkConnection":{"description":"Mobile LTE","downloadBandwidth":12000,"latency":70,"packetLoss":0,"uploadBandwidth":12000},"viewportHeight":844,"viewportWidth":375},"frequency":5,"id":1,"locationIds":["na-us-virginia"],"name":"My Test","schedulingStrategy":"round_robin","transactions":[{"name":"Example transaction","steps":[{"name":"element step","selector":".main","selectorType":"css","type":"click_element","waitForNav":true}]}],"type":"browser","updatedAt":"2022-09-14T14:35:38.099Z","lastRunAt":"2024-03-07T00:47:43.741Z","lastRunStatus":"success"}}`
2929
inputGetHttpCheckV2 = verifyHttpCheckV2Input(string(getHttpCheckV2Body))
3030
)
3131

syntheticsclientv2/get_portcheckv2_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
var (
28-
getPortCheckV2Body = `{"test":{"id":1647, "customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "name":"splunk - port 443","active":true,"frequency":10,"scheduling_strategy":"round_robin","created_at":"2022-11-21T15:38:54.546Z","updated_at":"2022-11-21T15:38:54.554Z","location_ids":["aws-us-east-1"],"type":"port","protocol":"tcp","host":"www.splunk.com","port":443}}`
28+
getPortCheckV2Body = `{"test":{"id":1647, "customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "name":"splunk - port 443","active":true,"frequency":10,"scheduling_strategy":"round_robin","created_at":"2022-11-21T15:38:54.546Z","updated_at":"2022-11-21T15:38:54.554Z","lastRunAt":"2024-03-07T00:47:43.741Z","lastRunStatus":"success","location_ids":["aws-us-east-1"],"type":"port","protocol":"tcp","host":"www.splunk.com","port":443}}`
2929
inputGetPortCheckV2 = verifyPortCheckV2Input(string(getPortCheckV2Body))
3030
)
3131

0 commit comments

Comments
 (0)