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/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 new file mode 100644 index 000000000..962a494b0 --- /dev/null +++ b/internal/services/cockpit/source_data_source.go @@ -0,0 +1,163 @@ +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, + Computed: true, + Description: "The origin of the data source (e.g., 'scaleway', 'external', 'custom').", + ValidateFunc: validation.StringInSlice([]string{ + "scaleway", "external", "custom", + }, false), + }, + "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) + if err != nil { + return diag.FromErr(err) + } + d.SetId(id) + 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)) + } + + res, err := api.ListDataSources(req, scw.WithContext(ctx), scw.WithAllPages()) + if err != nil { + return diag.FromErr(err) + } + + 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 res.DataSources { + if ds.Name == name.(string) { + flattenDataSource(d, ds) + return nil + } + } + return diag.Errorf("no data source found with name '%s'", name.(string)) + } + + flattenDataSource(d, res.DataSources[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..45ba20ed5 --- /dev/null +++ b/internal/services/cockpit/source_data_source_test.go @@ -0,0 +1,129 @@ +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() + orgID, orgIDExists := tt.Meta.ScwClient().GetDefaultOrganizationID() + if !orgIDExists { + orgID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ProviderFactories: tt.ProviderFactories, + + Steps: []resource.TestStep{ + { + Config: fmt.Sprintf(` + + data scaleway_account_project "by_name" { + name = "default" + organization_id = "%s" + } + + + data "scaleway_cockpit_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"), + 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..230089b77 --- /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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44: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: + - bad254d8-79a1-42df-8d80-6574ebcae671 + status: 200 OK + code: 200 + duration: 778.572542ms + - 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/71c99248-68f5-44f7-a660-4f0a6549fbec + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44: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: + - fb5d82c9-f968-45a6-9caa-b6bfb5b38ca0 + status: 200 OK + code: 200 + duration: 122.695375ms + - 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":"71c99248-68f5-44f7-a660-4f0a6549fbec","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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44: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: + - babd2949-24d0-4e55-ab8d-68f78b0ee3d2 + status: 200 OK + code: 200 + duration: 273.657875ms + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44: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: + - e8e0567d-5cc6-4f49-861e-611292cdc5b2 + status: 200 OK + code: 200 + duration: 70.825ms + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44: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: + - 7f777bde-7a42-405d-beaf-cbbf087659c2 + status: 200 OK + code: 200 + duration: 90.531084ms + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:16 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: + - 5e27e817-53a0-4667-9f2a-4b4d0f51d9ed + status: 200 OK + code: 200 + duration: 75.236792ms + - 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/71c99248-68f5-44f7-a660-4f0a6549fbec + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:17 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: + - 98fccf99-c479-4ab9-aa9c-8ddecde02804 + status: 200 OK + code: 200 + duration: 108.68575ms + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:17 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: + - b331989c-c11d-44a1-a997-d6f9a6111e78 + status: 200 OK + code: 200 + duration: 79.52575ms + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:17 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: + - c6f79c0b-91e6-40ab-aea6-9c05613ba52d + status: 200 OK + code: 200 + duration: 82.519625ms + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:17 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: + - 7a391354-6c77-45e8-8021-5d728e3880d0 + status: 200 OK + code: 200 + duration: 159.168084ms + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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 15:44:18 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: + - 82b75fda-063b-4de7-82a8-2e618a621f86 + status: 204 No Content + code: 204 + duration: 691.144333ms + - 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/71c99248-68f5-44f7-a660-4f0a6549fbec + 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 15:44:20 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: + - da04275b-7206-4978-a620-877becfa538b + status: 204 No Content + code: 204 + duration: 1.40576475s + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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":"1a1b2eaf-2481-437c-a099-9dc959f2e157","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 15:44:20 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: + - 3121cb49-ab99-4956-91f3-3555569aba09 + status: 404 Not Found + code: 404 + duration: 22.53975ms + - 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/1a1b2eaf-2481-437c-a099-9dc959f2e157 + 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":"1a1b2eaf-2481-437c-a099-9dc959f2e157","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 15:44:20 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: + - 515922ad-df49-4d01-bc82-1e4e56f9c066 + status: 404 Not Found + code: 404 + 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 new file mode 100644 index 000000000..dfe018972 --- /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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:25 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: + - bda0931c-3ac7-44e4-86b9-135965e02f2a + status: 200 OK + code: 200 + duration: 711.389334ms + - 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/1697b4af-0ac9-405f-8bc7-d316a3379daf + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:25 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: + - fb5c05d5-4371-4147-bae1-57061d77338c + status: 200 OK + code: 200 + duration: 90.277875ms + - 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":"1697b4af-0ac9-405f-8bc7-d316a3379daf","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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:25 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: + - 73b8a873-27ce-477f-8c0a-8382a88f304b + status: 200 OK + code: 200 + duration: 289ms + - 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/d936f1d5-2775-474d-8f5c-008cc381d472 + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:25 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: + - 770fbc76-5df8-4dcd-8730-1f05548e0f93 + status: 200 OK + code: 200 + duration: 62.475167ms + - 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&project_id=1697b4af-0ac9-405f-8bc7-d316a3379daf + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:26 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: + - 561cfbd2-d119-4087-ab92-3b237f18fe97 + status: 200 OK + code: 200 + duration: 431.446417ms + - 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&project_id=1697b4af-0ac9-405f-8bc7-d316a3379daf + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:27 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: + - 31818d1c-55a1-41f3-b384-9df4f73e1cfa + status: 200 OK + code: 200 + duration: 841.578334ms + - 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/1697b4af-0ac9-405f-8bc7-d316a3379daf + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:28 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: + - 1bd1a252-fdbc-4788-8faa-47e126f9b807 + status: 200 OK + code: 200 + duration: 117.303708ms + - 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/d936f1d5-2775-474d-8f5c-008cc381d472 + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:28 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: + - c692e304-3279-4f3b-a57c-9834b888a850 + status: 200 OK + code: 200 + duration: 66.068042ms + - 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&project_id=1697b4af-0ac9-405f-8bc7-d316a3379daf + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:28 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: + - a6e078b3-187d-4c9f-831f-d2a099db83db + status: 200 OK + code: 200 + duration: 517.80325ms + - 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&project_id=1697b4af-0ac9-405f-8bc7-d316a3379daf + 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-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" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Fri, 20 Dec 2024 15:44:29 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: + - e1541588-ad85-425e-9392-9b71c1b895a2 + status: 200 OK + code: 200 + duration: 446.547583ms + - 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/d936f1d5-2775-474d-8f5c-008cc381d472 + 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 15:44:30 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: + - f6b3ad78-4a09-49ff-ad66-e9979bc42b64 + status: 204 No Content + code: 204 + duration: 236.622917ms + - 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/1697b4af-0ac9-405f-8bc7-d316a3379daf + 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 15:44:31 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: + - de087763-c10a-45ce-9eda-a4d57a3ea2c0 + status: 204 No Content + code: 204 + duration: 1.317276958s + - 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/d936f1d5-2775-474d-8f5c-008cc381d472 + 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":"d936f1d5-2775-474d-8f5c-008cc381d472","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 15:44:31 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: + - 0eae7439-e86d-4b0f-953a-1263e5e7a4c3 + status: 404 Not Found + code: 404 + duration: 28.087709ms + - 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/d936f1d5-2775-474d-8f5c-008cc381d472 + 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":"d936f1d5-2775-474d-8f5c-008cc381d472","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 15:44:31 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: + - 081cbef2-839b-463c-af08-08de51ad4d22 + status: 404 Not Found + code: 404 + 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 new file mode 100644 index 000000000..ea5b80cc1 --- /dev/null +++ b/internal/services/cockpit/testdata/cockpit-source-data-source-defaults.cassette.yaml @@ -0,0 +1,983 @@ +--- +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 15:54:50 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: + - e9258334-68b5-4a01-9142-aa5ace87fec2 + status: 200 OK + code: 200 + duration: 1.743161209s + - 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 15:54:50 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: + - 3be837c7-696e-46d2-9325-05150dbf1ff4 + status: 200 OK + code: 200 + duration: 112.439708ms + - 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&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 15:54:50 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: + - cec79336-ee05-47d2-81ca-4010437c4115 + status: 200 OK + code: 200 + duration: 123.399083ms + - 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&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 15:54:50 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: + - 7e1bd9d7-9f1a-4dda-b112-fc6aebaf9309 + status: 200 OK + code: 200 + duration: 233.466167ms + - 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 15:54:51 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: + - ab7a9115-4909-4d4f-80cf-7528f7da9a22 + status: 200 OK + code: 200 + duration: 1.232966959s + - 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 15:54:52 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: + - a3d17948-e565-4cfb-830e-e41d2ad8cfb7 + status: 200 OK + code: 200 + duration: 110.372458ms + - 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&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 15:54:52 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: + - 8d6db7ee-28af-445b-b846-5692289ef340 + status: 200 OK + code: 200 + duration: 138.980833ms + - 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&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 15:54:52 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: + - ebe47e22-0531-4b44-9ba5-5622cbea0d06 + status: 200 OK + code: 200 + duration: 246.599833ms + - 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 15:54:54 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: + - 1159ba7f-95a4-4466-b2c6-cf5e400dd629 + status: 200 OK + code: 200 + duration: 1.083074542s + - 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 15:54:54 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: + - 15f4c729-57cf-4a11-afa9-fbd9d226dc6f + status: 200 OK + code: 200 + duration: 132.633791ms + - 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?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 + 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 15:54:54 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: + - 4d7bd387-b920-4f95-936d-174212a004c9 + status: 200 OK + code: 200 + duration: 144.049083ms + - 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/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 + 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 15:54:54 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: + - f613bec5-5b9b-477b-9859-60617bab8e85 + status: 200 OK + code: 200 + duration: 231.396541ms + - 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 15:54:56 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: + - f2009b6f-c2e9-4a88-9c82-5d133af8e7bb + status: 200 OK + code: 200 + duration: 1.370716583s + - 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 15:54:56 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: + - a90b1191-af8e-43de-ac97-159ae7172e7f + status: 200 OK + code: 200 + duration: 126.832042ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.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&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 15:54:56 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: + - 42b4de9c-c24c-405c-a9fb-dbb5a7c01497 + status: 200 OK + code: 200 + duration: 113.693875ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.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&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 15:54:56 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: + - c231be64-2b3b-4f77-98f2-1c078864a8e9 + status: 200 OK + code: 200 + duration: 261.617334ms + - 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 15:54:58 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: + - 8b051957-c884-49c3-bf00-e7fadd4e8794 + status: 200 OK + code: 200 + duration: 1.407640125s + - 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 15:54:58 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: + - debe0522-b7c1-4277-bf04-381438602709 + status: 200 OK + code: 200 + duration: 116.958541ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.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&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 15:54:58 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: + - 506985ca-135e-4178-9120-80ca91b2f41b + status: 200 OK + code: 200 + duration: 127.849375ms + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: api.scaleway.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.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&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 15:54:58 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: + - 99fcd1d5-e162-4fb0-9b15-89934552438e + status: 200 OK + code: 200 + duration: 204.826417ms