Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [Unreleased]

- Make `field` property optional in a custom metrics SLO

## [0.11.14] - 2025-03-17

- Fix a provider crash when interacting with elasticstack_kibana_data_view resources created with 0.11.0. ([#979](https://github.com/elastic/terraform-provider-elasticstack/pull/979))
Expand Down
3 changes: 1 addition & 2 deletions generated/slo-spec.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#retrieved from https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml
openapi: 3.0.1
info:
title: SLOs
Expand Down Expand Up @@ -671,7 +672,6 @@ components:
required:
- name
- aggregation
- field
properties:
name:
description: The name of the metric. Only valid options are A-Z
Expand Down Expand Up @@ -712,7 +712,6 @@ components:
required:
- name
- aggregation
- field
properties:
name:
description: The name of the metric. Only valid options are A-Z
Expand Down
2 changes: 0 additions & 2 deletions generated/slo/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,6 @@ components:
type: string
required:
- aggregation
- field
- name
type: object
indicator_properties_custom_metric_params_good:
Expand Down Expand Up @@ -1562,7 +1561,6 @@ components:
type: string
required:
- aggregation
- field
- name
type: object
indicator_properties_custom_metric_params_total:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | The name of the metric. Only valid options are A-Z |
**Aggregation** | **string** | The aggregation type of the metric. Only valid option is \"sum\" |
**Field** | **string** | The field of the metric. |
**Field** | Pointer to **string** | The field of the metric. | [optional]
**Filter** | Pointer to **string** | The filter to apply to the metric. | [optional]

## Methods

### NewIndicatorPropertiesCustomMetricParamsGoodMetricsInner

`func NewIndicatorPropertiesCustomMetricParamsGoodMetricsInner(name string, aggregation string, field string, ) *IndicatorPropertiesCustomMetricParamsGoodMetricsInner`
`func NewIndicatorPropertiesCustomMetricParamsGoodMetricsInner(name string, aggregation string, ) *IndicatorPropertiesCustomMetricParamsGoodMetricsInner`

NewIndicatorPropertiesCustomMetricParamsGoodMetricsInner instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInner object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -87,6 +87,11 @@ and a boolean to check if the value has been set.

SetField sets Field field to given value.

### HasField

`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) HasField() bool`

HasField returns a boolean if a field has been set.

### GetFilter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | The name of the metric. Only valid options are A-Z |
**Aggregation** | **string** | The aggregation type of the metric. Only valid option is \"sum\" |
**Field** | **string** | The field of the metric. |
**Field** | Pointer to **string** | The field of the metric. | [optional]
**Filter** | Pointer to **string** | The filter to apply to the metric. | [optional]

## Methods

### NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner

`func NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner(name string, aggregation string, field string, ) *IndicatorPropertiesCustomMetricParamsTotalMetricsInner`
`func NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner(name string, aggregation string, ) *IndicatorPropertiesCustomMetricParamsTotalMetricsInner`

NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner instantiates a new IndicatorPropertiesCustomMetricParamsTotalMetricsInner object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -87,6 +87,11 @@ and a boolean to check if the value has been set.

SetField sets Field field to given value.

### HasField

`func (o *IndicatorPropertiesCustomMetricParamsTotalMetricsInner) HasField() bool`

HasField returns a boolean if a field has been set.

### GetFilter

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/kibana/slo.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ func getSloFromResourceData(d *schema.ResourceData) (models.Slo, diag.Diagnostic
idx := fmt.Sprint(n)
goodMetrics = append(goodMetrics, slo.IndicatorPropertiesCustomMetricParamsGoodMetricsInner{
Name: d.Get(indicatorType + ".0.good.0.metrics." + idx + ".name").(string),
Field: d.Get(indicatorType + ".0.good.0.metrics." + idx + ".field").(string),
Field: getOrNilString(indicatorType+".0.good.0.metrics."+idx+".field", d),
Aggregation: d.Get(indicatorType + ".0.good.0.metrics." + idx + ".aggregation").(string),
Filter: getOrNilString(indicatorType+".0.good.0.metrics."+idx+".filter", d),
})
Expand All @@ -610,7 +610,7 @@ func getSloFromResourceData(d *schema.ResourceData) (models.Slo, diag.Diagnostic
idx := fmt.Sprint(n)
totalMetrics = append(totalMetrics, slo.IndicatorPropertiesCustomMetricParamsTotalMetricsInner{
Name: d.Get(indicatorType + ".0.total.0.metrics." + idx + ".name").(string),
Field: d.Get(indicatorType + ".0.total.0.metrics." + idx + ".field").(string),
Field: getOrNilString(indicatorType+".0.total.0.metrics."+idx+".field", d),
Aggregation: d.Get(indicatorType + ".0.total.0.metrics." + idx + ".aggregation").(string),
Filter: getOrNilString(indicatorType+".0.total.0.metrics."+idx+".filter", d),
})
Expand Down
Loading