feat(observability): add send_resolved field (#935)

relates to STACKITTPR-283
This commit is contained in:
Ruben Hönle 2025-09-12 17:28:50 +02:00 committed by GitHub
parent b1e97e92f9
commit 4b46119433
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 110 additions and 52 deletions

View file

@ -24,6 +24,7 @@ func fixtureEmailConfigsModel() basetypes.ListValue {
"auth_password": types.StringValue("password"),
"auth_username": types.StringValue("username"),
"from": types.StringValue("notification@example.com"),
"send_resolved": types.BoolValue(true),
"smart_host": types.StringValue("smtp.example.com"),
"to": types.StringValue("me@example.com"),
}),
@ -33,10 +34,11 @@ func fixtureEmailConfigsModel() basetypes.ListValue {
func fixtureOpsGenieConfigsModel() basetypes.ListValue {
return types.ListValueMust(types.ObjectType{AttrTypes: opsgenieConfigsTypes}, []attr.Value{
types.ObjectValueMust(opsgenieConfigsTypes, map[string]attr.Value{
"api_key": types.StringValue("key"),
"tags": types.StringValue("tag"),
"api_url": types.StringValue("ops.example.com"),
"priority": types.StringValue("P3"),
"api_key": types.StringValue("key"),
"tags": types.StringValue("tag"),
"api_url": types.StringValue("ops.example.com"),
"priority": types.StringValue("P3"),
"send_resolved": types.BoolValue(true),
}),
})
}
@ -44,9 +46,10 @@ func fixtureOpsGenieConfigsModel() basetypes.ListValue {
func fixtureWebHooksConfigsModel() basetypes.ListValue {
return types.ListValueMust(types.ObjectType{AttrTypes: webHooksConfigsTypes}, []attr.Value{
types.ObjectValueMust(webHooksConfigsTypes, map[string]attr.Value{
"url": types.StringValue("http://example.com"),
"ms_teams": types.BoolValue(true),
"google_chat": types.BoolValue(true),
"url": types.StringValue("http://example.com"),
"ms_teams": types.BoolValue(true),
"google_chat": types.BoolValue(true),
"send_resolved": types.BoolValue(true),
}),
})
}
@ -135,6 +138,7 @@ func fixtureEmailConfigsPayload() observability.CreateAlertConfigReceiverPayload
AuthPassword: utils.Ptr("password"),
AuthUsername: utils.Ptr("username"),
From: utils.Ptr("notification@example.com"),
SendResolved: utils.Ptr(true),
Smarthost: utils.Ptr("smtp.example.com"),
To: utils.Ptr("me@example.com"),
}
@ -142,18 +146,20 @@ func fixtureEmailConfigsPayload() observability.CreateAlertConfigReceiverPayload
func fixtureOpsGenieConfigsPayload() observability.CreateAlertConfigReceiverPayloadOpsgenieConfigsInner {
return observability.CreateAlertConfigReceiverPayloadOpsgenieConfigsInner{
ApiKey: utils.Ptr("key"),
Tags: utils.Ptr("tag"),
ApiUrl: utils.Ptr("ops.example.com"),
Priority: utils.Ptr("P3"),
ApiKey: utils.Ptr("key"),
Tags: utils.Ptr("tag"),
ApiUrl: utils.Ptr("ops.example.com"),
Priority: utils.Ptr("P3"),
SendResolved: utils.Ptr(true),
}
}
func fixtureWebHooksConfigsPayload() observability.CreateAlertConfigReceiverPayloadWebHookConfigsInner {
return observability.CreateAlertConfigReceiverPayloadWebHookConfigsInner{
Url: utils.Ptr("http://example.com"),
MsTeams: utils.Ptr(true),
GoogleChat: utils.Ptr(true),
Url: utils.Ptr("http://example.com"),
MsTeams: utils.Ptr(true),
GoogleChat: utils.Ptr(true),
SendResolved: utils.Ptr(true),
}
}
@ -216,6 +222,7 @@ func fixtureEmailConfigsResponse() observability.EmailConfig {
AuthPassword: utils.Ptr("password"),
AuthUsername: utils.Ptr("username"),
From: utils.Ptr("notification@example.com"),
SendResolved: utils.Ptr(true),
Smarthost: utils.Ptr("smtp.example.com"),
To: utils.Ptr("me@example.com"),
}
@ -223,18 +230,20 @@ func fixtureEmailConfigsResponse() observability.EmailConfig {
func fixtureOpsGenieConfigsResponse() observability.OpsgenieConfig {
return observability.OpsgenieConfig{
ApiKey: utils.Ptr("key"),
Tags: utils.Ptr("tag"),
ApiUrl: utils.Ptr("ops.example.com"),
Priority: utils.Ptr("P3"),
ApiKey: utils.Ptr("key"),
Tags: utils.Ptr("tag"),
ApiUrl: utils.Ptr("ops.example.com"),
Priority: utils.Ptr("P3"),
SendResolved: utils.Ptr(true),
}
}
func fixtureWebHooksConfigsResponse() observability.WebHook {
return observability.WebHook{
Url: utils.Ptr("http://example.com"),
MsTeams: utils.Ptr(true),
GoogleChat: utils.Ptr(true),
Url: utils.Ptr("http://example.com"),
MsTeams: utils.Ptr(true),
GoogleChat: utils.Ptr(true),
SendResolved: utils.Ptr(true),
}
}