From 60741d4d9292cc6fe49fb45de8466f9ef08635c9 Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Thu, 4 Sep 2025 06:48:49 +0200 Subject: [PATCH] feat(cockpit): add scaleway_cockpit_sources data source --- docs/data-sources/cockpit_sources.md | 86 ++ internal/provider/provider.go | 1 + .../services/cockpit/sources_data_source.go | 119 +++ .../cockpit/sources_data_source_test.go | 208 ++++ ...kpit-sources-data-source-all.cassette.yaml | 885 ++++++++++++++++++ ...-sources-data-source-by-name.cassette.yaml | 885 ++++++++++++++++++ ...-sources-data-source-by-type.cassette.yaml | 885 ++++++++++++++++++ ...-data-source-default-sources.cassette.yaml | 738 +++++++++++++++ ...it-sources-data-source-empty.cassette.yaml | 395 ++++++++ .../data-sources/cockpit_sources.md.tmpl | 86 ++ 10 files changed, 4288 insertions(+) create mode 100644 docs/data-sources/cockpit_sources.md create mode 100644 internal/services/cockpit/sources_data_source.go create mode 100644 internal/services/cockpit/sources_data_source_test.go create mode 100644 internal/services/cockpit/testdata/cockpit-sources-data-source-all.cassette.yaml create mode 100644 internal/services/cockpit/testdata/cockpit-sources-data-source-by-name.cassette.yaml create mode 100644 internal/services/cockpit/testdata/cockpit-sources-data-source-by-type.cassette.yaml create mode 100644 internal/services/cockpit/testdata/cockpit-sources-data-source-default-sources.cassette.yaml create mode 100644 internal/services/cockpit/testdata/cockpit-sources-data-source-empty.cassette.yaml create mode 100644 templates/data-sources/cockpit_sources.md.tmpl diff --git a/docs/data-sources/cockpit_sources.md b/docs/data-sources/cockpit_sources.md new file mode 100644 index 0000000000..750ba4e315 --- /dev/null +++ b/docs/data-sources/cockpit_sources.md @@ -0,0 +1,86 @@ +--- +subcategory: "Cockpit" +page_title: "Scaleway: scaleway_cockpit_sources" +--- + +# scaleway_cockpit_sources + +Gets information about multiple Cockpit data sources. + +## Example Usage + +### List all sources in a project + +```hcl +data "scaleway_cockpit_sources" "all" { + project_id = "11111111-1111-1111-1111-111111111111" +} +``` + +### Filter sources by type + +```hcl +data "scaleway_cockpit_sources" "metrics" { + project_id = "11111111-1111-1111-1111-111111111111" + type = "metrics" +} +``` + +### Filter sources by name + +```hcl +data "scaleway_cockpit_sources" "my_sources" { + project_id = "11111111-1111-1111-1111-111111111111" + name = "my-data-source" +} +``` + +### Filter sources by origin + +```hcl +data "scaleway_cockpit_sources" "external" { + project_id = "11111111-1111-1111-1111-111111111111" + origin = "external" +} +``` + +### List default Scaleway sources + +```hcl +data "scaleway_cockpit_sources" "default" { + project_id = "11111111-1111-1111-1111-111111111111" + origin = "scaleway" +} +``` + +## Argument Reference + +The following arguments are supported: + +- `project_id` - (Optional) The project ID the cockpit sources are associated with. +- `region` - (Optional) The region in which the cockpit sources are located. +- `name` - (Optional) Filter sources by name. +- `type` - (Optional) Filter sources by type. Possible values are: `metrics`, `logs`, `traces`. +- `origin` - (Optional) Filter sources by origin. Possible values are: `scaleway`, `external`, `custom`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `sources` - List of cockpit sources. + +Each `sources` block contains: + +- `id` - The ID of the data source. +- `name` - Name of the datasource. +- `url` - The URL of the datasource. +- `type` - The type of the datasource. +- `origin` - The origin of the datasource. +- `synchronized_with_grafana` - Indicates whether the data source is synchronized with Grafana. +- `created_at` - The date and time of the creation of the cockpit datasource. +- `updated_at` - The date and time of the last update of the cockpit datasource. +- `retention_days` - The number of days to retain data. +- `push_url` - The URL endpoint used for pushing data to the cockpit data source. +- `region` - The region of the data source. +- `project_id` - The project ID of the data source. + diff --git a/internal/provider/provider.go b/internal/provider/provider.go index aab96723da..77dcdee706 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -268,6 +268,7 @@ func Provider(config *Config) plugin.ProviderFunc { "scaleway_block_volume": block.DataSourceVolume(), "scaleway_cockpit": cockpit.DataSourceCockpit(), "scaleway_cockpit_source": cockpit.DataSourceCockpitSource(), + "scaleway_cockpit_sources": cockpit.DataSourceCockpitSources(), "scaleway_config": scwconfig.DataSourceConfig(), "scaleway_container": container.DataSourceContainer(), "scaleway_container_namespace": container.DataSourceNamespace(), diff --git a/internal/services/cockpit/sources_data_source.go b/internal/services/cockpit/sources_data_source.go new file mode 100644 index 0000000000..8445373eca --- /dev/null +++ b/internal/services/cockpit/sources_data_source.go @@ -0,0 +1,119 @@ +package cockpit + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/scaleway/scaleway-sdk-go/api/cockpit/v1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/datasource" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/meta" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" +) + +func DataSourceCockpitSources() *schema.Resource { + dsSchema := datasource.SchemaFromResourceSchema(ResourceCockpitSource().Schema) + + sourceElementSchema := datasource.SchemaFromResourceSchema(ResourceCockpitSource().Schema) + delete(sourceElementSchema, "sources") + + sourceElementSchema["id"] = &schema.Schema{ + Type: schema.TypeString, + Description: "The ID of the data source.", + Computed: true, + } + + dsSchema["sources"] = &schema.Schema{ + Type: schema.TypeList, + Description: "List of cockpit sources.", + Computed: true, + Elem: &schema.Resource{ + Schema: sourceElementSchema, + }, + } + + datasource.FixDatasourceSchemaFlags(dsSchema, false, "name", "project_id") + datasource.AddOptionalFieldsToSchema(dsSchema, "region", "type", "origin") + + return &schema.Resource{ + ReadContext: dataSourceCockpitSourcesRead, + Schema: dsSchema, + } +} + +func dataSourceCockpitSourcesRead(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics { + var region scw.Region + + var err error + + if v, ok := d.GetOk("region"); ok && v.(string) != "" { + region, err = scw.ParseRegion(v.(string)) + if err != nil { + return diag.FromErr(err) + } + } else { + _, region, err = cockpitAPIWithRegion(d, m) + if err != nil { + return diag.FromErr(err) + } + } + + api := cockpit.NewRegionalAPI(meta.ExtractScwClient(m)) + + req := &cockpit.RegionalAPIListDataSourcesRequest{ + Region: region, + ProjectID: d.Get("project_id").(string), + } + + if v, ok := d.GetOk("type"); ok { + req.Types = []cockpit.DataSourceType{cockpit.DataSourceType(v.(string))} + } + + if v, ok := d.GetOk("origin"); ok { + req.Origin = cockpit.DataSourceOrigin(v.(string)) + } + + res, err := api.ListDataSources(req, scw.WithContext(ctx), scw.WithAllPages()) + if err != nil { + return diag.FromErr(err) + } + + sources := []any(nil) + + for _, ds := range res.DataSources { + if name, ok := d.GetOk("name"); ok { + if ds.Name != name.(string) { + continue + } + } + + rawSource := flattenDataSourceToMap(ds) + sources = append(sources, rawSource) + } + + d.SetId(region.String()) + _ = d.Set("sources", sources) + + return nil +} + +func flattenDataSourceToMap(ds *cockpit.DataSource) map[string]any { + pushURL, _ := createCockpitPushURL(ds.Type, ds.URL) + + return map[string]any{ + "id": regional.NewIDString(ds.Region, ds.ID), + "project_id": ds.ProjectID, + "name": ds.Name, + "url": ds.URL, + "type": ds.Type.String(), + "origin": ds.Origin.String(), + "created_at": types.FlattenTime(ds.CreatedAt), + "updated_at": types.FlattenTime(ds.UpdatedAt), + "synchronized_with_grafana": ds.SynchronizedWithGrafana, + "retention_days": int(ds.RetentionDays), + "region": ds.Region.String(), + "push_url": pushURL, + } +} diff --git a/internal/services/cockpit/sources_data_source_test.go b/internal/services/cockpit/sources_data_source_test.go new file mode 100644 index 0000000000..0ab7a98813 --- /dev/null +++ b/internal/services/cockpit/sources_data_source_test.go @@ -0,0 +1,208 @@ +package cockpit_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" +) + +func TestAccCockpitSources_DataSource_All(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + CheckDestroy: isSourceDestroyed(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_account_project" "project" { + name = "tf_tests_cockpit_sources_all" + } + + resource "scaleway_cockpit_source" "metrics" { + project_id = scaleway_account_project.project.id + name = "test-metrics-source" + type = "metrics" + retention_days = 30 + } + + resource "scaleway_cockpit_source" "logs" { + project_id = scaleway_account_project.project.id + name = "test-logs-source" + type = "logs" + retention_days = 30 + } + + data "scaleway_cockpit_sources" "all" { + project_id = scaleway_account_project.project.id + depends_on = [scaleway_cockpit_source.metrics, scaleway_cockpit_source.logs] + } + `, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.all", "sources.#", "2"), + resource.TestCheckResourceAttrSet("data.scaleway_cockpit_sources.all", "sources.0.id"), + resource.TestCheckResourceAttrSet("data.scaleway_cockpit_sources.all", "sources.1.id"), + resource.TestCheckResourceAttrSet("data.scaleway_cockpit_sources.all", "sources.0.url"), + resource.TestCheckResourceAttrSet("data.scaleway_cockpit_sources.all", "sources.1.url"), + resource.TestCheckResourceAttrSet("data.scaleway_cockpit_sources.all", "sources.0.push_url"), + resource.TestCheckResourceAttrSet("data.scaleway_cockpit_sources.all", "sources.1.push_url"), + ), + }, + }, + }) +} + +func TestAccCockpitSources_DataSource_ByType(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + CheckDestroy: isSourceDestroyed(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_account_project" "project" { + name = "tf_tests_cockpit_sources_by_type" + } + + resource "scaleway_cockpit_source" "metrics" { + project_id = scaleway_account_project.project.id + name = "test-metrics-source" + type = "metrics" + retention_days = 30 + } + + resource "scaleway_cockpit_source" "logs" { + project_id = scaleway_account_project.project.id + name = "test-logs-source" + type = "logs" + retention_days = 30 + } + + data "scaleway_cockpit_sources" "metrics_only" { + project_id = scaleway_account_project.project.id + type = "metrics" + depends_on = [scaleway_cockpit_source.metrics, scaleway_cockpit_source.logs] + } + `, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.metrics_only", "sources.#", "1"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.metrics_only", "sources.0.type", "metrics"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.metrics_only", "sources.0.name", "test-metrics-source"), + ), + }, + }, + }) +} + +func TestAccCockpitSources_DataSource_ByName(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + CheckDestroy: isSourceDestroyed(tt), + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_account_project" "project" { + name = "tf_tests_cockpit_sources_by_name" + } + + resource "scaleway_cockpit_source" "metrics" { + project_id = scaleway_account_project.project.id + name = "test-metrics-source" + type = "metrics" + retention_days = 30 + } + + resource "scaleway_cockpit_source" "logs" { + project_id = scaleway_account_project.project.id + name = "test-logs-source" + type = "logs" + retention_days = 30 + } + + data "scaleway_cockpit_sources" "by_name" { + project_id = scaleway_account_project.project.id + name = "test-metrics-source" + depends_on = [scaleway_cockpit_source.metrics, scaleway_cockpit_source.logs] + } + `, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.by_name", "sources.#", "1"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.by_name", "sources.0.name", "test-metrics-source"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.by_name", "sources.0.type", "metrics"), + ), + }, + }, + }) +} + +func TestAccCockpitSources_DataSource_Empty(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + Steps: []resource.TestStep{ + { + Config: ` + resource "scaleway_account_project" "project" { + name = "tf_tests_cockpit_sources_empty" + } + + data "scaleway_cockpit_sources" "empty" { + project_id = scaleway_account_project.project.id + } + `, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.empty", "sources.#", "0"), + ), + }, + }, + }) +} + +func TestAccCockpitSources_DataSource_DefaultSources(t *testing.T) { + tt := acctest.NewTestTools(t) + defer tt.Cleanup() + + orgID, orgIDExists := tt.Meta.ScwClient().GetDefaultOrganizationID() + if !orgIDExists { + orgID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + } + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + Steps: []resource.TestStep{ + { + Config: fmt.Sprintf(` + data scaleway_account_project "by_name" { + name = "default" + organization_id = "%s" + } + + data "scaleway_cockpit_sources" "default_sources" { + project_id = data.scaleway_account_project.by_name.id + origin = "scaleway" + } + `, orgID), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.default_sources", "sources.#", "2"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.default_sources", "sources.0.origin", "scaleway"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_sources.default_sources", "sources.1.origin", "scaleway"), + ), + }, + }, + }) +} diff --git a/internal/services/cockpit/testdata/cockpit-sources-data-source-all.cassette.yaml b/internal/services/cockpit/testdata/cockpit-sources-data-source-all.cassette.yaml new file mode 100644 index 0000000000..d1eb167868 --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-sources-data-source-all.cassette.yaml @@ -0,0 +1,885 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 113 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf_tests_cockpit_sources_all","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.24.0; darwin; arm64) 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: 264 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.099459Z","description":"","id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","name":"tf_tests_cockpit_sources_all","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":null,"updated_at":"2025-09-04T04:39:44.099459Z"}' + headers: + Content-Length: + - "264" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:44 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 505b5cc0-648b-4ac4-b961-cdd3b0692aa5 + status: 200 OK + code: 200 + duration: 752.691625ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/37a7272e-9c71-4a45-a9d6-45c6eb9b28ef + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 309 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.099459Z","description":"","id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","name":"tf_tests_cockpit_sources_all","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-09-04T04:39:44.099459Z"}' + headers: + Content-Length: + - "309" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:44 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f21c95db-e5be-42bd-98fd-abac90345e40 + status: 200 OK + code: 200 + duration: 173.3485ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 113 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","name":"test-logs-source","type":"logs","retention_days":30}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; darwin; arm64) 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: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.810147Z","id":"83b98b7f-a223-4f71-8602-5866cf5b951a","name":"test-logs-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:39:44.810147Z","url":"https://83b98b7f-a223-4f71-8602-5866cf5b951a.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:44 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 817fae01-16ca-4ba5-8351-e4491f88b74a + status: 200 OK + code: 200 + duration: 283.606708ms + - id: 3 + 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":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","name":"test-metrics-source","type":"metrics","retention_days":30}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; darwin; arm64) 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: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.807137Z","id":"1340075b-e6bd-4092-bb8f-69f71aba8d1e","name":"test-metrics-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:39:44.807137Z","url":"https://1340075b-e6bd-4092-bb8f-69f71aba8d1e.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:44 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - aeb045dc-cc23-4652-b653-b73550f4f75a + status: 200 OK + code: 200 + duration: 283.667416ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1340075b-e6bd-4092-bb8f-69f71aba8d1e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.807137Z","id":"1340075b-e6bd-4092-bb8f-69f71aba8d1e","name":"test-metrics-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:39:44.807137Z","url":"https://1340075b-e6bd-4092-bb8f-69f71aba8d1e.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:45 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 4a18f91d-13f9-474f-96c0-1d4ff85a57df + status: 200 OK + code: 200 + duration: 95.35325ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/83b98b7f-a223-4f71-8602-5866cf5b951a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.810147Z","id":"83b98b7f-a223-4f71-8602-5866cf5b951a","name":"test-logs-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:39:44.810147Z","url":"https://83b98b7f-a223-4f71-8602-5866cf5b951a.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:45 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a69f2ec1-07d5-4acb-ae6b-b8559116a7f9 + status: 200 OK + code: 200 + duration: 116.847208ms + - id: 6 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=37a7272e-9c71-4a45-a9d6-45c6eb9b28ef + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 837 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:39:44.807137Z","id":"1340075b-e6bd-4092-bb8f-69f71aba8d1e","name":"test-metrics-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:39:44.807137Z","url":"https://1340075b-e6bd-4092-bb8f-69f71aba8d1e.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2025-09-04T04:39:44.810147Z","id":"83b98b7f-a223-4f71-8602-5866cf5b951a","name":"test-logs-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:39:44.810147Z","url":"https://83b98b7f-a223-4f71-8602-5866cf5b951a.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "837" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:45 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7a744151-959f-4230-b3a5-91db5b2e6ec7 + status: 200 OK + code: 200 + duration: 108.286208ms + - id: 7 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=37a7272e-9c71-4a45-a9d6-45c6eb9b28ef + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 837 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:39:44.807137Z","id":"1340075b-e6bd-4092-bb8f-69f71aba8d1e","name":"test-metrics-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:39:44.807137Z","url":"https://1340075b-e6bd-4092-bb8f-69f71aba8d1e.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2025-09-04T04:39:44.810147Z","id":"83b98b7f-a223-4f71-8602-5866cf5b951a","name":"test-logs-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:39:44.810147Z","url":"https://83b98b7f-a223-4f71-8602-5866cf5b951a.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "837" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:45 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 8641322e-3c9b-4308-bb81-b8c0e2997033 + status: 200 OK + code: 200 + duration: 194.042ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/37a7272e-9c71-4a45-a9d6-45c6eb9b28ef + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 309 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.099459Z","description":"","id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","name":"tf_tests_cockpit_sources_all","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-09-04T04:39:44.099459Z"}' + headers: + Content-Length: + - "309" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:46 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c7590849-9c3a-462f-94ce-50dd60972764 + status: 200 OK + code: 200 + duration: 225.81025ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1340075b-e6bd-4092-bb8f-69f71aba8d1e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.807137Z","id":"1340075b-e6bd-4092-bb8f-69f71aba8d1e","name":"test-metrics-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:39:44.807137Z","url":"https://1340075b-e6bd-4092-bb8f-69f71aba8d1e.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:46 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 78b7ed40-1d3b-4887-8f63-35dec2db6213 + status: 200 OK + code: 200 + duration: 87.51475ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/83b98b7f-a223-4f71-8602-5866cf5b951a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:39:44.810147Z","id":"83b98b7f-a223-4f71-8602-5866cf5b951a","name":"test-logs-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:39:44.810147Z","url":"https://83b98b7f-a223-4f71-8602-5866cf5b951a.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:46 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f2313b07-c316-421c-abd5-7ec0fd1dc47d + status: 200 OK + code: 200 + duration: 93.174167ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=37a7272e-9c71-4a45-a9d6-45c6eb9b28ef + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 837 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:39:44.807137Z","id":"1340075b-e6bd-4092-bb8f-69f71aba8d1e","name":"test-metrics-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:39:44.807137Z","url":"https://1340075b-e6bd-4092-bb8f-69f71aba8d1e.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2025-09-04T04:39:44.810147Z","id":"83b98b7f-a223-4f71-8602-5866cf5b951a","name":"test-logs-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:39:44.810147Z","url":"https://83b98b7f-a223-4f71-8602-5866cf5b951a.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "837" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:46 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fd705cb2-db0f-44ac-be7c-f0ca94d35688 + status: 200 OK + code: 200 + duration: 83.288959ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=37a7272e-9c71-4a45-a9d6-45c6eb9b28ef + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 837 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:39:44.807137Z","id":"1340075b-e6bd-4092-bb8f-69f71aba8d1e","name":"test-metrics-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:39:44.807137Z","url":"https://1340075b-e6bd-4092-bb8f-69f71aba8d1e.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2025-09-04T04:39:44.810147Z","id":"83b98b7f-a223-4f71-8602-5866cf5b951a","name":"test-logs-source","origin":"custom","project_id":"37a7272e-9c71-4a45-a9d6-45c6eb9b28ef","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:39:44.810147Z","url":"https://83b98b7f-a223-4f71-8602-5866cf5b951a.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "837" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:47 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 50259e68-935d-4471-a486-7bd53b3fcf4d + status: 200 OK + code: 200 + duration: 97.212042ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/83b98b7f-a223-4f71-8602-5866cf5b951a + 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: + - Thu, 04 Sep 2025 04:39:47 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1ac0c90e-17db-4777-977b-5539e7ccea3e + status: 204 No Content + code: 204 + duration: 334.307167ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1340075b-e6bd-4092-bb8f-69f71aba8d1e + 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: + - Thu, 04 Sep 2025 04:39:48 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9a02de3e-7174-4633-8219-e5ce2acf8bb9 + status: 204 No Content + code: 204 + duration: 594.056166ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/37a7272e-9c71-4a45-a9d6-45c6eb9b28ef + 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: + - Thu, 04 Sep 2025 04:39:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ce293f72-9a88-4b68-a77a-b25e32705f98 + status: 204 No Content + code: 204 + duration: 1.652618834s + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1340075b-e6bd-4092-bb8f-69f71aba8d1e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"data source","resource_id":"1340075b-e6bd-4092-bb8f-69f71aba8d1e","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1fc825cb-319f-44ff-9886-7bcfffa84d55 + status: 404 Not Found + code: 404 + duration: 28.549958ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/83b98b7f-a223-4f71-8602-5866cf5b951a + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"data source","resource_id":"83b98b7f-a223-4f71-8602-5866cf5b951a","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:39:49 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 119f74f3-f842-4815-aac6-6c25994e236c + status: 404 Not Found + code: 404 + duration: 25.756792ms diff --git a/internal/services/cockpit/testdata/cockpit-sources-data-source-by-name.cassette.yaml b/internal/services/cockpit/testdata/cockpit-sources-data-source-by-name.cassette.yaml new file mode 100644 index 0000000000..ef1352521d --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-sources-data-source-by-name.cassette.yaml @@ -0,0 +1,885 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 117 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf_tests_cockpit_sources_by_name","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.24.0; darwin; arm64) 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: 268 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:36.606945Z","description":"","id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","name":"tf_tests_cockpit_sources_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":null,"updated_at":"2025-09-04T04:40:36.606945Z"}' + headers: + Content-Length: + - "268" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:36 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7c86174f-db09-47e3-b907-077f1061c798 + status: 200 OK + code: 200 + duration: 698.553458ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/19aba76f-55dd-4982-9ff4-afa9e841ec7e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 313 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:36.606945Z","description":"","id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","name":"tf_tests_cockpit_sources_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-09-04T04:40:36.606945Z"}' + headers: + Content-Length: + - "313" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 128057bd-35f0-4eac-90b7-b759c7e3bae9 + status: 200 OK + code: 200 + duration: 189.945334ms + - id: 2 + 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":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","name":"test-metrics-source","type":"metrics","retention_days":30}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; darwin; arm64) 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: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:37.212075Z","id":"09db8f64-f5f1-4ad5-8784-e0c39787fb60","name":"test-metrics-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:37.212075Z","url":"https://09db8f64-f5f1-4ad5-8784-e0c39787fb60.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3b04dd3e-b1ed-4c9d-8d89-780f3d333e5e + status: 200 OK + code: 200 + duration: 220.031833ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 113 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","name":"test-logs-source","type":"logs","retention_days":30}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; darwin; arm64) 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: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:37.212604Z","id":"487d75e6-9be7-47e3-826f-094b691d7b6e","name":"test-logs-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:37.212604Z","url":"https://487d75e6-9be7-47e3-826f-094b691d7b6e.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 541b352d-43e4-4823-963e-7b3777217922 + status: 200 OK + code: 200 + duration: 242.296416ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/09db8f64-f5f1-4ad5-8784-e0c39787fb60 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:37.212075Z","id":"09db8f64-f5f1-4ad5-8784-e0c39787fb60","name":"test-metrics-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:37.212075Z","url":"https://09db8f64-f5f1-4ad5-8784-e0c39787fb60.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 33065c15-f196-49de-9984-d204ecc2c840 + status: 200 OK + code: 200 + duration: 79.088209ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/487d75e6-9be7-47e3-826f-094b691d7b6e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:37.212604Z","id":"487d75e6-9be7-47e3-826f-094b691d7b6e","name":"test-logs-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:37.212604Z","url":"https://487d75e6-9be7-47e3-826f-094b691d7b6e.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 24080d7d-2962-4cfe-bb42-8af89f0b427c + status: 200 OK + code: 200 + duration: 98.10775ms + - id: 6 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=19aba76f-55dd-4982-9ff4-afa9e841ec7e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 837 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:40:37.212075Z","id":"09db8f64-f5f1-4ad5-8784-e0c39787fb60","name":"test-metrics-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:37.212075Z","url":"https://09db8f64-f5f1-4ad5-8784-e0c39787fb60.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2025-09-04T04:40:37.212604Z","id":"487d75e6-9be7-47e3-826f-094b691d7b6e","name":"test-logs-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:37.212604Z","url":"https://487d75e6-9be7-47e3-826f-094b691d7b6e.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "837" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:37 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 15501421-aadd-4a90-880c-e5146c5405b5 + status: 200 OK + code: 200 + duration: 93.68675ms + - id: 7 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=19aba76f-55dd-4982-9ff4-afa9e841ec7e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 837 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:40:37.212075Z","id":"09db8f64-f5f1-4ad5-8784-e0c39787fb60","name":"test-metrics-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:37.212075Z","url":"https://09db8f64-f5f1-4ad5-8784-e0c39787fb60.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2025-09-04T04:40:37.212604Z","id":"487d75e6-9be7-47e3-826f-094b691d7b6e","name":"test-logs-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:37.212604Z","url":"https://487d75e6-9be7-47e3-826f-094b691d7b6e.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "837" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6be65eac-5daa-4beb-bd31-b2afe0a00808 + status: 200 OK + code: 200 + duration: 89.120959ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/19aba76f-55dd-4982-9ff4-afa9e841ec7e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 313 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:36.606945Z","description":"","id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","name":"tf_tests_cockpit_sources_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-09-04T04:40:36.606945Z"}' + headers: + Content-Length: + - "313" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b76966a2-f828-4009-867b-fa184bc62316 + status: 200 OK + code: 200 + duration: 211.52025ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/09db8f64-f5f1-4ad5-8784-e0c39787fb60 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:37.212075Z","id":"09db8f64-f5f1-4ad5-8784-e0c39787fb60","name":"test-metrics-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:37.212075Z","url":"https://09db8f64-f5f1-4ad5-8784-e0c39787fb60.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 84f02dd0-6d2c-427a-a98e-0584535e9301 + status: 200 OK + code: 200 + duration: 81.69725ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/487d75e6-9be7-47e3-826f-094b691d7b6e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:37.212604Z","id":"487d75e6-9be7-47e3-826f-094b691d7b6e","name":"test-logs-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:37.212604Z","url":"https://487d75e6-9be7-47e3-826f-094b691d7b6e.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3e5edb49-42b0-4bec-9cb8-4b4426e7f152 + status: 200 OK + code: 200 + duration: 84.602416ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=19aba76f-55dd-4982-9ff4-afa9e841ec7e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 837 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:40:37.212075Z","id":"09db8f64-f5f1-4ad5-8784-e0c39787fb60","name":"test-metrics-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:37.212075Z","url":"https://09db8f64-f5f1-4ad5-8784-e0c39787fb60.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2025-09-04T04:40:37.212604Z","id":"487d75e6-9be7-47e3-826f-094b691d7b6e","name":"test-logs-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:37.212604Z","url":"https://487d75e6-9be7-47e3-826f-094b691d7b6e.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "837" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:38 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5db6c8e9-f647-429f-9bbb-353f7eb25c4b + status: 200 OK + code: 200 + duration: 85.893ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=19aba76f-55dd-4982-9ff4-afa9e841ec7e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 837 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:40:37.212075Z","id":"09db8f64-f5f1-4ad5-8784-e0c39787fb60","name":"test-metrics-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:37.212075Z","url":"https://09db8f64-f5f1-4ad5-8784-e0c39787fb60.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2025-09-04T04:40:37.212604Z","id":"487d75e6-9be7-47e3-826f-094b691d7b6e","name":"test-logs-source","origin":"custom","project_id":"19aba76f-55dd-4982-9ff4-afa9e841ec7e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:37.212604Z","url":"https://487d75e6-9be7-47e3-826f-094b691d7b6e.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "837" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 17d7dff6-871a-40a3-bf79-667dd0f1a633 + status: 200 OK + code: 200 + duration: 75.075958ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/487d75e6-9be7-47e3-826f-094b691d7b6e + 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: + - Thu, 04 Sep 2025 04:40:39 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c68c1efc-2206-4e70-8b90-16e2764e09d9 + status: 204 No Content + code: 204 + duration: 156.675792ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/09db8f64-f5f1-4ad5-8784-e0c39787fb60 + 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: + - Thu, 04 Sep 2025 04:40:40 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c099f7fc-384f-40fc-8cf2-ca8f97baa8d7 + status: 204 No Content + code: 204 + duration: 253.071625ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/19aba76f-55dd-4982-9ff4-afa9e841ec7e + 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: + - Thu, 04 Sep 2025 04:40:41 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bfae30ae-8184-40fc-8eed-9472103b72fb + status: 204 No Content + code: 204 + duration: 1.473353s + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/487d75e6-9be7-47e3-826f-094b691d7b6e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"data source","resource_id":"487d75e6-9be7-47e3-826f-094b691d7b6e","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:41 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1efa2491-e0b1-482d-9ca0-5ce541936588 + status: 404 Not Found + code: 404 + duration: 28.394083ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/09db8f64-f5f1-4ad5-8784-e0c39787fb60 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"data source","resource_id":"09db8f64-f5f1-4ad5-8784-e0c39787fb60","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:41 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 91400cb2-e1c4-4a6c-9064-02bfdcf78dbd + status: 404 Not Found + code: 404 + duration: 27.643709ms diff --git a/internal/services/cockpit/testdata/cockpit-sources-data-source-by-type.cassette.yaml b/internal/services/cockpit/testdata/cockpit-sources-data-source-by-type.cassette.yaml new file mode 100644 index 0000000000..935d885eae --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-sources-data-source-by-type.cassette.yaml @@ -0,0 +1,885 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 117 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf_tests_cockpit_sources_by_type","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.24.0; darwin; arm64) 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: 268 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.225400Z","description":"","id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","name":"tf_tests_cockpit_sources_by_type","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":null,"updated_at":"2025-09-04T04:40:23.225400Z"}' + headers: + Content-Length: + - "268" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:23 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 8fd88ce6-4dda-4be7-8224-2f85af43cc5e + status: 200 OK + code: 200 + duration: 579.094125ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/ac788a0b-05ad-420b-a62e-ed71a5de0334 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 313 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.225400Z","description":"","id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","name":"tf_tests_cockpit_sources_by_type","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-09-04T04:40:23.225400Z"}' + headers: + Content-Length: + - "313" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:23 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e7bd91d9-122f-4c76-aa5f-ff9d9287b886 + status: 200 OK + code: 200 + duration: 195.089416ms + - id: 2 + 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":"ac788a0b-05ad-420b-a62e-ed71a5de0334","name":"test-metrics-source","type":"metrics","retention_days":30}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; darwin; arm64) 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: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.834161Z","id":"2351a960-ec71-449c-ad4c-e4b7f4b69364","name":"test-metrics-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:23.834161Z","url":"https://2351a960-ec71-449c-ad4c-e4b7f4b69364.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:23 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 2f1f8c05-fdec-4ed9-ac84-88eb7bb143e4 + status: 200 OK + code: 200 + duration: 227.45525ms + - id: 3 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/2351a960-ec71-449c-ad4c-e4b7f4b69364 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.834161Z","id":"2351a960-ec71-449c-ad4c-e4b7f4b69364","name":"test-metrics-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:23.834161Z","url":"https://2351a960-ec71-449c-ad4c-e4b7f4b69364.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:24 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0687dbd3-8ad1-4f42-9622-19834d03f10f + status: 200 OK + code: 200 + duration: 88.891834ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 113 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","name":"test-logs-source","type":"logs","retention_days":30}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.24.0; darwin; arm64) 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: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.833741Z","id":"c2b73c7b-1fb8-4afb-a9c7-653c84adca55","name":"test-logs-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:23.833741Z","url":"https://c2b73c7b-1fb8-4afb-a9c7-653c84adca55.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:24 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6115f39a-4b78-438e-9cd9-e90645ea8b59 + status: 200 OK + code: 200 + duration: 321.239ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c2b73c7b-1fb8-4afb-a9c7-653c84adca55 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.833741Z","id":"c2b73c7b-1fb8-4afb-a9c7-653c84adca55","name":"test-logs-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:23.833741Z","url":"https://c2b73c7b-1fb8-4afb-a9c7-653c84adca55.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:24 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 447a52dc-e72b-4398-a72b-e7c535b073d0 + status: 200 OK + code: 200 + duration: 101.259958ms + - id: 6 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=ac788a0b-05ad-420b-a62e-ed71a5de0334&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:40:23.834161Z","id":"2351a960-ec71-449c-ad4c-e4b7f4b69364","name":"test-metrics-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:23.834161Z","url":"https://2351a960-ec71-449c-ad4c-e4b7f4b69364.metrics.cockpit.fr-par.scw.cloud"}],"total_count":1}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:24 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 779b4efb-4da5-4153-8dc4-ca1ca349a5d6 + status: 200 OK + code: 200 + duration: 100.445875ms + - id: 7 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=ac788a0b-05ad-420b-a62e-ed71a5de0334&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:40:23.834161Z","id":"2351a960-ec71-449c-ad4c-e4b7f4b69364","name":"test-metrics-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:23.834161Z","url":"https://2351a960-ec71-449c-ad4c-e4b7f4b69364.metrics.cockpit.fr-par.scw.cloud"}],"total_count":1}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:24 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6006f38f-3f1b-4b34-92f7-d86e3f02b337 + status: 200 OK + code: 200 + duration: 92.259583ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/ac788a0b-05ad-420b-a62e-ed71a5de0334 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 313 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.225400Z","description":"","id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","name":"tf_tests_cockpit_sources_by_type","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-09-04T04:40:23.225400Z"}' + headers: + Content-Length: + - "313" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:25 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7bd09770-7cfe-4a36-a32a-674109a9b0b0 + status: 200 OK + code: 200 + duration: 182.581083ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/2351a960-ec71-449c-ad4c-e4b7f4b69364 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 405 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.834161Z","id":"2351a960-ec71-449c-ad4c-e4b7f4b69364","name":"test-metrics-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:23.834161Z","url":"https://2351a960-ec71-449c-ad4c-e4b7f4b69364.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "405" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:25 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d1f5baa7-ee4c-4ef4-9c38-d6e2391ebc5c + status: 200 OK + code: 200 + duration: 187.865041ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c2b73c7b-1fb8-4afb-a9c7-653c84adca55 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 396 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:23.833741Z","id":"c2b73c7b-1fb8-4afb-a9c7-653c84adca55","name":"test-logs-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2025-09-04T04:40:23.833741Z","url":"https://c2b73c7b-1fb8-4afb-a9c7-653c84adca55.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "396" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:25 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6dd04667-b6e4-4016-9fba-7a27e4ed54fa + status: 200 OK + code: 200 + duration: 187.716708ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=ac788a0b-05ad-420b-a62e-ed71a5de0334&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:40:23.834161Z","id":"2351a960-ec71-449c-ad4c-e4b7f4b69364","name":"test-metrics-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:23.834161Z","url":"https://2351a960-ec71-449c-ad4c-e4b7f4b69364.metrics.cockpit.fr-par.scw.cloud"}],"total_count":1}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:25 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d462c5e6-966f-4c69-983c-8f72e745690d + status: 200 OK + code: 200 + duration: 98.690708ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=ac788a0b-05ad-420b-a62e-ed71a5de0334&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 440 + uncompressed: false + body: '{"data_sources":[{"created_at":"2025-09-04T04:40:23.834161Z","id":"2351a960-ec71-449c-ad4c-e4b7f4b69364","name":"test-metrics-source","origin":"custom","project_id":"ac788a0b-05ad-420b-a62e-ed71a5de0334","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2025-09-04T04:40:23.834161Z","url":"https://2351a960-ec71-449c-ad4c-e4b7f4b69364.metrics.cockpit.fr-par.scw.cloud"}],"total_count":1}' + headers: + Content-Length: + - "440" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:25 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b8e8ec64-5a07-4c1c-a0a5-0d129841540a + status: 200 OK + code: 200 + duration: 101.075792ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c2b73c7b-1fb8-4afb-a9c7-653c84adca55 + 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: + - Thu, 04 Sep 2025 04:40:26 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a4cd11c6-46a8-462a-ab49-c6f8f205fcb3 + status: 204 No Content + code: 204 + duration: 432.388625ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/2351a960-ec71-449c-ad4c-e4b7f4b69364 + 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: + - Thu, 04 Sep 2025 04:40:26 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7e90f836-8d60-428a-bf71-e6423b83f04f + status: 204 No Content + code: 204 + duration: 469.329166ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/ac788a0b-05ad-420b-a62e-ed71a5de0334 + 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: + - Thu, 04 Sep 2025 04:40:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c77fcbf3-5191-4a57-83fc-caf4199917d9 + status: 204 No Content + code: 204 + duration: 1.579743291s + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/2351a960-ec71-449c-ad4c-e4b7f4b69364 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"data source","resource_id":"2351a960-ec71-449c-ad4c-e4b7f4b69364","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d9173ebd-394e-4669-867b-12fd03fa64de + status: 404 Not Found + code: 404 + duration: 197.553125ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/c2b73c7b-1fb8-4afb-a9c7-653c84adca55 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 132 + uncompressed: false + body: '{"message":"resource is not found","resource":"data source","resource_id":"c2b73c7b-1fb8-4afb-a9c7-653c84adca55","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - ab739d25-0fd4-43ba-9d36-9f474a04056b + status: 404 Not Found + code: 404 + duration: 24.999292ms diff --git a/internal/services/cockpit/testdata/cockpit-sources-data-source-default-sources.cassette.yaml b/internal/services/cockpit/testdata/cockpit-sources-data-source-default-sources.cassette.yaml new file mode 100644 index 0000000000..1bbd149a08 --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-sources-data-source-default-sources.cassette.yaml @@ -0,0 +1,738 @@ +--- +version: 2 +interactions: + - id: 0 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects?name=default&order_by=created_at_asc&organization_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 319 + uncompressed: false + body: '{"projects":[{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "319" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:02 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1e4e7a27-8e5b-4f56-9add-ad0388e15f25 + status: 200 OK + code: 200 + duration: 1.871958083s + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 288 + uncompressed: false + body: '{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "288" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:02 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0ff25d9f-fbd9-4339-9273-5a6f9ec45999 + status: 200 OK + code: 200 + duration: 213.119667ms + - id: 2 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=scaleway&page=1&project_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 832 + uncompressed: false + body: '{"data_sources":[{"created_at":"2023-05-17T09:46:07.242137Z","id":"af496812-8fa1-4c66-be81-04c04733333a","name":"Scaleway Metrics","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":31,"synchronized_with_grafana":true,"type":"metrics","updated_at":"2023-05-17T09:46:07.242137Z","url":"https://af496812-8fa1-4c66-be81-04c04733333a.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2023-05-17T09:46:07.247820Z","id":"b3113e91-ae36-4e27-b2f2-48b8868c62ff","name":"Scaleway Logs","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":7,"synchronized_with_grafana":true,"type":"logs","updated_at":"2023-05-17T09:46:07.247820Z","url":"https://b3113e91-ae36-4e27-b2f2-48b8868c62ff.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "832" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:02 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1b7e18cb-92ac-4f94-87b0-92fd37a3e55d + status: 200 OK + code: 200 + duration: 93.072625ms + - id: 3 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects?name=default&order_by=created_at_asc&organization_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 319 + uncompressed: false + body: '{"projects":[{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "319" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:03 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - fb9e0e97-d831-4386-b997-bb5788b0f8c2 + status: 200 OK + code: 200 + duration: 943.040208ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 288 + uncompressed: false + body: '{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "288" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:03 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 036c4c49-0071-4af3-8b61-64833acaea43 + status: 200 OK + code: 200 + duration: 169.733584ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=scaleway&page=1&project_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 832 + uncompressed: false + body: '{"data_sources":[{"created_at":"2023-05-17T09:46:07.242137Z","id":"af496812-8fa1-4c66-be81-04c04733333a","name":"Scaleway Metrics","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":31,"synchronized_with_grafana":true,"type":"metrics","updated_at":"2023-05-17T09:46:07.242137Z","url":"https://af496812-8fa1-4c66-be81-04c04733333a.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2023-05-17T09:46:07.247820Z","id":"b3113e91-ae36-4e27-b2f2-48b8868c62ff","name":"Scaleway Logs","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":7,"synchronized_with_grafana":true,"type":"logs","updated_at":"2023-05-17T09:46:07.247820Z","url":"https://b3113e91-ae36-4e27-b2f2-48b8868c62ff.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "832" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:03 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 2cab9284-3045-4f85-a343-0db93f63b9da + status: 200 OK + code: 200 + duration: 93.863875ms + - id: 6 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects?name=default&order_by=created_at_asc&organization_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 319 + uncompressed: false + body: '{"projects":[{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "319" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:05 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 94fcd6dc-a681-4702-b1e5-d4d49b849e7a + status: 200 OK + code: 200 + duration: 987.506625ms + - id: 7 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 288 + uncompressed: false + body: '{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "288" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:05 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 2582f50a-4544-4355-ab5b-99dd8b7909d4 + status: 200 OK + code: 200 + duration: 193.861166ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=scaleway&page=1&project_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 832 + uncompressed: false + body: '{"data_sources":[{"created_at":"2023-05-17T09:46:07.242137Z","id":"af496812-8fa1-4c66-be81-04c04733333a","name":"Scaleway Metrics","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":31,"synchronized_with_grafana":true,"type":"metrics","updated_at":"2023-05-17T09:46:07.242137Z","url":"https://af496812-8fa1-4c66-be81-04c04733333a.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2023-05-17T09:46:07.247820Z","id":"b3113e91-ae36-4e27-b2f2-48b8868c62ff","name":"Scaleway Logs","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":7,"synchronized_with_grafana":true,"type":"logs","updated_at":"2023-05-17T09:46:07.247820Z","url":"https://b3113e91-ae36-4e27-b2f2-48b8868c62ff.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "832" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:05 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7ce85875-cbc2-48d4-aef5-54a83e12893d + status: 200 OK + code: 200 + duration: 91.610167ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects?name=default&order_by=created_at_asc&organization_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 319 + uncompressed: false + body: '{"projects":[{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "319" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:07 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b8d83b8d-5392-49e8-9efb-c792838974c1 + status: 200 OK + code: 200 + duration: 960.5865ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 288 + uncompressed: false + body: '{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "288" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:07 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1dfb56fc-aca0-4d95-aa8f-8df1f11c2357 + status: 200 OK + code: 200 + duration: 171.683333ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=scaleway&page=1&project_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 832 + uncompressed: false + body: '{"data_sources":[{"created_at":"2023-05-17T09:46:07.242137Z","id":"af496812-8fa1-4c66-be81-04c04733333a","name":"Scaleway Metrics","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":31,"synchronized_with_grafana":true,"type":"metrics","updated_at":"2023-05-17T09:46:07.242137Z","url":"https://af496812-8fa1-4c66-be81-04c04733333a.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2023-05-17T09:46:07.247820Z","id":"b3113e91-ae36-4e27-b2f2-48b8868c62ff","name":"Scaleway Logs","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":7,"synchronized_with_grafana":true,"type":"logs","updated_at":"2023-05-17T09:46:07.247820Z","url":"https://b3113e91-ae36-4e27-b2f2-48b8868c62ff.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "832" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:07 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0a91024b-4fdb-4b0a-b4af-cdb9c9f1fe9e + status: 200 OK + code: 200 + duration: 178.3895ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects?name=default&order_by=created_at_asc&organization_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 319 + uncompressed: false + body: '{"projects":[{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "319" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:09 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 33693689-2b40-4842-8cc5-197fc8fafd2d + status: 200 OK + code: 200 + duration: 963.05625ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 288 + uncompressed: false + body: '{"created_at":"2019-09-30T07:52:49.358300Z","description":"","id":"105bdce1-64c0-48ab-899d-868455867ecf","name":"default","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "288" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:09 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 207eaa1a-09ce-4fa5-bbee-ac6a61d42fa8 + status: 200 OK + code: 200 + duration: 176.261792ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=scaleway&page=1&project_id=105bdce1-64c0-48ab-899d-868455867ecf + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 832 + uncompressed: false + body: '{"data_sources":[{"created_at":"2023-05-17T09:46:07.242137Z","id":"af496812-8fa1-4c66-be81-04c04733333a","name":"Scaleway Metrics","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":31,"synchronized_with_grafana":true,"type":"metrics","updated_at":"2023-05-17T09:46:07.242137Z","url":"https://af496812-8fa1-4c66-be81-04c04733333a.metrics.cockpit.fr-par.scw.cloud"},{"created_at":"2023-05-17T09:46:07.247820Z","id":"b3113e91-ae36-4e27-b2f2-48b8868c62ff","name":"Scaleway Logs","origin":"scaleway","project_id":"105bdce1-64c0-48ab-899d-868455867ecf","region":"fr-par","retention_days":7,"synchronized_with_grafana":true,"type":"logs","updated_at":"2023-05-17T09:46:07.247820Z","url":"https://b3113e91-ae36-4e27-b2f2-48b8868c62ff.logs.cockpit.fr-par.scw.cloud"}],"total_count":2}' + headers: + Content-Length: + - "832" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:41:09 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7430d216-19ef-4bb6-8ca2-ff9557bf6e8c + status: 200 OK + code: 200 + duration: 80.552042ms diff --git a/internal/services/cockpit/testdata/cockpit-sources-data-source-empty.cassette.yaml b/internal/services/cockpit/testdata/cockpit-sources-data-source-empty.cassette.yaml new file mode 100644 index 0000000000..007499d107 --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-sources-data-source-empty.cassette.yaml @@ -0,0 +1,395 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 115 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf_tests_cockpit_sources_empty","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.24.0; darwin; arm64) 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: 266 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:50.632554Z","description":"","id":"a592a746-63c8-435c-8c7a-b6d6ac288c29","name":"tf_tests_cockpit_sources_empty","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":null,"updated_at":"2025-09-04T04:40:50.632554Z"}' + headers: + Content-Length: + - "266" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:50 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 703d2bec-9a2c-4b57-9e00-0ef69d04bb9a + status: 200 OK + code: 200 + duration: 1.151388833s + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/a592a746-63c8-435c-8c7a-b6d6ac288c29 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 311 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:50.632554Z","description":"","id":"a592a746-63c8-435c-8c7a-b6d6ac288c29","name":"tf_tests_cockpit_sources_empty","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-09-04T04:40:50.632554Z"}' + headers: + Content-Length: + - "311" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:51 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 35fa4b42-1f00-4b77-a8db-e425c187d81d + status: 200 OK + code: 200 + duration: 284.915208ms + - id: 2 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=a592a746-63c8-435c-8c7a-b6d6ac288c29 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 35 + uncompressed: false + body: '{"data_sources":[],"total_count":0}' + headers: + Content-Length: + - "35" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:51 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 66373b4c-1442-46d0-90af-a72acf483752 + status: 200 OK + code: 200 + duration: 150.905ms + - id: 3 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=a592a746-63c8-435c-8c7a-b6d6ac288c29 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 35 + uncompressed: false + body: '{"data_sources":[],"total_count":0}' + headers: + Content-Length: + - "35" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:52 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3f460c91-7ff7-4daf-a298-5482970079ec + status: 200 OK + code: 200 + duration: 140.677833ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/a592a746-63c8-435c-8c7a-b6d6ac288c29 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 311 + uncompressed: false + body: '{"created_at":"2025-09-04T04:40:50.632554Z","description":"","id":"a592a746-63c8-435c-8c7a-b6d6ac288c29","name":"tf_tests_cockpit_sources_empty","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","qualification":{"architecture_type":"unknown_architecture_type"},"updated_at":"2025-09-04T04:40:50.632554Z"}' + headers: + Content-Length: + - "311" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:52 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6bfa9a5a-e372-4b14-a409-76532bafe214 + status: 200 OK + code: 200 + duration: 166.284208ms + - 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=a592a746-63c8-435c-8c7a-b6d6ac288c29 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 35 + uncompressed: false + body: '{"data_sources":[],"total_count":0}' + headers: + Content-Length: + - "35" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:52 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 96b2509b-40ef-4406-9a56-70fb84355923 + status: 200 OK + code: 200 + duration: 76.189583ms + - id: 6 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=a592a746-63c8-435c-8c7a-b6d6ac288c29 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 35 + uncompressed: false + body: '{"data_sources":[],"total_count":0}' + headers: + Content-Length: + - "35" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Thu, 04 Sep 2025 04:40:53 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 001b0930-2450-4af0-ad6d-398838bb33b3 + status: 200 OK + code: 200 + duration: 84.576459ms + - id: 7 + 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.24.0; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/a592a746-63c8-435c-8c7a-b6d6ac288c29 + 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: + - Thu, 04 Sep 2025 04:40:55 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c4d565c9-2a67-4627-9bbe-811fbfa66734 + status: 204 No Content + code: 204 + duration: 1.580785334s diff --git a/templates/data-sources/cockpit_sources.md.tmpl b/templates/data-sources/cockpit_sources.md.tmpl new file mode 100644 index 0000000000..750ba4e315 --- /dev/null +++ b/templates/data-sources/cockpit_sources.md.tmpl @@ -0,0 +1,86 @@ +--- +subcategory: "Cockpit" +page_title: "Scaleway: scaleway_cockpit_sources" +--- + +# scaleway_cockpit_sources + +Gets information about multiple Cockpit data sources. + +## Example Usage + +### List all sources in a project + +```hcl +data "scaleway_cockpit_sources" "all" { + project_id = "11111111-1111-1111-1111-111111111111" +} +``` + +### Filter sources by type + +```hcl +data "scaleway_cockpit_sources" "metrics" { + project_id = "11111111-1111-1111-1111-111111111111" + type = "metrics" +} +``` + +### Filter sources by name + +```hcl +data "scaleway_cockpit_sources" "my_sources" { + project_id = "11111111-1111-1111-1111-111111111111" + name = "my-data-source" +} +``` + +### Filter sources by origin + +```hcl +data "scaleway_cockpit_sources" "external" { + project_id = "11111111-1111-1111-1111-111111111111" + origin = "external" +} +``` + +### List default Scaleway sources + +```hcl +data "scaleway_cockpit_sources" "default" { + project_id = "11111111-1111-1111-1111-111111111111" + origin = "scaleway" +} +``` + +## Argument Reference + +The following arguments are supported: + +- `project_id` - (Optional) The project ID the cockpit sources are associated with. +- `region` - (Optional) The region in which the cockpit sources are located. +- `name` - (Optional) Filter sources by name. +- `type` - (Optional) Filter sources by type. Possible values are: `metrics`, `logs`, `traces`. +- `origin` - (Optional) Filter sources by origin. Possible values are: `scaleway`, `external`, `custom`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `sources` - List of cockpit sources. + +Each `sources` block contains: + +- `id` - The ID of the data source. +- `name` - Name of the datasource. +- `url` - The URL of the datasource. +- `type` - The type of the datasource. +- `origin` - The origin of the datasource. +- `synchronized_with_grafana` - Indicates whether the data source is synchronized with Grafana. +- `created_at` - The date and time of the creation of the cockpit datasource. +- `updated_at` - The date and time of the last update of the cockpit datasource. +- `retention_days` - The number of days to retain data. +- `push_url` - The URL endpoint used for pushing data to the cockpit data source. +- `region` - The region of the data source. +- `project_id` - The project ID of the data source. +