From b7cbbc607981bc50bf6ecb8027e53072ab42527d Mon Sep 17 00:00:00 2001 From: devtools-ci-cd Date: Fri, 20 Dec 2024 14:40:00 +0100 Subject: [PATCH 1/4] feat(cockpit): add data source for source --- docs/data-sources/cockpit_source.md | 79 ++ docs/resources/cockpit_source.md | 2 +- .../services/cockpit/source_data_source.go | 182 +++++ .../cockpit/source_data_source_test.go | 116 +++ ...cockpit-source-basic-metrics.cassette.yaml | 124 ++-- ...pit-source-data-source-by-id.cassette.yaml | 689 ++++++++++++++++++ ...t-source-data-source-by-name.cassette.yaml | 689 ++++++++++++++++++ ...-source-data-source-defaults.cassette.yaml | 493 +++++++++++++ 8 files changed, 2311 insertions(+), 63 deletions(-) create mode 100644 docs/data-sources/cockpit_source.md create mode 100644 internal/services/cockpit/source_data_source.go create mode 100644 internal/services/cockpit/source_data_source_test.go create mode 100644 internal/services/cockpit/testdata/cockpit-source-data-source-by-id.cassette.yaml create mode 100644 internal/services/cockpit/testdata/cockpit-source-data-source-by-name.cassette.yaml create mode 100644 internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml diff --git a/docs/data-sources/cockpit_source.md b/docs/data-sources/cockpit_source.md new file mode 100644 index 000000000..dfeb58588 --- /dev/null +++ b/docs/data-sources/cockpit_source.md @@ -0,0 +1,79 @@ +--- +subcategory: "Cockpit" +page_title: "Scaleway: scaleway_cockpit_source" +--- + +# Data Source: scaleway_cockpit_source + +The `scaleway_cockpit_source` data source allows you to retrieve information about a specific [data source](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#data-sources) in Scaleway's Cockpit. + +Refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api) for more information. + +## Example Usage + +### Retrieve a specific data source by ID + +The following example retrieves a Cockpit data source by its unique ID. + +```terraform +data "scaleway_cockpit_source" "example" { + id = "fr-par/11111111-1111-1111-1111-111111111111" +} +``` + +### Retrieve a data source by filters + +You can also retrieve a data source by specifying filtering criteria such as `name`, `type`, and `origin`. + +```terraform +data "scaleway_cockpit_source" "filtered" { + project_id = "11111111-1111-1111-1111-111111111111" + region = "fr-par" + name = "my-data-source" +} +``` + +## Argument Reference + +This section lists the arguments that are supported: + +- `id` - (Optional) The unique identifier of the Cockpit data source in the `{region}/{id}` format. If specified, other filters are ignored. + +- `region` - (Optional) The [region](../guides/regions_and_zones.md#regions) where the data source is located. Defaults to the region specified in the [provider configuration](../index.md#region). + +- `project_id` - (Required unless `id` is specified) The ID of the Project the data source is associated with. Defaults to the Project ID specified in the [provider configuration](../index.md#project_id). + +- `name` - (Optional) The name of the data source. + +- `type` - (Optional) The [type](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#data-types) of data source. Possible values are: `metrics`, `logs`, or `traces`. + +- `origin` - (Optional) The origin of the data source. Possible values are: + - `scaleway` - Data source managed by Scaleway. + - `external` - Data source created by the user. + - `custom` - User-defined custom data source. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +- `id` - The unique identifier of the data source in the `{region}/{id}` format. + +- `url` - The URL of the Cockpit data source. + +- `created_at` - The date and time the data source was created (in RFC 3339 format). + +- `updated_at` - The date and time the data source was last updated (in RFC 3339 format). + +- `origin` - The origin of the data source. + +- `synchronized_with_grafana` - Indicates whether the data source is synchronized with Grafana. + +- `retention_days` - The number of days the data is retained in the data source. + +## Import + +You can import a Cockpit data source using its unique ID in the `{region}/{id}` format. + +```bash +terraform import scaleway_cockpit_source.example fr-par/11111111-1111-1111-1111-111111111111 +``` diff --git a/docs/resources/cockpit_source.md b/docs/resources/cockpit_source.md index c297bf52b..caafd2ea5 100644 --- a/docs/resources/cockpit_source.md +++ b/docs/resources/cockpit_source.md @@ -5,7 +5,7 @@ page_title: "Scaleway: scaleway_cockpit_source" # Resource: scaleway_cockpit_source -The `scaleway_cockpit_source` resource allows you to create and manage [data sources](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#data-sources) in Scaleway's Cockpit. +The `scaleway_cockpit_sourource allows you to create and manage [data sources](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#data-sources) in Scaleway's Cockpit. Refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api) for more information. diff --git a/internal/services/cockpit/source_data_source.go b/internal/services/cockpit/source_data_source.go new file mode 100644 index 000000000..1d361bcc7 --- /dev/null +++ b/internal/services/cockpit/source_data_source.go @@ -0,0 +1,182 @@ +package cockpit + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/scaleway/scaleway-sdk-go/api/cockpit/v1" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/account" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" +) + +func DataSourceCockpitSource() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceCockpitSourceRead, + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "ID of the data source.", + }, + "region": { + Type: schema.TypeString, + Computed: true, + Description: "The region of the data source.", + }, + "project_id": account.ProjectIDSchema(), + "name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The name of the data source.", + }, + "type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The type of the data source (e.g., 'metrics', 'logs', 'traces').", + ValidateFunc: validation.StringInSlice([]string{ + "metrics", "logs", "traces", + }, false), + }, + "origin": { + Type: schema.TypeString, + Optional: true, + Description: "The origin of the data source (e.g., 'scaleway', 'external', 'custom').", + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "scaleway", "external", "custom", + }, false), + }, + // Computed fields + "url": { + Type: schema.TypeString, + Computed: true, + Description: "The URL of the data source.", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "The creation date of the data source.", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "The last update date of the data source.", + }, + "synchronized_with_grafana": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether the data source is synchronized with Grafana.", + }, + "retention_days": { + Type: schema.TypeInt, + Computed: true, + Description: "The retention period of the data source in days.", + }, + }, + } +} + +func dataSourceCockpitSourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + if _, ok := d.GetOk("id"); ok { + return fetchDataSourceByID(ctx, d, meta) + } + + return fetchDataSourceByFilters(ctx, d, meta) +} + +func fetchDataSourceByID(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + regionalID := d.Get("id").(string) + api, region, id, err := NewAPIWithRegionAndID(meta, regionalID) + d.SetId(id) + if err != nil { + return diag.FromErr(err) + } + res, err := api.GetDataSource(&cockpit.RegionalAPIGetDataSourceRequest{ + Region: region, + DataSourceID: id, + }, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + flattenDataSource(d, res) + return nil +} + +func fetchDataSourceByFilters(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + api, region, err := cockpitAPIWithRegion(d, meta) + if err != nil { + return diag.FromErr(err) + } + + 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)) + } + var allDataSources []*cockpit.DataSource + page := int32(1) + for { + req.Page = &page + req.PageSize = scw.Uint32Ptr(1000) + + res, err := api.ListDataSources(req, scw.WithContext(ctx)) + if err != nil { + return diag.FromErr(err) + } + + allDataSources = append(allDataSources, res.DataSources...) + + if len(res.DataSources) < 1000 { + break + } + + page++ + } + + if len(allDataSources) == 0 { + return diag.Errorf("no data source found matching the specified criteria") + } + + if name, ok := d.GetOk("name"); ok { + for _, ds := range allDataSources { + if ds.Name == name.(string) { + flattenDataSource(d, ds) + return nil + } + } + return diag.Errorf("no data source found with name '%s'", name.(string)) + } + + flattenDataSource(d, allDataSources[0]) + return nil +} + +func flattenDataSource(d *schema.ResourceData, ds *cockpit.DataSource) { + d.SetId(regional.NewIDString(ds.Region, ds.ID)) + _ = d.Set("project_id", ds.ProjectID) + _ = d.Set("name", ds.Name) + _ = d.Set("url", ds.URL) + _ = d.Set("type", ds.Type.String()) + _ = d.Set("origin", ds.Origin.String()) + _ = d.Set("created_at", types.FlattenTime(ds.CreatedAt)) + _ = d.Set("updated_at", types.FlattenTime(ds.UpdatedAt)) + _ = d.Set("synchronized_with_grafana", ds.SynchronizedWithGrafana) + _ = d.Set("retention_days", int(ds.RetentionDays)) + _ = d.Set("region", ds.Region.String()) +} diff --git a/internal/services/cockpit/source_data_source_test.go b/internal/services/cockpit/source_data_source_test.go new file mode 100644 index 000000000..f7c4a0c85 --- /dev/null +++ b/internal/services/cockpit/source_data_source_test.go @@ -0,0 +1,116 @@ +package cockpit_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest" +) + +func TestAccCockpitSource_DataSource_ByID(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_datasource_by_id" + } + + resource "scaleway_cockpit_source" "main" { + project_id = scaleway_account_project.project.id + name = "source-by-id" + type = "metrics" + retention_days = 30 + } + + data "scaleway_cockpit_source" "by_id" { + id = scaleway_cockpit_source.main.id + } + `, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair("data.scaleway_cockpit_source.by_id", "id", "scaleway_cockpit_source.main", "id"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_source.by_id", "name", "source-by-id"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_source.by_id", "type", "metrics"), + ), + }, + }, + }) +} + +func TestAccCockpitSource_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_datasource_by_name" + } + + resource "scaleway_cockpit_source" "main" { + project_id = scaleway_account_project.project.id + name = "source-by-name" + type = "logs" + retention_days = 30 + } + + data "scaleway_cockpit_source" "by_name" { + project_id = scaleway_account_project.project.id + name = "source-by-name" + depends_on = [scaleway_cockpit_source.main] + } + `, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair("data.scaleway_cockpit_source.by_name", "id", "scaleway_cockpit_source.main", "id"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_source.by_name", "name", "source-by-name"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_source.by_name", "type", "logs"), + ), + }, + }, + }) +} + +func TestAccCockpitSource_DataSource_Defaults(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: fmt.Sprintf(` + data "scaleway_cockpit_source" "default_metrics" { + type = "metrics" + origin = "scaleway" + } + + data "scaleway_cockpit_source" "default_logs" { + type = "logs" + origin = "scaleway" + } + `), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("data.scaleway_cockpit_source.default_metrics", "name", "Scaleway Metrics"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_source.default_metrics", "type", "metrics"), + resource.TestCheckResourceAttrSet("data.scaleway_cockpit_source.default_metrics", "url"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_source.default_logs", "name", "Scaleway Logs"), + resource.TestCheckResourceAttr("data.scaleway_cockpit_source.default_logs", "type", "logs"), + resource.TestCheckResourceAttrSet("data.scaleway_cockpit_source.default_logs", "url"), + ), + }, + }, + }) +} diff --git a/internal/services/cockpit/testdata/cockpit-source-basic-metrics.cassette.yaml b/internal/services/cockpit/testdata/cockpit-source-basic-metrics.cassette.yaml index b272c188a..f9b474f39 100644 --- a/internal/services/cockpit/testdata/cockpit-source-basic-metrics.cassette.yaml +++ b/internal/services/cockpit/testdata/cockpit-source-basic-metrics.cassette.yaml @@ -27,18 +27,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 248 + content_length: 253 uncompressed: false - body: '{"created_at":"2024-12-12T14:54:23.052479Z","description":"","id":"f9d7fbd6-c86c-45d8-ad28-963e0a251e0c","name":"tf_tests_cockpit_datasource_basic","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-12T14:54:23.052479Z"}' + body: '{"created_at":"2024-12-20T09:54:17.847960Z","description":"","id":"f520ad24-16c6-49b7-b3c5-885aa9e74dca","name":"tf_tests_cockpit_datasource_basic","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T09:54:17.847960Z"}' headers: Content-Length: - - "248" + - "253" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:23 GMT + - Fri, 20 Dec 2024 09:54:18 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -48,10 +48,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 5fa12e8c-eaca-4edf-9c3f-4df7680a20c3 + - 064ee00b-0085-4b4d-8e5d-04245888966b status: 200 OK code: 200 - duration: 977.68625ms + duration: 687.479959ms - id: 1 request: proto: HTTP/1.1 @@ -68,7 +68,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/f9d7fbd6-c86c-45d8-ad28-963e0a251e0c + url: https://api.scaleway.com/account/v3/projects/f520ad24-16c6-49b7-b3c5-885aa9e74dca method: GET response: proto: HTTP/2.0 @@ -76,18 +76,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 248 + content_length: 253 uncompressed: false - body: '{"created_at":"2024-12-12T14:54:23.052479Z","description":"","id":"f9d7fbd6-c86c-45d8-ad28-963e0a251e0c","name":"tf_tests_cockpit_datasource_basic","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-12T14:54:23.052479Z"}' + body: '{"created_at":"2024-12-20T09:54:17.847960Z","description":"","id":"f520ad24-16c6-49b7-b3c5-885aa9e74dca","name":"tf_tests_cockpit_datasource_basic","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T09:54:17.847960Z"}' headers: Content-Length: - - "248" + - "253" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:23 GMT + - Fri, 20 Dec 2024 09:54:18 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -97,10 +97,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6e23808e-426f-4575-8d17-00f5b23f611d + - 88b4c325-6710-4c7b-9d80-7fe35766b80a status: 200 OK code: 200 - duration: 110.312959ms + duration: 216.657ms - id: 2 request: proto: HTTP/1.1 @@ -112,7 +112,7 @@ interactions: host: api.scaleway.com remote_addr: "" request_uri: "" - body: '{"project_id":"f9d7fbd6-c86c-45d8-ad28-963e0a251e0c","name":"my-source","type":"metrics","retention_days":31}' + body: '{"project_id":"f520ad24-16c6-49b7-b3c5-885aa9e74dca","name":"my-source","type":"metrics","retention_days":31}' form: {} headers: Content-Type: @@ -127,18 +127,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 395 + content_length: 405 uncompressed: false - body: '{"created_at":"2024-12-12T14:54:23.714975Z","id":"547c1b2d-321c-4a80-8c53-5e58a866b0c3","name":"my-source","origin":"custom","project_id":"f9d7fbd6-c86c-45d8-ad28-963e0a251e0c","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-12T14:54:23.714975Z","url":"https://547c1b2d-321c-4a80-8c53-5e58a866b0c3.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T09:54:18.548120Z","id":"4998fe45-b576-4ef7-9a3e-acfc01db1ea3","name":"my-source","origin":"custom","project_id":"f520ad24-16c6-49b7-b3c5-885aa9e74dca","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T09:54:18.548120Z","url":"https://4998fe45-b576-4ef7-9a3e-acfc01db1ea3.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - - "395" + - "405" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:23 GMT + - Fri, 20 Dec 2024 09:54:18 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -148,10 +148,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6c35e620-38ee-4b3e-99f5-fe4a300e3313 + - b5f3304c-ed3f-4cfe-bce5-fa7de6b4b480 status: 200 OK code: 200 - duration: 339.527125ms + duration: 278.85775ms - id: 3 request: proto: HTTP/1.1 @@ -168,7 +168,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/547c1b2d-321c-4a80-8c53-5e58a866b0c3 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/4998fe45-b576-4ef7-9a3e-acfc01db1ea3 method: GET response: proto: HTTP/2.0 @@ -176,18 +176,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 395 + content_length: 405 uncompressed: false - body: '{"created_at":"2024-12-12T14:54:23.714975Z","id":"547c1b2d-321c-4a80-8c53-5e58a866b0c3","name":"my-source","origin":"custom","project_id":"f9d7fbd6-c86c-45d8-ad28-963e0a251e0c","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-12T14:54:23.714975Z","url":"https://547c1b2d-321c-4a80-8c53-5e58a866b0c3.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T09:54:18.548120Z","id":"4998fe45-b576-4ef7-9a3e-acfc01db1ea3","name":"my-source","origin":"custom","project_id":"f520ad24-16c6-49b7-b3c5-885aa9e74dca","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T09:54:18.548120Z","url":"https://4998fe45-b576-4ef7-9a3e-acfc01db1ea3.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - - "395" + - "405" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:23 GMT + - Fri, 20 Dec 2024 09:54:18 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -197,10 +197,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - ff682e64-a8ad-4a83-96b4-54115e8fc05f + - ec4cbc7e-9d10-45f3-86cb-19267f4f84e0 status: 200 OK code: 200 - duration: 147.375709ms + duration: 64.481833ms - id: 4 request: proto: HTTP/1.1 @@ -217,7 +217,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/547c1b2d-321c-4a80-8c53-5e58a866b0c3 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/4998fe45-b576-4ef7-9a3e-acfc01db1ea3 method: GET response: proto: HTTP/2.0 @@ -225,18 +225,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 395 + content_length: 405 uncompressed: false - body: '{"created_at":"2024-12-12T14:54:23.714975Z","id":"547c1b2d-321c-4a80-8c53-5e58a866b0c3","name":"my-source","origin":"custom","project_id":"f9d7fbd6-c86c-45d8-ad28-963e0a251e0c","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-12T14:54:23.714975Z","url":"https://547c1b2d-321c-4a80-8c53-5e58a866b0c3.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T09:54:18.548120Z","id":"4998fe45-b576-4ef7-9a3e-acfc01db1ea3","name":"my-source","origin":"custom","project_id":"f520ad24-16c6-49b7-b3c5-885aa9e74dca","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T09:54:18.548120Z","url":"https://4998fe45-b576-4ef7-9a3e-acfc01db1ea3.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - - "395" + - "405" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:24 GMT + - Fri, 20 Dec 2024 09:54:18 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -246,10 +246,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 41cade1c-b80d-4e9f-8547-029cf5f8a21c + - 82fbd1ef-74ba-4f70-967e-413e6e6cca17 status: 200 OK code: 200 - duration: 109.970125ms + duration: 61.194625ms - id: 5 request: proto: HTTP/1.1 @@ -266,7 +266,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/f9d7fbd6-c86c-45d8-ad28-963e0a251e0c + url: https://api.scaleway.com/account/v3/projects/f520ad24-16c6-49b7-b3c5-885aa9e74dca method: GET response: proto: HTTP/2.0 @@ -274,18 +274,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 248 + content_length: 253 uncompressed: false - body: '{"created_at":"2024-12-12T14:54:23.052479Z","description":"","id":"f9d7fbd6-c86c-45d8-ad28-963e0a251e0c","name":"tf_tests_cockpit_datasource_basic","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-12T14:54:23.052479Z"}' + body: '{"created_at":"2024-12-20T09:54:17.847960Z","description":"","id":"f520ad24-16c6-49b7-b3c5-885aa9e74dca","name":"tf_tests_cockpit_datasource_basic","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T09:54:17.847960Z"}' headers: Content-Length: - - "248" + - "253" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:24 GMT + - Fri, 20 Dec 2024 09:54:19 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -295,10 +295,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6ec08702-e303-4b3f-8108-80a63525be85 + - fa193641-045a-40ef-a25f-2b126a85d9e1 status: 200 OK code: 200 - duration: 146.50125ms + duration: 130.3035ms - id: 6 request: proto: HTTP/1.1 @@ -315,7 +315,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/547c1b2d-321c-4a80-8c53-5e58a866b0c3 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/4998fe45-b576-4ef7-9a3e-acfc01db1ea3 method: GET response: proto: HTTP/2.0 @@ -323,18 +323,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 395 + content_length: 405 uncompressed: false - body: '{"created_at":"2024-12-12T14:54:23.714975Z","id":"547c1b2d-321c-4a80-8c53-5e58a866b0c3","name":"my-source","origin":"custom","project_id":"f9d7fbd6-c86c-45d8-ad28-963e0a251e0c","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-12T14:54:23.714975Z","url":"https://547c1b2d-321c-4a80-8c53-5e58a866b0c3.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T09:54:18.548120Z","id":"4998fe45-b576-4ef7-9a3e-acfc01db1ea3","name":"my-source","origin":"custom","project_id":"f520ad24-16c6-49b7-b3c5-885aa9e74dca","region":"fr-par","retention_days":31,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T09:54:18.548120Z","url":"https://4998fe45-b576-4ef7-9a3e-acfc01db1ea3.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - - "395" + - "405" Content-Security-Policy: - default-src 'none'; frame-ancestors 'none' Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:25 GMT + - Fri, 20 Dec 2024 09:54:19 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -344,10 +344,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 709f87bc-a9a7-423e-900e-0c2c25cbb038 + - 5f568678-88e7-4de9-80eb-bf691988d265 status: 200 OK code: 200 - duration: 103.497542ms + duration: 84.566208ms - id: 7 request: proto: HTTP/1.1 @@ -364,7 +364,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/547c1b2d-321c-4a80-8c53-5e58a866b0c3 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/4998fe45-b576-4ef7-9a3e-acfc01db1ea3 method: DELETE response: proto: HTTP/2.0 @@ -381,7 +381,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:26 GMT + - Fri, 20 Dec 2024 09:54:22 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -391,10 +391,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 2f765233-6068-4774-92c6-3530110cd98b + - 9081d417-5c46-4237-aade-0b2a00879541 status: 204 No Content code: 204 - duration: 428.495834ms + duration: 1.751845291s - id: 8 request: proto: HTTP/1.1 @@ -411,7 +411,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/f9d7fbd6-c86c-45d8-ad28-963e0a251e0c + url: https://api.scaleway.com/account/v3/projects/f520ad24-16c6-49b7-b3c5-885aa9e74dca method: DELETE response: proto: HTTP/2.0 @@ -428,7 +428,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:27 GMT + - Fri, 20 Dec 2024 09:54:23 GMT Server: - Scaleway API Gateway (fr-par-1;edge02) Strict-Transport-Security: @@ -438,10 +438,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 520787bc-c213-4344-99a1-78830c9407b3 + - 7d430bda-4e33-4222-88c2-9b304646b6cc status: 204 No Content code: 204 - duration: 1.448017958s + duration: 1.421014541s - id: 9 request: proto: HTTP/1.1 @@ -458,7 +458,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/547c1b2d-321c-4a80-8c53-5e58a866b0c3 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/4998fe45-b576-4ef7-9a3e-acfc01db1ea3 method: GET response: proto: HTTP/2.0 @@ -468,7 +468,7 @@ interactions: trailer: {} content_length: 132 uncompressed: false - body: '{"message":"resource is not found","resource":"data source","resource_id":"547c1b2d-321c-4a80-8c53-5e58a866b0c3","type":"not_found"}' + body: '{"message":"resource is not found","resource":"data source","resource_id":"4998fe45-b576-4ef7-9a3e-acfc01db1ea3","type":"not_found"}' headers: Content-Length: - "132" @@ -477,9 +477,9 @@ interactions: Content-Type: - application/json Date: - - Thu, 12 Dec 2024 14:54:27 GMT + - Fri, 20 Dec 2024 09:54:58 GMT Server: - - Scaleway API Gateway (fr-par-1;edge02) + - Scaleway API Gateway (fr-par-1;edge03) Strict-Transport-Security: - max-age=63072000 X-Content-Type-Options: @@ -487,7 +487,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - b759f7b2-eeae-4351-a230-4813e34e82e2 + - 12b3bca1-ae57-427c-8b7f-a86ccf2b163d status: 404 Not Found code: 404 - duration: 26.838917ms + duration: 59.513583ms diff --git a/internal/services/cockpit/testdata/cockpit-source-data-source-by-id.cassette.yaml b/internal/services/cockpit/testdata/cockpit-source-data-source-by-id.cassette.yaml new file mode 100644 index 000000000..78cc03472 --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-source-data-source-by-id.cassette.yaml @@ -0,0 +1,689 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 118 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf_tests_cockpit_datasource_by_id","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.23.3; 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: 253 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:09.381796Z","description":"","id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:03:09.381796Z"}' + headers: + Content-Length: + - "253" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:10 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1ab5f9f2-4c93-4a68-976c-dca58f350f5e + status: 200 OK + code: 200 + duration: 1.153418042s + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/cc420be3-b7f6-4a27-8725-74f89bcbe14e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 253 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:09.381796Z","description":"","id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:03:09.381796Z"}' + headers: + Content-Length: + - "253" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:10 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1e84ac44-c1df-4907-9aed-899dbc7cf917 + status: 200 OK + code: 200 + duration: 122.846459ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 112 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","name":"source-by-id","type":"metrics","retention_days":30}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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: 408 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:10 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a80ae927-7244-4ee6-a3b6-457b2c251a8d + status: 200 OK + code: 200 + duration: 371.868291ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:10 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e8b5dfaa-12c7-494b-86cc-4c2b68202fef + status: 200 OK + code: 200 + duration: 83.0945ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:10 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 34daea16-0180-4b33-887a-9304661a1bf3 + status: 200 OK + code: 200 + duration: 71.595667ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:11 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 59d69aca-a2e7-4b1c-b6bb-14caeb082b2a + status: 200 OK + code: 200 + duration: 438.024917ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/cc420be3-b7f6-4a27-8725-74f89bcbe14e + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 253 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:09.381796Z","description":"","id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:03:09.381796Z"}' + headers: + Content-Length: + - "253" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:12 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 704a14dc-3482-4386-ae52-3e2cb191e368 + status: 200 OK + code: 200 + duration: 133.494333ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:12 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 95ac9149-f6f7-4281-81ec-1269876dfc55 + status: 200 OK + code: 200 + duration: 89.501708ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:12 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7ffd982d-1158-4889-8fa2-e5b9231a5c96 + status: 200 OK + code: 200 + duration: 97.050791ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 408 + uncompressed: false + body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "408" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:12 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 7a22b2c8-03df-4c66-831f-fb1582b27091 + status: 200 OK + code: 200 + duration: 80.017042ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:13 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c7398161-cd70-4945-9683-4d9320ebf775 + status: 204 No Content + code: 204 + duration: 511.200833ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/cc420be3-b7f6-4a27-8725-74f89bcbe14e + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:15 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 8646ede5-1301-4e18-8f0d-2b1aca91b158 + status: 204 No Content + code: 204 + duration: 1.499719083s + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + 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":"38051151-1afc-4383-8785-1a881e3b1ca4","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:15 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f500e21e-bedc-4195-964b-a80599349fb1 + status: 404 Not Found + code: 404 + duration: 33.18975ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + 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":"38051151-1afc-4383-8785-1a881e3b1ca4","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:03:15 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5fb79a0c-9250-4b63-8368-0b0a28f20623 + status: 404 Not Found + code: 404 + duration: 36.561125ms diff --git a/internal/services/cockpit/testdata/cockpit-source-data-source-by-name.cassette.yaml b/internal/services/cockpit/testdata/cockpit-source-data-source-by-name.cassette.yaml new file mode 100644 index 000000000..aa1b59834 --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-source-data-source-by-name.cassette.yaml @@ -0,0 +1,689 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 120 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"name":"tf_tests_cockpit_datasource_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.23.3; 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: 255 + uncompressed: false + body: '{"created_at":"2024-12-20T13:17:49.902550Z","description":"","id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:17:49.902550Z"}' + headers: + Content-Length: + - "255" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:50 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5bcb13d5-414c-4a01-a939-34eb18665217 + status: 200 OK + code: 200 + duration: 866.01925ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 255 + uncompressed: false + body: '{"created_at":"2024-12-20T13:17:49.902550Z","description":"","id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:17:49.902550Z"}' + headers: + Content-Length: + - "255" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:50 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 302fd721-9dbe-41ea-b829-9d2e07e49913 + status: 200 OK + code: 200 + duration: 140.926709ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 111 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: '{"project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","name":"source-by-name","type":"logs","retention_days":30}' + form: {} + headers: + Content-Type: + - application/json + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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: 404 + uncompressed: false + body: '{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "404" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:50 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 0f6b8eae-ca69-4c13-a587-59be67ce5dd4 + status: 200 OK + code: 200 + duration: 257.876917ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 404 + uncompressed: false + body: '{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "404" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:50 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - c64497ba-eab5-4252-9478-6db539277464 + status: 200 OK + code: 200 + duration: 71.133875ms + - 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.23.3; 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&page_size=1000&project_id=cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + 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":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.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: + - Fri, 20 Dec 2024 13:17:51 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 76eea9c8-56d6-43a9-84d6-5fd8152c4ef2 + status: 200 OK + code: 200 + duration: 603.106791ms + - 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.23.3; 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&page_size=1000&project_id=cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + 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":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.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: + - Fri, 20 Dec 2024 13:17:52 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b171db7f-4115-45b8-8b08-d7c170cdeef2 + status: 200 OK + code: 200 + duration: 462.589208ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 255 + uncompressed: false + body: '{"created_at":"2024-12-20T13:17:49.902550Z","description":"","id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:17:49.902550Z"}' + headers: + Content-Length: + - "255" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:52 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 2cdd33c0-41d6-4815-820e-65698d38bf3f + status: 200 OK + code: 200 + duration: 139.008625ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 404 + uncompressed: false + body: '{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}' + headers: + Content-Length: + - "404" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:52 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - af6bec19-1004-414e-aded-4913438b0b13 + status: 200 OK + code: 200 + duration: 60.067625ms + - 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.23.3; 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&page_size=1000&project_id=cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + 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":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.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: + - Fri, 20 Dec 2024 13:17:53 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5cf8d5f4-fc51-42c5-be4e-858c206e502d + status: 200 OK + code: 200 + duration: 487.633125ms + - 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.23.3; 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&page_size=1000&project_id=cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + 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":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.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: + - Fri, 20 Dec 2024 13:17:54 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - cf9d5f1b-205b-4243-aa98-9481b5165710 + status: 200 OK + code: 200 + duration: 573.352042ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:54 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 53a3f0ea-50b1-435d-87a6-05af288a5408 + status: 204 No Content + code: 204 + duration: 186.514833ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/account/v3/projects/cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:56 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 612b62d7-9fa3-4ea3-8ae8-f532f3a8971e + status: 204 No Content + code: 204 + duration: 1.443823875s + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + 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":"69bce474-8dd5-4628-b386-5562f561e69b","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:56 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d4503138-42bb-4f1f-8ca4-44c56d47befa + status: 404 Not Found + code: 404 + duration: 29.735791ms + - 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.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + 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":"69bce474-8dd5-4628-b386-5562f561e69b","type":"not_found"}' + headers: + Content-Length: + - "132" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:17:56 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge03) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6f8c8da5-9de3-489b-b69c-afe44ba16c1b + status: 404 Not Found + code: 404 + duration: 27.168625ms diff --git a/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml b/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml new file mode 100644 index 000000000..4c6e6f849 --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml @@ -0,0 +1,493 @@ +--- +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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 439 + uncompressed: false + body: '{"data_sources":[{"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":1}' + headers: + Content-Length: + - "439" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:30 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 39a42dc8-393a-482f-93aa-9b907d591ccf + status: 200 OK + code: 200 + duration: 311.477041ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 449 + 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"}],"total_count":1}' + headers: + Content-Length: + - "449" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:30 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1715b1d5-5241-418c-9c23-f696c79bc761 + status: 200 OK + code: 200 + duration: 393.495583ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 439 + uncompressed: false + body: '{"data_sources":[{"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":1}' + headers: + Content-Length: + - "439" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:30 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 9a7552d6-2086-4633-8726-4fcd749ef031 + status: 200 OK + code: 200 + duration: 125.612625ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 449 + 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"}],"total_count":1}' + headers: + Content-Length: + - "449" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:30 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - e00f8ef0-a0e4-40b6-a620-7e4d4c548157 + status: 200 OK + code: 200 + duration: 497.384458ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 439 + uncompressed: false + body: '{"data_sources":[{"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":1}' + headers: + Content-Length: + - "439" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:32 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - f2c397eb-8d65-4181-bcb7-a630bf3fa606 + status: 200 OK + code: 200 + duration: 146.649709ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 449 + 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"}],"total_count":1}' + headers: + Content-Length: + - "449" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:32 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 8b01daaa-f0a9-4432-b4c0-60a3c017c0c6 + status: 200 OK + code: 200 + duration: 224.155042ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 439 + uncompressed: false + body: '{"data_sources":[{"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":1}' + headers: + Content-Length: + - "439" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:32 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 96ea773e-d9d4-49b4-87f8-863b39c402bb + status: 200 OK + code: 200 + duration: 117.905458ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 449 + 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"}],"total_count":1}' + headers: + Content-Length: + - "449" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:32 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 92895ce9-7206-498f-b12f-883cda8dcae6 + status: 200 OK + code: 200 + duration: 235.92275ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 439 + uncompressed: false + body: '{"data_sources":[{"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":1}' + headers: + Content-Length: + - "439" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:33 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 3f26755c-7b4f-4f2c-b61a-e3aeb6bad6ca + status: 200 OK + code: 200 + duration: 114.577084ms + - 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.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 449 + 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"}],"total_count":1}' + headers: + Content-Length: + - "449" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 13:18:33 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 4806f960-acb5-4242-b2e8-58e9c6df58df + status: 200 OK + code: 200 + duration: 200.839375ms From 4a0148b5b2c6583d13ab3578db37cbda114f2007 Mon Sep 17 00:00:00 2001 From: devtools-ci-cd Date: Fri, 20 Dec 2024 14:47:15 +0100 Subject: [PATCH 2/4] feat(cockpit): fix lint --- internal/provider/provider.go | 1 + internal/services/cockpit/source_data_source.go | 11 ++--------- internal/services/cockpit/source_data_source_test.go | 5 ++--- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index f5f814099..19ae83710 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -239,6 +239,7 @@ func Provider(config *Config) plugin.ProviderFunc { "scaleway_block_volume": block.DataSourceVolume(), "scaleway_cockpit": cockpit.DataSourceCockpit(), "scaleway_cockpit_plan": cockpit.DataSourcePlan(), + "scaleway_cockpit_source": cockpit.DataSourceCockpitSource(), "scaleway_config": scwconfig.DataSourceConfig(), "scaleway_container": container.DataSourceContainer(), "scaleway_container_namespace": container.DataSourceNamespace(), diff --git a/internal/services/cockpit/source_data_source.go b/internal/services/cockpit/source_data_source.go index 1d361bcc7..6ba72f055 100644 --- a/internal/services/cockpit/source_data_source.go +++ b/internal/services/cockpit/source_data_source.go @@ -47,13 +47,12 @@ func DataSourceCockpitSource() *schema.Resource { "origin": { Type: schema.TypeString, Optional: true, - Description: "The origin of the data source (e.g., 'scaleway', 'external', 'custom').", Computed: true, + Description: "The origin of the data source (e.g., 'scaleway', 'external', 'custom').", ValidateFunc: validation.StringInSlice([]string{ "scaleway", "external", "custom", }, false), }, - // Computed fields "url": { Type: schema.TypeString, Computed: true, @@ -84,22 +83,19 @@ func DataSourceCockpitSource() *schema.Resource { } func dataSourceCockpitSourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - if _, ok := d.GetOk("id"); ok { return fetchDataSourceByID(ctx, d, meta) } - return fetchDataSourceByFilters(ctx, d, meta) } func fetchDataSourceByID(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - regionalID := d.Get("id").(string) api, region, id, err := NewAPIWithRegionAndID(meta, regionalID) - d.SetId(id) if err != nil { return diag.FromErr(err) } + d.SetId(id) res, err := api.GetDataSource(&cockpit.RegionalAPIGetDataSourceRequest{ Region: region, DataSourceID: id, @@ -112,7 +108,6 @@ func fetchDataSourceByID(ctx context.Context, d *schema.ResourceData, meta inter } func fetchDataSourceByFilters(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - api, region, err := cockpitAPIWithRegion(d, meta) if err != nil { return diag.FromErr(err) @@ -141,11 +136,9 @@ func fetchDataSourceByFilters(ctx context.Context, d *schema.ResourceData, meta } allDataSources = append(allDataSources, res.DataSources...) - if len(res.DataSources) < 1000 { break } - page++ } diff --git a/internal/services/cockpit/source_data_source_test.go b/internal/services/cockpit/source_data_source_test.go index f7c4a0c85..b687ccdc1 100644 --- a/internal/services/cockpit/source_data_source_test.go +++ b/internal/services/cockpit/source_data_source_test.go @@ -1,7 +1,6 @@ package cockpit_test import ( - "fmt" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -91,7 +90,7 @@ func TestAccCockpitSource_DataSource_Defaults(t *testing.T) { ProviderFactories: tt.ProviderFactories, Steps: []resource.TestStep{ { - Config: fmt.Sprintf(` + Config: ` data "scaleway_cockpit_source" "default_metrics" { type = "metrics" origin = "scaleway" @@ -101,7 +100,7 @@ func TestAccCockpitSource_DataSource_Defaults(t *testing.T) { type = "logs" origin = "scaleway" } - `), + `, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.scaleway_cockpit_source.default_metrics", "name", "Scaleway Metrics"), resource.TestCheckResourceAttr("data.scaleway_cockpit_source.default_metrics", "type", "metrics"), From 1280ebad1070095afcadb6f7fc83072e9edbd8b8 Mon Sep 17 00:00:00 2001 From: devtools-ci-cd Date: Fri, 20 Dec 2024 15:26:24 +0100 Subject: [PATCH 3/4] feat(cockpit): fix test --- docs/resources/cockpit_source.md | 2 +- .../cockpit/source_data_source_test.go | 20 +- ...-source-data-source-defaults.cassette.yaml | 568 ++++++++++++++++-- 3 files changed, 547 insertions(+), 43 deletions(-) diff --git a/docs/resources/cockpit_source.md b/docs/resources/cockpit_source.md index caafd2ea5..c297bf52b 100644 --- a/docs/resources/cockpit_source.md +++ b/docs/resources/cockpit_source.md @@ -5,7 +5,7 @@ page_title: "Scaleway: scaleway_cockpit_source" # Resource: scaleway_cockpit_source -The `scaleway_cockpit_sourource allows you to create and manage [data sources](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#data-sources) in Scaleway's Cockpit. +The `scaleway_cockpit_source` resource allows you to create and manage [data sources](https://www.scaleway.com/en/docs/observability/cockpit/concepts/#data-sources) in Scaleway's Cockpit. Refer to Cockpit's [product documentation](https://www.scaleway.com/en/docs/observability/cockpit/concepts/) and [API documentation](https://www.scaleway.com/en/developers/api/cockpit/regional-api) for more information. diff --git a/internal/services/cockpit/source_data_source_test.go b/internal/services/cockpit/source_data_source_test.go index b687ccdc1..45ba20ed5 100644 --- a/internal/services/cockpit/source_data_source_test.go +++ b/internal/services/cockpit/source_data_source_test.go @@ -1,6 +1,7 @@ package cockpit_test import ( + "fmt" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -84,23 +85,36 @@ func TestAccCockpitSource_DataSource_ByName(t *testing.T) { func TestAccCockpitSource_DataSource_Defaults(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: ` + Config: fmt.Sprintf(` + + data scaleway_account_project "by_name" { + name = "default" + organization_id = "%s" + } + + data "scaleway_cockpit_source" "default_metrics" { + project_id = data.scaleway_account_project.by_name.id type = "metrics" origin = "scaleway" } data "scaleway_cockpit_source" "default_logs" { + project_id = data.scaleway_account_project.by_name.id type = "logs" origin = "scaleway" } - `, + `, orgID), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.scaleway_cockpit_source.default_metrics", "name", "Scaleway Metrics"), resource.TestCheckResourceAttr("data.scaleway_cockpit_source.default_metrics", "type", "metrics"), diff --git a/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml b/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml index 4c6e6f849..619bbdfd7 100644 --- a/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml +++ b/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml @@ -2,6 +2,104 @@ 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.23.3; 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: 259 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "259" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:25:57 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a2a2709b-0ac9-40ab-89f2-ce3cae5c7057 + status: 200 OK + code: 200 + duration: 2.139183083s + - 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.23.3; 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: 227 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "227" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:25:57 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - a0ffcc2c-e49d-4a1d-8583-8dff8bb1fe77 + status: 200 OK + code: 200 + duration: 125.802208ms + - id: 2 request: proto: HTTP/1.1 proto_major: 1 @@ -36,7 +134,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:30 GMT + - Fri, 20 Dec 2024 14:25:58 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -46,11 +144,11 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 39a42dc8-393a-482f-93aa-9b907d591ccf + - 0792fcbc-7ff1-4fb1-a04d-493c41e27b90 status: 200 OK code: 200 - duration: 311.477041ms - - id: 1 + duration: 137.824334ms + - id: 3 request: proto: HTTP/1.1 proto_major: 1 @@ -85,7 +183,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:30 GMT + - Fri, 20 Dec 2024 14:25:58 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -95,11 +193,109 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 1715b1d5-5241-418c-9c23-f696c79bc761 + - 6b594e99-7115-4607-9a79-a8553d505ccb status: 200 OK code: 200 - duration: 393.495583ms - - id: 2 + duration: 270.892459ms + - 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.23.3; 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: 259 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "259" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:25:59 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - d364fc3d-ec20-4a3e-b7f5-11391ed581d7 + status: 200 OK + code: 200 + duration: 1.069475583s + - 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.23.3; 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: 227 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "227" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:25:59 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6274bae6-6ee2-4c9a-b46b-bfbb99893d33 + status: 200 OK + code: 200 + duration: 98.715083ms + - id: 6 request: proto: HTTP/1.1 proto_major: 1 @@ -134,7 +330,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:30 GMT + - Fri, 20 Dec 2024 14:25:59 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -144,11 +340,11 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 9a7552d6-2086-4633-8726-4fcd749ef031 + - cbab28ec-614f-49b0-8118-ce728b2efa75 status: 200 OK code: 200 - duration: 125.612625ms - - id: 3 + duration: 128.825833ms + - id: 7 request: proto: HTTP/1.1 proto_major: 1 @@ -183,7 +379,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:30 GMT + - Fri, 20 Dec 2024 14:25:59 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -193,11 +389,109 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - e00f8ef0-a0e4-40b6-a620-7e4d4c548157 + - 2dab8988-96ba-4450-8768-a5326861eab8 status: 200 OK code: 200 - duration: 497.384458ms - - id: 4 + duration: 225.994792ms + - 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.23.3; 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: 259 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "259" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:26:01 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - bc475219-3e31-4de0-ba06-98e79f1717f6 + status: 200 OK + code: 200 + duration: 990.133875ms + - 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.23.3; 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: 227 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "227" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:26:01 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 699f182e-e9bb-4578-a015-ae9647fe0e81 + status: 200 OK + code: 200 + duration: 119.069041ms + - id: 10 request: proto: HTTP/1.1 proto_major: 1 @@ -232,7 +526,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:32 GMT + - Fri, 20 Dec 2024 14:26:01 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -242,11 +536,11 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - f2c397eb-8d65-4181-bcb7-a630bf3fa606 + - e179e301-8a5b-40bd-ac00-0f4efbd4e0a9 status: 200 OK code: 200 - duration: 146.649709ms - - id: 5 + duration: 133.217458ms + - id: 11 request: proto: HTTP/1.1 proto_major: 1 @@ -281,7 +575,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:32 GMT + - Fri, 20 Dec 2024 14:26:01 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -291,11 +585,109 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 8b01daaa-f0a9-4432-b4c0-60a3c017c0c6 + - 5e253f66-908a-42fc-bae3-cf6c983cbe52 status: 200 OK code: 200 - duration: 224.155042ms - - id: 6 + duration: 242.197917ms + - 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.23.3; 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: 259 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "259" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:26:03 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b6ce031a-20a5-4b01-b18e-5af3eb4ddce4 + status: 200 OK + code: 200 + duration: 757.35675ms + - 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.23.3; 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: 227 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "227" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:26:03 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 26ccb4bd-ac18-4e98-b5e8-52c3a1395d7b + status: 200 OK + code: 200 + duration: 174.060458ms + - id: 14 request: proto: HTTP/1.1 proto_major: 1 @@ -330,7 +722,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:32 GMT + - Fri, 20 Dec 2024 14:26:03 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -340,11 +732,11 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 96ea773e-d9d4-49b4-87f8-863b39c402bb + - e9d1aa33-aba7-436d-8a50-15228362dd15 status: 200 OK code: 200 - duration: 117.905458ms - - id: 7 + duration: 164.622459ms + - id: 15 request: proto: HTTP/1.1 proto_major: 1 @@ -379,7 +771,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:32 GMT + - Fri, 20 Dec 2024 14:26:03 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -389,11 +781,109 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 92895ce9-7206-498f-b12f-883cda8dcae6 + - e1d039b8-50d0-4c80-8b2d-3454b42fce1e status: 200 OK code: 200 - duration: 235.92275ms - - id: 8 + duration: 259.928541ms + - 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.23.3; 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: 259 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}],"total_count":1}' + headers: + Content-Length: + - "259" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:26:04 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - b5f790c7-c957-4adb-be23-5fcb2af928d3 + status: 200 OK + code: 200 + duration: 821.919916ms + - 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.23.3; 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: 227 + 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","updated_at":"2020-05-03T19:41:17.997124Z"}' + headers: + Content-Length: + - "227" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 14:26:04 GMT + Server: + - Scaleway API Gateway (fr-par-2;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 6cce2317-037b-4dcf-b1c0-14b8685e5c4d + status: 200 OK + code: 200 + duration: 103.723167ms + - id: 18 request: proto: HTTP/1.1 proto_major: 1 @@ -428,7 +918,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:33 GMT + - Fri, 20 Dec 2024 14:26:04 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -438,11 +928,11 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 3f26755c-7b4f-4f2c-b61a-e3aeb6bad6ca + - 343f3ba0-e1c0-4d88-b47c-48d50946055c status: 200 OK code: 200 - duration: 114.577084ms - - id: 9 + duration: 133.369833ms + - id: 19 request: proto: HTTP/1.1 proto_major: 1 @@ -477,7 +967,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:18:33 GMT + - Fri, 20 Dec 2024 14:26:04 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -487,7 +977,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 4806f960-acb5-4242-b2e8-58e9c6df58df + - 4659bbac-0e5a-48a5-8a05-ce5a2f90dc0c status: 200 OK code: 200 - duration: 200.839375ms + duration: 235.348ms From 6b4d1e02f98900d3f4377f34ffc6da1659e22ffe Mon Sep 17 00:00:00 2001 From: devtools-ci-cd Date: Fri, 20 Dec 2024 16:45:37 +0100 Subject: [PATCH 4/4] feat(cockpit): refacto fetch all --- .../services/cockpit/source_data_source.go | 24 +-- ...pit-source-data-source-by-id.cassette.yaml | 134 ++++++++--------- ...t-source-data-source-by-name.cassette.yaml | 134 ++++++++--------- ...-source-data-source-defaults.cassette.yaml | 140 +++++++++--------- 4 files changed, 210 insertions(+), 222 deletions(-) diff --git a/internal/services/cockpit/source_data_source.go b/internal/services/cockpit/source_data_source.go index 6ba72f055..962a494b0 100644 --- a/internal/services/cockpit/source_data_source.go +++ b/internal/services/cockpit/source_data_source.go @@ -124,30 +124,18 @@ func fetchDataSourceByFilters(ctx context.Context, d *schema.ResourceData, meta if v, ok := d.GetOk("origin"); ok { req.Origin = cockpit.DataSourceOrigin(v.(string)) } - var allDataSources []*cockpit.DataSource - page := int32(1) - for { - req.Page = &page - req.PageSize = scw.Uint32Ptr(1000) - res, err := api.ListDataSources(req, scw.WithContext(ctx)) - if err != nil { - return diag.FromErr(err) - } - - allDataSources = append(allDataSources, res.DataSources...) - if len(res.DataSources) < 1000 { - break - } - page++ + res, err := api.ListDataSources(req, scw.WithContext(ctx), scw.WithAllPages()) + if err != nil { + return diag.FromErr(err) } - if len(allDataSources) == 0 { + if res.TotalCount == 0 { return diag.Errorf("no data source found matching the specified criteria") } if name, ok := d.GetOk("name"); ok { - for _, ds := range allDataSources { + for _, ds := range res.DataSources { if ds.Name == name.(string) { flattenDataSource(d, ds) return nil @@ -156,7 +144,7 @@ func fetchDataSourceByFilters(ctx context.Context, d *schema.ResourceData, meta return diag.Errorf("no data source found with name '%s'", name.(string)) } - flattenDataSource(d, allDataSources[0]) + flattenDataSource(d, res.DataSources[0]) return nil } diff --git a/internal/services/cockpit/testdata/cockpit-source-data-source-by-id.cassette.yaml b/internal/services/cockpit/testdata/cockpit-source-data-source-by-id.cassette.yaml index 78cc03472..230089b77 100644 --- a/internal/services/cockpit/testdata/cockpit-source-data-source-by-id.cassette.yaml +++ b/internal/services/cockpit/testdata/cockpit-source-data-source-by-id.cassette.yaml @@ -29,7 +29,7 @@ interactions: trailer: {} content_length: 253 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:09.381796Z","description":"","id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:03:09.381796Z"}' + body: '{"created_at":"2024-12-20T15:44:14.932504Z","description":"","id":"71c99248-68f5-44f7-a660-4f0a6549fbec","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T15:44:14.932504Z"}' headers: Content-Length: - "253" @@ -38,7 +38,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:10 GMT + - Fri, 20 Dec 2024 15:44:15 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -48,10 +48,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 1ab5f9f2-4c93-4a68-976c-dca58f350f5e + - bad254d8-79a1-42df-8d80-6574ebcae671 status: 200 OK code: 200 - duration: 1.153418042s + duration: 778.572542ms - id: 1 request: proto: HTTP/1.1 @@ -68,7 +68,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/cc420be3-b7f6-4a27-8725-74f89bcbe14e + url: https://api.scaleway.com/account/v3/projects/71c99248-68f5-44f7-a660-4f0a6549fbec method: GET response: proto: HTTP/2.0 @@ -78,7 +78,7 @@ interactions: trailer: {} content_length: 253 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:09.381796Z","description":"","id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:03:09.381796Z"}' + body: '{"created_at":"2024-12-20T15:44:14.932504Z","description":"","id":"71c99248-68f5-44f7-a660-4f0a6549fbec","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T15:44:14.932504Z"}' headers: Content-Length: - "253" @@ -87,7 +87,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:10 GMT + - Fri, 20 Dec 2024 15:44:15 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -97,10 +97,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 1e84ac44-c1df-4907-9aed-899dbc7cf917 + - fb5d82c9-f968-45a6-9caa-b6bfb5b38ca0 status: 200 OK code: 200 - duration: 122.846459ms + duration: 122.695375ms - id: 2 request: proto: HTTP/1.1 @@ -112,7 +112,7 @@ interactions: host: api.scaleway.com remote_addr: "" request_uri: "" - body: '{"project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","name":"source-by-id","type":"metrics","retention_days":30}' + body: '{"project_id":"71c99248-68f5-44f7-a660-4f0a6549fbec","name":"source-by-id","type":"metrics","retention_days":30}' form: {} headers: Content-Type: @@ -129,7 +129,7 @@ interactions: trailer: {} content_length: 408 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:15.584406Z","id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","name":"source-by-id","origin":"custom","project_id":"71c99248-68f5-44f7-a660-4f0a6549fbec","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T15:44:15.584406Z","url":"https://1a1b2eaf-2481-437c-a099-9dc959f2e157.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "408" @@ -138,7 +138,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:10 GMT + - Fri, 20 Dec 2024 15:44:15 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -148,10 +148,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - a80ae927-7244-4ee6-a3b6-457b2c251a8d + - babd2949-24d0-4e55-ab8d-68f78b0ee3d2 status: 200 OK code: 200 - duration: 371.868291ms + duration: 273.657875ms - id: 3 request: proto: HTTP/1.1 @@ -168,7 +168,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: GET response: proto: HTTP/2.0 @@ -178,7 +178,7 @@ interactions: trailer: {} content_length: 408 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:15.584406Z","id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","name":"source-by-id","origin":"custom","project_id":"71c99248-68f5-44f7-a660-4f0a6549fbec","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T15:44:15.584406Z","url":"https://1a1b2eaf-2481-437c-a099-9dc959f2e157.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "408" @@ -187,7 +187,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:10 GMT + - Fri, 20 Dec 2024 15:44:15 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -197,10 +197,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - e8b5dfaa-12c7-494b-86cc-4c2b68202fef + - e8e0567d-5cc6-4f49-861e-611292cdc5b2 status: 200 OK code: 200 - duration: 83.0945ms + duration: 70.825ms - id: 4 request: proto: HTTP/1.1 @@ -217,7 +217,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: GET response: proto: HTTP/2.0 @@ -227,7 +227,7 @@ interactions: trailer: {} content_length: 408 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:15.584406Z","id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","name":"source-by-id","origin":"custom","project_id":"71c99248-68f5-44f7-a660-4f0a6549fbec","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T15:44:15.584406Z","url":"https://1a1b2eaf-2481-437c-a099-9dc959f2e157.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "408" @@ -236,7 +236,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:10 GMT + - Fri, 20 Dec 2024 15:44:15 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -246,10 +246,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 34daea16-0180-4b33-887a-9304661a1bf3 + - 7f777bde-7a42-405d-beaf-cbbf087659c2 status: 200 OK code: 200 - duration: 71.595667ms + duration: 90.531084ms - id: 5 request: proto: HTTP/1.1 @@ -266,7 +266,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: GET response: proto: HTTP/2.0 @@ -276,7 +276,7 @@ interactions: trailer: {} content_length: 408 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:15.584406Z","id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","name":"source-by-id","origin":"custom","project_id":"71c99248-68f5-44f7-a660-4f0a6549fbec","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T15:44:15.584406Z","url":"https://1a1b2eaf-2481-437c-a099-9dc959f2e157.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "408" @@ -285,7 +285,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:11 GMT + - Fri, 20 Dec 2024 15:44:16 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -295,10 +295,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 59d69aca-a2e7-4b1c-b6bb-14caeb082b2a + - 5e27e817-53a0-4667-9f2a-4b4d0f51d9ed status: 200 OK code: 200 - duration: 438.024917ms + duration: 75.236792ms - id: 6 request: proto: HTTP/1.1 @@ -315,7 +315,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/cc420be3-b7f6-4a27-8725-74f89bcbe14e + url: https://api.scaleway.com/account/v3/projects/71c99248-68f5-44f7-a660-4f0a6549fbec method: GET response: proto: HTTP/2.0 @@ -325,7 +325,7 @@ interactions: trailer: {} content_length: 253 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:09.381796Z","description":"","id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:03:09.381796Z"}' + body: '{"created_at":"2024-12-20T15:44:14.932504Z","description":"","id":"71c99248-68f5-44f7-a660-4f0a6549fbec","name":"tf_tests_cockpit_datasource_by_id","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T15:44:14.932504Z"}' headers: Content-Length: - "253" @@ -334,7 +334,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:12 GMT + - Fri, 20 Dec 2024 15:44:17 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -344,10 +344,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 704a14dc-3482-4386-ae52-3e2cb191e368 + - 98fccf99-c479-4ab9-aa9c-8ddecde02804 status: 200 OK code: 200 - duration: 133.494333ms + duration: 108.68575ms - id: 7 request: proto: HTTP/1.1 @@ -364,7 +364,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: GET response: proto: HTTP/2.0 @@ -374,7 +374,7 @@ interactions: trailer: {} content_length: 408 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:15.584406Z","id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","name":"source-by-id","origin":"custom","project_id":"71c99248-68f5-44f7-a660-4f0a6549fbec","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T15:44:15.584406Z","url":"https://1a1b2eaf-2481-437c-a099-9dc959f2e157.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "408" @@ -383,7 +383,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:12 GMT + - Fri, 20 Dec 2024 15:44:17 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -393,10 +393,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 95ac9149-f6f7-4281-81ec-1269876dfc55 + - b331989c-c11d-44a1-a997-d6f9a6111e78 status: 200 OK code: 200 - duration: 89.501708ms + duration: 79.52575ms - id: 8 request: proto: HTTP/1.1 @@ -413,7 +413,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: GET response: proto: HTTP/2.0 @@ -423,7 +423,7 @@ interactions: trailer: {} content_length: 408 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:15.584406Z","id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","name":"source-by-id","origin":"custom","project_id":"71c99248-68f5-44f7-a660-4f0a6549fbec","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T15:44:15.584406Z","url":"https://1a1b2eaf-2481-437c-a099-9dc959f2e157.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "408" @@ -432,7 +432,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:12 GMT + - Fri, 20 Dec 2024 15:44:17 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -442,10 +442,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 7ffd982d-1158-4889-8fa2-e5b9231a5c96 + - c6f79c0b-91e6-40ab-aea6-9c05613ba52d status: 200 OK code: 200 - duration: 97.050791ms + duration: 82.519625ms - id: 9 request: proto: HTTP/1.1 @@ -462,7 +462,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: GET response: proto: HTTP/2.0 @@ -472,7 +472,7 @@ interactions: trailer: {} content_length: 408 uncompressed: false - body: '{"created_at":"2024-12-20T13:03:10.609040Z","id":"38051151-1afc-4383-8785-1a881e3b1ca4","name":"source-by-id","origin":"custom","project_id":"cc420be3-b7f6-4a27-8725-74f89bcbe14e","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T13:03:10.609040Z","url":"https://38051151-1afc-4383-8785-1a881e3b1ca4.metrics.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:15.584406Z","id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","name":"source-by-id","origin":"custom","project_id":"71c99248-68f5-44f7-a660-4f0a6549fbec","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"metrics","updated_at":"2024-12-20T15:44:15.584406Z","url":"https://1a1b2eaf-2481-437c-a099-9dc959f2e157.metrics.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "408" @@ -481,7 +481,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:12 GMT + - Fri, 20 Dec 2024 15:44:17 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -491,10 +491,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 7a22b2c8-03df-4c66-831f-fb1582b27091 + - 7a391354-6c77-45e8-8021-5d728e3880d0 status: 200 OK code: 200 - duration: 80.017042ms + duration: 159.168084ms - id: 10 request: proto: HTTP/1.1 @@ -511,7 +511,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: DELETE response: proto: HTTP/2.0 @@ -528,7 +528,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:13 GMT + - Fri, 20 Dec 2024 15:44:18 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -538,10 +538,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - c7398161-cd70-4945-9683-4d9320ebf775 + - 82b75fda-063b-4de7-82a8-2e618a621f86 status: 204 No Content code: 204 - duration: 511.200833ms + duration: 691.144333ms - id: 11 request: proto: HTTP/1.1 @@ -558,7 +558,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/cc420be3-b7f6-4a27-8725-74f89bcbe14e + url: https://api.scaleway.com/account/v3/projects/71c99248-68f5-44f7-a660-4f0a6549fbec method: DELETE response: proto: HTTP/2.0 @@ -575,7 +575,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:15 GMT + - Fri, 20 Dec 2024 15:44:20 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -585,10 +585,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 8646ede5-1301-4e18-8f0d-2b1aca91b158 + - da04275b-7206-4978-a620-877becfa538b status: 204 No Content code: 204 - duration: 1.499719083s + duration: 1.40576475s - id: 12 request: proto: HTTP/1.1 @@ -605,7 +605,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: GET response: proto: HTTP/2.0 @@ -615,7 +615,7 @@ interactions: trailer: {} content_length: 132 uncompressed: false - body: '{"message":"resource is not found","resource":"data source","resource_id":"38051151-1afc-4383-8785-1a881e3b1ca4","type":"not_found"}' + body: '{"message":"resource is not found","resource":"data source","resource_id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","type":"not_found"}' headers: Content-Length: - "132" @@ -624,7 +624,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:15 GMT + - Fri, 20 Dec 2024 15:44:20 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -634,10 +634,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - f500e21e-bedc-4195-964b-a80599349fb1 + - 3121cb49-ab99-4956-91f3-3555569aba09 status: 404 Not Found code: 404 - duration: 33.18975ms + duration: 22.53975ms - id: 13 request: proto: HTTP/1.1 @@ -654,7 +654,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/38051151-1afc-4383-8785-1a881e3b1ca4 + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/1a1b2eaf-2481-437c-a099-9dc959f2e157 method: GET response: proto: HTTP/2.0 @@ -664,7 +664,7 @@ interactions: trailer: {} content_length: 132 uncompressed: false - body: '{"message":"resource is not found","resource":"data source","resource_id":"38051151-1afc-4383-8785-1a881e3b1ca4","type":"not_found"}' + body: '{"message":"resource is not found","resource":"data source","resource_id":"1a1b2eaf-2481-437c-a099-9dc959f2e157","type":"not_found"}' headers: Content-Length: - "132" @@ -673,7 +673,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:03:15 GMT + - Fri, 20 Dec 2024 15:44:20 GMT Server: - Scaleway API Gateway (fr-par-2;edge01) Strict-Transport-Security: @@ -683,7 +683,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 5fb79a0c-9250-4b63-8368-0b0a28f20623 + - 515922ad-df49-4d01-bc82-1e4e56f9c066 status: 404 Not Found code: 404 - duration: 36.561125ms + duration: 29.318209ms diff --git a/internal/services/cockpit/testdata/cockpit-source-data-source-by-name.cassette.yaml b/internal/services/cockpit/testdata/cockpit-source-data-source-by-name.cassette.yaml index aa1b59834..dfe018972 100644 --- a/internal/services/cockpit/testdata/cockpit-source-data-source-by-name.cassette.yaml +++ b/internal/services/cockpit/testdata/cockpit-source-data-source-by-name.cassette.yaml @@ -29,7 +29,7 @@ interactions: trailer: {} content_length: 255 uncompressed: false - body: '{"created_at":"2024-12-20T13:17:49.902550Z","description":"","id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:17:49.902550Z"}' + body: '{"created_at":"2024-12-20T15:44:25.222057Z","description":"","id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T15:44:25.222057Z"}' headers: Content-Length: - "255" @@ -38,7 +38,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:50 GMT + - Fri, 20 Dec 2024 15:44:25 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -48,10 +48,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 5bcb13d5-414c-4a01-a939-34eb18665217 + - bda0931c-3ac7-44e4-86b9-135965e02f2a status: 200 OK code: 200 - duration: 866.01925ms + duration: 711.389334ms - id: 1 request: proto: HTTP/1.1 @@ -68,7 +68,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + url: https://api.scaleway.com/account/v3/projects/1697b4af-0ac9-405f-8bc7-d316a3379daf method: GET response: proto: HTTP/2.0 @@ -78,7 +78,7 @@ interactions: trailer: {} content_length: 255 uncompressed: false - body: '{"created_at":"2024-12-20T13:17:49.902550Z","description":"","id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:17:49.902550Z"}' + body: '{"created_at":"2024-12-20T15:44:25.222057Z","description":"","id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T15:44:25.222057Z"}' headers: Content-Length: - "255" @@ -87,7 +87,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:50 GMT + - Fri, 20 Dec 2024 15:44:25 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -97,10 +97,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 302fd721-9dbe-41ea-b829-9d2e07e49913 + - fb5c05d5-4371-4147-bae1-57061d77338c status: 200 OK code: 200 - duration: 140.926709ms + duration: 90.277875ms - id: 2 request: proto: HTTP/1.1 @@ -112,7 +112,7 @@ interactions: host: api.scaleway.com remote_addr: "" request_uri: "" - body: '{"project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","name":"source-by-name","type":"logs","retention_days":30}' + body: '{"project_id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","name":"source-by-name","type":"logs","retention_days":30}' form: {} headers: Content-Type: @@ -129,7 +129,7 @@ interactions: trailer: {} content_length: 404 uncompressed: false - body: '{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:25.790248Z","id":"d936f1d5-2775-474d-8f5c-008cc381d472","name":"source-by-name","origin":"custom","project_id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T15:44:25.790248Z","url":"https://d936f1d5-2775-474d-8f5c-008cc381d472.logs.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "404" @@ -138,7 +138,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:50 GMT + - Fri, 20 Dec 2024 15:44:25 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -148,10 +148,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 0f6b8eae-ca69-4c13-a587-59be67ce5dd4 + - 73b8a873-27ce-477f-8c0a-8382a88f304b status: 200 OK code: 200 - duration: 257.876917ms + duration: 289ms - id: 3 request: proto: HTTP/1.1 @@ -168,7 +168,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/d936f1d5-2775-474d-8f5c-008cc381d472 method: GET response: proto: HTTP/2.0 @@ -178,7 +178,7 @@ interactions: trailer: {} content_length: 404 uncompressed: false - body: '{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:25.790248Z","id":"d936f1d5-2775-474d-8f5c-008cc381d472","name":"source-by-name","origin":"custom","project_id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T15:44:25.790248Z","url":"https://d936f1d5-2775-474d-8f5c-008cc381d472.logs.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "404" @@ -187,7 +187,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:50 GMT + - Fri, 20 Dec 2024 15:44:25 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -197,10 +197,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - c64497ba-eab5-4252-9478-6db539277464 + - 770fbc76-5df8-4dcd-8730-1f05548e0f93 status: 200 OK code: 200 - duration: 71.133875ms + duration: 62.475167ms - id: 4 request: proto: HTTP/1.1 @@ -217,7 +217,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=1697b4af-0ac9-405f-8bc7-d316a3379daf method: GET response: proto: HTTP/2.0 @@ -227,7 +227,7 @@ interactions: trailer: {} content_length: 440 uncompressed: false - body: '{"data_sources":[{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}],"total_count":1}' + body: '{"data_sources":[{"created_at":"2024-12-20T15:44:25.790248Z","id":"d936f1d5-2775-474d-8f5c-008cc381d472","name":"source-by-name","origin":"custom","project_id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T15:44:25.790248Z","url":"https://d936f1d5-2775-474d-8f5c-008cc381d472.logs.cockpit.fr-par.scw.cloud"}],"total_count":1}' headers: Content-Length: - "440" @@ -236,7 +236,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:51 GMT + - Fri, 20 Dec 2024 15:44:26 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -246,10 +246,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 76eea9c8-56d6-43a9-84d6-5fd8152c4ef2 + - 561cfbd2-d119-4087-ab92-3b237f18fe97 status: 200 OK code: 200 - duration: 603.106791ms + duration: 431.446417ms - id: 5 request: proto: HTTP/1.1 @@ -266,7 +266,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=1697b4af-0ac9-405f-8bc7-d316a3379daf method: GET response: proto: HTTP/2.0 @@ -276,7 +276,7 @@ interactions: trailer: {} content_length: 440 uncompressed: false - body: '{"data_sources":[{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}],"total_count":1}' + body: '{"data_sources":[{"created_at":"2024-12-20T15:44:25.790248Z","id":"d936f1d5-2775-474d-8f5c-008cc381d472","name":"source-by-name","origin":"custom","project_id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T15:44:25.790248Z","url":"https://d936f1d5-2775-474d-8f5c-008cc381d472.logs.cockpit.fr-par.scw.cloud"}],"total_count":1}' headers: Content-Length: - "440" @@ -285,7 +285,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:52 GMT + - Fri, 20 Dec 2024 15:44:27 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -295,10 +295,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - b171db7f-4115-45b8-8b08-d7c170cdeef2 + - 31818d1c-55a1-41f3-b384-9df4f73e1cfa status: 200 OK code: 200 - duration: 462.589208ms + duration: 841.578334ms - id: 6 request: proto: HTTP/1.1 @@ -315,7 +315,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + url: https://api.scaleway.com/account/v3/projects/1697b4af-0ac9-405f-8bc7-d316a3379daf method: GET response: proto: HTTP/2.0 @@ -325,7 +325,7 @@ interactions: trailer: {} content_length: 255 uncompressed: false - body: '{"created_at":"2024-12-20T13:17:49.902550Z","description":"","id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T13:17:49.902550Z"}' + body: '{"created_at":"2024-12-20T15:44:25.222057Z","description":"","id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","name":"tf_tests_cockpit_datasource_by_name","organization_id":"105bdce1-64c0-48ab-899d-868455867ecf","updated_at":"2024-12-20T15:44:25.222057Z"}' headers: Content-Length: - "255" @@ -334,7 +334,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:52 GMT + - Fri, 20 Dec 2024 15:44:28 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -344,10 +344,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 2cdd33c0-41d6-4815-820e-65698d38bf3f + - 1bd1a252-fdbc-4788-8faa-47e126f9b807 status: 200 OK code: 200 - duration: 139.008625ms + duration: 117.303708ms - id: 7 request: proto: HTTP/1.1 @@ -364,7 +364,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/d936f1d5-2775-474d-8f5c-008cc381d472 method: GET response: proto: HTTP/2.0 @@ -374,7 +374,7 @@ interactions: trailer: {} content_length: 404 uncompressed: false - body: '{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}' + body: '{"created_at":"2024-12-20T15:44:25.790248Z","id":"d936f1d5-2775-474d-8f5c-008cc381d472","name":"source-by-name","origin":"custom","project_id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T15:44:25.790248Z","url":"https://d936f1d5-2775-474d-8f5c-008cc381d472.logs.cockpit.fr-par.scw.cloud"}' headers: Content-Length: - "404" @@ -383,7 +383,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:52 GMT + - Fri, 20 Dec 2024 15:44:28 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -393,10 +393,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - af6bec19-1004-414e-aded-4913438b0b13 + - c692e304-3279-4f3b-a57c-9834b888a850 status: 200 OK code: 200 - duration: 60.067625ms + duration: 66.068042ms - id: 8 request: proto: HTTP/1.1 @@ -413,7 +413,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=1697b4af-0ac9-405f-8bc7-d316a3379daf method: GET response: proto: HTTP/2.0 @@ -423,7 +423,7 @@ interactions: trailer: {} content_length: 440 uncompressed: false - body: '{"data_sources":[{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}],"total_count":1}' + body: '{"data_sources":[{"created_at":"2024-12-20T15:44:25.790248Z","id":"d936f1d5-2775-474d-8f5c-008cc381d472","name":"source-by-name","origin":"custom","project_id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T15:44:25.790248Z","url":"https://d936f1d5-2775-474d-8f5c-008cc381d472.logs.cockpit.fr-par.scw.cloud"}],"total_count":1}' headers: Content-Length: - "440" @@ -432,7 +432,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:53 GMT + - Fri, 20 Dec 2024 15:44:28 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -442,10 +442,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 5cf8d5f4-fc51-42c5-be4e-858c206e502d + - a6e078b3-187d-4c9f-831f-d2a099db83db status: 200 OK code: 200 - duration: 487.633125ms + duration: 517.80325ms - id: 9 request: proto: HTTP/1.1 @@ -462,7 +462,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources?order_by=created_at_asc&origin=unknown_origin&page=1&project_id=1697b4af-0ac9-405f-8bc7-d316a3379daf method: GET response: proto: HTTP/2.0 @@ -472,7 +472,7 @@ interactions: trailer: {} content_length: 440 uncompressed: false - body: '{"data_sources":[{"created_at":"2024-12-20T13:17:50.621465Z","id":"69bce474-8dd5-4628-b386-5562f561e69b","name":"source-by-name","origin":"custom","project_id":"cb88baf1-80d8-4b0b-bb31-3ffe20810b7d","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T13:17:50.621465Z","url":"https://69bce474-8dd5-4628-b386-5562f561e69b.logs.cockpit.fr-par.scw.cloud"}],"total_count":1}' + body: '{"data_sources":[{"created_at":"2024-12-20T15:44:25.790248Z","id":"d936f1d5-2775-474d-8f5c-008cc381d472","name":"source-by-name","origin":"custom","project_id":"1697b4af-0ac9-405f-8bc7-d316a3379daf","region":"fr-par","retention_days":30,"synchronized_with_grafana":false,"type":"logs","updated_at":"2024-12-20T15:44:25.790248Z","url":"https://d936f1d5-2775-474d-8f5c-008cc381d472.logs.cockpit.fr-par.scw.cloud"}],"total_count":1}' headers: Content-Length: - "440" @@ -481,7 +481,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:54 GMT + - Fri, 20 Dec 2024 15:44:29 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -491,10 +491,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - cf9d5f1b-205b-4243-aa98-9481b5165710 + - e1541588-ad85-425e-9392-9b71c1b895a2 status: 200 OK code: 200 - duration: 573.352042ms + duration: 446.547583ms - id: 10 request: proto: HTTP/1.1 @@ -511,7 +511,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/d936f1d5-2775-474d-8f5c-008cc381d472 method: DELETE response: proto: HTTP/2.0 @@ -528,7 +528,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:54 GMT + - Fri, 20 Dec 2024 15:44:30 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -538,10 +538,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 53a3f0ea-50b1-435d-87a6-05af288a5408 + - f6b3ad78-4a09-49ff-ad66-e9979bc42b64 status: 204 No Content code: 204 - duration: 186.514833ms + duration: 236.622917ms - id: 11 request: proto: HTTP/1.1 @@ -558,7 +558,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/account/v3/projects/cb88baf1-80d8-4b0b-bb31-3ffe20810b7d + url: https://api.scaleway.com/account/v3/projects/1697b4af-0ac9-405f-8bc7-d316a3379daf method: DELETE response: proto: HTTP/2.0 @@ -575,7 +575,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:56 GMT + - Fri, 20 Dec 2024 15:44:31 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -585,10 +585,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 612b62d7-9fa3-4ea3-8ae8-f532f3a8971e + - de087763-c10a-45ce-9eda-a4d57a3ea2c0 status: 204 No Content code: 204 - duration: 1.443823875s + duration: 1.317276958s - id: 12 request: proto: HTTP/1.1 @@ -605,7 +605,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/d936f1d5-2775-474d-8f5c-008cc381d472 method: GET response: proto: HTTP/2.0 @@ -615,7 +615,7 @@ interactions: trailer: {} content_length: 132 uncompressed: false - body: '{"message":"resource is not found","resource":"data source","resource_id":"69bce474-8dd5-4628-b386-5562f561e69b","type":"not_found"}' + body: '{"message":"resource is not found","resource":"data source","resource_id":"d936f1d5-2775-474d-8f5c-008cc381d472","type":"not_found"}' headers: Content-Length: - "132" @@ -624,7 +624,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:56 GMT + - Fri, 20 Dec 2024 15:44:31 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -634,10 +634,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - d4503138-42bb-4f1f-8ca4-44c56d47befa + - 0eae7439-e86d-4b0f-953a-1263e5e7a4c3 status: 404 Not Found code: 404 - duration: 29.735791ms + duration: 28.087709ms - id: 13 request: proto: HTTP/1.1 @@ -654,7 +654,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; darwin; arm64) terraform-provider/develop terraform/terraform-tests - url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/69bce474-8dd5-4628-b386-5562f561e69b + url: https://api.scaleway.com/cockpit/v1/regions/fr-par/data-sources/d936f1d5-2775-474d-8f5c-008cc381d472 method: GET response: proto: HTTP/2.0 @@ -664,7 +664,7 @@ interactions: trailer: {} content_length: 132 uncompressed: false - body: '{"message":"resource is not found","resource":"data source","resource_id":"69bce474-8dd5-4628-b386-5562f561e69b","type":"not_found"}' + body: '{"message":"resource is not found","resource":"data source","resource_id":"d936f1d5-2775-474d-8f5c-008cc381d472","type":"not_found"}' headers: Content-Length: - "132" @@ -673,7 +673,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 13:17:56 GMT + - Fri, 20 Dec 2024 15:44:31 GMT Server: - Scaleway API Gateway (fr-par-2;edge03) Strict-Transport-Security: @@ -683,7 +683,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6f8c8da5-9de3-489b-b69c-afe44ba16c1b + - 081cbef2-839b-463c-af08-08de51ad4d22 status: 404 Not Found code: 404 - duration: 27.168625ms + duration: 25.341125ms diff --git a/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml b/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml index 619bbdfd7..ea5b80cc1 100644 --- a/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml +++ b/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml @@ -36,7 +36,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:25:57 GMT + - Fri, 20 Dec 2024 15:54:50 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -46,10 +46,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - a2a2709b-0ac9-40ab-89f2-ce3cae5c7057 + - e9258334-68b5-4a01-9142-aa5ace87fec2 status: 200 OK code: 200 - duration: 2.139183083s + duration: 1.743161209s - id: 1 request: proto: HTTP/1.1 @@ -85,7 +85,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:25:57 GMT + - Fri, 20 Dec 2024 15:54:50 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -95,10 +95,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - a0ffcc2c-e49d-4a1d-8583-8dff8bb1fe77 + - 3be837c7-696e-46d2-9325-05150dbf1ff4 status: 200 OK code: 200 - duration: 125.802208ms + duration: 112.439708ms - id: 2 request: proto: HTTP/1.1 @@ -115,7 +115,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + 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&types=logs method: GET response: proto: HTTP/2.0 @@ -134,7 +134,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:25:58 GMT + - Fri, 20 Dec 2024 15:54:50 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -144,10 +144,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 0792fcbc-7ff1-4fb1-a04d-493c41e27b90 + - cec79336-ee05-47d2-81ca-4010437c4115 status: 200 OK code: 200 - duration: 137.824334ms + duration: 123.399083ms - id: 3 request: proto: HTTP/1.1 @@ -164,7 +164,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + 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&types=metrics method: GET response: proto: HTTP/2.0 @@ -183,7 +183,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:25:58 GMT + - Fri, 20 Dec 2024 15:54:50 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -193,10 +193,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6b594e99-7115-4607-9a79-a8553d505ccb + - 7e1bd9d7-9f1a-4dda-b112-fc6aebaf9309 status: 200 OK code: 200 - duration: 270.892459ms + duration: 233.466167ms - id: 4 request: proto: HTTP/1.1 @@ -232,7 +232,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:25:59 GMT + - Fri, 20 Dec 2024 15:54:51 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -242,10 +242,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - d364fc3d-ec20-4a3e-b7f5-11391ed581d7 + - ab7a9115-4909-4d4f-80cf-7528f7da9a22 status: 200 OK code: 200 - duration: 1.069475583s + duration: 1.232966959s - id: 5 request: proto: HTTP/1.1 @@ -281,7 +281,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:25:59 GMT + - Fri, 20 Dec 2024 15:54:52 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -291,10 +291,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6274bae6-6ee2-4c9a-b46b-bfbb99893d33 + - a3d17948-e565-4cfb-830e-e41d2ad8cfb7 status: 200 OK code: 200 - duration: 98.715083ms + duration: 110.372458ms - id: 6 request: proto: HTTP/1.1 @@ -311,7 +311,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + 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&types=logs method: GET response: proto: HTTP/2.0 @@ -330,7 +330,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:25:59 GMT + - Fri, 20 Dec 2024 15:54:52 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -340,10 +340,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - cbab28ec-614f-49b0-8118-ce728b2efa75 + - 8d6db7ee-28af-445b-b846-5692289ef340 status: 200 OK code: 200 - duration: 128.825833ms + duration: 138.980833ms - id: 7 request: proto: HTTP/1.1 @@ -360,7 +360,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + 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&types=metrics method: GET response: proto: HTTP/2.0 @@ -379,7 +379,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:25:59 GMT + - Fri, 20 Dec 2024 15:54:52 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -389,10 +389,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 2dab8988-96ba-4450-8768-a5326861eab8 + - ebe47e22-0531-4b44-9ba5-5622cbea0d06 status: 200 OK code: 200 - duration: 225.994792ms + duration: 246.599833ms - id: 8 request: proto: HTTP/1.1 @@ -428,7 +428,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:01 GMT + - Fri, 20 Dec 2024 15:54:54 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -438,10 +438,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - bc475219-3e31-4de0-ba06-98e79f1717f6 + - 1159ba7f-95a4-4466-b2c6-cf5e400dd629 status: 200 OK code: 200 - duration: 990.133875ms + duration: 1.083074542s - id: 9 request: proto: HTTP/1.1 @@ -477,7 +477,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:01 GMT + - Fri, 20 Dec 2024 15:54:54 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -487,10 +487,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 699f182e-e9bb-4578-a015-ae9647fe0e81 + - 15f4c729-57cf-4a11-afa9-fbd9d226dc6f status: 200 OK code: 200 - duration: 119.069041ms + duration: 132.633791ms - id: 10 request: proto: HTTP/1.1 @@ -507,7 +507,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + 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&types=logs method: GET response: proto: HTTP/2.0 @@ -526,7 +526,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:01 GMT + - Fri, 20 Dec 2024 15:54:54 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -536,10 +536,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - e179e301-8a5b-40bd-ac00-0f4efbd4e0a9 + - 4d7bd387-b920-4f95-936d-174212a004c9 status: 200 OK code: 200 - duration: 133.217458ms + duration: 144.049083ms - id: 11 request: proto: HTTP/1.1 @@ -556,7 +556,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + 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&types=metrics method: GET response: proto: HTTP/2.0 @@ -575,7 +575,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:01 GMT + - Fri, 20 Dec 2024 15:54:54 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -585,10 +585,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 5e253f66-908a-42fc-bae3-cf6c983cbe52 + - f613bec5-5b9b-477b-9859-60617bab8e85 status: 200 OK code: 200 - duration: 242.197917ms + duration: 231.396541ms - id: 12 request: proto: HTTP/1.1 @@ -624,7 +624,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:03 GMT + - Fri, 20 Dec 2024 15:54:56 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -634,10 +634,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - b6ce031a-20a5-4b01-b18e-5af3eb4ddce4 + - f2009b6f-c2e9-4a88-9c82-5d133af8e7bb status: 200 OK code: 200 - duration: 757.35675ms + duration: 1.370716583s - id: 13 request: proto: HTTP/1.1 @@ -673,7 +673,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:03 GMT + - Fri, 20 Dec 2024 15:54:56 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -683,10 +683,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 26ccb4bd-ac18-4e98-b5e8-52c3a1395d7b + - a90b1191-af8e-43de-ac97-159ae7172e7f status: 200 OK code: 200 - duration: 174.060458ms + duration: 126.832042ms - id: 14 request: proto: HTTP/1.1 @@ -703,7 +703,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + 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&types=logs method: GET response: proto: HTTP/2.0 @@ -722,7 +722,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:03 GMT + - Fri, 20 Dec 2024 15:54:56 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -732,10 +732,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - e9d1aa33-aba7-436d-8a50-15228362dd15 + - 42b4de9c-c24c-405c-a9fb-dbb5a7c01497 status: 200 OK code: 200 - duration: 164.622459ms + duration: 113.693875ms - id: 15 request: proto: HTTP/1.1 @@ -752,7 +752,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + 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&types=metrics method: GET response: proto: HTTP/2.0 @@ -771,7 +771,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:03 GMT + - Fri, 20 Dec 2024 15:54:56 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -781,10 +781,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - e1d039b8-50d0-4c80-8b2d-3454b42fce1e + - c231be64-2b3b-4f77-98f2-1c078864a8e9 status: 200 OK code: 200 - duration: 259.928541ms + duration: 261.617334ms - id: 16 request: proto: HTTP/1.1 @@ -820,7 +820,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:04 GMT + - Fri, 20 Dec 2024 15:54:58 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -830,10 +830,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - b5f790c7-c957-4adb-be23-5fcb2af928d3 + - 8b051957-c884-49c3-bf00-e7fadd4e8794 status: 200 OK code: 200 - duration: 821.919916ms + duration: 1.407640125s - id: 17 request: proto: HTTP/1.1 @@ -869,7 +869,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:04 GMT + - Fri, 20 Dec 2024 15:54:58 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -879,10 +879,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 6cce2317-037b-4dcf-b1c0-14b8685e5c4d + - debe0522-b7c1-4277-bf04-381438602709 status: 200 OK code: 200 - duration: 103.723167ms + duration: 116.958541ms - id: 18 request: proto: HTTP/1.1 @@ -899,7 +899,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=logs + 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&types=logs method: GET response: proto: HTTP/2.0 @@ -918,7 +918,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:04 GMT + - Fri, 20 Dec 2024 15:54:58 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -928,10 +928,10 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 343f3ba0-e1c0-4d88-b47c-48d50946055c + - 506985ca-135e-4178-9120-80ca91b2f41b status: 200 OK code: 200 - duration: 133.369833ms + duration: 127.849375ms - id: 19 request: proto: HTTP/1.1 @@ -948,7 +948,7 @@ interactions: headers: User-Agent: - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.23.3; 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&page_size=1000&project_id=105bdce1-64c0-48ab-899d-868455867ecf&types=metrics + 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&types=metrics method: GET response: proto: HTTP/2.0 @@ -967,7 +967,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 20 Dec 2024 14:26:04 GMT + - Fri, 20 Dec 2024 15:54:58 GMT Server: - Scaleway API Gateway (fr-par-2;edge02) Strict-Transport-Security: @@ -977,7 +977,7 @@ interactions: X-Frame-Options: - DENY X-Request-Id: - - 4659bbac-0e5a-48a5-8a05-ce5a2f90dc0c + - 99fcd1d5-e162-4fb0-9b15-89934552438e status: 200 OK code: 200 - duration: 235.348ms + duration: 204.826417ms