From bbfd32b7d3330f404cdc6aef443e295ffcd87051 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Fri, 28 Jul 2023 15:06:58 +0200 Subject: [PATCH 01/19] Create dashboard_list data source for framework --- .../data_source_datadog_dashboard_list.go | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 datadog/fwprovider/data_source_datadog_dashboard_list.go diff --git a/datadog/fwprovider/data_source_datadog_dashboard_list.go b/datadog/fwprovider/data_source_datadog_dashboard_list.go new file mode 100644 index 0000000000..8a7360d9c1 --- /dev/null +++ b/datadog/fwprovider/data_source_datadog_dashboard_list.go @@ -0,0 +1,94 @@ +package fwprovider + +import ( + "context" + "strconv" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils" +) + +var ( + _ datasource.DataSource = &datadogDashboardListDatasource{} +) + +func NewDatadogDashboardListDataSource() datasource.DataSource { + return &datadogDashboardListDatasource{} +} + +type datadogDashboardListDatasourceModel struct { + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` +} + +type datadogDashboardListDatasource struct { + Api *datadogV1.DashboardListsApi + Auth context.Context +} + +func (d *datadogDashboardListDatasource) Configure(_ context.Context, request datasource.ConfigureRequest, response *datasource.ConfigureResponse) { + providerData, _ := request.ProviderData.(*FrameworkProvider) + d.Api = providerData.DatadogApiInstances.GetDashboardListsApiV1() + d.Auth = providerData.Auth +} + +func (d *datadogDashboardListDatasource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = "dashboard_list" +} + +func (d *datadogDashboardListDatasource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "Use this data source to retrieve information about an existing dashboard list, for use in other resources. In particular, it can be used in a dashboard to register it in the list.", + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Description: "A dashboard list name to limit the search.", + Required: true, + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + }, + }, + } +} + +func (d *datadogDashboardListDatasource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + if resp.Diagnostics.HasError() { + return + } + var state datadogDashboardListDatasourceModel + + listResponse, httpresp, err := d.Api.ListDashboardLists(d.Auth) + + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error querying dashboard lists")) + return + } + + if err := utils.CheckForUnparsed(listResponse); err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(err, "")) + } + + searchedName := state.Name + var foundList *datadogV1.DashboardList + + for _, dashList := range listResponse.GetDashboardLists() { + if dashList.GetName() == searchedName.ValueString() { + foundList = &dashList + break + } + } + + if foundList == nil { + errString := "Couldn't find a dashboard list named" + searchedName.ValueString() + resp.Diagnostics.AddError(errString, "") + } + + id := foundList.GetId() + state.ID = types.StringValue(strconv.Itoa(int(id))) + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} From 1042ec1cf0c37ae55a19300087e7632cf65fb3bf Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Fri, 28 Jul 2023 18:41:47 +0200 Subject: [PATCH 02/19] remove old datasource, migrate test, fix datasource --- datadog/data_source_datadog_dashboard_list.go | 64 ------------------- .../data_source_datadog_dashboard_list.go | 12 ++-- datadog/fwprovider/framework_provider.go | 2 + ...data_source_datadog_dashboard_list_test.go | 15 ++--- .../resource_datadog_dashboard_list_test.go | 36 +++++++---- 5 files changed, 38 insertions(+), 91 deletions(-) delete mode 100644 datadog/data_source_datadog_dashboard_list.go diff --git a/datadog/data_source_datadog_dashboard_list.go b/datadog/data_source_datadog_dashboard_list.go deleted file mode 100644 index d2d67b2e99..0000000000 --- a/datadog/data_source_datadog_dashboard_list.go +++ /dev/null @@ -1,64 +0,0 @@ -package datadog - -import ( - "context" - "strconv" - - "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" - "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" -) - -func dataSourceDatadogDashboardList() *schema.Resource { - return &schema.Resource{ - Description: "Use this data source to retrieve information about an existing dashboard list, for use in other resources. In particular, it can be used in a dashboard to register it in the list.", - ReadContext: dataSourceDatadogDashboardListRead, - - SchemaFunc: func() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "name": { - Description: "A dashboard list name to limit the search.", - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - } - }, - } -} - -func dataSourceDatadogDashboardListRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - providerConf := meta.(*ProviderConfiguration) - apiInstances := providerConf.DatadogApiInstances - auth := providerConf.Auth - - listResponse, httpresp, err := apiInstances.GetDashboardListsApiV1().ListDashboardLists(auth) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error querying dashboard lists") - } - if err := utils.CheckForUnparsed(listResponse); err != nil { - return diag.FromErr(err) - } - - searchedName := d.Get("name") - var foundList *datadogV1.DashboardList - - for _, dashList := range listResponse.GetDashboardLists() { - if dashList.GetName() == searchedName { - foundList = &dashList - break - } - } - - if foundList == nil { - return diag.Errorf("Couldn't find a dashboard list named %s", searchedName) - } - - id := foundList.GetId() - d.SetId(strconv.Itoa(int(id))) - - return nil -} diff --git a/datadog/fwprovider/data_source_datadog_dashboard_list.go b/datadog/fwprovider/data_source_datadog_dashboard_list.go index 8a7360d9c1..0c18217f69 100644 --- a/datadog/fwprovider/data_source_datadog_dashboard_list.go +++ b/datadog/fwprovider/data_source_datadog_dashboard_list.go @@ -57,35 +57,35 @@ func (d *datadogDashboardListDatasource) Schema(ctx context.Context, req datasou } func (d *datadogDashboardListDatasource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var state datadogDashboardListDatasourceModel + resp.Diagnostics.Append(req.Config.Get(ctx, &state)...) if resp.Diagnostics.HasError() { return } - var state datadogDashboardListDatasourceModel listResponse, httpresp, err := d.Api.ListDashboardLists(d.Auth) - if err != nil { resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error querying dashboard lists")) return } - if err := utils.CheckForUnparsed(listResponse); err != nil { resp.Diagnostics.Append(utils.FrameworkErrorDiag(err, "")) } - searchedName := state.Name + searchedName := state.Name.ValueString() var foundList *datadogV1.DashboardList for _, dashList := range listResponse.GetDashboardLists() { - if dashList.GetName() == searchedName.ValueString() { + if dashList.GetName() == searchedName { foundList = &dashList break } } if foundList == nil { - errString := "Couldn't find a dashboard list named" + searchedName.ValueString() + errString := "Couldn't find a dashboard list named" + searchedName resp.Diagnostics.AddError(errString, "") + return } id := foundList.GetId() diff --git a/datadog/fwprovider/framework_provider.go b/datadog/fwprovider/framework_provider.go index 6954f66cd5..bdb5586127 100644 --- a/datadog/fwprovider/framework_provider.go +++ b/datadog/fwprovider/framework_provider.go @@ -33,6 +33,7 @@ var ( var Resources = []func() resource.Resource{ NewAPIKeyResource, + //Add New list Dashbaord resource NewIntegrationCloudflareAccountResource, NewIntegrationConfluentAccountResource, NewIntegrationConfluentResourceResource, @@ -51,6 +52,7 @@ var Resources = []func() resource.Resource{ var Datasources = []func() datasource.DataSource{ NewAPIKeyDataSource, + NewDatadogDashboardListDataSource, NewDatadogIntegrationAWSNamespaceRulesDatasource, NewDatadogServiceAccountDatasource, NewDatadogTeamDataSource, diff --git a/datadog/tests/data_source_datadog_dashboard_list_test.go b/datadog/tests/data_source_datadog_dashboard_list_test.go index 226e1e19ea..5f4b7eb593 100644 --- a/datadog/tests/data_source_datadog_dashboard_list_test.go +++ b/datadog/tests/data_source_datadog_dashboard_list_test.go @@ -5,30 +5,29 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccDatadogDashboardListDatasource(t *testing.T) { t.Parallel() - ctx, accProviders := testAccProviders(context.Background(), t) + ctx, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t) uniq := uniqueEntityName(ctx, t) - accProvider := testAccProvider(t, accProviders) + accProvider := providers.frameworkProvider resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: accProviders, - CheckDestroy: testAccCheckDatadogDashListDestroy(accProvider), + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: accProviders, + CheckDestroy: testAccCheckDatadogDashListDestroy(accProvider), Steps: []resource.TestStep{ { Config: testAccDatasourceDashboardListNameFilterConfig(uniq), - Check: checkDatasourceDashboardListAttrs(accProvider, uniq), + Check: checkDatasourceDashboardListAttrs(uniq), }, }, }) } -func checkDatasourceDashboardListAttrs(accProvider func() (*schema.Provider, error), uniq string) resource.TestCheckFunc { +func checkDatasourceDashboardListAttrs(uniq string) resource.TestCheckFunc { return resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "data.datadog_dashboard_list.my_list", "name", uniq), diff --git a/datadog/tests/resource_datadog_dashboard_list_test.go b/datadog/tests/resource_datadog_dashboard_list_test.go index a328548b41..b9291c2a3f 100644 --- a/datadog/tests/resource_datadog_dashboard_list_test.go +++ b/datadog/tests/resource_datadog_dashboard_list_test.go @@ -7,13 +7,12 @@ import ( "strings" "testing" - "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/terraform-providers/terraform-provider-datadog/datadog" + "github.com/terraform-providers/terraform-provider-datadog/datadog/fwprovider" + "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils" ) func testAccCheckDatadogDashListConfig(uniq string) string { @@ -125,17 +124,17 @@ resource "datadog_dashboard" "time" { func TestDatadogDashListImport(t *testing.T) { t.Parallel() resourceName := "datadog_dashboard_list.new_list" - ctx, accProviders := testAccProviders(context.Background(), t) + ctx, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t) uniqueName := uniqueEntityName(ctx, t) - accProvider := testAccProvider(t, accProviders) + accProvider := providers.frameworkProvider // Getting the hash for a TypeSet element that has dynamic elements isn't possible // So instead we use an import test to make sure the resource can be imported properly. resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: accProviders, - CheckDestroy: testAccCheckDatadogDashListDestroy(accProvider), + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: accProviders, + CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(accProvider), Steps: []resource.TestStep{ { Config: testAccCheckDatadogDashListConfig(uniqueName), @@ -151,14 +150,14 @@ func TestDatadogDashListImport(t *testing.T) { func TestDatadogDashListInDashboard(t *testing.T) { t.Parallel() - ctx, accProviders := testAccProviders(context.Background(), t) + ctx, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t) uniqueName := uniqueEntityName(ctx, t) - accProvider := testAccProvider(t, accProviders) + accProvider := providers.frameworkProvider resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: accProviders, - CheckDestroy: testAccCheckDatadogDashListDestroy(accProvider), + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: accProviders, + CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(accProvider), Steps: []resource.TestStep{ { Config: testAccCheckDatadogDashListConfigInDashboard(uniqueName), @@ -184,6 +183,7 @@ func TestDatadogDashListInDashboard(t *testing.T) { }) } +// Migrate this to fw when other dashboard resources are migrated func testAccCheckDatadogDashListDestroy(accProvider func() (*schema.Provider, error)) resource.TestCheckFunc { return func(s *terraform.State) error { provider, _ := accProvider() @@ -195,6 +195,16 @@ func testAccCheckDatadogDashListDestroy(accProvider func() (*schema.Provider, er } } +// remove this when all the dashboard resources are migrated to framework +func testAccCheckDatadogDashListDestroyWithFw(accProvider *fwprovider.FrameworkProvider) func(*terraform.State) error { + return func(s *terraform.State) error { + apiInstances := accProvider.DatadogApiInstances + auth := accProvider.Auth + + return datadogDashListDestroyHelper(auth, s, apiInstances) + } +} + func datadogDashListDestroyHelper(ctx context.Context, s *terraform.State, apiInstances *utils.ApiInstances) error { for _, r := range s.RootModule().Resources { if !strings.Contains(r.Primary.Attributes["name"], "List") { From 676551e4ed4ad11c84a6fe5cfdbd4aab5921fc8f Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Mon, 31 Jul 2023 13:44:49 +0200 Subject: [PATCH 03/19] Remove datasource from old provider --- datadog/provider.go | 1 - 1 file changed, 1 deletion(-) diff --git a/datadog/provider.go b/datadog/provider.go index 38c3e54fe2..6f4e87e46d 100644 --- a/datadog/provider.go +++ b/datadog/provider.go @@ -209,7 +209,6 @@ func Provider() *schema.Provider { "datadog_application_key": dataSourceDatadogApplicationKey(), "datadog_cloud_workload_security_agent_rules": dataSourceDatadogCloudWorkloadSecurityAgentRules(), "datadog_dashboard": dataSourceDatadogDashboard(), - "datadog_dashboard_list": dataSourceDatadogDashboardList(), "datadog_integration_aws_logs_services": dataSourceDatadogIntegrationAWSLogsServices(), "datadog_logs_archives_order": dataSourceDatadogLogsArchivesOrder(), "datadog_logs_indexes": dataSourceDatadogLogsIndexes(), From 304a88a3e2b97232502f65eca12d4dfcd97c36f0 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Mon, 31 Jul 2023 14:31:48 +0200 Subject: [PATCH 04/19] Use testAccCheckDatadogDashListDestroyWithFW --- datadog/tests/data_source_datadog_dashboard_list_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog/tests/data_source_datadog_dashboard_list_test.go b/datadog/tests/data_source_datadog_dashboard_list_test.go index 5f4b7eb593..289c8bee86 100644 --- a/datadog/tests/data_source_datadog_dashboard_list_test.go +++ b/datadog/tests/data_source_datadog_dashboard_list_test.go @@ -17,7 +17,7 @@ func TestAccDatadogDashboardListDatasource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: accProviders, - CheckDestroy: testAccCheckDatadogDashListDestroy(accProvider), + CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(accProvider), Steps: []resource.TestStep{ { Config: testAccDatasourceDashboardListNameFilterConfig(uniq), From 123efcdccceba45a3e3d27ae3a5d718488d4d750 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Mon, 31 Jul 2023 16:27:15 +0200 Subject: [PATCH 05/19] Adds id in Datasource --- datadog/fwprovider/data_source_datadog_dashboard_list.go | 1 + 1 file changed, 1 insertion(+) diff --git a/datadog/fwprovider/data_source_datadog_dashboard_list.go b/datadog/fwprovider/data_source_datadog_dashboard_list.go index 0c18217f69..c8f4502591 100644 --- a/datadog/fwprovider/data_source_datadog_dashboard_list.go +++ b/datadog/fwprovider/data_source_datadog_dashboard_list.go @@ -52,6 +52,7 @@ func (d *datadogDashboardListDatasource) Schema(ctx context.Context, req datasou stringvalidator.LengthAtLeast(1), }, }, + "id": utils.ResourceIDAttribute(), }, } } From 9baeb269937fbec6e6c60ba6d6cdec5f7e69c5c2 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Mon, 31 Jul 2023 20:01:57 +0200 Subject: [PATCH 06/19] Adding Create for Dashboard list resource --- datadog/fwprovider/framework_provider.go | 2 +- .../resource_datadog_dashboard_list.go | 177 ++++++++++++++++++ 2 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 datadog/fwprovider/resource_datadog_dashboard_list.go diff --git a/datadog/fwprovider/framework_provider.go b/datadog/fwprovider/framework_provider.go index bdb5586127..cbbb6a023f 100644 --- a/datadog/fwprovider/framework_provider.go +++ b/datadog/fwprovider/framework_provider.go @@ -33,7 +33,7 @@ var ( var Resources = []func() resource.Resource{ NewAPIKeyResource, - //Add New list Dashbaord resource + NewDashboardListResource, NewIntegrationCloudflareAccountResource, NewIntegrationConfluentAccountResource, NewIntegrationConfluentResourceResource, diff --git a/datadog/fwprovider/resource_datadog_dashboard_list.go b/datadog/fwprovider/resource_datadog_dashboard_list.go new file mode 100644 index 0000000000..3ebb016cb6 --- /dev/null +++ b/datadog/fwprovider/resource_datadog_dashboard_list.go @@ -0,0 +1,177 @@ +package fwprovider + +import ( + "context" + "strconv" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + frameworkPath "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils" + "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/validators" +) + +var ( + _ resource.ResourceWithConfigure = &dashboardListResource{} + _ resource.ResourceWithImportState = &dashboardListResource{} +) + +func NewDashboardListResource() resource.Resource { + return &dashboardListResource{} +} + +type dashboardListResource struct { + ApiV1 *datadogV1.DashboardListsApi + ApiV2 *datadogV2.DashboardListsApi + Auth context.Context +} + +type dashboardListResourceModel struct { + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + DashItem []*DashItemModel `tfsdk:"dash_item"` +} + +type DashItemModel struct { + Type types.String `tfsdk:"type"` + Dash_id types.String `tfsdk:"dash_id"` +} + +func (r *dashboardListResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + providerData := req.ProviderData.(*FrameworkProvider) + r.ApiV1 = providerData.DatadogApiInstances.GetDashboardListsApiV1() + r.ApiV2 = providerData.DatadogApiInstances.GetDashboardListsApiV2() + r.Auth = providerData.Auth +} + +func (r *dashboardListResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, frameworkPath.Root("id"), req, resp) +} + +func (r *dashboardListResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = "dashboard_list" +} + +func (r *dashboardListResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Description: "Provides a Datadog dashboard_list resource. This can be used to create and manage Datadog Dashboard Lists and the individual dashboards within them.", + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Description: "The name of the Dashboard List", + Required: true, + }, + "id": utils.ResourceIDAttribute(), + }, + Blocks: map[string]schema.Block{ + "dash_item": schema.SetNestedBlock{ + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "type": schema.StringAttribute{ + Description: "The type of this dashboard.", + Required: true, + Validators: []validator.String{ + validators.NewEnumValidator[validator.String](datadogV2.NewDashboardTypeFromValue), + }, + }, + "dash_id": schema.StringAttribute{ + Description: "The ID of the dashboard to add", + Required: true, + }, + }, + }, + }, + }, + } + +} + +func (r *dashboardListResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var state dashboardListResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + dashboardListPayload, err := buildDatadogDashboardList(&state) + if err != nil { + resp.Diagnostics.AddError("failed to parse resource configuration: ", err.Error()) + return + } + + dashboardList, httpresp, err := r.ApiV1.CreateDashboardList(r.Auth, *dashboardListPayload) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error creating dashboard lists")) + return + } + if err := utils.CheckForUnparsed(dashboardList); err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(err, "")) + return + } + + id := dashboardList.GetId() + state.ID = types.StringValue(strconv.Itoa(int(id))) + + if len(state.DashItem) > 0 { + dashboardListV2Items, err := buildDatadogDashboardListUpdateItemsV2(&state) + if err != nil { + resp.Diagnostics.AddError("failed to parse resource configuration: ", err.Error()) + return + } + dashboardListUpdateItemsResponse, _, err := r.ApiV2.UpdateDashboardListItems(r.Auth, id, *dashboardListV2Items) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error updating dashboard list item")) + return + } + r.updateState(ctx, &state, &dashboardListUpdateItemsResponse) + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) + } + return +} + +func (r *dashboardListResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + /* ... */ +} + +func (r *dashboardListResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + /* ... */ +} + +func (r *dashboardListResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + /* ... */ +} + +func buildDatadogDashboardList(state *dashboardListResourceModel) (*datadogV1.DashboardList, error) { + var dashboardList datadogV1.DashboardList + dashboardList.SetName(state.Name.ValueString()) + return &dashboardList, nil +} + +func buildDatadogDashboardListUpdateItemsV2(state *dashboardListResourceModel) (*datadogV2.DashboardListUpdateItemsRequest, error) { + dashboardListV2ItemsArr := make([]datadogV2.DashboardListItemRequest, 0) + for _, dashItem := range state.DashItem { + dashType := datadogV2.DashboardType(dashItem.Type.ValueString()) + dashItem := datadogV2.NewDashboardListItemRequest(dashItem.Dash_id.ValueString(), dashType) + dashboardListV2ItemsArr = append(dashboardListV2ItemsArr, *dashItem) + } + dashboardListV2Items := datadogV2.NewDashboardListUpdateItemsRequest() + dashboardListV2Items.SetDashboards(dashboardListV2ItemsArr) + return dashboardListV2Items, nil +} + +func (r *dashboardListResource) updateState(ctx context.Context, state *dashboardListResourceModel, resp *datadogV2.DashboardListUpdateItemsResponse) { + + dashboards := resp.GetDashboards() + state.DashItem = []*DashItemModel{} + + for _, dashboard := range dashboards { + dashboardItem := DashItemModel{} + dashboardItem.Dash_id = types.StringValue(dashboard.Id) + dashboardItem.Type = types.StringValue(string(dashboard.Type)) + state.DashItem = append(state.DashItem, &dashboardItem) + } +} From 49fb44b0c25fe6dddd1528fdb1fc616c40834943 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Tue, 1 Aug 2023 16:42:26 +0200 Subject: [PATCH 07/19] Finish resource methods --- .../resource_datadog_dashboard_list.go | 157 ++++++++++++++++-- 1 file changed, 144 insertions(+), 13 deletions(-) diff --git a/datadog/fwprovider/resource_datadog_dashboard_list.go b/datadog/fwprovider/resource_datadog_dashboard_list.go index 3ebb016cb6..064dadc2da 100644 --- a/datadog/fwprovider/resource_datadog_dashboard_list.go +++ b/datadog/fwprovider/resource_datadog_dashboard_list.go @@ -115,6 +115,7 @@ func (r *dashboardListResource) Create(ctx context.Context, req resource.CreateR id := dashboardList.GetId() state.ID = types.StringValue(strconv.Itoa(int(id))) + // Add all the dash list items into the List if len(state.DashItem) > 0 { dashboardListV2Items, err := buildDatadogDashboardListUpdateItemsV2(&state) if err != nil { @@ -126,23 +127,133 @@ func (r *dashboardListResource) Create(ctx context.Context, req resource.CreateR resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error updating dashboard list item")) return } - r.updateState(ctx, &state, &dashboardListUpdateItemsResponse) - // Save data into Terraform state - resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) + dashboards := dashboardListUpdateItemsResponse.GetDashboards() + r.updateStateFromResponse(ctx, &state, dashboards) } - return -} -func (r *dashboardListResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - /* ... */ + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } func (r *dashboardListResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - /* ... */ + var state dashboardListResourceModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + id, err := strconv.ParseInt(state.ID.ValueString(), 10, 64) + if err != nil { + resp.Diagnostics.AddError("failed to parse resource id: ", err.Error()) + return + } + + // Make any necessary updates to the Overall Dashboard List Object + dashList, err := buildDatadogDashboardList(&state) + if err != nil { + resp.Diagnostics.AddError("failed to parse resource configuration: ", err.Error()) + return + } + + dashList.SetName(state.Name.ValueString()) + + _, httpresp, err := r.ApiV1.UpdateDashboardList(r.Auth, id, *dashList) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error updating dashboard list")) + return + } + + // Delete all elements from the dash list and add back only the ones in the config + completeDashListV2, httpresp, err := r.ApiV2.GetDashboardListItems(r.Auth, id) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error getting dashboard list item")) + return + } + if err := utils.CheckForUnparsed(completeDashListV2); err != nil { + resp.Diagnostics.AddError("", err.Error()) + return + } + + completeDashListDeleteV2, err := buildDatadogDashboardListDeleteItemsV2(&completeDashListV2) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error creating dashboard list delete item")) + return + } + _, httpresp, err = r.ApiV2.DeleteDashboardListItems(r.Auth, id, *completeDashListDeleteV2) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error deleting dashboard list item")) + return + } + + if len(state.DashItem) > 0 { + dashboardListV2Items, err := buildDatadogDashboardListUpdateItemsV2(&state) + if err != nil { + resp.Diagnostics.AddError("failed to parse resource configuration: ", err.Error()) + return + } + dashboardListUpdateItemsResponse, httpresp, err := r.ApiV2.UpdateDashboardListItems(r.Auth, id, *dashboardListV2Items) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error updating dashboard list item")) + return + } + r.updateStateFromResponse(ctx, &state, dashboardListUpdateItemsResponse.GetDashboards()) + } + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +func (r *dashboardListResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state dashboardListResourceModel + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + id, err := strconv.ParseInt(state.ID.ValueString(), 10, 64) + if err != nil { + resp.Diagnostics.AddError("failed to parse resource id: ", err.Error()) + return + } + + //Read the overall Dashboard List object + dashList, httpresp, err := r.ApiV1.GetDashboardList(r.Auth, id) + if err != nil { + if httpresp != nil && httpresp.StatusCode == 404 { + state.ID = types.StringNull() + return + } + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error getting dashboard list")) + return + } + state.Name = types.StringValue(dashList.GetName()) + + // Read and set all the dashboard list elements + completeItemListV2, _, err := r.ApiV2.GetDashboardListItems(r.Auth, id) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error getting dashboard list item")) + return + } + if err := utils.CheckForUnparsed(completeItemListV2); err != nil { + resp.Diagnostics.AddError("", err.Error()) + return + } + r.updateStateFromDashItem(ctx, &state, completeItemListV2.GetDashboards()) + resp.Diagnostics.AddError("", err.Error()) } func (r *dashboardListResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - /* ... */ + var state dashboardListResourceModel + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + id, _ := strconv.ParseInt(state.ID.ValueString(), 10, 64) + _, httpresp, err := r.ApiV1.DeleteDashboardList(r.Auth, id) + if err != nil { + resp.Diagnostics.Append(utils.FrameworkErrorDiag(utils.TranslateClientError(err, httpresp, ""), "error deleting dashboard list")) + return + } } func buildDatadogDashboardList(state *dashboardListResourceModel) (*datadogV1.DashboardList, error) { @@ -163,15 +274,35 @@ func buildDatadogDashboardListUpdateItemsV2(state *dashboardListResourceModel) ( return dashboardListV2Items, nil } -func (r *dashboardListResource) updateState(ctx context.Context, state *dashboardListResourceModel, resp *datadogV2.DashboardListUpdateItemsResponse) { +func buildDatadogDashboardListDeleteItemsV2(dashboardListItems *datadogV2.DashboardListItems) (*datadogV2.DashboardListDeleteItemsRequest, error) { + dashboardListV2ItemsArr := make([]datadogV2.DashboardListItemRequest, 0) + for _, dashItem := range dashboardListItems.GetDashboards() { + dashType := dashItem.GetType() + dashID := dashItem.GetId() + dashItem := datadogV2.NewDashboardListItemRequest(dashID, dashType) + dashboardListV2ItemsArr = append(dashboardListV2ItemsArr, *dashItem) + } + dashboardListV2Items := datadogV2.NewDashboardListDeleteItemsRequest() + dashboardListV2Items.SetDashboards(dashboardListV2ItemsArr) + return dashboardListV2Items, nil +} - dashboards := resp.GetDashboards() +func (r *dashboardListResource) updateStateFromResponse(ctx context.Context, state *dashboardListResourceModel, dashboards []datadogV2.DashboardListItemResponse) { state.DashItem = []*DashItemModel{} + for _, dashboard := range dashboards { + dashboardItem := DashItemModel{} + dashboardItem.Dash_id = types.StringValue(dashboard.GetId()) + dashboardItem.Type = types.StringValue(string(dashboard.GetType())) + state.DashItem = append(state.DashItem, &dashboardItem) + } +} +func (r *dashboardListResource) updateStateFromDashItem(ctx context.Context, state *dashboardListResourceModel, dashboards []datadogV2.DashboardListItem) { + state.DashItem = []*DashItemModel{} for _, dashboard := range dashboards { dashboardItem := DashItemModel{} - dashboardItem.Dash_id = types.StringValue(dashboard.Id) - dashboardItem.Type = types.StringValue(string(dashboard.Type)) + dashboardItem.Dash_id = types.StringValue(dashboard.GetId()) + dashboardItem.Type = types.StringValue(string(dashboard.GetType())) state.DashItem = append(state.DashItem, &dashboardItem) } } From 0e2c6975ad25e456f2f31c3650d95043f113db0a Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Tue, 1 Aug 2023 17:02:00 +0200 Subject: [PATCH 08/19] Update desc --- datadog/fwprovider/resource_datadog_dashboard_list.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datadog/fwprovider/resource_datadog_dashboard_list.go b/datadog/fwprovider/resource_datadog_dashboard_list.go index 064dadc2da..d87dbb2238 100644 --- a/datadog/fwprovider/resource_datadog_dashboard_list.go +++ b/datadog/fwprovider/resource_datadog_dashboard_list.go @@ -68,10 +68,11 @@ func (r *dashboardListResource) Schema(ctx context.Context, req resource.SchemaR }, Blocks: map[string]schema.Block{ "dash_item": schema.SetNestedBlock{ + Description: "A set of dashboard items that belong to this list", NestedObject: schema.NestedBlockObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "The type of this dashboard.", + Description: "The type of this dashboard. Valid values are `custom_timeboard`, `custom_screenboard`, `integration_screenboard`, `integration_timeboard`, `host_timeboard`.", Required: true, Validators: []validator.String{ validators.NewEnumValidator[validator.String](datadogV2.NewDashboardTypeFromValue), From 60b06a2aaccf5a8c8cd30f71a080de8946d44d90 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Tue, 1 Aug 2023 17:28:38 +0200 Subject: [PATCH 09/19] Remove potential segfault --- datadog/fwprovider/resource_datadog_dashboard_list.go | 1 - 1 file changed, 1 deletion(-) diff --git a/datadog/fwprovider/resource_datadog_dashboard_list.go b/datadog/fwprovider/resource_datadog_dashboard_list.go index d87dbb2238..56d262e9e7 100644 --- a/datadog/fwprovider/resource_datadog_dashboard_list.go +++ b/datadog/fwprovider/resource_datadog_dashboard_list.go @@ -239,7 +239,6 @@ func (r *dashboardListResource) Read(ctx context.Context, req resource.ReadReque return } r.updateStateFromDashItem(ctx, &state, completeItemListV2.GetDashboards()) - resp.Diagnostics.AddError("", err.Error()) } func (r *dashboardListResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { From fc6bcc5dd02f3acd7dc1e7c46f026094d4c8d6b2 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Tue, 1 Aug 2023 17:47:03 +0200 Subject: [PATCH 10/19] remove original resource --- datadog/resource_datadog_dashboard_list.go | 234 --------------------- 1 file changed, 234 deletions(-) delete mode 100644 datadog/resource_datadog_dashboard_list.go diff --git a/datadog/resource_datadog_dashboard_list.go b/datadog/resource_datadog_dashboard_list.go deleted file mode 100644 index 4e1a6c35d7..0000000000 --- a/datadog/resource_datadog_dashboard_list.go +++ /dev/null @@ -1,234 +0,0 @@ -package datadog - -import ( - "context" - "strconv" - - "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils" - "github.com/terraform-providers/terraform-provider-datadog/datadog/internal/validators" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceDatadogDashboardList() *schema.Resource { - return &schema.Resource{ - Description: "Provides a Datadog dashboard_list resource. This can be used to create and manage Datadog Dashboard Lists and the individual dashboards within them.", - CreateContext: resourceDatadogDashboardListCreate, - UpdateContext: resourceDatadogDashboardListUpdate, - ReadContext: resourceDatadogDashboardListRead, - DeleteContext: resourceDatadogDashboardListDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - SchemaFunc: func() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - Description: "The name of the Dashboard List", - }, - "dash_item": { - Type: schema.TypeSet, - Optional: true, - Description: "A set of dashboard items that belong to this list", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - Required: true, - ValidateDiagFunc: validators.ValidateEnumValue(datadogV2.NewDashboardTypeFromValue), - Description: "The type of this dashboard.", - }, - "dash_id": { - Type: schema.TypeString, - Required: true, - Description: "The ID of the dashboard to add", - }, - }, - }, - }, - } - }, - } -} - -func resourceDatadogDashboardListCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - providerConf := meta.(*ProviderConfiguration) - apiInstances := providerConf.DatadogApiInstances - auth := providerConf.Auth - - dashboardListPayload, err := buildDatadogDashboardList(d) - if err != nil { - return diag.Errorf("failed to parse resource configuration: %s", err.Error()) - } - dashboardList, httpresp, err := apiInstances.GetDashboardListsApiV1().CreateDashboardList(auth, *dashboardListPayload) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error creating dashboard list") - } - if err := utils.CheckForUnparsed(dashboardList); err != nil { - return diag.FromErr(err) - } - id := dashboardList.GetId() - d.SetId(strconv.Itoa(int(id))) - - // Add all the dash list items into the List - if len(d.Get("dash_item").(*schema.Set).List()) > 0 { - dashboardListV2Items, err := buildDatadogDashboardListUpdateItemsV2(d) - if err != nil { - return diag.Errorf("failed to parse resource configuration: %s", err.Error()) - } - _, _, err = apiInstances.GetDashboardListsApiV2().UpdateDashboardListItems(auth, id, *dashboardListV2Items) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error updating dashboard list item") - } - } - - return resourceDatadogDashboardListRead(ctx, d, meta) -} - -func resourceDatadogDashboardListUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - providerConf := meta.(*ProviderConfiguration) - apiInstances := providerConf.DatadogApiInstances - auth := providerConf.Auth - - id, err := strconv.ParseInt(d.Id(), 10, 64) - if err != nil { - return diag.Errorf("failed to parse resource id: %s", err.Error()) - } - - // Make any necessary updates to the Overall Dashboard List Object - dashList, err := buildDatadogDashboardList(d) - if err != nil { - return diag.Errorf("failed to parse resource configuration: %s", err.Error()) - } - dashList.SetName(d.Get("name").(string)) - _, httpresp, err := apiInstances.GetDashboardListsApiV1().UpdateDashboardList(auth, id, *dashList) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error updating dashboard list") - } - - // Delete all elements from the dash list and add back only the ones in the config - completeDashListV2, httpresp, err := apiInstances.GetDashboardListsApiV2().GetDashboardListItems(auth, id) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error getting dashboard list item") - } - if err := utils.CheckForUnparsed(completeDashListV2); err != nil { - return diag.FromErr(err) - } - completeDashListDeleteV2, err := buildDatadogDashboardListDeleteItemsV2(&completeDashListV2) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error creating dashboard list delete item") - } - _, httpresp, err = apiInstances.GetDashboardListsApiV2().DeleteDashboardListItems(auth, id, *completeDashListDeleteV2) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error deleting dashboard list item") - } - if len(d.Get("dash_item").(*schema.Set).List()) > 0 { - dashboardListV2Items, err := buildDatadogDashboardListUpdateItemsV2(d) - if err != nil { - return diag.Errorf("failed to parse resource configuration: %s", err.Error()) - } - _, httpresp, err = apiInstances.GetDashboardListsApiV2().UpdateDashboardListItems(auth, id, *dashboardListV2Items) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error updating dashboard list item") - } - } - - return resourceDatadogDashboardListRead(ctx, d, meta) -} - -func resourceDatadogDashboardListRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - providerConf := meta.(*ProviderConfiguration) - apiInstances := providerConf.DatadogApiInstances - auth := providerConf.Auth - - id, _ := strconv.ParseInt(d.Id(), 10, 64) - - //Read the overall Dashboard List object - dashList, httpresp, err := apiInstances.GetDashboardListsApiV1().GetDashboardList(auth, id) - if err != nil { - if httpresp != nil && httpresp.StatusCode == 404 { - d.SetId("") - return nil - } - return utils.TranslateClientErrorDiag(err, httpresp, "error getting dashboard list") - } - d.Set("name", dashList.GetName()) - - // Read and set all the dashboard list elements - completeItemListV2, _, err := apiInstances.GetDashboardListsApiV2().GetDashboardListItems(auth, id) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error getting dashboard list item") - } - if err := utils.CheckForUnparsed(completeItemListV2); err != nil { - return diag.FromErr(err) - } - dashItemListV2, err := buildTerraformDashboardListItemsV2(&completeItemListV2) - if err != nil { - return diag.Errorf("failed to parse resource configuration: %s", err.Error()) - } - d.Set("dash_item", dashItemListV2) - return diag.FromErr(err) -} - -func resourceDatadogDashboardListDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - providerConf := meta.(*ProviderConfiguration) - apiInstances := providerConf.DatadogApiInstances - auth := providerConf.Auth - - id, _ := strconv.ParseInt(d.Id(), 10, 64) - // Deleting the overall List will also take care of deleting its sub elements - // Deletion of individual dash items happens in the Update method - // Note this doesn't delete the actual dashboards, just removes them from the deleted list - _, httpresp, err := apiInstances.GetDashboardListsApiV1().DeleteDashboardList(auth, id) - if err != nil { - return utils.TranslateClientErrorDiag(err, httpresp, "error deleting dashboard list") - } - return nil -} - -func buildDatadogDashboardList(d *schema.ResourceData) (*datadogV1.DashboardList, error) { - var dashboardList datadogV1.DashboardList - dashboardList.SetName(d.Get("name").(string)) - return &dashboardList, nil -} - -func buildDatadogDashboardListDeleteItemsV2(dashboardListItems *datadogV2.DashboardListItems) (*datadogV2.DashboardListDeleteItemsRequest, error) { - dashboardListV2ItemsArr := make([]datadogV2.DashboardListItemRequest, 0) - for _, dashItem := range dashboardListItems.GetDashboards() { - dashType := dashItem.GetType() - dashID := dashItem.GetId() - dashItem := datadogV2.NewDashboardListItemRequest(dashID, dashType) - dashboardListV2ItemsArr = append(dashboardListV2ItemsArr, *dashItem) - } - dashboardListV2Items := datadogV2.NewDashboardListDeleteItemsRequest() - dashboardListV2Items.SetDashboards(dashboardListV2ItemsArr) - return dashboardListV2Items, nil -} - -func buildDatadogDashboardListUpdateItemsV2(d *schema.ResourceData) (*datadogV2.DashboardListUpdateItemsRequest, error) { - dashboardListV2ItemsArr := make([]datadogV2.DashboardListItemRequest, 0) - for _, dashItem := range d.Get("dash_item").(*schema.Set).List() { - dashItemRaw := dashItem.(map[string]interface{}) - dashType := datadogV2.DashboardType(dashItemRaw["type"].(string)) - dashItem := datadogV2.NewDashboardListItemRequest(dashItemRaw["dash_id"].(string), dashType) - dashboardListV2ItemsArr = append(dashboardListV2ItemsArr, *dashItem) - } - dashboardListV2Items := datadogV2.NewDashboardListUpdateItemsRequest() - dashboardListV2Items.SetDashboards(dashboardListV2ItemsArr) - return dashboardListV2Items, nil -} - -func buildTerraformDashboardListItemsV2(completeItemListV2 *datadogV2.DashboardListItems) ([]map[string]interface{}, error) { - dashItemListV2 := make([]map[string]interface{}, 0, 1) - for _, item := range completeItemListV2.GetDashboards() { - dashItem := make(map[string]interface{}) - dashItem["type"] = item.GetType() - dashItem["dash_id"] = item.GetId() - dashItemListV2 = append(dashItemListV2, dashItem) - } - return dashItemListV2, nil -} From edbaa38daaa0b96c2a5f574fcdb9007dbc128c0a Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Tue, 1 Aug 2023 17:47:36 +0200 Subject: [PATCH 11/19] remove from old provider --- datadog/provider.go | 1 - 1 file changed, 1 deletion(-) diff --git a/datadog/provider.go b/datadog/provider.go index 6f4e87e46d..5bc2763422 100644 --- a/datadog/provider.go +++ b/datadog/provider.go @@ -159,7 +159,6 @@ func Provider() *schema.Provider { "datadog_cloud_workload_security_agent_rule": resourceDatadogCloudWorkloadSecurityAgentRule(), "datadog_dashboard": resourceDatadogDashboard(), "datadog_dashboard_json": resourceDatadogDashboardJSON(), - "datadog_dashboard_list": resourceDatadogDashboardList(), "datadog_downtime": resourceDatadogDowntime(), "datadog_integration_aws": resourceDatadogIntegrationAws(), "datadog_integration_aws_tag_filter": resourceDatadogIntegrationAwsTagFilter(), From a0b357be7fdd9dcc26e3af00a75174bef8c9b11b Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Tue, 1 Aug 2023 18:22:24 +0200 Subject: [PATCH 12/19] Update dashboard list json test --- datadog/tests/resource_datadog_dashboard_json_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/datadog/tests/resource_datadog_dashboard_json_test.go b/datadog/tests/resource_datadog_dashboard_json_test.go index f874d492b3..ac30df35c0 100644 --- a/datadog/tests/resource_datadog_dashboard_json_test.go +++ b/datadog/tests/resource_datadog_dashboard_json_test.go @@ -131,14 +131,12 @@ func TestAccDatadogDashboardJSONImport(t *testing.T) { func TestDatadogDashListInDashboardJSON(t *testing.T) { t.Parallel() - ctx, accProviders := testAccProviders(context.Background(), t) + ctx, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t) uniqueName := uniqueEntityName(ctx, t) - accProvider := testAccProvider(t, accProviders) - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: accProviders, - CheckDestroy: testAccCheckDatadogDashListDestroy(accProvider), + PreCheck: func() { testAccPreCheck(t) }, + ProtoV5ProviderFactories: accProviders, + CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(providers.frameworkProvider), Steps: []resource.TestStep{ { Config: testAccCheckDatadogDashListConfigInDashboardJSON(uniqueName), From ef969f6aa4ab91ddde172f8e4c8592f3f37e76e6 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Tue, 1 Aug 2023 18:22:47 +0200 Subject: [PATCH 13/19] simplify test --- .../tests/data_source_datadog_dashboard_list_test.go | 3 +-- .../tests/resource_datadog_dashboard_list_test.go | 12 +++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/datadog/tests/data_source_datadog_dashboard_list_test.go b/datadog/tests/data_source_datadog_dashboard_list_test.go index 289c8bee86..6a42a571e4 100644 --- a/datadog/tests/data_source_datadog_dashboard_list_test.go +++ b/datadog/tests/data_source_datadog_dashboard_list_test.go @@ -12,12 +12,11 @@ func TestAccDatadogDashboardListDatasource(t *testing.T) { t.Parallel() ctx, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t) uniq := uniqueEntityName(ctx, t) - accProvider := providers.frameworkProvider resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: accProviders, - CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(accProvider), + CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(providers.frameworkProvider), Steps: []resource.TestStep{ { Config: testAccDatasourceDashboardListNameFilterConfig(uniq), diff --git a/datadog/tests/resource_datadog_dashboard_list_test.go b/datadog/tests/resource_datadog_dashboard_list_test.go index b9291c2a3f..90312c4c4a 100644 --- a/datadog/tests/resource_datadog_dashboard_list_test.go +++ b/datadog/tests/resource_datadog_dashboard_list_test.go @@ -126,15 +126,13 @@ func TestDatadogDashListImport(t *testing.T) { resourceName := "datadog_dashboard_list.new_list" ctx, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t) uniqueName := uniqueEntityName(ctx, t) - accProvider := providers.frameworkProvider // Getting the hash for a TypeSet element that has dynamic elements isn't possible // So instead we use an import test to make sure the resource can be imported properly. - resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: accProviders, - CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(accProvider), + CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(providers.frameworkProvider), Steps: []resource.TestStep{ { Config: testAccCheckDatadogDashListConfig(uniqueName), @@ -152,12 +150,10 @@ func TestDatadogDashListInDashboard(t *testing.T) { t.Parallel() ctx, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t) uniqueName := uniqueEntityName(ctx, t) - accProvider := providers.frameworkProvider - resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: accProviders, - CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(accProvider), + CheckDestroy: testAccCheckDatadogDashListDestroyWithFw(providers.frameworkProvider), Steps: []resource.TestStep{ { Config: testAccCheckDatadogDashListConfigInDashboard(uniqueName), @@ -200,7 +196,6 @@ func testAccCheckDatadogDashListDestroyWithFw(accProvider *fwprovider.FrameworkP return func(s *terraform.State) error { apiInstances := accProvider.DatadogApiInstances auth := accProvider.Auth - return datadogDashListDestroyHelper(auth, s, apiInstances) } } @@ -218,8 +213,7 @@ func datadogDashListDestroyHelper(ctx context.Context, s *terraform.State, apiIn } return fmt.Errorf("received an error retrieving Dash List %s", errList) } - - return fmt.Errorf("dashoard List still exists") + return fmt.Errorf("dashoard list still exists") } return nil } From 3ed8b076aacef61bb2f1216bbb22fcede88c42e9 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Tue, 1 Aug 2023 19:23:59 +0200 Subject: [PATCH 14/19] update state and cassettes --- .../resource_datadog_dashboard_list.go | 2 + ...stAccDatadogDashboardListDatasource.freeze | 2 +- ...TestAccDatadogDashboardListDatasource.yaml | 64 ++----- .../TestDatadogDashListImport.freeze | 2 +- .../cassettes/TestDatadogDashListImport.yaml | 100 ++++------- .../TestDatadogDashListInDashboard.freeze | 2 +- .../TestDatadogDashListInDashboard.yaml | 158 +++++------------ .../TestDatadogDashListInDashboardJSON.freeze | 2 +- .../TestDatadogDashListInDashboardJSON.yaml | 162 +++++------------- 9 files changed, 146 insertions(+), 348 deletions(-) diff --git a/datadog/fwprovider/resource_datadog_dashboard_list.go b/datadog/fwprovider/resource_datadog_dashboard_list.go index 56d262e9e7..53eb285bef 100644 --- a/datadog/fwprovider/resource_datadog_dashboard_list.go +++ b/datadog/fwprovider/resource_datadog_dashboard_list.go @@ -239,6 +239,8 @@ func (r *dashboardListResource) Read(ctx context.Context, req resource.ReadReque return } r.updateStateFromDashItem(ctx, &state, completeItemListV2.GetDashboards()) + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) } func (r *dashboardListResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { diff --git a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze index dda064644b..f79d0c18d2 100644 --- a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze +++ b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze @@ -1 +1 @@ -2023-04-20T11:11:15.334534-04:00 \ No newline at end of file +2023-08-01T19:17:31.0563+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml index 002b1cbc1b..2a99283cb2 100644 --- a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml +++ b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"name":"tf-TestAccDatadogDashboardListDatasource-local-1682003475"} + {"name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965"} form: {} headers: Accept: @@ -14,41 +14,7 @@ interactions: method: POST response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:11:16.214755+00:00","dashboards":null,"dashboard_count":0,"id":379581,"is_favorite":false,"modified":"2023-04-20T15:11:16.214761+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1682003475","type":"manual_dashboard_list"} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379581 - method: GET - response: - body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:11:16.214755+00:00","dashboards":null,"dashboard_count":0,"id":379581,"is_favorite":false,"modified":"2023-04-20T15:11:16.214761+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1682003475","type":"manual_dashboard_list"} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379581/dashboards - method: GET - response: - body: | - {"dashboards":[],"total":0} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -65,7 +31,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":true,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:04.511354+00:00","dashboards":null,"dashboard_count":0,"id":368163,"is_favorite":false,"modified":"2023-03-03T15:15:04.511361+00:00","name":"Test-Add_custom_screenboard_dashboard_to_an_existing_dashboard_list_returns_OK_response-1677856504","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:05.452328+00:00","dashboards":null,"dashboard_count":0,"id":368164,"is_favorite":false,"modified":"2023-03-03T15:15:05.452334+00:00","name":"Test-Add_custom_timeboard_dashboard_to_an_existing_dashboard_list_returns_OK_response-1677856505","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:18.320222+00:00","dashboards":null,"dashboard_count":0,"id":368154,"is_favorite":false,"modified":"2023-03-03T15:12:18.320227+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1677856338","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:19.534944+00:00","dashboards":null,"dashboard_count":0,"id":368156,"is_favorite":false,"modified":"2023-03-03T15:12:19.534950+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1677856339","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:06.402992+00:00","dashboards":null,"dashboard_count":0,"id":368165,"is_favorite":false,"modified":"2023-03-03T15:15:06.403001+00:00","name":"Test-Delete_custom_screenboard_dashboard_from_an_existing_dashboard_list_returns_OK_response-1677856506","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:07.329230+00:00","dashboards":null,"dashboard_count":0,"id":368166,"is_favorite":false,"modified":"2023-03-03T15:15:07.329236+00:00","name":"Test-Delete_custom_timeboard_dashboard_from_an_existing_dashboard_list_returns_OK_response-1677856507","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:20.506882+00:00","dashboards":null,"dashboard_count":0,"id":368157,"is_favorite":false,"modified":"2023-03-03T15:12:20.506888+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1677856340","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:08.249746+00:00","dashboards":null,"dashboard_count":0,"id":368167,"is_favorite":false,"modified":"2023-03-03T15:15:08.249751+00:00","name":"Test-Get_items_of_a_Dashboard_List_returns_OK_response-1677856508","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2022-12-09T15:04:28.806069+00:00","dashboards":null,"dashboard_count":1,"id":348463,"is_favorite":false,"modified":"2022-12-09T15:04:29.985883+00:00","name":"Test-Go-TestDashboardListItemCRUD-1670598268","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:13:01.356447+00:00","dashboards":null,"dashboard_count":0,"id":368162,"is_favorite":false,"modified":"2023-03-03T15:13:01.356453+00:00","name":"Test-TestDashboardListLifecycle-1677856381","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:21.395438+00:00","dashboards":null,"dashboard_count":0,"id":368158,"is_favorite":false,"modified":"2023-03-03T15:12:21.395444+00:00","name":"Test-Update_a_dashboard_list_returns_OK_response-1677856341","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:09.196541+00:00","dashboards":null,"dashboard_count":0,"id":368168,"is_favorite":false,"modified":"2023-03-03T15:15:09.196547+00:00","name":"Test-Update_items_of_a_dashboard_list_returns_OK_response-1677856509","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:11:16.214755+00:00","dashboards":null,"dashboard_count":0,"id":379581,"is_favorite":false,"modified":"2023-04-20T15:11:16.214761+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1682003475","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -82,7 +48,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":true,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:04.511354+00:00","dashboards":null,"dashboard_count":0,"id":368163,"is_favorite":false,"modified":"2023-03-03T15:15:04.511361+00:00","name":"Test-Add_custom_screenboard_dashboard_to_an_existing_dashboard_list_returns_OK_response-1677856504","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:05.452328+00:00","dashboards":null,"dashboard_count":0,"id":368164,"is_favorite":false,"modified":"2023-03-03T15:15:05.452334+00:00","name":"Test-Add_custom_timeboard_dashboard_to_an_existing_dashboard_list_returns_OK_response-1677856505","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:18.320222+00:00","dashboards":null,"dashboard_count":0,"id":368154,"is_favorite":false,"modified":"2023-03-03T15:12:18.320227+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1677856338","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:19.534944+00:00","dashboards":null,"dashboard_count":0,"id":368156,"is_favorite":false,"modified":"2023-03-03T15:12:19.534950+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1677856339","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:06.402992+00:00","dashboards":null,"dashboard_count":0,"id":368165,"is_favorite":false,"modified":"2023-03-03T15:15:06.403001+00:00","name":"Test-Delete_custom_screenboard_dashboard_from_an_existing_dashboard_list_returns_OK_response-1677856506","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:07.329230+00:00","dashboards":null,"dashboard_count":0,"id":368166,"is_favorite":false,"modified":"2023-03-03T15:15:07.329236+00:00","name":"Test-Delete_custom_timeboard_dashboard_from_an_existing_dashboard_list_returns_OK_response-1677856507","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:20.506882+00:00","dashboards":null,"dashboard_count":0,"id":368157,"is_favorite":false,"modified":"2023-03-03T15:12:20.506888+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1677856340","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:08.249746+00:00","dashboards":null,"dashboard_count":0,"id":368167,"is_favorite":false,"modified":"2023-03-03T15:15:08.249751+00:00","name":"Test-Get_items_of_a_Dashboard_List_returns_OK_response-1677856508","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2022-12-09T15:04:28.806069+00:00","dashboards":null,"dashboard_count":1,"id":348463,"is_favorite":false,"modified":"2022-12-09T15:04:29.985883+00:00","name":"Test-Go-TestDashboardListItemCRUD-1670598268","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:13:01.356447+00:00","dashboards":null,"dashboard_count":0,"id":368162,"is_favorite":false,"modified":"2023-03-03T15:13:01.356453+00:00","name":"Test-TestDashboardListLifecycle-1677856381","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:21.395438+00:00","dashboards":null,"dashboard_count":0,"id":368158,"is_favorite":false,"modified":"2023-03-03T15:12:21.395444+00:00","name":"Test-Update_a_dashboard_list_returns_OK_response-1677856341","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:09.196541+00:00","dashboards":null,"dashboard_count":0,"id":368168,"is_favorite":false,"modified":"2023-03-03T15:15:09.196547+00:00","name":"Test-Update_items_of_a_dashboard_list_returns_OK_response-1677856509","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:11:16.214755+00:00","dashboards":null,"dashboard_count":0,"id":379581,"is_favorite":false,"modified":"2023-04-20T15:11:16.214761+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1682003475","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -95,11 +61,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379581 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404942 method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:11:16.214755+00:00","dashboards":null,"dashboard_count":0,"id":379581,"is_favorite":false,"modified":"2023-04-20T15:11:16.214761+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1682003475","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -112,7 +78,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379581/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404942/dashboards method: GET response: body: | @@ -133,7 +99,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":true,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:04.511354+00:00","dashboards":null,"dashboard_count":0,"id":368163,"is_favorite":false,"modified":"2023-03-03T15:15:04.511361+00:00","name":"Test-Add_custom_screenboard_dashboard_to_an_existing_dashboard_list_returns_OK_response-1677856504","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:05.452328+00:00","dashboards":null,"dashboard_count":0,"id":368164,"is_favorite":false,"modified":"2023-03-03T15:15:05.452334+00:00","name":"Test-Add_custom_timeboard_dashboard_to_an_existing_dashboard_list_returns_OK_response-1677856505","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:18.320222+00:00","dashboards":null,"dashboard_count":0,"id":368154,"is_favorite":false,"modified":"2023-03-03T15:12:18.320227+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1677856338","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:19.534944+00:00","dashboards":null,"dashboard_count":0,"id":368156,"is_favorite":false,"modified":"2023-03-03T15:12:19.534950+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1677856339","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:06.402992+00:00","dashboards":null,"dashboard_count":0,"id":368165,"is_favorite":false,"modified":"2023-03-03T15:15:06.403001+00:00","name":"Test-Delete_custom_screenboard_dashboard_from_an_existing_dashboard_list_returns_OK_response-1677856506","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:07.329230+00:00","dashboards":null,"dashboard_count":0,"id":368166,"is_favorite":false,"modified":"2023-03-03T15:15:07.329236+00:00","name":"Test-Delete_custom_timeboard_dashboard_from_an_existing_dashboard_list_returns_OK_response-1677856507","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:20.506882+00:00","dashboards":null,"dashboard_count":0,"id":368157,"is_favorite":false,"modified":"2023-03-03T15:12:20.506888+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1677856340","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:08.249746+00:00","dashboards":null,"dashboard_count":0,"id":368167,"is_favorite":false,"modified":"2023-03-03T15:15:08.249751+00:00","name":"Test-Get_items_of_a_Dashboard_List_returns_OK_response-1677856508","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2022-12-09T15:04:28.806069+00:00","dashboards":null,"dashboard_count":1,"id":348463,"is_favorite":false,"modified":"2022-12-09T15:04:29.985883+00:00","name":"Test-Go-TestDashboardListItemCRUD-1670598268","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:13:01.356447+00:00","dashboards":null,"dashboard_count":0,"id":368162,"is_favorite":false,"modified":"2023-03-03T15:13:01.356453+00:00","name":"Test-TestDashboardListLifecycle-1677856381","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:21.395438+00:00","dashboards":null,"dashboard_count":0,"id":368158,"is_favorite":false,"modified":"2023-03-03T15:12:21.395444+00:00","name":"Test-Update_a_dashboard_list_returns_OK_response-1677856341","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:09.196541+00:00","dashboards":null,"dashboard_count":0,"id":368168,"is_favorite":false,"modified":"2023-03-03T15:15:09.196547+00:00","name":"Test-Update_items_of_a_dashboard_list_returns_OK_response-1677856509","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:11:16.214755+00:00","dashboards":null,"dashboard_count":0,"id":379581,"is_favorite":false,"modified":"2023-04-20T15:11:16.214761+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1682003475","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -150,7 +116,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":true,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:04.511354+00:00","dashboards":null,"dashboard_count":0,"id":368163,"is_favorite":false,"modified":"2023-03-03T15:15:04.511361+00:00","name":"Test-Add_custom_screenboard_dashboard_to_an_existing_dashboard_list_returns_OK_response-1677856504","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:05.452328+00:00","dashboards":null,"dashboard_count":0,"id":368164,"is_favorite":false,"modified":"2023-03-03T15:15:05.452334+00:00","name":"Test-Add_custom_timeboard_dashboard_to_an_existing_dashboard_list_returns_OK_response-1677856505","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:18.320222+00:00","dashboards":null,"dashboard_count":0,"id":368154,"is_favorite":false,"modified":"2023-03-03T15:12:18.320227+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1677856338","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:19.534944+00:00","dashboards":null,"dashboard_count":0,"id":368156,"is_favorite":false,"modified":"2023-03-03T15:12:19.534950+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1677856339","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:06.402992+00:00","dashboards":null,"dashboard_count":0,"id":368165,"is_favorite":false,"modified":"2023-03-03T15:15:06.403001+00:00","name":"Test-Delete_custom_screenboard_dashboard_from_an_existing_dashboard_list_returns_OK_response-1677856506","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:07.329230+00:00","dashboards":null,"dashboard_count":0,"id":368166,"is_favorite":false,"modified":"2023-03-03T15:15:07.329236+00:00","name":"Test-Delete_custom_timeboard_dashboard_from_an_existing_dashboard_list_returns_OK_response-1677856507","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:20.506882+00:00","dashboards":null,"dashboard_count":0,"id":368157,"is_favorite":false,"modified":"2023-03-03T15:12:20.506888+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1677856340","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:08.249746+00:00","dashboards":null,"dashboard_count":0,"id":368167,"is_favorite":false,"modified":"2023-03-03T15:15:08.249751+00:00","name":"Test-Get_items_of_a_Dashboard_List_returns_OK_response-1677856508","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2022-12-09T15:04:28.806069+00:00","dashboards":null,"dashboard_count":1,"id":348463,"is_favorite":false,"modified":"2022-12-09T15:04:29.985883+00:00","name":"Test-Go-TestDashboardListItemCRUD-1670598268","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:13:01.356447+00:00","dashboards":null,"dashboard_count":0,"id":368162,"is_favorite":false,"modified":"2023-03-03T15:13:01.356453+00:00","name":"Test-TestDashboardListLifecycle-1677856381","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:12:21.395438+00:00","dashboards":null,"dashboard_count":0,"id":368158,"is_favorite":false,"modified":"2023-03-03T15:12:21.395444+00:00","name":"Test-Update_a_dashboard_list_returns_OK_response-1677856341","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-03-03T15:15:09.196541+00:00","dashboards":null,"dashboard_count":0,"id":368168,"is_favorite":false,"modified":"2023-03-03T15:15:09.196547+00:00","name":"Test-Update_items_of_a_dashboard_list_returns_OK_response-1677856509","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:11:16.214755+00:00","dashboards":null,"dashboard_count":0,"id":379581,"is_favorite":false,"modified":"2023-04-20T15:11:16.214761+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1682003475","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -163,11 +129,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379581 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404942 method: DELETE response: body: | - {"deleted_dashboard_list_id":379581} + {"deleted_dashboard_list_id":404942} headers: Content-Type: - application/json @@ -180,10 +146,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379581 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404942 method: GET response: - body: '{"errors":["Manual Dashboard List with id 379581 not found"]}' + body: '{"errors":["Manual Dashboard List with id 404942 not found"]}' headers: Content-Type: - application/json @@ -196,10 +162,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379581 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404942 method: GET response: - body: '{"errors":["Manual Dashboard List with id 379581 not found"]}' + body: '{"errors":["Manual Dashboard List with id 404942 not found"]}' headers: Content-Type: - application/json diff --git a/datadog/tests/cassettes/TestDatadogDashListImport.freeze b/datadog/tests/cassettes/TestDatadogDashListImport.freeze index 6f5780352e..15abb72893 100644 --- a/datadog/tests/cassettes/TestDatadogDashListImport.freeze +++ b/datadog/tests/cassettes/TestDatadogDashListImport.freeze @@ -1 +1 @@ -2023-04-26T13:19:51.048296-04:00 \ No newline at end of file +2023-08-01T19:17:31.035287+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestDatadogDashListImport.yaml b/datadog/tests/cassettes/TestDatadogDashListImport.yaml index e1b1e98137..72b707033f 100644 --- a/datadog/tests/cassettes/TestDatadogDashListImport.yaml +++ b/datadog/tests/cassettes/TestDatadogDashListImport.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"","layout_type":"free","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1682529591-screen","widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5}}]} + {"description":"Created using the Datadog provider in Terraform","id":"","layout_type":"free","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690910177-screen","widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5}}]} form: {} headers: Accept: @@ -14,7 +14,7 @@ interactions: method: POST response: body: | - {"id":"rxf-5db-53y","title":"tf-TestDatadogDashListImport-local-1682529591-screen","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"free","url":"/dashboard/rxf-5db-53y/tf-testdatadogdashlistimport-local-1682529591-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":6324982369876596}],"notify_list":[],"created_at":"2023-04-26T17:19:53.363443+00:00","modified_at":"2023-04-26T17:19:53.363443+00:00","template_variable_presets":[],"tags":[]} + {"id":"86d-jaj-ym4","title":"tf-TestDatadogDashListImport-local-1690910177-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":5130893252056120}],"notify_list":[],"created_at":"2023-08-01T17:16:23.381408+00:00","modified_at":"2023-08-01T17:16:23.381408+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -27,11 +27,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/rxf-5db-53y + url: https://api.datadoghq.com/api/v1/dashboard/86d-jaj-ym4 method: GET response: body: | - {"id":"rxf-5db-53y","title":"tf-TestDatadogDashListImport-local-1682529591-screen","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"free","url":"/dashboard/rxf-5db-53y/tf-testdatadogdashlistimport-local-1682529591-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":6324982369876596}],"notify_list":[],"created_at":"2023-04-26T17:19:53.363443+00:00","modified_at":"2023-04-26T17:19:53.363443+00:00","template_variable_presets":[],"tags":[]} + {"id":"86d-jaj-ym4","title":"tf-TestDatadogDashListImport-local-1690910177-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":5130893252056120}],"notify_list":[],"created_at":"2023-08-01T17:16:23.381408+00:00","modified_at":"2023-08-01T17:16:23.381408+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -40,7 +40,7 @@ interactions: duration: "" - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1682529591-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} + {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690910177-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} form: {} headers: Accept: @@ -51,7 +51,7 @@ interactions: method: POST response: body: | - {"id":"5uw-8vd-z53","title":"tf-TestDatadogDashListImport-local-1682529591-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/5uw-8vd-z53/tf-testdatadogdashlistimport-local-1682529591-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":3682516369002652}],"notify_list":[],"created_at":"2023-04-26T17:19:54.110283+00:00","modified_at":"2023-04-26T17:19:54.110283+00:00","template_variable_presets":[],"tags":[]} + {"id":"jef-kge-pkx","title":"tf-TestDatadogDashListImport-local-1690910177-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":8156784494169468}],"notify_list":[],"created_at":"2023-08-01T17:16:24.050484+00:00","modified_at":"2023-08-01T17:16:24.050484+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -64,11 +64,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/5uw-8vd-z53 + url: https://api.datadoghq.com/api/v1/dashboard/jef-kge-pkx method: GET response: body: | - {"id":"5uw-8vd-z53","title":"tf-TestDatadogDashListImport-local-1682529591-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/5uw-8vd-z53/tf-testdatadogdashlistimport-local-1682529591-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":3682516369002652}],"notify_list":[],"created_at":"2023-04-26T17:19:54.110283+00:00","modified_at":"2023-04-26T17:19:54.110283+00:00","template_variable_presets":[],"tags":[]} + {"id":"jef-kge-pkx","title":"tf-TestDatadogDashListImport-local-1690910177-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":8156784494169468}],"notify_list":[],"created_at":"2023-08-01T17:16:24.050484+00:00","modified_at":"2023-08-01T17:16:24.050484+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -77,7 +77,7 @@ interactions: duration: "" - request: body: | - {"name":"tf-TestDatadogDashListImport-local-1682529591"} + {"name":"tf-TestDatadogDashListImport-local-1690910177"} form: {} headers: Accept: @@ -88,7 +88,7 @@ interactions: method: POST response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:54.538351+00:00","dashboards":null,"dashboard_count":0,"id":381158,"is_favorite":false,"modified":"2023-04-26T17:19:54.538357+00:00","name":"tf-TestDatadogDashListImport-local-1682529591","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.587364+00:00","dashboards":null,"dashboard_count":0,"id":404968,"is_favorite":false,"modified":"2023-08-01T17:16:24.587374+00:00","name":"tf-TestDatadogDashListImport-local-1690910177","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -97,18 +97,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"5uw-8vd-z53","type":"custom_timeboard"},{"id":"rxf-5db-53y","type":"custom_screenboard"}]} + {"dashboards":[{"id":"86d-jaj-ym4","type":"custom_screenboard"},{"id":"jef-kge-pkx","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/381158/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404968/dashboards method: PUT response: body: | - {"dashboards":[{"type":"custom_timeboard","id":"5uw-8vd-z53"},{"type":"custom_screenboard","id":"rxf-5db-53y"}]} + {"dashboards":[{"type":"custom_screenboard","id":"86d-jaj-ym4"},{"type":"custom_timeboard","id":"jef-kge-pkx"}]} headers: Content-Type: - application/json @@ -121,11 +121,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/381158 + url: https://api.datadoghq.com/api/v1/dashboard/86d-jaj-ym4 method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:54.538351+00:00","dashboards":null,"dashboard_count":2,"id":381158,"is_favorite":false,"modified":"2023-04-26T17:19:54.756161+00:00","name":"tf-TestDatadogDashListImport-local-1682529591","type":"manual_dashboard_list"} + {"id":"86d-jaj-ym4","title":"tf-TestDatadogDashListImport-local-1690910177-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":5130893252056120}],"notify_list":[],"created_at":"2023-08-01T17:16:23.381408+00:00","modified_at":"2023-08-01T17:16:23.381408+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -138,11 +138,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/381158/dashboards + url: https://api.datadoghq.com/api/v1/dashboard/jef-kge-pkx method: GET response: body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:54.110283+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-26T17:19:54.110283+00:00","title":"tf-TestDatadogDashListImport-local-1682529591-time","type":"custom_timeboard","id":"5uw-8vd-z53","url":"/dashboard/5uw-8vd-z53/tf-testdatadogdashlistimport-local-1682529591-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:53.363443+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-26T17:19:53.363443+00:00","title":"tf-TestDatadogDashListImport-local-1682529591-screen","type":"custom_screenboard","id":"rxf-5db-53y","url":"/dashboard/rxf-5db-53y/tf-testdatadogdashlistimport-local-1682529591-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} + {"id":"jef-kge-pkx","title":"tf-TestDatadogDashListImport-local-1690910177-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":8156784494169468}],"notify_list":[],"created_at":"2023-08-01T17:16:24.050484+00:00","modified_at":"2023-08-01T17:16:24.050484+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -155,11 +155,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/rxf-5db-53y + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404968 method: GET response: body: | - {"id":"rxf-5db-53y","title":"tf-TestDatadogDashListImport-local-1682529591-screen","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"free","url":"/dashboard/rxf-5db-53y/tf-testdatadogdashlistimport-local-1682529591-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":6324982369876596}],"notify_list":[],"created_at":"2023-04-26T17:19:53.363443+00:00","modified_at":"2023-04-26T17:19:53.363443+00:00","template_variable_presets":[],"tags":[]} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.587364+00:00","dashboards":null,"dashboard_count":2,"id":404968,"is_favorite":false,"modified":"2023-08-01T17:16:24.800582+00:00","name":"tf-TestDatadogDashListImport-local-1690910177","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -172,11 +172,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/5uw-8vd-z53 + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404968/dashboards method: GET response: body: | - {"id":"5uw-8vd-z53","title":"tf-TestDatadogDashListImport-local-1682529591-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/5uw-8vd-z53/tf-testdatadogdashlistimport-local-1682529591-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":3682516369002652}],"notify_list":[],"created_at":"2023-04-26T17:19:54.110283+00:00","modified_at":"2023-04-26T17:19:54.110283+00:00","template_variable_presets":[],"tags":[]} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.050484+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:16:24.050484+00:00","title":"tf-TestDatadogDashListImport-local-1690910177-time","type":"custom_timeboard","id":"jef-kge-pkx","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:23.381408+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:16:23.381408+00:00","title":"tf-TestDatadogDashListImport-local-1690910177-screen","type":"custom_screenboard","id":"86d-jaj-ym4","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} headers: Content-Type: - application/json @@ -189,11 +189,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/381158 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404968 method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:54.538351+00:00","dashboards":null,"dashboard_count":2,"id":381158,"is_favorite":false,"modified":"2023-04-26T17:19:54.756161+00:00","name":"tf-TestDatadogDashListImport-local-1682529591","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.587364+00:00","dashboards":null,"dashboard_count":2,"id":404968,"is_favorite":false,"modified":"2023-08-01T17:16:24.800582+00:00","name":"tf-TestDatadogDashListImport-local-1690910177","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -206,11 +206,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/381158/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404968/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:54.110283+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-26T17:19:54.110283+00:00","title":"tf-TestDatadogDashListImport-local-1682529591-time","type":"custom_timeboard","id":"5uw-8vd-z53","url":"/dashboard/5uw-8vd-z53/tf-testdatadogdashlistimport-local-1682529591-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:53.363443+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-26T17:19:53.363443+00:00","title":"tf-TestDatadogDashListImport-local-1682529591-screen","type":"custom_screenboard","id":"rxf-5db-53y","url":"/dashboard/rxf-5db-53y/tf-testdatadogdashlistimport-local-1682529591-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.050484+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:16:24.050484+00:00","title":"tf-TestDatadogDashListImport-local-1690910177-time","type":"custom_timeboard","id":"jef-kge-pkx","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:23.381408+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:16:23.381408+00:00","title":"tf-TestDatadogDashListImport-local-1690910177-screen","type":"custom_screenboard","id":"86d-jaj-ym4","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} headers: Content-Type: - application/json @@ -223,45 +223,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/381158 - method: GET - response: - body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:54.538351+00:00","dashboards":null,"dashboard_count":2,"id":381158,"is_favorite":false,"modified":"2023-04-26T17:19:54.756161+00:00","name":"tf-TestDatadogDashListImport-local-1682529591","type":"manual_dashboard_list"} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/381158/dashboards - method: GET - response: - body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:54.110283+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-26T17:19:54.110283+00:00","title":"tf-TestDatadogDashListImport-local-1682529591-time","type":"custom_timeboard","id":"5uw-8vd-z53","url":"/dashboard/5uw-8vd-z53/tf-testdatadogdashlistimport-local-1682529591-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-26T17:19:53.363443+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-26T17:19:53.363443+00:00","title":"tf-TestDatadogDashListImport-local-1682529591-screen","type":"custom_screenboard","id":"rxf-5db-53y","url":"/dashboard/rxf-5db-53y/tf-testdatadogdashlistimport-local-1682529591-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/381158 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404968 method: DELETE response: body: | - {"deleted_dashboard_list_id":381158} + {"deleted_dashboard_list_id":404968} headers: Content-Type: - application/json @@ -274,11 +240,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/5uw-8vd-z53 + url: https://api.datadoghq.com/api/v1/dashboard/jef-kge-pkx method: DELETE response: body: | - {"deleted_dashboard_id":"5uw-8vd-z53"} + {"deleted_dashboard_id":"jef-kge-pkx"} headers: Content-Type: - application/json @@ -291,11 +257,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/rxf-5db-53y + url: https://api.datadoghq.com/api/v1/dashboard/86d-jaj-ym4 method: DELETE response: body: | - {"deleted_dashboard_id":"rxf-5db-53y"} + {"deleted_dashboard_id":"86d-jaj-ym4"} headers: Content-Type: - application/json @@ -308,10 +274,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/381158 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404968 method: GET response: - body: '{"errors":["Manual Dashboard List with id 381158 not found"]}' + body: '{"errors":["Manual Dashboard List with id 404968 not found"]}' headers: Content-Type: - application/json diff --git a/datadog/tests/cassettes/TestDatadogDashListInDashboard.freeze b/datadog/tests/cassettes/TestDatadogDashListInDashboard.freeze index cc74c92519..62cb556de9 100644 --- a/datadog/tests/cassettes/TestDatadogDashListInDashboard.freeze +++ b/datadog/tests/cassettes/TestDatadogDashListInDashboard.freeze @@ -1 +1 @@ -2023-04-20T11:20:47.474315-04:00 \ No newline at end of file +2023-08-01T19:21:09.705372+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestDatadogDashListInDashboard.yaml b/datadog/tests/cassettes/TestDatadogDashListInDashboard.yaml index 225f14dfd3..a1fbb7ade4 100644 --- a/datadog/tests/cassettes/TestDatadogDashListInDashboard.yaml +++ b/datadog/tests/cassettes/TestDatadogDashListInDashboard.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"name":"tf-TestDatadogDashListInDashboard-local-1682004047"} + {"name":"tf-TestDatadogDashListInDashboard-local-1690910469"} form: {} headers: Accept: @@ -14,41 +14,7 @@ interactions: method: POST response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.823988+00:00","dashboards":null,"dashboard_count":0,"id":379595,"is_favorite":false,"modified":"2023-04-20T15:20:48.823993+00:00","name":"tf-TestDatadogDashListInDashboard-local-1682004047","type":"manual_dashboard_list"} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379595 - method: GET - response: - body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.823988+00:00","dashboards":null,"dashboard_count":0,"id":379595,"is_favorite":false,"modified":"2023-04-20T15:20:48.823993+00:00","name":"tf-TestDatadogDashListInDashboard-local-1682004047","type":"manual_dashboard_list"} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards - method: GET - response: - body: | - {"dashboards":[],"total":0} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":0,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:12.729818+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -57,7 +23,7 @@ interactions: duration: "" - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} + {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} form: {} headers: Accept: @@ -68,7 +34,7 @@ interactions: method: POST response: body: | - {"id":"njg-9wh-z4w","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":1378392403058501}],"notify_list":[],"created_at":"2023-04-20T15:20:49.466041+00:00","modified_at":"2023-04-20T15:20:49.466041+00:00","template_variable_presets":[],"tags":[]} + {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":2783692773127749}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:13.198600+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -81,11 +47,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/njg-9wh-z4w + url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s method: GET response: body: | - {"id":"njg-9wh-z4w","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":1378392403058501}],"notify_list":[],"created_at":"2023-04-20T15:20:49.466041+00:00","modified_at":"2023-04-20T15:20:49.466041+00:00","template_variable_presets":[],"tags":[]} + {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":2783692773127749}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:13.198600+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -94,18 +60,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"njg-9wh-z4w","type":"custom_timeboard"}]} + {"dashboards":[{"id":"g8e-27i-t9s","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards method: POST response: body: | - {"added_dashboards_to_list":[{"type":"custom_timeboard","id":"njg-9wh-z4w"}]} + {"added_dashboards_to_list":[{"type":"custom_timeboard","id":"g8e-27i-t9s"}]} headers: Content-Type: - application/json @@ -118,11 +84,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379595 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.823988+00:00","dashboards":null,"dashboard_count":1,"id":379595,"is_favorite":false,"modified":"2023-04-20T15:20:50.104128+00:00","name":"tf-TestDatadogDashListInDashboard-local-1682004047","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":1,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:13.766897+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -135,11 +101,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:49.466041+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-20T15:20:49.466041+00:00","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","type":"custom_timeboard","id":"njg-9wh-z4w","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:13.198600+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:13.198600+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","type":"custom_timeboard","id":"g8e-27i-t9s","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -152,11 +118,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/njg-9wh-z4w + url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s method: GET response: body: | - {"id":"njg-9wh-z4w","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":1378392403058501}],"notify_list":[],"created_at":"2023-04-20T15:20:49.466041+00:00","modified_at":"2023-04-20T15:20:49.466041+00:00","template_variable_presets":[],"tags":[]} + {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":2783692773127749}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:13.198600+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -169,11 +135,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379595 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.823988+00:00","dashboards":null,"dashboard_count":1,"id":379595,"is_favorite":false,"modified":"2023-04-20T15:20:50.104128+00:00","name":"tf-TestDatadogDashListInDashboard-local-1682004047","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":1,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:13.766897+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -186,11 +152,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/njg-9wh-z4w + url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s method: GET response: body: | - {"id":"njg-9wh-z4w","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":1378392403058501}],"notify_list":[],"created_at":"2023-04-20T15:20:49.466041+00:00","modified_at":"2023-04-20T15:20:49.466041+00:00","template_variable_presets":[],"tags":[]} + {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":2783692773127749}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:13.198600+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -203,11 +169,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:49.466041+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-20T15:20:49.466041+00:00","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","type":"custom_timeboard","id":"njg-9wh-z4w","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:13.198600+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:13.198600+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","type":"custom_timeboard","id":"g8e-27i-t9s","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -216,18 +182,18 @@ interactions: duration: "" - request: body: | - {"name":"tf-TestDatadogDashListInDashboard-local-1682004047"} + {"name":"tf-TestDatadogDashListInDashboard-local-1690910469"} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379595 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 method: PUT response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.823988+00:00","dashboards":null,"dashboard_count":1,"id":379595,"is_favorite":false,"modified":"2023-04-20T15:20:50.104128+00:00","name":"tf-TestDatadogDashListInDashboard-local-1682004047","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":1,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:13.766897+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -240,11 +206,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:49.466041+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-20T15:20:49.466041+00:00","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","type":"custom_timeboard","id":"njg-9wh-z4w","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:13.198600+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:13.198600+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","type":"custom_timeboard","id":"g8e-27i-t9s","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -253,52 +219,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"njg-9wh-z4w","type":"custom_timeboard"}]} + {"dashboards":[{"id":"g8e-27i-t9s","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards method: DELETE response: body: | - {"deleted_dashboards_from_list":[{"type":"custom_timeboard","id":"njg-9wh-z4w"}]} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379595 - method: GET - response: - body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.823988+00:00","dashboards":null,"dashboard_count":1,"id":379595,"is_favorite":false,"modified":"2023-04-20T15:20:50.104128+00:00","name":"tf-TestDatadogDashListInDashboard-local-1682004047","type":"manual_dashboard_list"} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards - method: GET - response: - body: | - {"dashboards":[],"total":0} + {"deleted_dashboards_from_list":[{"type":"custom_timeboard","id":"g8e-27i-t9s"}]} headers: Content-Type: - application/json @@ -307,18 +239,18 @@ interactions: duration: "" - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"njg-9wh-z4w","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} + {"description":"Created using the Datadog provider in Terraform","id":"g8e-27i-t9s","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/njg-9wh-z4w + url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s method: PUT response: body: | - {"id":"njg-9wh-z4w","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":8817045966074162}],"notify_list":[],"created_at":"2023-04-20T15:20:49.466041+00:00","modified_at":"2023-04-20T15:20:55.612389+00:00","template_variable_presets":[],"tags":[]} + {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":4080719494848168}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:18.599620+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -327,14 +259,14 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"njg-9wh-z4w","type":"custom_timeboard"}]} + {"dashboards":[{"id":"g8e-27i-t9s","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards method: DELETE response: body: | @@ -351,11 +283,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/njg-9wh-z4w + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 method: GET response: body: | - {"id":"njg-9wh-z4w","title":"tf-TestDatadogDashListInDashboard-local-1682004047-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/njg-9wh-z4w/tf-testdatadogdashlistindashboard-local-1682004047-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":8817045966074162}],"notify_list":[],"created_at":"2023-04-20T15:20:49.466041+00:00","modified_at":"2023-04-20T15:20:55.612389+00:00","template_variable_presets":[],"tags":[]} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":0,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:18.460493+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -368,11 +300,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379595 + url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.823988+00:00","dashboards":null,"dashboard_count":0,"id":379595,"is_favorite":false,"modified":"2023-04-20T15:20:55.208821+00:00","name":"tf-TestDatadogDashListInDashboard-local-1682004047","type":"manual_dashboard_list"} + {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":4080719494848168}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:18.599620+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -385,7 +317,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379595/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards method: GET response: body: | @@ -402,11 +334,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379595 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 method: DELETE response: body: | - {"deleted_dashboard_list_id":379595} + {"deleted_dashboard_list_id":404973} headers: Content-Type: - application/json @@ -419,11 +351,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/njg-9wh-z4w + url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s method: DELETE response: body: | - {"deleted_dashboard_id":"njg-9wh-z4w"} + {"deleted_dashboard_id":"g8e-27i-t9s"} headers: Content-Type: - application/json @@ -436,10 +368,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379595 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 method: GET response: - body: '{"errors":["Manual Dashboard List with id 379595 not found"]}' + body: '{"errors":["Manual Dashboard List with id 404973 not found"]}' headers: Content-Type: - application/json diff --git a/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.freeze b/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.freeze index 98672ef8c3..31820a7afc 100644 --- a/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.freeze +++ b/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.freeze @@ -1 +1 @@ -2023-04-20T11:20:47.474363-04:00 \ No newline at end of file +2023-08-01T19:21:09.705356+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.yaml b/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.yaml index 21f872b78b..c71b8e013d 100644 --- a/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.yaml +++ b/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047"} + {"name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469"} form: {} headers: Accept: @@ -14,7 +14,7 @@ interactions: method: POST response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.688178+00:00","dashboards":null,"dashboard_count":0,"id":379594,"is_favorite":false,"modified":"2023-04-20T15:20:48.688184+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":0,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:12.290933+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -22,41 +22,7 @@ interactions: code: 200 duration: "" - request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379594 - method: GET - response: - body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.688178+00:00","dashboards":null,"dashboard_count":0,"id":379594,"is_favorite":false,"modified":"2023-04-20T15:20:48.688184+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"manual_dashboard_list"} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards - method: GET - response: - body: | - {"dashboards":[],"total":0} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "{\n \"author_handle\":\"removed_handle\",\n \"title\":\"tf-TestDatadogDashListInDashboardJSON-local-1682004047\",\n \"description\":\"Created using the Datadog provider in Terraform\",\n \"widgets\":[\n {\n \"id\":5436370674582587,\n \"definition\":{\n \"title\":\"Widget Title\",\n \"type\":\"alert_value\",\n \"alert_id\":\"895605\",\n \"unit\":\"b\",\n \"text_align\":\"center\",\n \"precision\":3\n }\n }\n ],\n \"template_variables\":[\n \n ],\n \"layout_type\":\"ordered\",\n \"is_read_only\":true,\n \"notify_list\":[\n \n ],\n \"id\":\"5uw-bbj-xec\"\n}\n" + body: "{\n \"author_handle\":\"removed_handle\",\n \"title\":\"tf-TestDatadogDashListInDashboardJSON-local-1690910469\",\n \"description\":\"Created using the Datadog provider in Terraform\",\n \"widgets\":[\n {\n \"id\":5436370674582587,\n \"definition\":{\n \"title\":\"Widget Title\",\n \"type\":\"alert_value\",\n \"alert_id\":\"895605\",\n \"unit\":\"b\",\n \"text_align\":\"center\",\n \"precision\":3\n }\n }\n ],\n \"template_variables\":[\n \n ],\n \"layout_type\":\"ordered\",\n \"is_read_only\":true,\n \"notify_list\":[\n \n ],\n \"id\":\"5uw-bbj-xec\"\n}\n" form: {} headers: Content-Type: @@ -65,7 +31,7 @@ interactions: method: POST response: body: | - {"id":"g5i-625-f8m","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-04-20T15:20:49.388707+00:00","modified_at":"2023-04-20T15:20:49.388707+00:00"} + {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:12.517752+00:00"} headers: Content-Type: - application/json @@ -78,11 +44,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g5i-625-f8m + url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g method: GET response: body: | - {"id":"g5i-625-f8m","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-04-20T15:20:49.388707+00:00","modified_at":"2023-04-20T15:20:49.388707+00:00"} + {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:12.517752+00:00"} headers: Content-Type: - application/json @@ -91,18 +57,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"g5i-625-f8m","type":"custom_timeboard"}]} + {"dashboards":[{"id":"x22-dye-p9g","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards method: POST response: body: | - {"added_dashboards_to_list":[{"type":"custom_timeboard","id":"g5i-625-f8m"}]} + {"added_dashboards_to_list":[{"type":"custom_timeboard","id":"x22-dye-p9g"}]} headers: Content-Type: - application/json @@ -115,11 +81,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379594 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.688178+00:00","dashboards":null,"dashboard_count":1,"id":379594,"is_favorite":false,"modified":"2023-04-20T15:20:49.791434+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":1,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:13.050602+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -132,11 +98,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:49.388707+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-20T15:20:49.388707+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"custom_timeboard","id":"g5i-625-f8m","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.517752+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:12.517752+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"custom_timeboard","id":"x22-dye-p9g","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -149,11 +115,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g5i-625-f8m + url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g method: GET response: body: | - {"id":"g5i-625-f8m","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-04-20T15:20:49.388707+00:00","modified_at":"2023-04-20T15:20:49.388707+00:00"} + {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:12.517752+00:00"} headers: Content-Type: - application/json @@ -166,11 +132,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379594 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.688178+00:00","dashboards":null,"dashboard_count":1,"id":379594,"is_favorite":false,"modified":"2023-04-20T15:20:49.791434+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":1,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:13.050602+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -181,13 +147,13 @@ interactions: body: "" form: {} headers: - Accept: + Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards + url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g method: GET response: body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:49.388707+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-20T15:20:49.388707+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"custom_timeboard","id":"g5i-625-f8m","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:12.517752+00:00"} headers: Content-Type: - application/json @@ -198,13 +164,13 @@ interactions: body: "" form: {} headers: - Content-Type: + Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g5i-625-f8m + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards method: GET response: body: | - {"id":"g5i-625-f8m","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-04-20T15:20:49.388707+00:00","modified_at":"2023-04-20T15:20:49.388707+00:00"} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.517752+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:12.517752+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"custom_timeboard","id":"x22-dye-p9g","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -213,18 +179,18 @@ interactions: duration: "" - request: body: | - {"name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047"} + {"name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469"} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379594 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 method: PUT response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.688178+00:00","dashboards":null,"dashboard_count":1,"id":379594,"is_favorite":false,"modified":"2023-04-20T15:20:49.791434+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":1,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:13.050602+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -237,11 +203,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:49.388707+00:00","is_favorite":false,"is_shared":false,"modified":"2023-04-20T15:20:49.388707+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"custom_timeboard","id":"g5i-625-f8m","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.517752+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:15.857036+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"custom_timeboard","id":"x22-dye-p9g","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -249,16 +215,16 @@ interactions: code: 200 duration: "" - request: - body: '{"description":"Created using the Datadog provider in Terraform","is_read_only":true,"layout_type":"ordered","notify_list":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"}}]}' + body: '{"description":"Created using the Datadog provider in Terraform","is_read_only":true,"layout_type":"ordered","notify_list":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"}}]}' form: {} headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g5i-625-f8m + url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g method: PUT response: body: | - {"id":"g5i-625-f8m","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"},"id":8998529478712332}],"notify_list":[],"created_at":"2023-04-20T15:20:49.388707+00:00","modified_at":"2023-04-20T15:20:51.955030+00:00"} + {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"},"id":8476879790025375}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:15.857036+00:00"} headers: Content-Type: - application/json @@ -267,18 +233,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"g5i-625-f8m","type":"custom_timeboard"}]} + {"dashboards":[{"id":"x22-dye-p9g","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards method: DELETE response: body: | - {"deleted_dashboards_from_list":[{"type":"custom_timeboard","id":"g5i-625-f8m"}]} + {"deleted_dashboards_from_list":[{"type":"custom_timeboard","id":"x22-dye-p9g"}]} headers: Content-Type: - application/json @@ -287,14 +253,14 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"g5i-625-f8m","type":"custom_timeboard"}]} + {"dashboards":[{"id":"x22-dye-p9g","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards method: DELETE response: body: | @@ -311,45 +277,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379594 - method: GET - response: - body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.688178+00:00","dashboards":null,"dashboard_count":0,"id":379594,"is_favorite":false,"modified":"2023-04-20T15:20:52.187296+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"manual_dashboard_list"} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards - method: GET - response: - body: | - {"dashboards":[],"total":0} - headers: - Content-Type: - - application/json - status: 200 OK - code: 200 - duration: "" -- request: - body: "" - form: {} - headers: - Accept: - - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379594 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 method: GET response: body: | - {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-04-20T15:20:48.688178+00:00","dashboards":null,"dashboard_count":0,"id":379594,"is_favorite":false,"modified":"2023-04-20T15:20:52.187296+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":0,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:16.080417+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -362,11 +294,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g5i-625-f8m + url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g method: GET response: body: | - {"id":"g5i-625-f8m","title":"tf-TestDatadogDashListInDashboardJSON-local-1682004047","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/g5i-625-f8m/tf-testdatadogdashlistindashboardjson-local-1682004047","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"},"id":8998529478712332}],"notify_list":[],"created_at":"2023-04-20T15:20:49.388707+00:00","modified_at":"2023-04-20T15:20:51.955030+00:00"} + {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"},"id":8476879790025375}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:15.857036+00:00"} headers: Content-Type: - application/json @@ -379,7 +311,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/379594/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards method: GET response: body: | @@ -396,11 +328,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379594 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 method: DELETE response: body: | - {"deleted_dashboard_list_id":379594} + {"deleted_dashboard_list_id":404972} headers: Content-Type: - application/json @@ -413,11 +345,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g5i-625-f8m + url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g method: DELETE response: body: | - {"deleted_dashboard_id":"g5i-625-f8m"} + {"deleted_dashboard_id":"x22-dye-p9g"} headers: Content-Type: - application/json @@ -430,10 +362,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/379594 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 method: GET response: - body: '{"errors":["Manual Dashboard List with id 379594 not found"]}' + body: '{"errors":["Manual Dashboard List with id 404972 not found"]}' headers: Content-Type: - application/json From 0d2dd05685dcb799c6cfc4c2369f23929cf20175 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Wed, 2 Aug 2023 14:27:17 +0200 Subject: [PATCH 15/19] Update cassettes --- ...stAccDatadogDashboardListDatasource.freeze | 2 +- ...TestAccDatadogDashboardListDatasource.yaml | 30 ++++----- .../TestDatadogDashListImport.freeze | 2 +- .../cassettes/TestDatadogDashListImport.yaml | 66 +++++++++---------- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze index f79d0c18d2..c43c63508c 100644 --- a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze +++ b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze @@ -1 +1 @@ -2023-08-01T19:17:31.0563+02:00 \ No newline at end of file +2023-08-02T13:56:27.140224+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml index 2a99283cb2..32ffbe3a41 100644 --- a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml +++ b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965"} + {"name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387"} form: {} headers: Accept: @@ -14,7 +14,7 @@ interactions: method: POST response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -31,7 +31,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -48,7 +48,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -61,11 +61,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404942 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405157 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -78,7 +78,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404942/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405157/dashboards method: GET response: body: | @@ -99,7 +99,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -116,7 +116,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:39:27.440493+00:00","dashboards":null,"dashboard_count":0,"id":404942,"is_favorite":false,"modified":"2023-08-01T16:39:27.440499+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690907965","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -129,11 +129,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404942 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405157 method: DELETE response: body: | - {"deleted_dashboard_list_id":404942} + {"deleted_dashboard_list_id":405157} headers: Content-Type: - application/json @@ -146,10 +146,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404942 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405157 method: GET response: - body: '{"errors":["Manual Dashboard List with id 404942 not found"]}' + body: '{"errors":["Manual Dashboard List with id 405157 not found"]}' headers: Content-Type: - application/json @@ -162,10 +162,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404942 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405157 method: GET response: - body: '{"errors":["Manual Dashboard List with id 404942 not found"]}' + body: '{"errors":["Manual Dashboard List with id 405157 not found"]}' headers: Content-Type: - application/json diff --git a/datadog/tests/cassettes/TestDatadogDashListImport.freeze b/datadog/tests/cassettes/TestDatadogDashListImport.freeze index 15abb72893..066cf2ef20 100644 --- a/datadog/tests/cassettes/TestDatadogDashListImport.freeze +++ b/datadog/tests/cassettes/TestDatadogDashListImport.freeze @@ -1 +1 @@ -2023-08-01T19:17:31.035287+02:00 \ No newline at end of file +2023-08-02T14:25:39.623677+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestDatadogDashListImport.yaml b/datadog/tests/cassettes/TestDatadogDashListImport.yaml index 72b707033f..c83248e885 100644 --- a/datadog/tests/cassettes/TestDatadogDashListImport.yaml +++ b/datadog/tests/cassettes/TestDatadogDashListImport.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"","layout_type":"free","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690910177-screen","widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5}}]} + {"description":"Created using the Datadog provider in Terraform","id":"","layout_type":"free","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690979139-screen","widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5}}]} form: {} headers: Accept: @@ -14,7 +14,7 @@ interactions: method: POST response: body: | - {"id":"86d-jaj-ym4","title":"tf-TestDatadogDashListImport-local-1690910177-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":5130893252056120}],"notify_list":[],"created_at":"2023-08-01T17:16:23.381408+00:00","modified_at":"2023-08-01T17:16:23.381408+00:00","template_variable_presets":[],"tags":[]} + {"id":"gch-5nj-v4i","title":"tf-TestDatadogDashListImport-local-1690979139-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":7304670458447286}],"notify_list":[],"created_at":"2023-08-02T12:25:43.092602+00:00","modified_at":"2023-08-02T12:25:43.092602+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -27,11 +27,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/86d-jaj-ym4 + url: https://api.datadoghq.com/api/v1/dashboard/gch-5nj-v4i method: GET response: body: | - {"id":"86d-jaj-ym4","title":"tf-TestDatadogDashListImport-local-1690910177-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":5130893252056120}],"notify_list":[],"created_at":"2023-08-01T17:16:23.381408+00:00","modified_at":"2023-08-01T17:16:23.381408+00:00","template_variable_presets":[],"tags":[]} + {"id":"gch-5nj-v4i","title":"tf-TestDatadogDashListImport-local-1690979139-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":7304670458447286}],"notify_list":[],"created_at":"2023-08-02T12:25:43.092602+00:00","modified_at":"2023-08-02T12:25:43.092602+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -40,7 +40,7 @@ interactions: duration: "" - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690910177-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} + {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690979139-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} form: {} headers: Accept: @@ -51,7 +51,7 @@ interactions: method: POST response: body: | - {"id":"jef-kge-pkx","title":"tf-TestDatadogDashListImport-local-1690910177-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":8156784494169468}],"notify_list":[],"created_at":"2023-08-01T17:16:24.050484+00:00","modified_at":"2023-08-01T17:16:24.050484+00:00","template_variable_presets":[],"tags":[]} + {"id":"bcp-bht-fxn","title":"tf-TestDatadogDashListImport-local-1690979139-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":804646531605046}],"notify_list":[],"created_at":"2023-08-02T12:25:43.768790+00:00","modified_at":"2023-08-02T12:25:43.768790+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -64,11 +64,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/jef-kge-pkx + url: https://api.datadoghq.com/api/v1/dashboard/bcp-bht-fxn method: GET response: body: | - {"id":"jef-kge-pkx","title":"tf-TestDatadogDashListImport-local-1690910177-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":8156784494169468}],"notify_list":[],"created_at":"2023-08-01T17:16:24.050484+00:00","modified_at":"2023-08-01T17:16:24.050484+00:00","template_variable_presets":[],"tags":[]} + {"id":"bcp-bht-fxn","title":"tf-TestDatadogDashListImport-local-1690979139-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":804646531605046}],"notify_list":[],"created_at":"2023-08-02T12:25:43.768790+00:00","modified_at":"2023-08-02T12:25:43.768790+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -77,7 +77,7 @@ interactions: duration: "" - request: body: | - {"name":"tf-TestDatadogDashListImport-local-1690910177"} + {"name":"tf-TestDatadogDashListImport-local-1690979139"} form: {} headers: Accept: @@ -88,7 +88,7 @@ interactions: method: POST response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.587364+00:00","dashboards":null,"dashboard_count":0,"id":404968,"is_favorite":false,"modified":"2023-08-01T17:16:24.587374+00:00","name":"tf-TestDatadogDashListImport-local-1690910177","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:44.288619+00:00","dashboards":null,"dashboard_count":0,"id":405163,"is_favorite":false,"modified":"2023-08-02T12:25:44.288626+00:00","name":"tf-TestDatadogDashListImport-local-1690979139","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -97,18 +97,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"86d-jaj-ym4","type":"custom_screenboard"},{"id":"jef-kge-pkx","type":"custom_timeboard"}]} + {"dashboards":[{"id":"bcp-bht-fxn","type":"custom_timeboard"},{"id":"gch-5nj-v4i","type":"custom_screenboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404968/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405163/dashboards method: PUT response: body: | - {"dashboards":[{"type":"custom_screenboard","id":"86d-jaj-ym4"},{"type":"custom_timeboard","id":"jef-kge-pkx"}]} + {"dashboards":[{"type":"custom_timeboard","id":"bcp-bht-fxn"},{"type":"custom_screenboard","id":"gch-5nj-v4i"}]} headers: Content-Type: - application/json @@ -121,11 +121,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/86d-jaj-ym4 + url: https://api.datadoghq.com/api/v1/dashboard/gch-5nj-v4i method: GET response: body: | - {"id":"86d-jaj-ym4","title":"tf-TestDatadogDashListImport-local-1690910177-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":5130893252056120}],"notify_list":[],"created_at":"2023-08-01T17:16:23.381408+00:00","modified_at":"2023-08-01T17:16:23.381408+00:00","template_variable_presets":[],"tags":[]} + {"id":"gch-5nj-v4i","title":"tf-TestDatadogDashListImport-local-1690979139-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":7304670458447286}],"notify_list":[],"created_at":"2023-08-02T12:25:43.092602+00:00","modified_at":"2023-08-02T12:25:43.092602+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -138,11 +138,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/jef-kge-pkx + url: https://api.datadoghq.com/api/v1/dashboard/bcp-bht-fxn method: GET response: body: | - {"id":"jef-kge-pkx","title":"tf-TestDatadogDashListImport-local-1690910177-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":8156784494169468}],"notify_list":[],"created_at":"2023-08-01T17:16:24.050484+00:00","modified_at":"2023-08-01T17:16:24.050484+00:00","template_variable_presets":[],"tags":[]} + {"id":"bcp-bht-fxn","title":"tf-TestDatadogDashListImport-local-1690979139-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":804646531605046}],"notify_list":[],"created_at":"2023-08-02T12:25:43.768790+00:00","modified_at":"2023-08-02T12:25:43.768790+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -155,11 +155,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404968 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405163 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.587364+00:00","dashboards":null,"dashboard_count":2,"id":404968,"is_favorite":false,"modified":"2023-08-01T17:16:24.800582+00:00","name":"tf-TestDatadogDashListImport-local-1690910177","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:44.288619+00:00","dashboards":null,"dashboard_count":2,"id":405163,"is_favorite":false,"modified":"2023-08-02T12:25:45.269958+00:00","name":"tf-TestDatadogDashListImport-local-1690979139","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -172,11 +172,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404968/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405163/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.050484+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:16:24.050484+00:00","title":"tf-TestDatadogDashListImport-local-1690910177-time","type":"custom_timeboard","id":"jef-kge-pkx","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:23.381408+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:16:23.381408+00:00","title":"tf-TestDatadogDashListImport-local-1690910177-screen","type":"custom_screenboard","id":"86d-jaj-ym4","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:43.768790+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T12:25:43.768790+00:00","title":"tf-TestDatadogDashListImport-local-1690979139-time","type":"custom_timeboard","id":"bcp-bht-fxn","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:43.092602+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T12:25:43.092602+00:00","title":"tf-TestDatadogDashListImport-local-1690979139-screen","type":"custom_screenboard","id":"gch-5nj-v4i","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} headers: Content-Type: - application/json @@ -189,11 +189,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404968 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405163 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.587364+00:00","dashboards":null,"dashboard_count":2,"id":404968,"is_favorite":false,"modified":"2023-08-01T17:16:24.800582+00:00","name":"tf-TestDatadogDashListImport-local-1690910177","type":"manual_dashboard_list"} + {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:44.288619+00:00","dashboards":null,"dashboard_count":2,"id":405163,"is_favorite":false,"modified":"2023-08-02T12:25:45.269958+00:00","name":"tf-TestDatadogDashListImport-local-1690979139","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -206,11 +206,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404968/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405163/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:24.050484+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:16:24.050484+00:00","title":"tf-TestDatadogDashListImport-local-1690910177-time","type":"custom_timeboard","id":"jef-kge-pkx","url":"/dashboard/jef-kge-pkx/tf-testdatadogdashlistimport-local-1690910177-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:16:23.381408+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:16:23.381408+00:00","title":"tf-TestDatadogDashListImport-local-1690910177-screen","type":"custom_screenboard","id":"86d-jaj-ym4","url":"/dashboard/86d-jaj-ym4/tf-testdatadogdashlistimport-local-1690910177-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} + {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:43.768790+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T12:25:43.768790+00:00","title":"tf-TestDatadogDashListImport-local-1690979139-time","type":"custom_timeboard","id":"bcp-bht-fxn","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:43.092602+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T12:25:43.092602+00:00","title":"tf-TestDatadogDashListImport-local-1690979139-screen","type":"custom_screenboard","id":"gch-5nj-v4i","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} headers: Content-Type: - application/json @@ -223,11 +223,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404968 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405163 method: DELETE response: body: | - {"deleted_dashboard_list_id":404968} + {"deleted_dashboard_list_id":405163} headers: Content-Type: - application/json @@ -240,11 +240,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/jef-kge-pkx + url: https://api.datadoghq.com/api/v1/dashboard/bcp-bht-fxn method: DELETE response: body: | - {"deleted_dashboard_id":"jef-kge-pkx"} + {"deleted_dashboard_id":"bcp-bht-fxn"} headers: Content-Type: - application/json @@ -257,11 +257,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/86d-jaj-ym4 + url: https://api.datadoghq.com/api/v1/dashboard/gch-5nj-v4i method: DELETE response: body: | - {"deleted_dashboard_id":"86d-jaj-ym4"} + {"deleted_dashboard_id":"gch-5nj-v4i"} headers: Content-Type: - application/json @@ -274,10 +274,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404968 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405163 method: GET response: - body: '{"errors":["Manual Dashboard List with id 404968 not found"]}' + body: '{"errors":["Manual Dashboard List with id 405163 not found"]}' headers: Content-Type: - application/json From 983973a9d427f72e98993e085241dd2a774fc43c Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Wed, 2 Aug 2023 16:22:36 +0200 Subject: [PATCH 16/19] update cassettes --- ...stAccDatadogDashboardListDatasource.freeze | 2 +- ...TestAccDatadogDashboardListDatasource.yaml | 30 +++--- .../TestDatadogDashListImport.freeze | 2 +- .../cassettes/TestDatadogDashListImport.yaml | 66 ++++++------ .../TestDatadogDashListInDashboard.freeze | 2 +- .../TestDatadogDashListInDashboard.yaml | 94 ++++++++-------- .../TestDatadogDashListInDashboardJSON.freeze | 2 +- .../TestDatadogDashListInDashboardJSON.yaml | 100 +++++++++--------- 8 files changed, 149 insertions(+), 149 deletions(-) diff --git a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze index c43c63508c..5e7422e71b 100644 --- a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze +++ b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.freeze @@ -1 +1 @@ -2023-08-02T13:56:27.140224+02:00 \ No newline at end of file +2023-08-02T16:17:37.856936+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml index 32ffbe3a41..d6080ca2aa 100644 --- a/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml +++ b/datadog/tests/cassettes/TestAccDatadogDashboardListDatasource.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387"} + {"name":"tf-TestAccDatadogDashboardListDatasource-local-1690985857"} form: {} headers: Accept: @@ -14,7 +14,7 @@ interactions: method: POST response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:17:40.075467+00:00","dashboards":null,"dashboard_count":0,"id":405189,"is_favorite":false,"modified":"2023-08-02T14:17:40.075473+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690985857","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -31,7 +31,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":true,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:14:42.047870+00:00","dashboards":null,"dashboard_count":2,"id":405186,"is_favorite":false,"modified":"2023-08-02T14:16:47.477436+00:00","name":"Terraform Created Listaaaa","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:17:40.075467+00:00","dashboards":null,"dashboard_count":0,"id":405189,"is_favorite":false,"modified":"2023-08-02T14:17:40.075473+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690985857","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -48,7 +48,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":true,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:14:42.047870+00:00","dashboards":null,"dashboard_count":2,"id":405186,"is_favorite":false,"modified":"2023-08-02T14:16:47.477436+00:00","name":"Terraform Created Listaaaa","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:17:40.075467+00:00","dashboards":null,"dashboard_count":0,"id":405189,"is_favorite":false,"modified":"2023-08-02T14:17:40.075473+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690985857","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -61,11 +61,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405157 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405189 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:17:40.075467+00:00","dashboards":null,"dashboard_count":0,"id":405189,"is_favorite":false,"modified":"2023-08-02T14:17:40.075473+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690985857","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -78,7 +78,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405157/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405189/dashboards method: GET response: body: | @@ -99,7 +99,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":true,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:14:42.047870+00:00","dashboards":null,"dashboard_count":2,"id":405186,"is_favorite":false,"modified":"2023-08-02T14:16:47.477436+00:00","name":"Terraform Created Listaaaa","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:17:40.075467+00:00","dashboards":null,"dashboard_count":0,"id":405189,"is_favorite":false,"modified":"2023-08-02T14:17:40.075473+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690985857","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -116,7 +116,7 @@ interactions: method: GET response: body: | - {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":false,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T11:56:29.560309+00:00","dashboards":null,"dashboard_count":0,"id":405157,"is_favorite":false,"modified":"2023-08-02T11:56:29.560315+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690977387","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} + {"dashboard_lists":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2020-09-08T07:12:57.679027+00:00","dashboards":null,"dashboard_count":0,"id":126798,"is_favorite":true,"modified":"2020-09-09T08:48:11.523877+00:00","name":"frog's List","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:14:42.047870+00:00","dashboards":null,"dashboard_count":2,"id":405186,"is_favorite":false,"modified":"2023-08-02T14:16:47.477436+00:00","name":"Terraform Created Listaaaa","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:05:39.149344+00:00","dashboards":null,"dashboard_count":0,"id":395908,"is_favorite":false,"modified":"2023-06-24T14:05:39.149350+00:00","name":"Test-Create_a_dashboard_list_returns_OK_response-1687615538","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T13:37:05.556714+00:00","dashboards":null,"dashboard_count":0,"id":395889,"is_favorite":false,"modified":"2023-06-24T13:37:05.556720+00:00","name":"Test-Delete_a_dashboard_list_returns_OK_response-1687613825","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:01.810048+00:00","dashboards":null,"dashboard_count":0,"id":395911,"is_favorite":false,"modified":"2023-06-24T14:06:01.810054+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615561","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-06-24T14:06:45.161987+00:00","dashboards":null,"dashboard_count":0,"id":395914,"is_favorite":false,"modified":"2023-06-24T14:06:45.161993+00:00","name":"Test-Get_a_dashboard_list_returns_OK_response-1687615604","type":"manual_dashboard_list"},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:17:40.075467+00:00","dashboards":null,"dashboard_count":0,"id":405189,"is_favorite":false,"modified":"2023-08-02T14:17:40.075473+00:00","name":"tf-TestAccDatadogDashboardListDatasource-local-1690985857","type":"manual_dashboard_list"},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T16:47:50.872208+00:00","dashboards":null,"dashboard_count":2,"id":404944,"is_favorite":false,"modified":"2023-08-01T16:47:51.059822+00:00","name":"tf-TestDatadogDashListImport-local-1690908466","type":"manual_dashboard_list"}]} headers: Content-Type: - application/json @@ -129,11 +129,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405157 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405189 method: DELETE response: body: | - {"deleted_dashboard_list_id":405157} + {"deleted_dashboard_list_id":405189} headers: Content-Type: - application/json @@ -146,10 +146,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405157 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405189 method: GET response: - body: '{"errors":["Manual Dashboard List with id 405157 not found"]}' + body: '{"errors":["Manual Dashboard List with id 405189 not found"]}' headers: Content-Type: - application/json @@ -162,10 +162,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405157 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405189 method: GET response: - body: '{"errors":["Manual Dashboard List with id 405157 not found"]}' + body: '{"errors":["Manual Dashboard List with id 405189 not found"]}' headers: Content-Type: - application/json diff --git a/datadog/tests/cassettes/TestDatadogDashListImport.freeze b/datadog/tests/cassettes/TestDatadogDashListImport.freeze index 066cf2ef20..6a0cf59d58 100644 --- a/datadog/tests/cassettes/TestDatadogDashListImport.freeze +++ b/datadog/tests/cassettes/TestDatadogDashListImport.freeze @@ -1 +1 @@ -2023-08-02T14:25:39.623677+02:00 \ No newline at end of file +2023-08-02T16:18:45.926659+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestDatadogDashListImport.yaml b/datadog/tests/cassettes/TestDatadogDashListImport.yaml index c83248e885..b793f4e13b 100644 --- a/datadog/tests/cassettes/TestDatadogDashListImport.yaml +++ b/datadog/tests/cassettes/TestDatadogDashListImport.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"","layout_type":"free","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690979139-screen","widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5}}]} + {"description":"Created using the Datadog provider in Terraform","id":"","layout_type":"free","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690985925-screen","widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5}}]} form: {} headers: Accept: @@ -14,7 +14,7 @@ interactions: method: POST response: body: | - {"id":"gch-5nj-v4i","title":"tf-TestDatadogDashListImport-local-1690979139-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":7304670458447286}],"notify_list":[],"created_at":"2023-08-02T12:25:43.092602+00:00","modified_at":"2023-08-02T12:25:43.092602+00:00","template_variable_presets":[],"tags":[]} + {"id":"mge-z2m-emb","title":"tf-TestDatadogDashListImport-local-1690985925-screen","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"free","url":"/dashboard/mge-z2m-emb/tf-testdatadogdashlistimport-local-1690985925-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":6874547096050083}],"notify_list":[],"created_at":"2023-08-02T14:18:49.540979+00:00","modified_at":"2023-08-02T14:18:49.540979+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -27,11 +27,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/gch-5nj-v4i + url: https://api.datadoghq.com/api/v1/dashboard/mge-z2m-emb method: GET response: body: | - {"id":"gch-5nj-v4i","title":"tf-TestDatadogDashListImport-local-1690979139-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":7304670458447286}],"notify_list":[],"created_at":"2023-08-02T12:25:43.092602+00:00","modified_at":"2023-08-02T12:25:43.092602+00:00","template_variable_presets":[],"tags":[]} + {"id":"mge-z2m-emb","title":"tf-TestDatadogDashListImport-local-1690985925-screen","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"free","url":"/dashboard/mge-z2m-emb/tf-testdatadogdashlistimport-local-1690985925-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":6874547096050083}],"notify_list":[],"created_at":"2023-08-02T14:18:49.540979+00:00","modified_at":"2023-08-02T14:18:49.540979+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -40,7 +40,7 @@ interactions: duration: "" - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690979139-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} + {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListImport-local-1690985925-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} form: {} headers: Accept: @@ -51,7 +51,7 @@ interactions: method: POST response: body: | - {"id":"bcp-bht-fxn","title":"tf-TestDatadogDashListImport-local-1690979139-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":804646531605046}],"notify_list":[],"created_at":"2023-08-02T12:25:43.768790+00:00","modified_at":"2023-08-02T12:25:43.768790+00:00","template_variable_presets":[],"tags":[]} + {"id":"s2k-mwf-wnh","title":"tf-TestDatadogDashListImport-local-1690985925-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/s2k-mwf-wnh/tf-testdatadogdashlistimport-local-1690985925-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":5475443000876135}],"notify_list":[],"created_at":"2023-08-02T14:18:50.193734+00:00","modified_at":"2023-08-02T14:18:50.193734+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -64,11 +64,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/bcp-bht-fxn + url: https://api.datadoghq.com/api/v1/dashboard/s2k-mwf-wnh method: GET response: body: | - {"id":"bcp-bht-fxn","title":"tf-TestDatadogDashListImport-local-1690979139-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":804646531605046}],"notify_list":[],"created_at":"2023-08-02T12:25:43.768790+00:00","modified_at":"2023-08-02T12:25:43.768790+00:00","template_variable_presets":[],"tags":[]} + {"id":"s2k-mwf-wnh","title":"tf-TestDatadogDashListImport-local-1690985925-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/s2k-mwf-wnh/tf-testdatadogdashlistimport-local-1690985925-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":5475443000876135}],"notify_list":[],"created_at":"2023-08-02T14:18:50.193734+00:00","modified_at":"2023-08-02T14:18:50.193734+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -77,7 +77,7 @@ interactions: duration: "" - request: body: | - {"name":"tf-TestDatadogDashListImport-local-1690979139"} + {"name":"tf-TestDatadogDashListImport-local-1690985925"} form: {} headers: Accept: @@ -88,7 +88,7 @@ interactions: method: POST response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:44.288619+00:00","dashboards":null,"dashboard_count":0,"id":405163,"is_favorite":false,"modified":"2023-08-02T12:25:44.288626+00:00","name":"tf-TestDatadogDashListImport-local-1690979139","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:18:50.592930+00:00","dashboards":null,"dashboard_count":0,"id":405192,"is_favorite":false,"modified":"2023-08-02T14:18:50.592937+00:00","name":"tf-TestDatadogDashListImport-local-1690985925","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -97,18 +97,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"bcp-bht-fxn","type":"custom_timeboard"},{"id":"gch-5nj-v4i","type":"custom_screenboard"}]} + {"dashboards":[{"id":"mge-z2m-emb","type":"custom_screenboard"},{"id":"s2k-mwf-wnh","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405163/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405192/dashboards method: PUT response: body: | - {"dashboards":[{"type":"custom_timeboard","id":"bcp-bht-fxn"},{"type":"custom_screenboard","id":"gch-5nj-v4i"}]} + {"dashboards":[{"type":"custom_screenboard","id":"mge-z2m-emb"},{"type":"custom_timeboard","id":"s2k-mwf-wnh"}]} headers: Content-Type: - application/json @@ -121,11 +121,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/gch-5nj-v4i + url: https://api.datadoghq.com/api/v1/dashboard/mge-z2m-emb method: GET response: body: | - {"id":"gch-5nj-v4i","title":"tf-TestDatadogDashListImport-local-1690979139-screen","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"free","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":7304670458447286}],"notify_list":[],"created_at":"2023-08-02T12:25:43.092602+00:00","modified_at":"2023-08-02T12:25:43.092602+00:00","template_variable_presets":[],"tags":[]} + {"id":"mge-z2m-emb","title":"tf-TestDatadogDashListImport-local-1690985925-screen","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"free","url":"/dashboard/mge-z2m-emb/tf-testdatadogdashlistimport-local-1690985925-screen","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"event_size":"l","query":"*","time":{"live_span":"1h"},"title":"Widget Title","title_align":"left","title_size":"16","type":"event_stream"},"layout":{"height":43,"width":32,"x":5,"y":5},"id":6874547096050083}],"notify_list":[],"created_at":"2023-08-02T14:18:49.540979+00:00","modified_at":"2023-08-02T14:18:49.540979+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -138,11 +138,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/bcp-bht-fxn + url: https://api.datadoghq.com/api/v1/dashboard/s2k-mwf-wnh method: GET response: body: | - {"id":"bcp-bht-fxn","title":"tf-TestDatadogDashListImport-local-1690979139-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":804646531605046}],"notify_list":[],"created_at":"2023-08-02T12:25:43.768790+00:00","modified_at":"2023-08-02T12:25:43.768790+00:00","template_variable_presets":[],"tags":[]} + {"id":"s2k-mwf-wnh","title":"tf-TestDatadogDashListImport-local-1690985925-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/s2k-mwf-wnh/tf-testdatadogdashlistimport-local-1690985925-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":5475443000876135}],"notify_list":[],"created_at":"2023-08-02T14:18:50.193734+00:00","modified_at":"2023-08-02T14:18:50.193734+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -155,11 +155,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405163 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405192 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:44.288619+00:00","dashboards":null,"dashboard_count":2,"id":405163,"is_favorite":false,"modified":"2023-08-02T12:25:45.269958+00:00","name":"tf-TestDatadogDashListImport-local-1690979139","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:18:50.592930+00:00","dashboards":null,"dashboard_count":2,"id":405192,"is_favorite":false,"modified":"2023-08-02T14:18:50.815731+00:00","name":"tf-TestDatadogDashListImport-local-1690985925","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -172,11 +172,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405163/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405192/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:43.768790+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T12:25:43.768790+00:00","title":"tf-TestDatadogDashListImport-local-1690979139-time","type":"custom_timeboard","id":"bcp-bht-fxn","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:43.092602+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T12:25:43.092602+00:00","title":"tf-TestDatadogDashListImport-local-1690979139-screen","type":"custom_screenboard","id":"gch-5nj-v4i","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} + {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:18:50.193734+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:18:50.193734+00:00","title":"tf-TestDatadogDashListImport-local-1690985925-time","type":"custom_timeboard","id":"s2k-mwf-wnh","url":"/dashboard/s2k-mwf-wnh/tf-testdatadogdashlistimport-local-1690985925-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:18:49.540979+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:18:49.540979+00:00","title":"tf-TestDatadogDashListImport-local-1690985925-screen","type":"custom_screenboard","id":"mge-z2m-emb","url":"/dashboard/mge-z2m-emb/tf-testdatadogdashlistimport-local-1690985925-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} headers: Content-Type: - application/json @@ -189,11 +189,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405163 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405192 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:44.288619+00:00","dashboards":null,"dashboard_count":2,"id":405163,"is_favorite":false,"modified":"2023-08-02T12:25:45.269958+00:00","name":"tf-TestDatadogDashListImport-local-1690979139","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:18:50.592930+00:00","dashboards":null,"dashboard_count":2,"id":405192,"is_favorite":false,"modified":"2023-08-02T14:18:50.815731+00:00","name":"tf-TestDatadogDashListImport-local-1690985925","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -206,11 +206,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405163/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405192/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:43.768790+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T12:25:43.768790+00:00","title":"tf-TestDatadogDashListImport-local-1690979139-time","type":"custom_timeboard","id":"bcp-bht-fxn","url":"/dashboard/bcp-bht-fxn/tf-testdatadogdashlistimport-local-1690979139-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-02T12:25:43.092602+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T12:25:43.092602+00:00","title":"tf-TestDatadogDashListImport-local-1690979139-screen","type":"custom_screenboard","id":"gch-5nj-v4i","url":"/dashboard/gch-5nj-v4i/tf-testdatadogdashlistimport-local-1690979139-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} + {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:18:50.193734+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:18:50.193734+00:00","title":"tf-TestDatadogDashListImport-local-1690985925-time","type":"custom_timeboard","id":"s2k-mwf-wnh","url":"/dashboard/s2k-mwf-wnh/tf-testdatadogdashlistimport-local-1690985925-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0},{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:18:49.540979+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:18:49.540979+00:00","title":"tf-TestDatadogDashListImport-local-1690985925-screen","type":"custom_screenboard","id":"mge-z2m-emb","url":"/dashboard/mge-z2m-emb/tf-testdatadogdashlistimport-local-1690985925-screen","is_read_only":false,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":2} headers: Content-Type: - application/json @@ -223,11 +223,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405163 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405192 method: DELETE response: body: | - {"deleted_dashboard_list_id":405163} + {"deleted_dashboard_list_id":405192} headers: Content-Type: - application/json @@ -240,11 +240,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/bcp-bht-fxn + url: https://api.datadoghq.com/api/v1/dashboard/s2k-mwf-wnh method: DELETE response: body: | - {"deleted_dashboard_id":"bcp-bht-fxn"} + {"deleted_dashboard_id":"s2k-mwf-wnh"} headers: Content-Type: - application/json @@ -257,11 +257,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/gch-5nj-v4i + url: https://api.datadoghq.com/api/v1/dashboard/mge-z2m-emb method: DELETE response: body: | - {"deleted_dashboard_id":"gch-5nj-v4i"} + {"deleted_dashboard_id":"mge-z2m-emb"} headers: Content-Type: - application/json @@ -274,10 +274,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405163 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405192 method: GET response: - body: '{"errors":["Manual Dashboard List with id 405163 not found"]}' + body: '{"errors":["Manual Dashboard List with id 405192 not found"]}' headers: Content-Type: - application/json diff --git a/datadog/tests/cassettes/TestDatadogDashListInDashboard.freeze b/datadog/tests/cassettes/TestDatadogDashListInDashboard.freeze index 62cb556de9..a67bfe3819 100644 --- a/datadog/tests/cassettes/TestDatadogDashListInDashboard.freeze +++ b/datadog/tests/cassettes/TestDatadogDashListInDashboard.freeze @@ -1 +1 @@ -2023-08-01T19:21:09.705372+02:00 \ No newline at end of file +2023-08-02T16:19:22.578935+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestDatadogDashListInDashboard.yaml b/datadog/tests/cassettes/TestDatadogDashListInDashboard.yaml index a1fbb7ade4..8362b44c98 100644 --- a/datadog/tests/cassettes/TestDatadogDashListInDashboard.yaml +++ b/datadog/tests/cassettes/TestDatadogDashListInDashboard.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"name":"tf-TestDatadogDashListInDashboard-local-1690910469"} + {"name":"tf-TestDatadogDashListInDashboard-local-1690985962"} form: {} headers: Accept: @@ -14,7 +14,7 @@ interactions: method: POST response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":0,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:12.729818+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.463839+00:00","dashboards":null,"dashboard_count":0,"id":405195,"is_favorite":false,"modified":"2023-08-02T14:19:25.463846+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -23,7 +23,7 @@ interactions: duration: "" - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} + {"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} form: {} headers: Accept: @@ -34,7 +34,7 @@ interactions: method: POST response: body: | - {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":2783692773127749}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:13.198600+00:00","template_variable_presets":[],"tags":[]} + {"id":"vyb-7iw-xtr","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":4386419645773892}],"notify_list":[],"created_at":"2023-08-02T14:19:25.920060+00:00","modified_at":"2023-08-02T14:19:25.920060+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -47,11 +47,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s + url: https://api.datadoghq.com/api/v1/dashboard/vyb-7iw-xtr method: GET response: body: | - {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":2783692773127749}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:13.198600+00:00","template_variable_presets":[],"tags":[]} + {"id":"vyb-7iw-xtr","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":4386419645773892}],"notify_list":[],"created_at":"2023-08-02T14:19:25.920060+00:00","modified_at":"2023-08-02T14:19:25.920060+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -60,18 +60,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"g8e-27i-t9s","type":"custom_timeboard"}]} + {"dashboards":[{"id":"vyb-7iw-xtr","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405195/dashboards method: POST response: body: | - {"added_dashboards_to_list":[{"type":"custom_timeboard","id":"g8e-27i-t9s"}]} + {"added_dashboards_to_list":[{"type":"custom_timeboard","id":"vyb-7iw-xtr"}]} headers: Content-Type: - application/json @@ -84,11 +84,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405195 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":1,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:13.766897+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.463839+00:00","dashboards":null,"dashboard_count":1,"id":405195,"is_favorite":false,"modified":"2023-08-02T14:19:26.353004+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -101,11 +101,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405195/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:13.198600+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:13.198600+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","type":"custom_timeboard","id":"g8e-27i-t9s","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.920060+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:19:25.920060+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","type":"custom_timeboard","id":"vyb-7iw-xtr","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -118,11 +118,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s + url: https://api.datadoghq.com/api/v1/dashboard/vyb-7iw-xtr method: GET response: body: | - {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":2783692773127749}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:13.198600+00:00","template_variable_presets":[],"tags":[]} + {"id":"vyb-7iw-xtr","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":4386419645773892}],"notify_list":[],"created_at":"2023-08-02T14:19:25.920060+00:00","modified_at":"2023-08-02T14:19:25.920060+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -135,11 +135,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405195 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":1,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:13.766897+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.463839+00:00","dashboards":null,"dashboard_count":1,"id":405195,"is_favorite":false,"modified":"2023-08-02T14:19:26.353004+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -152,11 +152,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s + url: https://api.datadoghq.com/api/v1/dashboard/vyb-7iw-xtr method: GET response: body: | - {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":2783692773127749}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:13.198600+00:00","template_variable_presets":[],"tags":[]} + {"id":"vyb-7iw-xtr","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":4386419645773892}],"notify_list":[],"created_at":"2023-08-02T14:19:25.920060+00:00","modified_at":"2023-08-02T14:19:25.920060+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -169,11 +169,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405195/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:13.198600+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:13.198600+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","type":"custom_timeboard","id":"g8e-27i-t9s","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.920060+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:19:25.920060+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","type":"custom_timeboard","id":"vyb-7iw-xtr","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -182,18 +182,18 @@ interactions: duration: "" - request: body: | - {"name":"tf-TestDatadogDashListInDashboard-local-1690910469"} + {"name":"tf-TestDatadogDashListInDashboard-local-1690985962"} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405195 method: PUT response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":1,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:13.766897+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.463839+00:00","dashboards":null,"dashboard_count":1,"id":405195,"is_favorite":false,"modified":"2023-08-02T14:19:26.353004+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -206,11 +206,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405195/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:13.198600+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:13.198600+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","type":"custom_timeboard","id":"g8e-27i-t9s","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.920060+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:19:25.920060+00:00","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","type":"custom_timeboard","id":"vyb-7iw-xtr","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"tags":[],"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -219,18 +219,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"g8e-27i-t9s","type":"custom_timeboard"}]} + {"description":"Created using the Datadog provider in Terraform","id":"vyb-7iw-xtr","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards - method: DELETE + url: https://api.datadoghq.com/api/v1/dashboard/vyb-7iw-xtr + method: PUT response: body: | - {"deleted_dashboards_from_list":[{"type":"custom_timeboard","id":"g8e-27i-t9s"}]} + {"id":"vyb-7iw-xtr","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":399685128705513}],"notify_list":[],"created_at":"2023-08-02T14:19:25.920060+00:00","modified_at":"2023-08-02T14:19:30.947073+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -239,18 +239,18 @@ interactions: duration: "" - request: body: | - {"description":"Created using the Datadog provider in Terraform","id":"g8e-27i-t9s","is_read_only":true,"layout_type":"ordered","notify_list":[],"tags":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"}}]} + {"dashboards":[{"id":"vyb-7iw-xtr","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s - method: PUT + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405195/dashboards + method: DELETE response: body: | - {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":4080719494848168}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:18.599620+00:00","template_variable_presets":[],"tags":[]} + {"deleted_dashboards_from_list":[{"type":"custom_timeboard","id":"vyb-7iw-xtr"}]} headers: Content-Type: - application/json @@ -259,14 +259,14 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"g8e-27i-t9s","type":"custom_timeboard"}]} + {"dashboards":[{"id":"vyb-7iw-xtr","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405195/dashboards method: DELETE response: body: | @@ -283,11 +283,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405195 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.729812+00:00","dashboards":null,"dashboard_count":0,"id":404973,"is_favorite":false,"modified":"2023-08-01T17:21:18.460493+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.463839+00:00","dashboards":null,"dashboard_count":0,"id":405195,"is_favorite":false,"modified":"2023-08-02T14:19:31.092084+00:00","name":"tf-TestDatadogDashListInDashboard-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -300,11 +300,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s + url: https://api.datadoghq.com/api/v1/dashboard/vyb-7iw-xtr method: GET response: body: | - {"id":"g8e-27i-t9s","title":"tf-TestDatadogDashListInDashboard-local-1690910469-time","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/g8e-27i-t9s/tf-testdatadogdashlistindashboard-local-1690910469-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":4080719494848168}],"notify_list":[],"created_at":"2023-08-01T17:21:13.198600+00:00","modified_at":"2023-08-01T17:21:18.599620+00:00","template_variable_presets":[],"tags":[]} + {"id":"vyb-7iw-xtr","title":"tf-TestDatadogDashListInDashboard-local-1690985962-time","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/vyb-7iw-xtr/tf-testdatadogdashlistindashboard-local-1690985962-time","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"1234","time":{"live_span":"1h"},"title":"Widget Title","type":"alert_graph","viz_type":"timeseries"},"id":399685128705513}],"notify_list":[],"created_at":"2023-08-02T14:19:25.920060+00:00","modified_at":"2023-08-02T14:19:30.947073+00:00","template_variable_presets":[],"tags":[]} headers: Content-Type: - application/json @@ -317,7 +317,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404973/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405195/dashboards method: GET response: body: | @@ -334,11 +334,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405195 method: DELETE response: body: | - {"deleted_dashboard_list_id":404973} + {"deleted_dashboard_list_id":405195} headers: Content-Type: - application/json @@ -351,11 +351,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/g8e-27i-t9s + url: https://api.datadoghq.com/api/v1/dashboard/vyb-7iw-xtr method: DELETE response: body: | - {"deleted_dashboard_id":"g8e-27i-t9s"} + {"deleted_dashboard_id":"vyb-7iw-xtr"} headers: Content-Type: - application/json @@ -368,10 +368,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404973 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405195 method: GET response: - body: '{"errors":["Manual Dashboard List with id 404973 not found"]}' + body: '{"errors":["Manual Dashboard List with id 405195 not found"]}' headers: Content-Type: - application/json diff --git a/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.freeze b/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.freeze index 31820a7afc..4664d1eea7 100644 --- a/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.freeze +++ b/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.freeze @@ -1 +1 @@ -2023-08-01T19:21:09.705356+02:00 \ No newline at end of file +2023-08-02T16:19:22.578943+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.yaml b/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.yaml index c71b8e013d..3ee8a2819d 100644 --- a/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.yaml +++ b/datadog/tests/cassettes/TestDatadogDashListInDashboardJSON.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469"} + {"name":"tf-TestDatadogDashListInDashboardJSON-local-1690985962"} form: {} headers: Accept: @@ -14,7 +14,7 @@ interactions: method: POST response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":0,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:12.290933+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.005013+00:00","dashboards":null,"dashboard_count":0,"id":405194,"is_favorite":false,"modified":"2023-08-02T14:19:25.005019+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -22,7 +22,7 @@ interactions: code: 200 duration: "" - request: - body: "{\n \"author_handle\":\"removed_handle\",\n \"title\":\"tf-TestDatadogDashListInDashboardJSON-local-1690910469\",\n \"description\":\"Created using the Datadog provider in Terraform\",\n \"widgets\":[\n {\n \"id\":5436370674582587,\n \"definition\":{\n \"title\":\"Widget Title\",\n \"type\":\"alert_value\",\n \"alert_id\":\"895605\",\n \"unit\":\"b\",\n \"text_align\":\"center\",\n \"precision\":3\n }\n }\n ],\n \"template_variables\":[\n \n ],\n \"layout_type\":\"ordered\",\n \"is_read_only\":true,\n \"notify_list\":[\n \n ],\n \"id\":\"5uw-bbj-xec\"\n}\n" + body: "{\n \"author_handle\":\"removed_handle\",\n \"title\":\"tf-TestDatadogDashListInDashboardJSON-local-1690985962\",\n \"description\":\"Created using the Datadog provider in Terraform\",\n \"widgets\":[\n {\n \"id\":5436370674582587,\n \"definition\":{\n \"title\":\"Widget Title\",\n \"type\":\"alert_value\",\n \"alert_id\":\"895605\",\n \"unit\":\"b\",\n \"text_align\":\"center\",\n \"precision\":3\n }\n }\n ],\n \"template_variables\":[\n \n ],\n \"layout_type\":\"ordered\",\n \"is_read_only\":true,\n \"notify_list\":[\n \n ],\n \"id\":\"5uw-bbj-xec\"\n}\n" form: {} headers: Content-Type: @@ -31,7 +31,7 @@ interactions: method: POST response: body: | - {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:12.517752+00:00"} + {"id":"xuj-y29-kzb","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-02T14:19:25.230996+00:00","modified_at":"2023-08-02T14:19:25.230996+00:00"} headers: Content-Type: - application/json @@ -44,11 +44,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g + url: https://api.datadoghq.com/api/v1/dashboard/xuj-y29-kzb method: GET response: body: | - {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:12.517752+00:00"} + {"id":"xuj-y29-kzb","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-02T14:19:25.230996+00:00","modified_at":"2023-08-02T14:19:25.230996+00:00"} headers: Content-Type: - application/json @@ -57,18 +57,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"x22-dye-p9g","type":"custom_timeboard"}]} + {"dashboards":[{"id":"xuj-y29-kzb","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405194/dashboards method: POST response: body: | - {"added_dashboards_to_list":[{"type":"custom_timeboard","id":"x22-dye-p9g"}]} + {"added_dashboards_to_list":[{"type":"custom_timeboard","id":"xuj-y29-kzb"}]} headers: Content-Type: - application/json @@ -81,11 +81,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405194 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":1,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:13.050602+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.005013+00:00","dashboards":null,"dashboard_count":1,"id":405194,"is_favorite":false,"modified":"2023-08-02T14:19:25.772211+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -98,11 +98,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405194/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.517752+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:12.517752+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"custom_timeboard","id":"x22-dye-p9g","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.230996+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:19:25.230996+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","type":"custom_timeboard","id":"xuj-y29-kzb","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -115,11 +115,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g + url: https://api.datadoghq.com/api/v1/dashboard/xuj-y29-kzb method: GET response: body: | - {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:12.517752+00:00"} + {"id":"xuj-y29-kzb","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-02T14:19:25.230996+00:00","modified_at":"2023-08-02T14:19:25.230996+00:00"} headers: Content-Type: - application/json @@ -132,11 +132,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405194 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":1,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:13.050602+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.005013+00:00","dashboards":null,"dashboard_count":1,"id":405194,"is_favorite":false,"modified":"2023-08-02T14:19:25.772211+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -149,11 +149,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g + url: https://api.datadoghq.com/api/v1/dashboard/xuj-y29-kzb method: GET response: body: | - {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:12.517752+00:00"} + {"id":"xuj-y29-kzb","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"template_variables":[],"widgets":[{"id":5436370674582587,"definition":{"title":"Widget Title","type":"alert_value","alert_id":"895605","unit":"b","text_align":"center","precision":3}}],"notify_list":[],"created_at":"2023-08-02T14:19:25.230996+00:00","modified_at":"2023-08-02T14:19:25.230996+00:00"} headers: Content-Type: - application/json @@ -166,11 +166,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405194/dashboards method: GET response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.517752+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:12.517752+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"custom_timeboard","id":"x22-dye-p9g","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.230996+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:19:25.230996+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","type":"custom_timeboard","id":"xuj-y29-kzb","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -179,18 +179,18 @@ interactions: duration: "" - request: body: | - {"name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469"} + {"name":"tf-TestDatadogDashListInDashboardJSON-local-1690985962"} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405194 method: PUT response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":1,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:13.050602+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.005013+00:00","dashboards":null,"dashboard_count":1,"id":405194,"is_favorite":false,"modified":"2023-08-02T14:19:25.772211+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -198,16 +198,16 @@ interactions: code: 200 duration: "" - request: - body: "" + body: '{"description":"Created using the Datadog provider in Terraform","is_read_only":true,"layout_type":"ordered","notify_list":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"}}]}' form: {} headers: - Accept: + Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards - method: GET + url: https://api.datadoghq.com/api/v1/dashboard/xuj-y29-kzb + method: PUT response: body: | - {"dashboards":[{"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.517752+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-01T17:21:15.857036+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"custom_timeboard","id":"x22-dye-p9g","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} + {"id":"xuj-y29-kzb","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"},"id":5631196553121349}],"notify_list":[],"created_at":"2023-08-02T14:19:25.230996+00:00","modified_at":"2023-08-02T14:19:28.591418+00:00"} headers: Content-Type: - application/json @@ -215,16 +215,16 @@ interactions: code: 200 duration: "" - request: - body: '{"description":"Created using the Datadog provider in Terraform","is_read_only":true,"layout_type":"ordered","notify_list":[],"template_variables":[],"title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"}}]}' + body: "" form: {} headers: - Content-Type: + Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g - method: PUT + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405194/dashboards + method: GET response: body: | - {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"},"id":8476879790025375}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:15.857036+00:00"} + {"dashboards":[{"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.230996+00:00","is_favorite":false,"is_shared":false,"modified":"2023-08-02T14:19:28.591418+00:00","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","type":"custom_timeboard","id":"xuj-y29-kzb","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"tags":null,"icon":null,"integration_id":null,"popularity":0}],"total":1} headers: Content-Type: - application/json @@ -233,18 +233,18 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"x22-dye-p9g","type":"custom_timeboard"}]} + {"dashboards":[{"id":"xuj-y29-kzb","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405194/dashboards method: DELETE response: body: | - {"deleted_dashboards_from_list":[{"type":"custom_timeboard","id":"x22-dye-p9g"}]} + {"deleted_dashboards_from_list":[{"type":"custom_timeboard","id":"xuj-y29-kzb"}]} headers: Content-Type: - application/json @@ -253,14 +253,14 @@ interactions: duration: "" - request: body: | - {"dashboards":[{"id":"x22-dye-p9g","type":"custom_timeboard"}]} + {"dashboards":[{"id":"xuj-y29-kzb","type":"custom_timeboard"}]} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405194/dashboards method: DELETE response: body: | @@ -277,11 +277,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405194 method: GET response: body: | - {"author":{"name":"Hanting Zhang","handle":"hanting.zhang@datadoghq.com"},"created":"2023-08-01T17:21:12.290927+00:00","dashboards":null,"dashboard_count":0,"id":404972,"is_favorite":false,"modified":"2023-08-01T17:21:16.080417+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","type":"manual_dashboard_list"} + {"author":{"name":null,"handle":"frog@datadoghq.com"},"created":"2023-08-02T14:19:25.005013+00:00","dashboards":null,"dashboard_count":0,"id":405194,"is_favorite":false,"modified":"2023-08-02T14:19:28.820985+00:00","name":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","type":"manual_dashboard_list"} headers: Content-Type: - application/json @@ -294,11 +294,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g + url: https://api.datadoghq.com/api/v1/dashboard/xuj-y29-kzb method: GET response: body: | - {"id":"x22-dye-p9g","title":"tf-TestDatadogDashListInDashboardJSON-local-1690910469","description":"Created using the Datadog provider in Terraform","author_handle":"hanting.zhang@datadoghq.com","author_name":"Hanting Zhang","layout_type":"ordered","url":"/dashboard/x22-dye-p9g/tf-testdatadogdashlistindashboardjson-local-1690910469","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"},"id":8476879790025375}],"notify_list":[],"created_at":"2023-08-01T17:21:12.517752+00:00","modified_at":"2023-08-01T17:21:15.857036+00:00"} + {"id":"xuj-y29-kzb","title":"tf-TestDatadogDashListInDashboardJSON-local-1690985962","description":"Created using the Datadog provider in Terraform","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/xuj-y29-kzb/tf-testdatadogdashlistindashboardjson-local-1690985962","is_read_only":true,"template_variables":[],"widgets":[{"definition":{"alert_id":"895605","precision":3,"text_align":"center","title":"Widget Title","type":"alert_value","unit":"b"},"id":5631196553121349}],"notify_list":[],"created_at":"2023-08-02T14:19:25.230996+00:00","modified_at":"2023-08-02T14:19:28.591418+00:00"} headers: Content-Type: - application/json @@ -311,7 +311,7 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/404972/dashboards + url: https://api.datadoghq.com/api/v2/dashboard/lists/manual/405194/dashboards method: GET response: body: | @@ -328,11 +328,11 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405194 method: DELETE response: body: | - {"deleted_dashboard_list_id":404972} + {"deleted_dashboard_list_id":405194} headers: Content-Type: - application/json @@ -345,11 +345,11 @@ interactions: headers: Content-Type: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/x22-dye-p9g + url: https://api.datadoghq.com/api/v1/dashboard/xuj-y29-kzb method: DELETE response: body: | - {"deleted_dashboard_id":"x22-dye-p9g"} + {"deleted_dashboard_id":"xuj-y29-kzb"} headers: Content-Type: - application/json @@ -362,10 +362,10 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/404972 + url: https://api.datadoghq.com/api/v1/dashboard/lists/manual/405194 method: GET response: - body: '{"errors":["Manual Dashboard List with id 404972 not found"]}' + body: '{"errors":["Manual Dashboard List with id 405194 not found"]}' headers: Content-Type: - application/json From d3f0764acbe2c6886dc92012f31f9ac2e91a26f8 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Wed, 2 Aug 2023 20:18:06 +0200 Subject: [PATCH 17/19] update update_state --- .../resource_datadog_dashboard_list.go | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/datadog/fwprovider/resource_datadog_dashboard_list.go b/datadog/fwprovider/resource_datadog_dashboard_list.go index 53eb285bef..f51376733d 100644 --- a/datadog/fwprovider/resource_datadog_dashboard_list.go +++ b/datadog/fwprovider/resource_datadog_dashboard_list.go @@ -33,12 +33,12 @@ type dashboardListResource struct { type dashboardListResourceModel struct { ID types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` - DashItem []*DashItemModel `tfsdk:"dash_item"` + DashItem []*dashItemModel `tfsdk:"dash_item"` } -type DashItemModel struct { - Type types.String `tfsdk:"type"` - Dash_id types.String `tfsdk:"dash_id"` +type dashItemModel struct { + Type types.String `tfsdk:"type"` + DashId types.String `tfsdk:"dash_id"` } func (r *dashboardListResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { @@ -268,7 +268,7 @@ func buildDatadogDashboardListUpdateItemsV2(state *dashboardListResourceModel) ( dashboardListV2ItemsArr := make([]datadogV2.DashboardListItemRequest, 0) for _, dashItem := range state.DashItem { dashType := datadogV2.DashboardType(dashItem.Type.ValueString()) - dashItem := datadogV2.NewDashboardListItemRequest(dashItem.Dash_id.ValueString(), dashType) + dashItem := datadogV2.NewDashboardListItemRequest(dashItem.DashId.ValueString(), dashType) dashboardListV2ItemsArr = append(dashboardListV2ItemsArr, *dashItem) } dashboardListV2Items := datadogV2.NewDashboardListUpdateItemsRequest() @@ -290,21 +290,41 @@ func buildDatadogDashboardListDeleteItemsV2(dashboardListItems *datadogV2.Dashbo } func (r *dashboardListResource) updateStateFromResponse(ctx context.Context, state *dashboardListResourceModel, dashboards []datadogV2.DashboardListItemResponse) { - state.DashItem = []*DashItemModel{} + dashItemList := []*dashItemModel{} for _, dashboard := range dashboards { - dashboardItem := DashItemModel{} - dashboardItem.Dash_id = types.StringValue(dashboard.GetId()) - dashboardItem.Type = types.StringValue(string(dashboard.GetType())) - state.DashItem = append(state.DashItem, &dashboardItem) + dashboardItem := dashItemModel{} + dashboardItem.DashId = types.StringValue(dashboard.GetId()) + found := false + for _, dashItem := range state.DashItem { + if dashItem.DashId.ValueString() == dashboard.GetId() { + found = true + dashboardItem.Type = dashItem.Type + } + } + if !found { + dashboardItem.Type = types.StringValue(string(dashboard.GetType())) + } + dashItemList = append(dashItemList, &dashboardItem) } + state.DashItem = dashItemList } func (r *dashboardListResource) updateStateFromDashItem(ctx context.Context, state *dashboardListResourceModel, dashboards []datadogV2.DashboardListItem) { - state.DashItem = []*DashItemModel{} + dashItemList := []*dashItemModel{} for _, dashboard := range dashboards { - dashboardItem := DashItemModel{} - dashboardItem.Dash_id = types.StringValue(dashboard.GetId()) - dashboardItem.Type = types.StringValue(string(dashboard.GetType())) - state.DashItem = append(state.DashItem, &dashboardItem) + dashboardItem := dashItemModel{} + dashboardItem.DashId = types.StringValue(dashboard.GetId()) + found := false + for _, dashItem := range state.DashItem { + if dashItem.DashId.ValueString() == dashboard.GetId() { + found = true + dashboardItem.Type = dashItem.Type + } + } + if !found { + dashboardItem.Type = types.StringValue(string(dashboard.GetType())) + } + dashItemList = append(dashItemList, &dashboardItem) } + state.DashItem = dashItemList } From a22c47bedb6c87f2f3a38fd7396db9359e59fc29 Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Fri, 4 Aug 2023 12:03:04 +0200 Subject: [PATCH 18/19] remove manually listed dashboard types --- datadog/fwprovider/resource_datadog_dashboard_list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog/fwprovider/resource_datadog_dashboard_list.go b/datadog/fwprovider/resource_datadog_dashboard_list.go index f51376733d..4c18af5539 100644 --- a/datadog/fwprovider/resource_datadog_dashboard_list.go +++ b/datadog/fwprovider/resource_datadog_dashboard_list.go @@ -72,7 +72,7 @@ func (r *dashboardListResource) Schema(ctx context.Context, req resource.SchemaR NestedObject: schema.NestedBlockObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "The type of this dashboard. Valid values are `custom_timeboard`, `custom_screenboard`, `integration_screenboard`, `integration_timeboard`, `host_timeboard`.", + Description: "The type of this dashboard. ", Required: true, Validators: []validator.String{ validators.NewEnumValidator[validator.String](datadogV2.NewDashboardTypeFromValue), From 57aca639f200bd2fbcd0db18b46b4a62ff00edae Mon Sep 17 00:00:00 2001 From: HantingZhang2 Date: Fri, 4 Aug 2023 12:04:11 +0200 Subject: [PATCH 19/19] remove space --- datadog/fwprovider/resource_datadog_dashboard_list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog/fwprovider/resource_datadog_dashboard_list.go b/datadog/fwprovider/resource_datadog_dashboard_list.go index 4c18af5539..17961630b2 100644 --- a/datadog/fwprovider/resource_datadog_dashboard_list.go +++ b/datadog/fwprovider/resource_datadog_dashboard_list.go @@ -72,7 +72,7 @@ func (r *dashboardListResource) Schema(ctx context.Context, req resource.SchemaR NestedObject: schema.NestedBlockObject{ Attributes: map[string]schema.Attribute{ "type": schema.StringAttribute{ - Description: "The type of this dashboard. ", + Description: "The type of this dashboard.", Required: true, Validators: []validator.String{ validators.NewEnumValidator[validator.String](datadogV2.NewDashboardTypeFromValue),