fix(deps): update stackit sdk modules (#846)
* fix(deps): update stackit sdk modules * feat: Use new generated enums Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> --------- Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de>
This commit is contained in:
parent
5d844a84d6
commit
7ce802769c
33 changed files with 222 additions and 225 deletions
|
|
@ -37,7 +37,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
DefaultScheme = "https" // API default is "http"
|
||||
DefaultScheme = observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTP // API default is "http"
|
||||
DefaultScrapeInterval = "5m"
|
||||
DefaultScrapeTimeout = "2m"
|
||||
DefaultSampleLimit = int64(5000)
|
||||
|
|
@ -187,7 +187,7 @@ func (r *scrapeConfigResource) Schema(_ context.Context, _ resource.SchemaReques
|
|||
Description: "Specifies the http scheme. Defaults to `https`.",
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Default: stringdefault.StaticString(DefaultScheme),
|
||||
Default: stringdefault.StaticString(string(DefaultScheme)),
|
||||
},
|
||||
"scrape_interval": schema.StringAttribute{
|
||||
Description: "Specifies the scrape interval as duration string. Defaults to `5m`.",
|
||||
|
|
@ -556,7 +556,7 @@ func mapFields(ctx context.Context, sc *observability.Job, model *Model) error {
|
|||
model.Name = types.StringValue(scName)
|
||||
|
||||
model.MetricsPath = types.StringPointerValue(sc.MetricsPath)
|
||||
model.Scheme = types.StringPointerValue(sc.Scheme)
|
||||
model.Scheme = types.StringValue(string(sc.GetScheme()))
|
||||
model.ScrapeInterval = types.StringPointerValue(sc.ScrapeInterval)
|
||||
model.ScrapeTimeout = types.StringPointerValue(sc.ScrapeTimeout)
|
||||
model.SampleLimit = types.Int64PointerValue(sc.SampleLimit)
|
||||
|
|
@ -695,7 +695,7 @@ func toCreatePayload(ctx context.Context, model *Model, saml2Model *saml2Model,
|
|||
ScrapeTimeout: conversion.StringValueToPointer(model.ScrapeTimeout),
|
||||
// potentially lossy conversion, depending on the allowed range for sample_limit
|
||||
SampleLimit: utils.Ptr(float64(model.SampleLimit.ValueInt64())),
|
||||
Scheme: conversion.StringValueToPointer(model.Scheme),
|
||||
Scheme: observability.CreateScrapeConfigPayloadGetSchemeAttributeType(conversion.StringValueToPointer(model.Scheme)),
|
||||
}
|
||||
setDefaultsCreateScrapeConfig(&sc, model, saml2Model)
|
||||
|
||||
|
|
@ -747,7 +747,7 @@ func setDefaultsCreateScrapeConfig(sc *observability.CreateScrapeConfigPayload,
|
|||
return
|
||||
}
|
||||
if model.Scheme.IsNull() || model.Scheme.IsUnknown() {
|
||||
sc.Scheme = utils.Ptr(DefaultScheme)
|
||||
sc.Scheme = DefaultScheme.Ptr()
|
||||
}
|
||||
if model.ScrapeInterval.IsNull() || model.ScrapeInterval.IsUnknown() {
|
||||
sc.ScrapeInterval = utils.Ptr(DefaultScrapeInterval)
|
||||
|
|
@ -784,7 +784,7 @@ func toUpdatePayload(ctx context.Context, model *Model, saml2Model *saml2Model,
|
|||
ScrapeTimeout: conversion.StringValueToPointer(model.ScrapeTimeout),
|
||||
// potentially lossy conversion, depending on the allowed range for sample_limit
|
||||
SampleLimit: utils.Ptr(float64(model.SampleLimit.ValueInt64())),
|
||||
Scheme: conversion.StringValueToPointer(model.Scheme),
|
||||
Scheme: observability.UpdateScrapeConfigPayloadGetSchemeAttributeType(conversion.StringValueToPointer(model.Scheme)),
|
||||
}
|
||||
setDefaultsUpdateScrapeConfig(&sc, model)
|
||||
|
||||
|
|
@ -836,7 +836,7 @@ func setDefaultsUpdateScrapeConfig(sc *observability.UpdateScrapeConfigPayload,
|
|||
return
|
||||
}
|
||||
if model.Scheme.IsNull() || model.Scheme.IsUnknown() {
|
||||
sc.Scheme = utils.Ptr(DefaultScheme)
|
||||
sc.Scheme = observability.UpdateScrapeConfigPayloadGetSchemeAttributeType(DefaultScheme.Ptr())
|
||||
}
|
||||
if model.ScrapeInterval.IsNull() || model.ScrapeInterval.IsUnknown() {
|
||||
sc.ScrapeInterval = utils.Ptr(DefaultScrapeInterval)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ func TestMapFields(t *testing.T) {
|
|||
InstanceId: types.StringValue("iid"),
|
||||
Name: types.StringValue("name"),
|
||||
MetricsPath: types.StringNull(),
|
||||
Scheme: types.StringNull(),
|
||||
Scheme: types.StringValue(""),
|
||||
ScrapeInterval: types.StringNull(),
|
||||
ScrapeTimeout: types.StringNull(),
|
||||
SAML2: types.ObjectNull(saml2Types),
|
||||
|
|
@ -48,7 +48,7 @@ func TestMapFields(t *testing.T) {
|
|||
Username: utils.Ptr("u"),
|
||||
},
|
||||
Params: &map[string][]string{"saml2": {"disabled"}, "x": {"y", "z"}},
|
||||
Scheme: utils.Ptr("scheme"),
|
||||
Scheme: observability.JOBSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("1"),
|
||||
ScrapeTimeout: utils.Ptr("2"),
|
||||
SampleLimit: utils.Ptr(int64(17)),
|
||||
|
|
@ -73,7 +73,7 @@ func TestMapFields(t *testing.T) {
|
|||
InstanceId: types.StringValue("iid"),
|
||||
Name: types.StringValue("name"),
|
||||
MetricsPath: types.StringValue("/m"),
|
||||
Scheme: types.StringValue("scheme"),
|
||||
Scheme: types.StringValue(string(observability.JOBSCHEME_HTTP)),
|
||||
ScrapeInterval: types.StringValue("1"),
|
||||
ScrapeTimeout: types.StringValue("2"),
|
||||
SampleLimit: types.Int64Value(17),
|
||||
|
|
@ -163,7 +163,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
&observability.CreateScrapeConfigPayload{
|
||||
MetricsPath: utils.Ptr("/metrics"),
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("https"),
|
||||
Scheme: observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -188,7 +188,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
JobName: utils.Ptr("Name"),
|
||||
Params: &map[string]any{"saml2": []string{"disabled"}},
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("https"),
|
||||
Scheme: observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -212,7 +212,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
JobName: utils.Ptr("Name"),
|
||||
Params: &map[string]any{"saml2": []string{"enabled"}},
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("https"),
|
||||
Scheme: observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -240,7 +240,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
Password: utils.Ptr("p"),
|
||||
},
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("https"),
|
||||
Scheme: observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -289,7 +289,7 @@ func TestToCreatePayload(t *testing.T) {
|
|||
},
|
||||
},
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("https"),
|
||||
Scheme: observability.CREATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -347,7 +347,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
&observability.UpdateScrapeConfigPayload{
|
||||
MetricsPath: utils.Ptr("/metrics"),
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("https"),
|
||||
Scheme: observability.UPDATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -369,7 +369,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
&observability.UpdateScrapeConfigPayload{
|
||||
MetricsPath: utils.Ptr("/metrics"),
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("http"),
|
||||
Scheme: observability.UPDATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -392,7 +392,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
&observability.UpdateScrapeConfigPayload{
|
||||
MetricsPath: utils.Ptr("/metrics"),
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("http"),
|
||||
Scheme: observability.UPDATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -420,7 +420,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
Password: utils.Ptr("p"),
|
||||
},
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("https"),
|
||||
Scheme: observability.UPDATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
@ -467,7 +467,7 @@ func TestToUpdatePayload(t *testing.T) {
|
|||
},
|
||||
},
|
||||
// Defaults
|
||||
Scheme: utils.Ptr("https"),
|
||||
Scheme: observability.UPDATESCRAPECONFIGPAYLOADSCHEME_HTTP.Ptr(),
|
||||
ScrapeInterval: utils.Ptr("5m"),
|
||||
ScrapeTimeout: utils.Ptr("2m"),
|
||||
SampleLimit: utils.Ptr(float64(5000)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue