Skip to content

Commit 31cde98

Browse files
committed
remove displayableTimeRange field
1 parent f0dc950 commit 31cde98

File tree

4 files changed

+34
-51
lines changed

4 files changed

+34
-51
lines changed

sumologic/resource_sumologic_log_search.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ func resourceSumologicLogSearch() *schema.Resource {
9999
Type: schema.TypeString,
100100
Optional: true,
101101
},
102-
"displayable_time_range": {
103-
Type: schema.TypeString,
104-
Optional: true,
105-
},
106102
"parseable_time_range": {
107103
Type: schema.TypeList,
108104
Required: true,
@@ -483,7 +479,6 @@ func getTerraformLogSearchSchedule(schedule *LogSearchSchedule) []map[string]int
483479
}
484480

485481
tfSearchSchedule[0]["cron_expression"] = schedule.CronExpression
486-
tfSearchSchedule[0]["displayable_time_range"] = schedule.DisplayableTimeRange
487482
tfSearchSchedule[0]["time_zone"] = schedule.TimeZone
488483
tfSearchSchedule[0]["mute_error_emails"] = schedule.MuteErrorEmails
489484
tfSearchSchedule[0]["schedule_type"] = schedule.ScheduleType
@@ -660,7 +655,6 @@ func resourceToLogSearchSchedule(data interface{}) *LogSearchSchedule {
660655
schedule.MuteErrorEmails = scheduleObj["mute_error_emails"].(bool)
661656
schedule.Notification = resourceToScheduleSearchNotification(scheduleObj["notification"])
662657
schedule.ScheduleType = scheduleObj["schedule_type"].(string)
663-
schedule.DisplayableTimeRange = scheduleObj["displayable_time_range"].(string)
664658
}
665659

666660
return &schedule

sumologic/resource_sumologic_log_search_test.go

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ func TestAccSumologicLogSearch_basic(t *testing.T) {
5050
Count: 10,
5151
}
5252
schedule := LogSearchSchedule{
53-
CronExpression: "0 0 6 ? * 3 *",
54-
DisplayableTimeRange: "-15m",
55-
ParseableTimeRange: boundedTimeRange,
56-
TimeZone: "America/Los_Angeles",
57-
Threshold: &notificationThreshold,
58-
Parameters: searchParameters,
59-
MuteErrorEmails: true,
60-
Notification: emailNotification,
61-
ScheduleType: "Custom",
53+
CronExpression: "0 0 6 ? * 3 *",
54+
ParseableTimeRange: boundedTimeRange,
55+
TimeZone: "America/Los_Angeles",
56+
Threshold: &notificationThreshold,
57+
Parameters: searchParameters,
58+
MuteErrorEmails: true,
59+
Notification: emailNotification,
60+
ScheduleType: "Custom",
6261
}
6362
runByReceiptTime := false
6463

@@ -121,15 +120,14 @@ func TestAccSumologicLogSearch_create(t *testing.T) {
121120
Count: 10,
122121
}
123122
schedule := LogSearchSchedule{
124-
CronExpression: "0 0 6 ? * 3 *",
125-
DisplayableTimeRange: "-15m",
126-
ParseableTimeRange: boundedTimeRange,
127-
TimeZone: "America/Los_Angeles",
128-
Threshold: &notificationThreshold,
129-
Parameters: searchParameters,
130-
MuteErrorEmails: true,
131-
Notification: emailNotification,
132-
ScheduleType: "Custom",
123+
CronExpression: "0 0 6 ? * 3 *",
124+
ParseableTimeRange: boundedTimeRange,
125+
TimeZone: "America/Los_Angeles",
126+
Threshold: &notificationThreshold,
127+
Parameters: searchParameters,
128+
MuteErrorEmails: true,
129+
Notification: emailNotification,
130+
ScheduleType: "Custom",
133131
}
134132
runByReceiptTime := false
135133

