Skip to content

Commit 7b990b5

Browse files
SYN-4078: add createdBy and updatedBy to /tests responses (#26)
1 parent 678ba62 commit 7b990b5

6 files changed

+15
-5
lines changed

syntheticsclientv2/common_models.go

+10
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ type Tests []struct {
155155
Lastrunstatus string `json:"lastRunStatus"`
156156
Lastrunat time.Time `json:"lastRunAt"`
157157
Automaticretries int `json:"automaticRetries"`
158+
Createdby string `json:"createdBy"`
159+
Updatedby string `json:"updatedBy"`
158160
}
159161

160162
type GetChecksV2Options struct {
@@ -305,6 +307,8 @@ type PortCheckV2Response struct {
305307
Lastrunstatus string `json:"lastRunStatus"`
306308
Lastrunat time.Time `json:"lastRunAt"`
307309
Automaticretries int `json:"automaticRetries"`
310+
Createdby string `json:"createdBy"`
311+
Updatedby string `json:"updatedBy"`
308312
} `json:"test"`
309313
}
310314

@@ -349,6 +353,8 @@ type HttpCheckV2Response struct {
349353
Lastrunat time.Time `json:"lastRunAt"`
350354
Automaticretries int `json:"automaticRetries"`
351355
Port int `json:"port"`
356+
Createdby string `json:"createdBy"`
357+
Updatedby string `json:"updatedBy"`
352358
} `json:"test"`
353359
}
354360

@@ -405,6 +411,8 @@ type ApiCheckV2Response struct {
405411
Lastrunstatus string `json:"lastRunStatus"`
406412
Lastrunat time.Time `json:"lastRunAt"`
407413
Automaticretries int `json:"automaticRetries"`
414+
Createdby string `json:"createdBy"`
415+
Updatedby string `json:"updatedBy"`
408416
}
409417
}
410418

