Skip to content

Commit 2d8f105

Browse files
authored
Merge pull request #381 from SumoLogic/agrv-slo-docs
[SLO] fix allowed value for compliance window size
2 parents 468b61f + 54ebfce commit 2d8f105

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

sumologic/resource_sumologic_slo.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ func resourceSumologicSLO() *schema.Resource {
211211
Type: schema.TypeString,
212212
Required: true,
213213
ValidateFunc: validation.StringInSlice([]string{
214+
"Week", "Month", "Quarter",
214215
"1d", "2d", "3d", "4d", "5d", "6d", "7d", "8d", "9d", "10d", "11d", "12d", "13d", "14d",
215216
}, false),
216217
},
@@ -519,15 +520,25 @@ func getSLOCompliance(d *schema.ResourceData) *SLOCompliance {
519520
complianceType := complianceDict["compliance_type"].(string)
520521

521522
startFrom := ""
522-
if complianceType == "Calendar" && complianceDict["start_from"] != nil {
523-
startFrom = complianceDict["start_from"].(string)
523+
windowType := ""
524+
size := complianceDict["size"].(string)
525+
526+
if complianceType == "Calendar" {
527+
// field windowType needs to be specified instead of `size` for calendar compliance
528+
windowType = size
529+
size = ""
530+
531+
if complianceDict["start_from"] != nil {
532+
startFrom = complianceDict["start_from"].(string)
533+
}
524534
}
525535

526536
return &SLOCompliance{
527537
ComplianceType: complianceType,
528538
Target: complianceDict["target"].(float64),
529539
Timezone: complianceDict["timezone"].(string),
530-
Size: complianceDict["size"].(string),
540+
Size: size,
541+
WindowType: windowType,
531542
StartFrom: startFrom,
532543
}
533544
}

website/docs/r/slo.html.markdown

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,17 @@ The following arguments are supported:
9797
- `target` - (Required) The target value to use, must be a number between 0 and 100.
9898
- `timezone` - (Required) Time zone for the SLO compliance. Follow the format in the [IANA Time Zone Database][3].
9999
- `size` - (Required) The size of the compliance period to use.
100-
For `Calendar` compliance type the allowed values are `Week`, `Month`, `Quarter`.
101-
- `start_from` - (Optional) Start of the calendar window. For week, it would be the day of the week (for e.g Sunday,
102-
Monday etc). For month, it will always be the first day of the month. For quarter, it would be the first month of
103-
the quarter (for e.g January, February etc.)
104-
- `indicator` - (Required) The service level indicator on which SLO is to be defined. more details on the difference
105-
b/w them can be found on
106-
the [slo help page](https://help.sumologic.com/Beta/SLO_Reliability_Management/Access_and_Create_SLOs)
107-
- [window_based_evaluation](#window_based_evaluation) - Evaluate SLI using successful/total windows.
108-
- [request_based_evaluation](#request_based_evaluation) - Evaluate SLI based on occurrence of successful
109-
events / total events over entire compliance period.
100+
- For `Rolling` compliance type it must be a multiple of days e.g. `1d`, `2d`.
101+
- For `Calendar` compliance type the allowed values are `Week`, `Month`, `Quarter`.
102+
- `start_from` - Start of the calendar window. For `Week` its required and it would be the day of the week (for e.g. Sunday,
103+
Monday etc). For `Quarter` its required, it would be the first month of the start of quarter (for e.g. January, February etc.).
104+
For `Month` it's not required and is set to first day of the month.
105+
- `indicator` - (Required) The service level indicator on which SLO is to be defined. more details on the difference
106+
b/w them can be found on
107+
the [slo help page](https://help.sumologic.com/Beta/SLO_Reliability_Management/Access_and_Create_SLOs)
108+
- [window_based_evaluation](#window_based_evaluation) - Evaluate SLI using successful/total windows.
109+
- [request_based_evaluation](#request_based_evaluation) - Evaluate SLI based on occurrence of successful
110+
events / total events over entire compliance period.
110111

111112
#### window_based_evaluation
112113

0 commit comments

Comments
 (0)