Skip to content

Commit 8142a6d

Browse files
authored
Merge pull request #817 from SumoLogic/SUMO-271548
add auto_pause_enabled support
2 parents 2d26dd5 + 038742b commit 8142a6d

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## X.Y.Z (Unreleased)
22
* Add new change notes here
3+
4+
ENHANCEMENTS:
5+
* Add auto_pause_enabled support for scheduled_view
6+
37

48
## 3.1.6 (October 10, 2025)
59

sumologic/resource_sumologic_scheduled_view.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ func resourceSumologicScheduledView() *schema.Resource {
7272
Computed: true,
7373
Description: "Time zone for ingesting data in scheduled view. Follow the format in the [IANA Time Zone Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).",
7474
},
75+
"auto_pause_enabled": {
76+
Type: schema.TypeBool,
77+
Optional: true,
78+
Computed: true,
79+
Description: "Auto Pause status of Scheduled View.",
80+
},
7581
},
7682
}
7783
}
@@ -86,6 +92,11 @@ func resourceSumologicScheduledViewCreate(d *schema.ResourceData, meta interface
8692
sview.TimeZone = v.(string)
8793
}
8894

95+
if v, ok := d.GetOkExists("auto_pause_enabled"); ok {
96+
autoPauseEnabled := v.(bool)
97+
sview.AutoPauseEnabled = &autoPauseEnabled
98+
}
99+
89100
createdSview, err := c.CreateScheduledView(sview)
90101

91102
if err != nil {
@@ -125,6 +136,7 @@ func resourceSumologicScheduledViewRead(d *schema.ResourceData, meta interface{}
125136
d.Set("data_forwarding_id", sview.DataForwardingId)
126137
d.Set("parsing_mode", sview.ParsingMode)
127138
d.Set("time_zone", sview.TimeZone)
139+
d.Set("auto_pause_enabled", sview.AutoPauseEnabled)
128140

129141
return nil
130142
}
@@ -139,6 +151,11 @@ func resourceSumologicScheduledViewUpdate(d *schema.ResourceData, meta interface
139151
sview.TimeZone = d.Get("time_zone").(string)
140152
}
141153

154+
if d.HasChange("auto_pause_enabled") {
155+
b := d.Get("auto_pause_enabled").(bool)
156+
sview.AutoPauseEnabled = &b
157+
}
158+
142159
c := meta.(*Client)
143160
err := c.UpdateScheduledView(sview)
144161

sumologic/sumologic_scheduled_view.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ type ScheduledView struct {
6767
ParsingMode string `json:"parsingMode"`
6868
ReduceRetentionPeriodImmediately bool `json:"reduceRetentionPeriodImmediately"`
6969
TimeZone string `json:"timeZone,omitempty"`
70+
AutoPauseEnabled *bool `json:"autoPauseEnabled,omitempty"`
7071
}

website/docs/r/scheduled_view.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ The following arguments are supported:
4343
- `parsing_mode` - (Optional, Forces new resource) Default to `Manual`. Define the parsing mode to scan the JSON format log messages. Possible values are: `AutoParse` - In AutoParse mode, the system automatically figures out fields to parse based on the search query. `Manual` - While in the Manual mode, no fields are parsed out automatically. For more information see Dynamic Parsing.
4444
- `reduce_retention_period_immediately` - (Optional) This is required on update if the newly specified retention period is less than the existing retention period. In such a situation, a value of true says that data between the existing retention period and the new retention period should be deleted immediately; if false, such data will be deleted after seven days. This property is optional and ignored if the specified retentionPeriod is greater than or equal to the current retention period.
4545
- `time_zone` - (Optional) Time zone for ingesting data in scheduled view. Follow the format in the [IANA Time Zone Database][3].
46+
- `auto_pause_enabled` - (Optional) Whether auto pause is enabled. Default is `true`.
4647

4748
The following attributes are exported:
4849

0 commit comments

Comments
 (0)