diff --git a/internal/locality/regional/schemas_framework.go b/internal/locality/regional/schemas_framework.go new file mode 100644 index 0000000000..4b287758bc --- /dev/null +++ b/internal/locality/regional/schemas_framework.go @@ -0,0 +1,24 @@ +package regional + +import ( + "github.com/hashicorp/terraform-plugin-framework/action/schema" + "github.com/scaleway/scaleway-sdk-go/scw" +) + +// AllRegions returns all valid Scaleway regions as strings +func AllRegions() []string { + regions := make([]string, 0, len(scw.AllRegions)) + for _, r := range scw.AllRegions { + regions = append(regions, r.String()) + } + + return regions +} + +// SchemaAttribute returns a Plugin Framework schema attribute for a region field +func SchemaAttribute() schema.StringAttribute { + return schema.StringAttribute{ + Optional: true, + Description: "The region you want to attach the resource to", + } +} diff --git a/internal/services/cockpit/action_trigger_test_alert_action.go b/internal/services/cockpit/action_trigger_test_alert_action.go new file mode 100644 index 0000000000..8100fd8432 --- /dev/null +++ b/internal/services/cockpit/action_trigger_test_alert_action.go @@ -0,0 +1,140 @@ +package cockpit + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-framework/action" + "github.com/hashicorp/terraform-plugin-framework/action/schema" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/scaleway/scaleway-sdk-go/api/cockpit/v1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/meta" +) + +var ( + _ action.Action = (*TriggerTestAlertAction)(nil) + _ action.ActionWithConfigure = (*TriggerTestAlertAction)(nil) +) + +type TriggerTestAlertAction struct { + regionalAPI *cockpit.RegionalAPI + meta *meta.Meta +} + +func (a *TriggerTestAlertAction) Configure(ctx context.Context, req action.ConfigureRequest, resp *action.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + m, ok := req.ProviderData.(*meta.Meta) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Action Configure Type", + fmt.Sprintf("Expected *meta.Meta, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + + return + } + + client := m.ScwClient() + a.regionalAPI = cockpit.NewRegionalAPI(client) + a.meta = m +} + +func (a *TriggerTestAlertAction) Metadata(ctx context.Context, req action.MetadataRequest, resp *action.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_cockpit_trigger_test_alert_action" +} + +type TriggerTestAlertActionModel struct { + ProjectID types.String `tfsdk:"project_id"` + Region types.String `tfsdk:"region"` +} + +func NewTriggerTestAlertAction() action.Action { + return &TriggerTestAlertAction{} +} + +func (a *TriggerTestAlertAction) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "project_id": schema.StringAttribute{ + Required: true, + Description: "ID of the Project", + }, + "region": regional.SchemaAttribute(), + }, + } +} + +func (a *TriggerTestAlertAction) Invoke(ctx context.Context, req action.InvokeRequest, resp *action.InvokeResponse) { + var data TriggerTestAlertActionModel + + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + if a.regionalAPI == nil { + resp.Diagnostics.AddError( + "Unconfigured regionalAPI", + "The action was not properly configured. The Scaleway client is missing. "+ + "This is usually a bug in the provider. Please report it to the maintainers.", + ) + + return + } + + if data.ProjectID.IsNull() || data.ProjectID.ValueString() == "" { + resp.Diagnostics.AddError( + "Missing project_id", + "The project_id attribute is required to trigger a test alert.", + ) + + return + } + + var region scw.Region + + if !data.Region.IsNull() && data.Region.ValueString() != "" { + parsedRegion, err := scw.ParseRegion(data.Region.ValueString()) + if err != nil { + resp.Diagnostics.AddError( + "Invalid region", + fmt.Sprintf("The region attribute must be a valid Scaleway region. Got %q: %s", data.Region.ValueString(), err), + ) + + return + } + + region = parsedRegion + } else { + // Use default region from provider configuration + defaultRegion, exists := a.meta.ScwClient().GetDefaultRegion() + if !exists { + resp.Diagnostics.AddError( + "Missing region", + "The region attribute is required to trigger a test alert. Please provide it explicitly or configure a default region in the provider.", + ) + + return + } + + region = defaultRegion + } + + err := a.regionalAPI.TriggerTestAlert(&cockpit.RegionalAPITriggerTestAlertRequest{ + ProjectID: data.ProjectID.ValueString(), + Region: region, + }, scw.WithContext(ctx)) + if err != nil { + resp.Diagnostics.AddError( + "Error executing Cockpit TriggerTestAlert action", + fmt.Sprintf("Failed to trigger test alert for project %s: %s", data.ProjectID.ValueString(), err), + ) + + return + } +} diff --git a/internal/services/cockpit/action_trigger_test_alert_action_test.go b/internal/services/cockpit/action_trigger_test_alert_action_test.go new file mode 100644 index 0000000000..19c40e51cf --- /dev/null +++ b/internal/services/cockpit/action_trigger_test_alert_action_test.go @@ -0,0 +1,118 @@ +package cockpit_test + +import ( + "errors" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" +) + +func TestAccActionCockpitTriggerTestAlert_Basic(t *testing.T) { + if acctest.IsRunningOpenTofu() { + t.Skip("Skipping TestAccActionCockpitTriggerTestAlert_Basic because actions are not yet supported on OpenTofu") + } + + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + ProtoV6ProviderFactories: tt.ProviderFactories, + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_account_project" "project" { + name = "tf_tests_cockpit_trigger_test_alert" + } + + resource "scaleway_cockpit_alert_manager" "main" { + project_id = scaleway_account_project.project.id + } + + resource "scaleway_cockpit_source" "metrics" { + project_id = scaleway_account_project.project.id + name = "test-metrics-source" + type = "metrics" + retention_days = 31 + + lifecycle { + action_trigger { + events = [after_create] + actions = [action.scaleway_cockpit_trigger_test_alert_action.main] + } + } + + depends_on = [scaleway_cockpit_alert_manager.main] + } + + action "scaleway_cockpit_trigger_test_alert_action" "main" { + config { + project_id = scaleway_account_project.project.id + } + } + `, + }, + { + Config: ` + resource "scaleway_account_project" "project" { + name = "tf_tests_cockpit_trigger_test_alert" + } + + resource "scaleway_cockpit_alert_manager" "main" { + project_id = scaleway_account_project.project.id + } + + resource "scaleway_cockpit_source" "metrics" { + project_id = scaleway_account_project.project.id + name = "test-metrics-source" + type = "metrics" + retention_days = 31 + + lifecycle { + action_trigger { + events = [after_create] + actions = [action.scaleway_cockpit_trigger_test_alert_action.main] + } + } + + depends_on = [scaleway_cockpit_alert_manager.main] + } + + action "scaleway_cockpit_trigger_test_alert_action" "main" { + config { + project_id = scaleway_account_project.project.id + } + } + + data "scaleway_audit_trail_event" "cockpit" { + project_id = scaleway_account_project.project.id + method_name = "TriggerTestAlert" + } + `, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.scaleway_audit_trail_event.cockpit", "events.#"), + func(state *terraform.State) error { + rs, ok := state.RootModule().Resources["data.scaleway_audit_trail_event.cockpit"] + if !ok { + return errors.New("not found: data.scaleway_audit_trail_event.cockpit") + } + + for key, value := range rs.Primary.Attributes { + if !strings.Contains(key, "method_name") { + continue + } + + if value == "TriggerTestAlert" { + return nil + } + } + + return errors.New("did not find the TriggerTestAlert event") + }, + ), + }, + }, + }) +} diff --git a/internal/services/cockpit/testdata/action-cockpit-trigger-test-alert-basic.cassette.yaml b/internal/services/cockpit/testdata/action-cockpit-trigger-test-alert-basic.cassette.yaml new file mode 100644 index 0000000000..aaefa31d94 --- /dev/null +++ b/internal/services/cockpit/testdata/action-cockpit-trigger-test-alert-basic.cassette.yaml @@ -0,0 +1,1432 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 120 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf_tests_cockpit_trigger_test_alert","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","description":""}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 277 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:19.599344Z","description":"","id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","name":"tf_tests_cockpit_trigger_test_alert","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":null,"updated_at":"2025-12-05T09:31:19.599344Z"}' + headers: + Content-Length: + - "277" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:19 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c07554af-7847-45f8-b58d-210dfe403b48 + status: 200 OK + code: 200 + duration: 567.061042ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 322 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:19.599344Z","description":"","id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","name":"tf_tests_cockpit_trigger_test_alert","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-12-05T09:31:19.599344Z"}' + headers: + Content-Length: + - "322" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:20 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e876af7e-a1e6-4ddf-813d-177bfa2fe89e + status: 200 OK + code: 200 + duration: 190.346708ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 53 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/enable + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 187 + uncompressed: false + body: '{"alert_manager_enabled":true,"alert_manager_url":"https://7a84b20e-0d34-45bf-8956-61406583a3cd.alertmanager.cockpit.fr-par.scw.cloud","managed_alerts_enabled":false,"region":"fr-par"}' + headers: + Content-Length: + - "187" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:20 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5ca13682-7581-4e42-a105-329df89d932c + status: 200 OK + code: 200 + duration: 340.521417ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 53 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/managed-alerts/enable + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 186 + uncompressed: false + body: '{"alert_manager_enabled":true,"alert_manager_url":"https://7a84b20e-0d34-45bf-8956-61406583a3cd.alertmanager.cockpit.fr-par.scw.cloud","managed_alerts_enabled":true,"region":"fr-par"}' + headers: + Content-Length: + - "186" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:23 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 413783f7-1207-43c5-b2b0-32ce1e5f3ee1 + status: 200 OK + code: 200 + duration: 2.747412041s + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 186 + uncompressed: false + body: '{"alert_manager_enabled":true,"alert_manager_url":"https://7a84b20e-0d34-45bf-8956-61406583a3cd.alertmanager.cockpit.fr-par.scw.cloud","managed_alerts_enabled":true,"region":"fr-par"}' + headers: + Content-Length: + - "186" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:23 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1673e3d1-d56d-4948-80d3-2766dd39ab46 + status: 200 OK + code: 200 + duration: 118.537875ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 111 + uncompressed: false + body: '{"contact_points":[],"has_additional_contact_points":false,"has_additional_receivers":false,"total_count":0}' + headers: + Content-Length: + - "111" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:23 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 585a7dbf-a016-472d-8ea3-72cf646da9f3 + status: 200 OK + code: 200 + duration: 142.14275ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 53 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/trigger-test-alert + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:23 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 77688625-5dc1-49c2-9aca-655577ae63bd + status: 204 No Content + code: 204 + duration: 257.615083ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 119 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","name":"test-metrics-source","type":"metrics","retention_days":31}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:23.668391Z","current_month_usage":0,"id":"c9a4784f-b0bd-444e-880c-aa1c60f1896a","name":"test-metrics-source","origin":"custom","project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-12-05T09:31:23.668391Z","url":"https://c9a4784f-b0bd-444e-880c-aa1c60f1896a.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:23 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7b5a5926-1b9f-43f2-b8ce-11aff37ab67d + status: 200 OK + code: 200 + duration: 366.24875ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c9a4784f-b0bd-444e-880c-aa1c60f1896a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:23.668391Z","current_month_usage":0,"id":"c9a4784f-b0bd-444e-880c-aa1c60f1896a","name":"test-metrics-source","origin":"custom","project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-12-05T09:31:23.668391Z","url":"https://c9a4784f-b0bd-444e-880c-aa1c60f1896a.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:23 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9745aac4-cf7b-498e-b47d-e545e1b2be5c + status: 200 OK + code: 200 + duration: 128.98975ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 322 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:19.599344Z","description":"","id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","name":"tf_tests_cockpit_trigger_test_alert","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-12-05T09:31:19.599344Z"}' + headers: + Content-Length: + - "322" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:24 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3b00deb6-53d1-403f-84d5-3158673e555f + status: 200 OK + code: 200 + duration: 231.023625ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 186 + uncompressed: false + body: '{"alert_manager_enabled":true,"alert_manager_url":"https://7a84b20e-0d34-45bf-8956-61406583a3cd.alertmanager.cockpit.fr-par.scw.cloud","managed_alerts_enabled":true,"region":"fr-par"}' + headers: + Content-Length: + - "186" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:24 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3eb74b0b-f13f-4d91-a73f-dc50f495420b + status: 200 OK + code: 200 + duration: 105.819834ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 111 + uncompressed: false + body: '{"contact_points":[],"has_additional_contact_points":false,"has_additional_receivers":false,"total_count":0}' + headers: + Content-Length: + - "111" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:24 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0d4c3343-6f2c-4b48-83a0-646a63b59f81 + status: 200 OK + code: 200 + duration: 144.468166ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c9a4784f-b0bd-444e-880c-aa1c60f1896a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:23.668391Z","current_month_usage":0,"id":"c9a4784f-b0bd-444e-880c-aa1c60f1896a","name":"test-metrics-source","origin":"custom","project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-12-05T09:31:23.668391Z","url":"https://c9a4784f-b0bd-444e-880c-aa1c60f1896a.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:24 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 677efe82-7099-4aa3-b1d6-b2113eb375b7 + status: 200 OK + code: 200 + duration: 39.170792ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 322 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:19.599344Z","description":"","id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","name":"tf_tests_cockpit_trigger_test_alert","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-12-05T09:31:19.599344Z"}' + headers: + Content-Length: + - "322" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:25 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e58a5e46-d27b-458f-86bc-61995b299e74 + status: 200 OK + code: 200 + duration: 219.520542ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 186 + uncompressed: false + body: '{"alert_manager_enabled":true,"alert_manager_url":"https://7a84b20e-0d34-45bf-8956-61406583a3cd.alertmanager.cockpit.fr-par.scw.cloud","managed_alerts_enabled":true,"region":"fr-par"}' + headers: + Content-Length: + - "186" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:25 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5b1503ac-e1b6-45f4-ba98-0279ee8fe381 + status: 200 OK + code: 200 + duration: 117.078292ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/audit-trail/v1alpha1/regions/fr-par/events?method_name=TriggerTestAlert&order_by=recorded_at_desc&organization_id=105bdce1-64c0-48ab-899d-868455867ecf&project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0&resource_type=unknown_type + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 13 + uncompressed: false + body: '{"events":[]}' + headers: + Content-Length: + - "13" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:25 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cdf810c4-b1d8-4662-9a64-137091e4a106 + status: 200 OK + code: 200 + duration: 151.133416ms + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 111 + uncompressed: false + body: '{"contact_points":[],"has_additional_contact_points":false,"has_additional_receivers":false,"total_count":0}' + headers: + Content-Length: + - "111" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:25 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 4d8789e4-99d5-4f6c-aade-7b316f8da21b + status: 200 OK + code: 200 + duration: 64.49ms + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c9a4784f-b0bd-444e-880c-aa1c60f1896a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:23.668391Z","current_month_usage":0,"id":"c9a4784f-b0bd-444e-880c-aa1c60f1896a","name":"test-metrics-source","origin":"custom","project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-12-05T09:31:23.668391Z","url":"https://c9a4784f-b0bd-444e-880c-aa1c60f1896a.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:25 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7a385fa1-862e-4b38-b5a0-dcaa8b6d468a + status: 200 OK + code: 200 + duration: 141.390584ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/audit-trail/v1alpha1/regions/fr-par/events?method_name=TriggerTestAlert&order_by=recorded_at_desc&organization_id=105bdce1-64c0-48ab-899d-868455867ecf&project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0&resource_type=unknown_type + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 13 + uncompressed: false + body: '{"events":[]}' + headers: + Content-Length: + - "13" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:25 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 726025de-d439-44c8-81d5-101429545c16 + status: 200 OK + code: 200 + duration: 39.558ms + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 322 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:19.599344Z","description":"","id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","name":"tf_tests_cockpit_trigger_test_alert","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-12-05T09:31:19.599344Z"}' + headers: + Content-Length: + - "322" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:26 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 865a55db-a7a6-4b43-8736-e4cf7c52f4cd + status: 200 OK + code: 200 + duration: 56.021833ms + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 186 + uncompressed: false + body: '{"alert_manager_enabled":true,"alert_manager_url":"https://7a84b20e-0d34-45bf-8956-61406583a3cd.alertmanager.cockpit.fr-par.scw.cloud","managed_alerts_enabled":true,"region":"fr-par"}' + headers: + Content-Length: + - "186" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:26 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f0df9a33-ccc7-468b-9d28-37d99e1d9e2c + status: 200 OK + code: 200 + duration: 43.468792ms + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/audit-trail/v1alpha1/regions/fr-par/events?method_name=TriggerTestAlert&order_by=recorded_at_desc&organization_id=105bdce1-64c0-48ab-899d-868455867ecf&project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0&resource_type=unknown_type + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 13 + uncompressed: false + body: '{"events":[]}' + headers: + Content-Length: + - "13" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:26 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e6c69264-5324-4510-ad19-3e4955086c2a + status: 200 OK + code: 200 + duration: 102.697541ms + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 111 + uncompressed: false + body: '{"contact_points":[],"has_additional_contact_points":false,"has_additional_receivers":false,"total_count":0}' + headers: + Content-Length: + - "111" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:26 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7e6f7c22-8d17-4645-b2b3-67722d709c53 + status: 200 OK + code: 200 + duration: 92.839125ms + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c9a4784f-b0bd-444e-880c-aa1c60f1896a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"created_at":"2025-12-05T09:31:23.668391Z","current_month_usage":0,"id":"c9a4784f-b0bd-444e-880c-aa1c60f1896a","name":"test-metrics-source","origin":"custom","project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-12-05T09:31:23.668391Z","url":"https://c9a4784f-b0bd-444e-880c-aa1c60f1896a.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:26 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - beec59c4-271a-4224-99db-3bb67cff3c7a + status: 200 OK + code: 200 + duration: 118.315958ms + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c9a4784f-b0bd-444e-880c-aa1c60f1896a + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:27 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 02345058-a4e1-40cf-ba9c-fcd57dc4c3f9 + status: 204 No Content + code: 204 + duration: 499.549458ms + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/contact-points?project_id=d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 111 + uncompressed: false + body: '{"contact_points":[],"has_additional_contact_points":false,"has_additional_receivers":false,"total_count":0}' + headers: + Content-Length: + - "111" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:27 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b5c95985-8f86-4e7d-bb3c-e973a9c56436 + status: 200 OK + code: 200 + duration: 144.958917ms + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 53 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/managed-alerts/disable + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 187 + uncompressed: false + body: '{"alert_manager_enabled":true,"alert_manager_url":"https://7a84b20e-0d34-45bf-8956-61406583a3cd.alertmanager.cockpit.fr-par.scw.cloud","managed_alerts_enabled":false,"region":"fr-par"}' + headers: + Content-Length: + - "187" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:27 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c1e3e961-8179-4146-8497-5c3aa41a8f28 + status: 200 OK + code: 200 + duration: 353.87775ms + - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 53 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"d39dc79c-0882-4f2a-ac07-b436f74f3ec0"}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/alert-manager/disable + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 108 + uncompressed: false + body: '{"alert_manager_enabled":false,"alert_manager_url":null,"managed_alerts_enabled":false,"region":"fr-par"}' + headers: + Content-Length: + - "108" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:27 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e793e891-6610-422d-b910-26b3c498d900 + status: 200 OK + code: 200 + duration: 239.674708ms + - id: 28 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.25.3; darwin; amd64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/d39dc79c-0882-4f2a-ac07-b436f74f3ec0 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 05 Dec 2025 09:31:29 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7a7583e4-e37a-4868-9cc2-497db91f9a86 + status: 204 No Content + code: 204 + duration: 1.507085667s diff --git a/provider/framework.go b/provider/framework.go index b35c784344..6c6ea73a31 100644 --- a/provider/framework.go +++ b/provider/framework.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/scaleway/terraform-provider-scaleway/v2/internal/meta" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/cockpit" "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/instance" "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/jobs" ) @@ -139,6 +140,7 @@ func (p *ScalewayProvider) Actions(_ context.Context) []func() action.Action { var res []func() action.Action res = append(res, instance.NewServerAction) + res = append(res, cockpit.NewTriggerTestAlertAction) res = append(res, jobs.NewStartJobDefinitionAction) return res diff --git a/templates/actions/cockpit_trigger_test_alert_action.md.tmpl b/templates/actions/cockpit_trigger_test_alert_action.md.tmpl new file mode 100644 index 0000000000..afdc0a2667 --- /dev/null +++ b/templates/actions/cockpit_trigger_test_alert_action.md.tmpl @@ -0,0 +1,10 @@ +{{- /*gotype: github.com/hashicorp/terraform-plugin-docs/internal/provider.ActionTemplateType */ -}} +--- +subcategory: "Cockpit" +page_title: "Scaleway: scaleway_cockpit_trigger_test_alert_action" +--- + +# scaleway_cockpit_trigger_test_alert_action (Action) + +{{ .SchemaMarkdown }} +