@@ -443,6 +451,8 @@ type BrowserCheckV2Response struct {
443451
Lastrunstatus string `json:"lastRunStatus"`
444452
Lastrunat time.Time `json:"lastRunAt"`
445453
Automaticretries int `json:"automaticRetries"`
454+
Createdby string `json:"createdBy"`
455+
Updatedby string `json:"updatedBy"`
446456
} `json:"test"`
447457
}
448458

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, "automaticRetries": 1, "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":[]}]}}`
28+
getApiCheckV2Body = `{"test":{"id":489,"name":"Appinspect login API","active":true, "automaticRetries": 1, "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","createdBy":"abc1234","updatedBy":"abc1234","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":{"automaticRetries": 1, "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,"waitForNavTimeout":2000}]}],"type":"browser","updatedAt":"2022-09-14T14:35:38.099Z","lastRunAt":"2024-03-07T00:47:43.741Z","lastRunStatus":"success"}}`
28+
getBrowserCheckV2Body = `{"test":{"automaticRetries": 1, "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,"waitForNavTimeout":2000}]}],"type":"browser","updatedAt":"2022-09-14T14:35:38.099Z","lastRunAt":"2024-03-07T00:47:43.741Z","lastRunStatus":"success","createdBy":"abc1234","updatedBy":"abc1234"}}`
2929
inputGetBrowserCheckV2 = verifyBrowserCheckV2Input(string(getBrowserCheckV2Body))
3030
)
3131

syntheticsclientv2/get_checksv2_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
var (
2828
getChecksV2Body = `{"testType":"","page":1,"perPage":50,"search":"","orderBy":"id"}`
2929
inputGetChecksV2 = verifyChecksV2Input(string(getChecksV2Body))
30-
getChecksV2Output = `{"tests":[{"id":482,"name":"Test of Splunk.com","active":true, "automaticRetries": 1, "frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-15T16:05:25.815Z","updatedAt":"2022-09-29T19:13:13.853Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"pending","lastRunAt":null},{"id":489,"name":"Appinspect login API","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-16T15:47:43.730Z","updatedAt":"2022-08-16T15:47:43.741Z","locationIds":["aws-us-east-1"],"type":"api","customProperties":null,"lastRunStatus":"success","lastRunAt":"2024-04-11T20:12:54.000Z"},{"id":490,"name":"Arch Linux Packages","active":true,"frequency":10,"schedulingStrategy":"round_robin","createdAt":"2022-08-16T16:48:42.119Z","updatedAt":"2022-08-16T16:48:42.131Z","locationIds":["aws-us-east-1"],"type":"http","customProperties":null,"lastRunStatus":"pending","lastRunAt":null},{"id":492,"name":"Test of Splunkbase","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-16T19:35:54.014Z","updatedAt":"2022-09-29T19:13:13.907Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"success","lastRunAt":"2024-04-11T20:09:54.000Z"},{"id":493,"name":"Brewery API","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-16T19:44:15.626Z","updatedAt":"2022-08-16T19:44:15.635Z","locationIds":["aws-us-east-1"],"type":"api","customProperties":null,"lastRunStatus":"pending","lastRunAt":null},{"id":495,"name":"Multi-step test of legacy Splunkbase","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-17T01:24:44.579Z","updatedAt":"2022-09-29T19:13:13.203Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"pending","lastRunAt":null},{"id":496,"name":"Multi-step Test of new Splunkbase","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-17T01:33:27.771Z","updatedAt":"2022-09-29T19:13:13.997Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"pending","lastRunAt":null},{"id":935,"name":"This test does test stuff","active":true,"frequency":30,"schedulingStrategy":"round_robin","createdAt":"2022-10-26T14:48:36.026Z","updatedAt":"2022-10-26T14:48:36.037Z","locationIds":["aws-us-east-1"],"type":"api","customProperties":null,"lastRunStatus":"pending","lastRunAt":null},{"id":1116,"name":"boop-test","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-11-16T19:18:59.603Z","updatedAt":"2022-11-16T19:20:58.911Z","locationIds":["aws-us-east-1","aws-ap-northeast-1"],"type":"api","customProperties":null,"lastRunStatus":"success","lastRunAt":"2024-04-11T20:12:32.000Z"},{"id":1128,"name":"boopbeep","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-11-17T14:19:49.564Z","updatedAt":"2022-11-17T14:19:49.571Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"pending","lastRunAt":null}],"page":1,"per_page":50,"next_page_link":null,"total_count":10}`
30+
getChecksV2Output = `{"tests":[{"id":482,"name":"Test of Splunk.com","active":true, "automaticRetries": 1, "frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-15T16:05:25.815Z","updatedAt":"2022-09-29T19:13:13.853Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"pending","lastRunAt":null,"createdBy":"abc1234","updatedBy":"abc1234"},{"id":489,"name":"Appinspect login API","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-16T15:47:43.730Z","updatedAt":"2022-08-16T15:47:43.741Z","locationIds":["aws-us-east-1"],"type":"api","customProperties":null,"lastRunStatus":"success","lastRunAt":"2024-04-11T20:12:54.000Z","createdBy":"abc1234","updatedBy":"abc1234"},{"id":490,"name":"Arch Linux Packages","active":true,"frequency":10,"schedulingStrategy":"round_robin","createdAt":"2022-08-16T16:48:42.119Z","updatedAt":"2022-08-16T16:48:42.131Z","locationIds":["aws-us-east-1"],"type":"http","customProperties":null,"lastRunStatus":"pending","lastRunAt":null,"createdBy":"abc1234","updatedBy":"abc1234"},{"id":492,"name":"Test of Splunkbase","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-16T19:35:54.014Z","updatedAt":"2022-09-29T19:13:13.907Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"success","lastRunAt":"2024-04-11T20:09:54.000Z","createdBy":"abc1234","updatedBy":"abc1234"},{"id":493,"name":"Brewery API","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-16T19:44:15.626Z","updatedAt":"2022-08-16T19:44:15.635Z","locationIds":["aws-us-east-1"],"type":"api","customProperties":null,"lastRunStatus":"pending","lastRunAt":null,"createdBy":"abc1234","updatedBy":"abc1234"},{"id":495,"name":"Multi-step test of legacy Splunkbase","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-17T01:24:44.579Z","updatedAt":"2022-09-29T19:13:13.203Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"pending","lastRunAt":null,"createdBy":"abc1234","updatedBy":"abc1234"},{"id":496,"name":"Multi-step Test of new Splunkbase","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-08-17T01:33:27.771Z","updatedAt":"2022-09-29T19:13:13.997Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"pending","lastRunAt":null,"createdBy":"abc1234","updatedBy":"abc1234"},{"id":935,"name":"This test does test stuff","active":true,"frequency":30,"schedulingStrategy":"round_robin","createdAt":"2022-10-26T14:48:36.026Z","updatedAt":"2022-10-26T14:48:36.037Z","locationIds":["aws-us-east-1"],"type":"api","customProperties":null,"lastRunStatus":"pending","lastRunAt":null,"createdBy":"abc1234","updatedBy":"abc1234"},{"id":1116,"name":"boop-test","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-11-16T19:18:59.603Z","updatedAt":"2022-11-16T19:20:58.911Z","locationIds":["aws-us-east-1","aws-ap-northeast-1"],"type":"api","customProperties":null,"lastRunStatus":"success","lastRunAt":"2024-04-11T20:12:32.000Z","createdBy":"abc1234","updatedBy":"abc1234"},{"id":1128,"name":"boopbeep","active":true,"frequency":5,"schedulingStrategy":"round_robin","createdAt":"2022-11-17T14:19:49.564Z","updatedAt":"2022-11-17T14:19:49.571Z","locationIds":["aws-us-east-1"],"type":"browser","customProperties":null,"lastRunStatus":"pending","lastRunAt":null,"createdBy":"abc1234","updatedBy":"abc1234"}],"page":1,"per_page":50,"next_page_link":null,"total_count":10}`
3131
output = &ChecksV2Response{}
3232
)
3333

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":{"automaticRetries": 1, "customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "active":true,"createdAt":"2022-09-14T14:35:37.801Z","frequency":5,"id":1,"locationIds":["na-us-virginia"],"name":"My Test","schedulingStrategy":"round_robin","type":"http","updatedAt":"2022-09-14T14:35:38.099Z","lastRunAt":"2024-03-07T00:47:43.741Z","lastRunStatus":"success","url":"https://splunk.com","requestMethod":"GET","body":null,"headers":[{"name":"Accept","value":"application/json","domain":"splunk.com"}],"userAgent":null,"validations":[],"verifyCertificates":false,"authentication":null,"port":null}}`
28+
getHttpCheckV2Body = `{"test":{"automaticRetries": 1, "customProperties": [{"key": "Test_Key", "value": "Test Custom Properties"}], "active":true,"createdAt":"2022-09-14T14:35:37.801Z","frequency":5,"id":1,"locationIds":["na-us-virginia"],"name":"My Test","schedulingStrategy":"round_robin","type":"http","updatedAt":"2022-09-14T14:35:38.099Z","lastRunAt":"2024-03-07T00:47:43.741Z","lastRunStatus":"success","createdBy":"abc1234","updatedBy":"abc1234","url":"https://splunk.com","requestMethod":"GET","body":null,"headers":[{"name":"Accept","value":"application/json","domain":"splunk.com"}],"userAgent":null,"validations":[],"verifyCertificates":false,"authentication":null,"port":null}}`
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, "automaticRetries": 1, "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}}`
28+
getPortCheckV2Body = `{"test":{"id":1647, "automaticRetries": 1, "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","createdBy":"abc1234","updatedBy":"abc1234","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)