Skip to content

Commit ad992fe

Browse files
committed
SUMO-172431: added acceptance test for playbook
1 parent e277113 commit ad992fe

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## 2.9.10 (Unreleased)
22

3+
FEATURES:
4+
5+
* Add a new optional field `playbook` to resource/sumologic_monitor.
6+
37
## 2.9.9 (August 12, 2021)
48

59
BUG FIXES:

sumologic/resource_sumologic_monitors_library_monitor_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ func TestAccSumologicMonitorsLibraryMonitor_update(t *testing.T) {
249249
testType := "MonitorsLibraryMonitor"
250250
testContentType := "Monitor"
251251
testMonitorType := "Logs"
252+
testPlaybook := "This is a test playbook"
252253
testIsDisabled := false
253254
testQueries := []MonitorQuery{
254255
{
@@ -306,6 +307,7 @@ func TestAccSumologicMonitorsLibraryMonitor_update(t *testing.T) {
306307
testUpdatedType := "MonitorsLibraryMonitor"
307308
testUpdatedContentType := "Monitor"
308309
testUpdatedMonitorType := "Logs"
310+
testUpdatedPlaybook := "This is an updated test playbook"
309311
testUpdatedIsDisabled := true
310312
testUpdatedQueries := []MonitorQuery{
311313
{
@@ -377,6 +379,7 @@ func TestAccSumologicMonitorsLibraryMonitor_update(t *testing.T) {
377379
resource.TestCheckResourceAttr("sumologic_monitor.test", "triggers.0.trigger_type", testTriggers[0].TriggerType),
378380
resource.TestCheckResourceAttr("sumologic_monitor.test", "triggers.0.time_range", testTriggers[0].TimeRange),
379381
resource.TestCheckResourceAttr("sumologic_monitor.test", "notifications.0.notification.0.connection_type", testNotifications[0].Notification.(EmailNotification).ConnectionType),
382+
resource.TestCheckResourceAttr("sumologic_monitor.test", "playbook", testPlaybook),
380383
),
381384
},
382385
{
@@ -392,6 +395,7 @@ func TestAccSumologicMonitorsLibraryMonitor_update(t *testing.T) {
392395
resource.TestCheckResourceAttr("sumologic_monitor.test", "triggers.0.trigger_type", testUpdatedTriggers[0].TriggerType),
393396
resource.TestCheckResourceAttr("sumologic_monitor.test", "triggers.0.time_range", testUpdatedTriggers[0].TimeRange),
394397
resource.TestCheckResourceAttr("sumologic_monitor.test", "notifications.0.notification.0.connection_type", testUpdatedNotifications[0].Notification.(EmailNotification).ConnectionType),
398+
resource.TestCheckResourceAttr("sumologic_monitor.test", "playbook", testUpdatedPlaybook),
395399
),
396400
},
397401
},
@@ -582,6 +586,7 @@ resource "sumologic_monitor" "test" {
582586
}
583587
run_for_trigger_types = [%s]
584588
}
589+
playbook = "This is a test playbook"
585590
}`, testName, monitorType, query, trigger, triggerTysStr)
586591
}
587592

sumologic/sumologic_monitors_library_monitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ type MonitorsLibraryMonitor struct {
136136
IsDisabled bool `json:"isDisabled"`
137137
Status []string `json:"status"`
138138
GroupNotifications bool `json:"groupNotifications"`
139-
Playbook string `json:"playbook"`
139+
Playbook string `json:"playbook,omitempty"`
140140
}
141141

142142
type MonitorQuery struct {

0 commit comments

Comments
 (0)