@@ -162,8 +160,6 @@ func TestAccSumologicLogSearch_create(t *testing.T) {
162160
// schedule
163161
resource.TestCheckResourceAttr(tfSearchResource, "schedule.#", "1"),
164162
resource.TestCheckResourceAttr(tfSearchResource, "schedule.0.cron_expression", schedule.CronExpression),
165-
resource.TestCheckResourceAttr(tfSearchResource, "schedule.0.displayable_time_range",
166-
schedule.DisplayableTimeRange),
167163
resource.TestCheckResourceAttr(tfSearchResource, "schedule.0.mute_error_emails",
168164
strconv.FormatBool(schedule.MuteErrorEmails)),
169165
// email notification
@@ -262,15 +258,14 @@ func TestAccSumologicLogSearch_update(t *testing.T) {
262258
Count: 10,
263259
}
264260
schedule := LogSearchSchedule{
265-
CronExpression: "0 0 6 ? * 3 *",
266-
DisplayableTimeRange: "-15m",
267-
ParseableTimeRange: boundedTimeRange,
268-
TimeZone: "America/Los_Angeles",
269-
Threshold: &notificationThreshold,
270-
Parameters: searchParameters,
271-
MuteErrorEmails: true,
272-
Notification: emailNotification,
273-
ScheduleType: "Custom",
261+
CronExpression: "0 0 6 ? * 3 *",
262+
ParseableTimeRange: boundedTimeRange,
263+
TimeZone: "America/Los_Angeles",
264+
Threshold: &notificationThreshold,
265+
Parameters: searchParameters,
266+
MuteErrorEmails: true,
267+
Notification: emailNotification,
268+
ScheduleType: "Custom",
274269
}
275270
runByReceiptTime := false
276271

@@ -446,7 +441,6 @@ func testAccSumologicLogSearch(tfResourceName string, name string, description s
446441
tfSchedule := fmt.Sprintf(`
447442
schedule {
448443
cron_expression = "%s"
449-
displayable_time_range = "%s"
450444
mute_error_emails = %t
451445
notification {
452446
email_search_notification {
@@ -483,7 +477,7 @@ func testAccSumologicLogSearch(tfResourceName string, name string, description s
483477
}
484478
time_zone = "%s"
485479
}
486-
`, schedule.CronExpression, schedule.DisplayableTimeRange, schedule.MuteErrorEmails,
480+
`, schedule.CronExpression, schedule.MuteErrorEmails,
487481
emailNotification.IncludeCsvAttachment, emailNotification.IncludeHistogram, emailNotification.IncludeQuery,
488482
emailNotification.IncludeResultSet, emailNotification.SubjectTemplate, emailNotification.ToList[0],
489483
schedule.Parameters[0].Name, schedule.Parameters[0].Value,
@@ -532,7 +526,6 @@ func testAccSumologicUpdatedLogSearch(tfResourceName string, name string, descri
532526
tfSchedule := fmt.Sprintf(`
533527
schedule {
534528
cron_expression = "%s"
535-
displayable_time_range = "%s"
536529
mute_error_emails = %t
537530
notification {
538531
email_search_notification {
@@ -574,7 +567,7 @@ func testAccSumologicUpdatedLogSearch(tfResourceName string, name string, descri
574567
}
575568
time_zone = "%s"
576569
}
577-
`, schedule.CronExpression, schedule.DisplayableTimeRange, schedule.MuteErrorEmails,
570+
`, schedule.CronExpression, schedule.MuteErrorEmails,
578571
emailNotification.IncludeCsvAttachment, emailNotification.IncludeHistogram, emailNotification.IncludeQuery,
579572
emailNotification.IncludeResultSet, emailNotification.SubjectTemplate, emailNotification.ToList[0],
580573
schedule.Parameters[0].Name, schedule.Parameters[0].Value, schedule.Parameters[1].Name, schedule.Parameters[1].Value,

sumologic/sumologic_log_search.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,14 @@ type LogSearchQueryParameter struct {
9898
}
9999

100100
type LogSearchSchedule struct {
101-
CronExpression string `json:"cronExpression"`
102-
DisplayableTimeRange string `json:"displayableTimeRange"`
103-
ParseableTimeRange interface{} `json:"parseableTimeRange"`
104-
TimeZone string `json:"timeZone"`
105-
Threshold *SearchNotificationThreshold `json:"threshold,omitempty"`
106-
Parameters []ScheduleSearchParameter `json:"parameters,omitempty"`
107-
MuteErrorEmails bool `json:"muteErrorEmails"`
108-
Notification interface{} `json:"notification"`
109-
ScheduleType string `json:"scheduleType"`
101+
CronExpression string `json:"cronExpression"`
102+
ParseableTimeRange interface{} `json:"parseableTimeRange"`
103+
TimeZone string `json:"timeZone"`
104+
Threshold *SearchNotificationThreshold `json:"threshold,omitempty"`
105+
Parameters []ScheduleSearchParameter `json:"parameters,omitempty"`
106+
MuteErrorEmails bool `json:"muteErrorEmails"`
107+
Notification interface{} `json:"notification"`
108+
ScheduleType string `json:"scheduleType"`
110109
}
111110

112111
type SearchNotificationThreshold struct {

website/docs/r/log_search.html.markdown

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ resource "sumologic_log_search" "example_log_search" {
3232
3333
schedule {
3434
cron_expression = "0 0 * * * ? *"
35-
displayable_time_range = "-15m"
3635
mute_error_emails = false
3736
notification {
3837
email_search_notification {
@@ -96,8 +95,6 @@ The following arguments are supported:
9695

9796
-> With `Custom`, `1Day` and `1Week` schedule types you need to provide the corresponding cron expression
9897
to determine when to actually run the search. E.g. valid cron for `1Day` is `0 0 16 ? * 2-6 *`.
99-
- `displayable_time_range` - (Optional) A human-friendly text describing the query time range. For e.g. "-2h",
100-
"last three days", "team default time"
10198
- `parseable_time_range` - (Block List, Max: 1, Required) Time range of the scheduled log search. See
10299
[time range schema](#schema-for-time_range)
103100
- `time_zone` - (Required) Time zone for the scheduled log search. Either an abbreviation such as "PST",

0 commit comments

Comments
 (0)