diff --git a/access/resource_sql_permissions_test.go b/access/resource_sql_permissions_test.go index f09dec2aba..01a270c764 100644 --- a/access/resource_sql_permissions_test.go +++ b/access/resource_sql_permissions_test.go @@ -184,7 +184,7 @@ var createHighConcurrencyCluster = []qa.HTTPFixture{ { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: compute.GetSparkVersionsResponse{ Versions: []compute.SparkVersion{ { @@ -197,7 +197,7 @@ var createHighConcurrencyCluster = []qa.HTTPFixture{ { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { @@ -261,7 +261,7 @@ var createSharedCluster = []qa.HTTPFixture{ { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: compute.GetSparkVersionsResponse{ Versions: []compute.SparkVersion{ { @@ -274,7 +274,7 @@ var createSharedCluster = []qa.HTTPFixture{ { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { diff --git a/catalog/bindings/bindings.go b/catalog/bindings/bindings.go index 6a2633ad8a..327e2a61f4 100644 --- a/catalog/bindings/bindings.go +++ b/catalog/bindings/bindings.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func AddCurrentWorkspaceBindings(ctx context.Context, d *schema.ResourceData, w *databricks.WorkspaceClient, securableName string, securableType string) error { +func AddCurrentWorkspaceBindings(ctx context.Context, d *schema.ResourceData, w *databricks.WorkspaceClient, securableName string, securableType catalog.UpdateBindingsSecurableType) error { if d.Get("isolation_mode") != "ISOLATED" && d.Get("isolation_mode") != "ISOLATION_MODE_ISOLATED" { return nil } diff --git a/catalog/resource_catalog.go b/catalog/resource_catalog.go index 6c0f339fdd..3c5bffaf0e 100644 --- a/catalog/resource_catalog.go +++ b/catalog/resource_catalog.go @@ -100,7 +100,7 @@ func ResourceCatalog() common.Resource { } // Bind the current workspace if the catalog is isolated, otherwise the read will fail - return bindings.AddCurrentWorkspaceBindings(ctx, d, w, ci.Name, "catalog") + return bindings.AddCurrentWorkspaceBindings(ctx, d, w, ci.Name, catalog.UpdateBindingsSecurableTypeCatalog) }, Read: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error { w, err := c.WorkspaceClient() @@ -166,7 +166,7 @@ func ResourceCatalog() common.Resource { d.SetId(ci.Name) // Bind the current workspace if the catalog is isolated, otherwise the read will fail - return bindings.AddCurrentWorkspaceBindings(ctx, d, w, ci.Name, "catalog") + return bindings.AddCurrentWorkspaceBindings(ctx, d, w, ci.Name, catalog.UpdateBindingsSecurableTypeCatalog) }, Delete: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error { w, err := c.WorkspaceClient() diff --git a/catalog/resource_external_location.go b/catalog/resource_external_location.go index f4f6524de0..f21549cb98 100644 --- a/catalog/resource_external_location.go +++ b/catalog/resource_external_location.go @@ -75,7 +75,7 @@ func ResourceExternalLocation() common.Resource { } // Bind the current workspace if the external location is isolated, otherwise the read will fail - return bindings.AddCurrentWorkspaceBindings(ctx, d, w, el.Name, "external-location") + return bindings.AddCurrentWorkspaceBindings(ctx, d, w, el.Name, catalog.UpdateBindingsSecurableTypeExternalLocation) }, Read: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error { w, err := c.WorkspaceClient() @@ -134,7 +134,7 @@ func ResourceExternalLocation() common.Resource { return err } // Bind the current workspace if the external location is isolated, otherwise the read will fail - return bindings.AddCurrentWorkspaceBindings(ctx, d, w, updateExternalLocationRequest.Name, "external-location") + return bindings.AddCurrentWorkspaceBindings(ctx, d, w, updateExternalLocationRequest.Name, catalog.UpdateBindingsSecurableTypeExternalLocation) }, Delete: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error { force := d.Get("force_destroy").(bool) diff --git a/catalog/resource_external_location_test.go b/catalog/resource_external_location_test.go index 3713edcff5..26493c1005 100644 --- a/catalog/resource_external_location_test.go +++ b/catalog/resource_external_location_test.go @@ -92,7 +92,7 @@ func TestCreateIsolatedExternalLocation(t *testing.T) { }, nil) w.GetMockWorkspaceBindingsAPI().EXPECT().UpdateBindings(mock.Anything, catalog.UpdateWorkspaceBindingsParameters{ SecurableName: "abc", - SecurableType: "external-location", + SecurableType: "external_location", Add: []catalog.WorkspaceBinding{ { WorkspaceId: int64(123456789101112), diff --git a/catalog/resource_sql_table_test.go b/catalog/resource_sql_table_test.go index fdf3fd4162..42573aaac7 100644 --- a/catalog/resource_sql_table_test.go +++ b/catalog/resource_sql_table_test.go @@ -1211,7 +1211,7 @@ func TestResourceSqlTableCreateTable_ExistingSQLWarehouse(t *testing.T) { WarehouseId: "existingwarehouse", OnWaitTimeout: sql.ExecuteStatementRequestOnWaitTimeoutCancel, }, - Response: sql.ExecuteStatementResponse{ + Response: sql.StatementResponse{ StatementId: "statement1", Status: &sql.StatementStatus{ State: "SUCCEEDED", @@ -1247,7 +1247,7 @@ var baseClusterFixture = []qa.HTTPFixture{ { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: compute.GetSparkVersionsResponse{ Versions: []compute.SparkVersion{ { @@ -1264,7 +1264,7 @@ var baseClusterFixture = []qa.HTTPFixture{ { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { diff --git a/catalog/resource_storage_credential.go b/catalog/resource_storage_credential.go index 8526acf1f3..02b79bdd06 100644 --- a/catalog/resource_storage_credential.go +++ b/catalog/resource_storage_credential.go @@ -110,7 +110,7 @@ func ResourceStorageCredential() common.Resource { return err } // Bind the current workspace if the storage credential is isolated, otherwise the read will fail - return bindings.AddCurrentWorkspaceBindings(ctx, d, w, storageCredential.Name, "storage-credential") + return bindings.AddCurrentWorkspaceBindings(ctx, d, w, storageCredential.Name, catalog.UpdateBindingsSecurableTypeStorageCredential) }) }, Read: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error { @@ -246,7 +246,7 @@ func ResourceStorageCredential() common.Resource { return err } // Bind the current workspace if the storage credential is isolated, otherwise the read will fail - return bindings.AddCurrentWorkspaceBindings(ctx, d, w, update.Name, "storage-credential") + return bindings.AddCurrentWorkspaceBindings(ctx, d, w, update.Name, catalog.UpdateBindingsSecurableTypeStorageCredential) }) }, Delete: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error { diff --git a/catalog/resource_storage_credential_test.go b/catalog/resource_storage_credential_test.go index fa76de2cbd..f54ef401e0 100644 --- a/catalog/resource_storage_credential_test.go +++ b/catalog/resource_storage_credential_test.go @@ -106,7 +106,7 @@ func TestCreateIsolatedStorageCredential(t *testing.T) { }, nil) w.GetMockWorkspaceBindingsAPI().EXPECT().UpdateBindings(mock.Anything, catalog.UpdateWorkspaceBindingsParameters{ SecurableName: "a", - SecurableType: "storage-credential", + SecurableType: "storage_credential", Add: []catalog.WorkspaceBinding{ { WorkspaceId: int64(123456789101112), diff --git a/catalog/resource_workspace_binding.go b/catalog/resource_workspace_binding.go index 0f558753b9..de8da8cd10 100644 --- a/catalog/resource_workspace_binding.go +++ b/catalog/resource_workspace_binding.go @@ -43,7 +43,7 @@ func ResourceWorkspaceBinding() common.Resource { Optional: true, Default: "catalog", } - common.CustomizeSchemaPath(m, "securable_type").SetValidateFunc(validation.StringInSlice([]string{"catalog", "external-location", "storage-credential"}, false)) + common.CustomizeSchemaPath(m, "securable_type").SetValidateFunc(validation.StringInSlice([]string{"catalog", "external_location", "storage_credential"}, false)) common.CustomizeSchemaPath(m, "binding_type").SetDefault(catalog.WorkspaceBindingBindingTypeBindingTypeReadWrite).SetValidateFunc(validation.StringInSlice([]string{ string(catalog.WorkspaceBindingBindingTypeBindingTypeReadWrite), string(catalog.WorkspaceBindingBindingTypeBindingTypeReadOnly), @@ -69,7 +69,7 @@ func ResourceWorkspaceBinding() common.Resource { var update catalog.WorkspaceBinding common.DataToStructPointer(d, workspaceBindingSchema, &update) securableName := getSecurableName(d) - securableType := d.Get("securable_type").(string) + securableType := catalog.UpdateBindingsSecurableType(d.Get("securable_type").(string)) _, err = w.WorkspaceBindings.UpdateBindings(ctx, catalog.UpdateWorkspaceBindingsParameters{ Add: []catalog.WorkspaceBinding{update}, SecurableName: securableName, @@ -88,7 +88,7 @@ func ResourceWorkspaceBinding() common.Resource { return fmt.Errorf("incorrect binding id: %s. Correct format: ||", d.Id()) } securableName := parts[2] - securableType := parts[1] + securableType := catalog.GetBindingsSecurableType(parts[1]) workspaceId, err := strconv.ParseInt(parts[0], 10, 0) if err != nil { return fmt.Errorf("can't parse workspace_id: %w", err) @@ -117,7 +117,7 @@ func ResourceWorkspaceBinding() common.Resource { _, err = w.WorkspaceBindings.UpdateBindings(ctx, catalog.UpdateWorkspaceBindingsParameters{ Remove: []catalog.WorkspaceBinding{update}, SecurableName: getSecurableName(d), - SecurableType: d.Get("securable_type").(string), + SecurableType: catalog.UpdateBindingsSecurableType(d.Get("securable_type").(string)), }) return err }, diff --git a/catalog/resource_workspace_binding_test.go b/catalog/resource_workspace_binding_test.go index 4059e11b44..9c883fa385 100644 --- a/catalog/resource_workspace_binding_test.go +++ b/catalog/resource_workspace_binding_test.go @@ -167,7 +167,7 @@ func TestSecurableWorkspaceBindings_CreateExtLocation(t *testing.T) { }, }, SecurableName: "external_location", - SecurableType: "external-location", + SecurableType: catalog.UpdateBindingsSecurableTypeExternalLocation, }).Return(&catalog.WorkspaceBindingsResponse{ Bindings: []catalog.WorkspaceBinding{ { @@ -176,7 +176,7 @@ func TestSecurableWorkspaceBindings_CreateExtLocation(t *testing.T) { }, }, }, nil) - e.GetBindingsBySecurableTypeAndSecurableName(mock.Anything, "external-location", "external_location").Return(&catalog.WorkspaceBindingsResponse{ + e.GetBindingsBySecurableTypeAndSecurableName(mock.Anything, catalog.GetBindingsSecurableTypeExternalLocation, "external_location").Return(&catalog.WorkspaceBindingsResponse{ Bindings: []catalog.WorkspaceBinding{ { WorkspaceId: int64(1234567890101112), @@ -188,7 +188,7 @@ func TestSecurableWorkspaceBindings_CreateExtLocation(t *testing.T) { Create: true, HCL: ` securable_name = "external_location" - securable_type = "external-location" + securable_type = "external_location" workspace_id = "1234567890101112" `, }.ApplyNoError(t) diff --git a/clusters/clusters_api_sdk_test.go b/clusters/clusters_api_sdk_test.go index 6067c21b34..ade90472c7 100644 --- a/clusters/clusters_api_sdk_test.go +++ b/clusters/clusters_api_sdk_test.go @@ -14,7 +14,7 @@ func TestStartClusterAndGetInfo_Pending(t *testing.T) { client, server, err := qa.HttpFixtureClient(t, []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: ClusterInfo{ State: ClusterStatePending, ClusterID: "abc", @@ -22,7 +22,7 @@ func TestStartClusterAndGetInfo_Pending(t *testing.T) { }, { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: ClusterInfo{ State: ClusterStateRunning, ClusterID: "abc", @@ -46,7 +46,7 @@ func TestStartClusterAndGetInfo_Terminating(t *testing.T) { client, server, err := qa.HttpFixtureClient(t, []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: ClusterInfo{ State: ClusterStateTerminating, ClusterID: "abc", @@ -54,7 +54,7 @@ func TestStartClusterAndGetInfo_Terminating(t *testing.T) { }, { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: ClusterInfo{ State: ClusterStateTerminated, ClusterID: "abc", @@ -62,14 +62,14 @@ func TestStartClusterAndGetInfo_Terminating(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/start", + Resource: "/api/2.1/clusters/start", ExpectedRequest: ClusterID{ ClusterID: "abc", }, }, { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: ClusterInfo{ State: ClusterStateRunning, ClusterID: "abc", @@ -93,7 +93,7 @@ func TestStartClusterAndGetInfo_Error(t *testing.T) { client, server, err := qa.HttpFixtureClient(t, []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: ClusterInfo{ State: ClusterStateError, StateMessage: "I am a teapot", @@ -101,14 +101,14 @@ func TestStartClusterAndGetInfo_Error(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/start", + Resource: "/api/2.1/clusters/start", ExpectedRequest: ClusterID{ ClusterID: "abc", }, }, { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: ClusterInfo{ State: ClusterStateRunning, ClusterID: "abc", @@ -132,7 +132,7 @@ func TestStartClusterAndGetInfo_StartingError(t *testing.T) { client, server, err := qa.HttpFixtureClient(t, []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: ClusterInfo{ State: ClusterStateError, StateMessage: "I am a teapot", @@ -140,7 +140,7 @@ func TestStartClusterAndGetInfo_StartingError(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/start", + Resource: "/api/2.1/clusters/start", ExpectedRequest: ClusterID{ ClusterID: "abc", }, diff --git a/clusters/clusters_api_test.go b/clusters/clusters_api_test.go index 6aac42debf..b30f7498b4 100644 --- a/clusters/clusters_api_test.go +++ b/clusters/clusters_api_test.go @@ -27,7 +27,7 @@ func TestGetOrCreateRunningCluster_AzureAuth(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: compute.GetSparkVersionsResponse{ Versions: []compute.SparkVersion{ { @@ -52,7 +52,7 @@ func TestGetOrCreateRunningCluster_AzureAuth(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { diff --git a/clusters/data_node_type_test.go b/clusters/data_node_type_test.go index f4c17d4f70..bbf7f693ad 100644 --- a/clusters/data_node_type_test.go +++ b/clusters/data_node_type_test.go @@ -14,7 +14,7 @@ func TestNodeType(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { @@ -123,7 +123,7 @@ func TestNodeTypeCategory(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { @@ -215,7 +215,7 @@ func TestNodeTypeCategoryNotAvailable(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { @@ -280,7 +280,7 @@ func TestNodeTypeFleet(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { @@ -324,7 +324,7 @@ func TestNodeTypeEmptyList(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{}, }, }, @@ -345,7 +345,7 @@ func TestNodeTypeFleetEmptyList(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{}, }, }, diff --git a/clusters/data_spark_version_test.go b/clusters/data_spark_version_test.go index c850e17840..9617382b42 100644 --- a/clusters/data_spark_version_test.go +++ b/clusters/data_spark_version_test.go @@ -237,7 +237,7 @@ func TestSparkVersionErrorBadAnswer(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: "{garbage....", }, }, diff --git a/clusters/resource_cluster_test.go b/clusters/resource_cluster_test.go index 4ddd930c2d..40f8a2db62 100644 --- a/clusters/resource_cluster_test.go +++ b/clusters/resource_cluster_test.go @@ -17,7 +17,7 @@ func TestResourceClusterCreate(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "POST", - Resource: "/api/2.0/clusters/create", + Resource: "/api/2.1/clusters/create", ExpectedRequest: compute.ClusterSpec{ NumWorkers: 100, ClusterName: "Shared Autoscaling", @@ -33,7 +33,7 @@ func TestResourceClusterCreate(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", NumWorkers: 100, @@ -46,7 +46,7 @@ func TestResourceClusterCreate(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -86,7 +86,7 @@ func TestResourceClusterCreatePinned(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "POST", - Resource: "/api/2.0/clusters/create", + Resource: "/api/2.1/clusters/create", ExpectedRequest: compute.CreateCluster{ NumWorkers: 100, ClusterName: "Shared Autoscaling", @@ -102,7 +102,7 @@ func TestResourceClusterCreatePinned(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", NumWorkers: 100, @@ -115,7 +115,7 @@ func TestResourceClusterCreatePinned(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/pin", + Resource: "/api/2.1/clusters/pin", ExpectedRequest: compute.PinCluster{ ClusterId: "abc", }, @@ -129,7 +129,7 @@ func TestResourceClusterCreatePinned(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -169,7 +169,7 @@ func TestResourceClusterCreate_WithLibraries(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "POST", - Resource: "/api/2.0/clusters/create", + Resource: "/api/2.1/clusters/create", ExpectedRequest: compute.CreateCluster{ NumWorkers: 100, SparkVersion: "7.1-scala12", @@ -184,7 +184,7 @@ func TestResourceClusterCreate_WithLibraries(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", NumWorkers: 100, @@ -197,7 +197,7 @@ func TestResourceClusterCreate_WithLibraries(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -365,7 +365,7 @@ func TestResourceClusterCreatePhoton(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "POST", - Resource: "/api/2.0/clusters/create", + Resource: "/api/2.1/clusters/create", ExpectedRequest: compute.CreateCluster{ NumWorkers: 100, ClusterName: "Shared Autoscaling", @@ -382,7 +382,7 @@ func TestResourceClusterCreatePhoton(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", NumWorkers: 100, @@ -396,7 +396,7 @@ func TestResourceClusterCreatePhoton(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -437,7 +437,7 @@ func TestResourceClusterCreate_Error(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "POST", - Resource: "/api/2.0/clusters/create", + Resource: "/api/2.1/clusters/create", Response: common.APIErrorBody{ ErrorCode: "INVALID_REQUEST", Message: "Internal error happened", @@ -464,7 +464,7 @@ func TestResourceClusterRead(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", NumWorkers: 100, @@ -480,7 +480,7 @@ func TestResourceClusterRead(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -517,7 +517,7 @@ func TestResourceClusterRead_NotFound(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: common.APIErrorBody{ // clusters API is not fully restful, so let's test for that // TODO: https://github.com/databricks/terraform-provider-databricks/issues/2021 @@ -539,7 +539,7 @@ func TestResourceClusterRead_Error(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: common.APIErrorBody{ ErrorCode: "INVALID_REQUEST", Message: "Internal error happened", @@ -561,7 +561,7 @@ func TestResourceClusterUpdate_ResizeForAutoscalingToNumWorkersCluster(t *testin Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -578,7 +578,7 @@ func TestResourceClusterUpdate_ResizeForAutoscalingToNumWorkersCluster(t *testin }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -592,7 +592,7 @@ func TestResourceClusterUpdate_ResizeForAutoscalingToNumWorkersCluster(t *testin }, { Method: "POST", - Resource: "/api/2.0/clusters/resize", + Resource: "/api/2.1/clusters/resize", ExpectedRequest: compute.ResizeCluster{ ClusterId: "abc", NumWorkers: 3, @@ -628,7 +628,7 @@ func TestResourceClusterUpdate_ResizeForNumWorkersToAutoscalingCluster(t *testin Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -642,7 +642,7 @@ func TestResourceClusterUpdate_ResizeForNumWorkersToAutoscalingCluster(t *testin }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -656,7 +656,7 @@ func TestResourceClusterUpdate_ResizeForNumWorkersToAutoscalingCluster(t *testin }, { Method: "POST", - Resource: "/api/2.0/clusters/resize", + Resource: "/api/2.1/clusters/resize", ExpectedRequest: compute.ResizeCluster{ ClusterId: "abc", Autoscale: &compute.AutoScale{ @@ -695,7 +695,7 @@ func TestResourceClusterUpdate_EditNumWorkersWhenClusterTerminated(t *testing.T) Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -709,7 +709,7 @@ func TestResourceClusterUpdate_EditNumWorkersWhenClusterTerminated(t *testing.T) }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -723,7 +723,7 @@ func TestResourceClusterUpdate_EditNumWorkersWhenClusterTerminated(t *testing.T) }, { Method: "POST", - Resource: "/api/2.0/clusters/edit", + Resource: "/api/2.1/clusters/edit", ExpectedRequest: compute.ClusterDetails{ AutoterminationMinutes: 15, ClusterId: "abc", @@ -759,7 +759,7 @@ func TestResourceClusterUpdate_ResizeAutoscale(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -774,7 +774,7 @@ func TestResourceClusterUpdate_ResizeAutoscale(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/resize", + Resource: "/api/2.1/clusters/resize", ExpectedRequest: compute.ResizeCluster{ ClusterId: "abc", Autoscale: &compute.AutoScale{ @@ -785,7 +785,7 @@ func TestResourceClusterUpdate_ResizeAutoscale(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -830,7 +830,7 @@ func TestResourceClusterUpdate_ResizeNumWorkers(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -844,7 +844,7 @@ func TestResourceClusterUpdate_ResizeNumWorkers(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -858,7 +858,7 @@ func TestResourceClusterUpdate_ResizeNumWorkers(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/resize", + Resource: "/api/2.1/clusters/resize", ExpectedRequest: compute.ResizeCluster{ ClusterId: "abc", NumWorkers: 100, @@ -890,7 +890,7 @@ func TestResourceClusterUpdate(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -904,7 +904,7 @@ func TestResourceClusterUpdate(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -918,7 +918,7 @@ func TestResourceClusterUpdate(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/start", + Resource: "/api/2.1/clusters/start", ExpectedRequest: compute.StartCluster{ ClusterId: "abc", }, @@ -932,7 +932,7 @@ func TestResourceClusterUpdate(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/edit", + Resource: "/api/2.1/clusters/edit", ExpectedRequest: compute.ClusterDetails{ AutoterminationMinutes: 15, ClusterId: "abc", @@ -970,7 +970,7 @@ func TestResourceClusterUpdateWithPinned(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -984,7 +984,7 @@ func TestResourceClusterUpdateWithPinned(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -998,7 +998,7 @@ func TestResourceClusterUpdateWithPinned(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/start", + Resource: "/api/2.1/clusters/start", ExpectedRequest: compute.StartCluster{ ClusterId: "abc", }, @@ -1012,7 +1012,7 @@ func TestResourceClusterUpdateWithPinned(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/pin", + Resource: "/api/2.1/clusters/pin", ExpectedRequest: compute.PinCluster{ ClusterId: "abc", }, @@ -1051,7 +1051,7 @@ func TestResourceClusterUpdateWithPinned(t *testing.T) { func TestResourceClusterUpdate_LibrariesChangeOnTerminatedCluster(t *testing.T) { terminated := qa.HTTPFixture{ Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", NumWorkers: 100, @@ -1087,7 +1087,7 @@ func TestResourceClusterUpdate_LibrariesChangeOnTerminatedCluster(t *testing.T) terminated, // 1 of ... { Method: "POST", - Resource: "/api/2.0/clusters/edit", + Resource: "/api/2.1/clusters/edit", ExpectedRequest: compute.EditCluster{ AutoterminationMinutes: 60, ClusterId: "abc", @@ -1121,7 +1121,7 @@ func TestResourceClusterUpdate_LibrariesChangeOnTerminatedCluster(t *testing.T) }, { // check to see if cluster is restarting (if so wait) Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", NumWorkers: 100, @@ -1132,7 +1132,7 @@ func TestResourceClusterUpdate_LibrariesChangeOnTerminatedCluster(t *testing.T) }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -1146,14 +1146,14 @@ func TestResourceClusterUpdate_LibrariesChangeOnTerminatedCluster(t *testing.T) }, { // start cluster before libs install Method: "POST", - Resource: "/api/2.0/clusters/start", + Resource: "/api/2.1/clusters/start", ExpectedRequest: compute.StartCluster{ ClusterId: "abc", }, }, { // 2 of ... Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", NumWorkers: 100, @@ -1191,7 +1191,7 @@ func TestResourceClusterUpdate_LibrariesChangeOnTerminatedCluster(t *testing.T) newLibs, { Method: "POST", - Resource: "/api/2.0/clusters/delete", + Resource: "/api/2.1/clusters/delete", ExpectedRequest: compute.DeleteCluster{ ClusterId: "abc", }, @@ -1225,7 +1225,7 @@ func TestResourceClusterUpdate_Error(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: common.APIErrorBody{ ErrorCode: "INVALID_REQUEST", Message: "Internal error happened", @@ -1253,7 +1253,7 @@ func TestResourceClusterUpdate_AutoAz(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -1272,7 +1272,7 @@ func TestResourceClusterUpdate_AutoAz(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -1286,7 +1286,7 @@ func TestResourceClusterUpdate_AutoAz(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/start", + Resource: "/api/2.1/clusters/start", ExpectedRequest: compute.StartCluster{ ClusterId: "abc", }, @@ -1300,7 +1300,7 @@ func TestResourceClusterUpdate_AutoAz(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/edit", + Resource: "/api/2.1/clusters/edit", ExpectedRequest: compute.EditCluster{ AutoterminationMinutes: 15, ClusterId: "abc", @@ -1348,21 +1348,21 @@ func TestResourceClusterDelete(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "POST", - Resource: "/api/2.0/clusters/delete", + Resource: "/api/2.1/clusters/delete", ExpectedRequest: compute.DeleteCluster{ ClusterId: "abc", }, }, { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ State: compute.StateTerminated, }, }, { Method: "POST", - Resource: "/api/2.0/clusters/permanent-delete", + Resource: "/api/2.1/clusters/permanent-delete", ExpectedRequest: compute.PermanentDeleteCluster{ ClusterId: "abc", }, @@ -1381,7 +1381,7 @@ func TestResourceClusterDelete_Error(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "POST", - Resource: "/api/2.0/clusters/permanent-delete", + Resource: "/api/2.1/clusters/permanent-delete", Response: common.APIErrorBody{ ErrorCode: "INVALID_REQUEST", Message: "Internal error happened", @@ -1402,7 +1402,7 @@ func TestResourceClusterCreate_SingleNode(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "POST", - Resource: "/api/2.0/clusters/create", + Resource: "/api/2.1/clusters/create", ExpectedRequest: compute.CreateCluster{ NumWorkers: 0, ClusterName: "Single Node Cluster", @@ -1425,7 +1425,7 @@ func TestResourceClusterCreate_SingleNode(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -1440,7 +1440,7 @@ func TestResourceClusterCreate_SingleNode(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", Response: compute.ClusterDetails{ ClusterId: "abc", ClusterName: "Single Node Cluster", @@ -1604,14 +1604,14 @@ func TestReadOnStoppedClusterWithLibrariesDoesNotFail(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=foo", + Resource: "/api/2.1/clusters/get?cluster_id=foo", Response: compute.ClusterDetails{ State: compute.StateTerminated, }, }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", }, { Method: "GET", @@ -1642,14 +1642,14 @@ func TestRefreshOnRunningClusterWithFailedLibraryUninstallsIt(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=foo", + Resource: "/api/2.1/clusters/get?cluster_id=foo", Response: compute.ClusterDetails{ State: compute.StateRunning, }, }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", }, { Method: "GET", @@ -1696,7 +1696,7 @@ func TestResourceClusterUpdate_LocalSsdCount(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: compute.ClusterDetails{ ClusterId: "abc", @@ -1713,7 +1713,7 @@ func TestResourceClusterUpdate_LocalSsdCount(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "abc", Limit: 1, @@ -1727,7 +1727,7 @@ func TestResourceClusterUpdate_LocalSsdCount(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/edit", + Resource: "/api/2.1/clusters/edit", ExpectedRequest: compute.ClusterDetails{ AutoterminationMinutes: 15, ClusterId: "abc", diff --git a/clusters/resource_library_test.go b/clusters/resource_library_test.go index 559ccff6be..f156d9e9bb 100644 --- a/clusters/resource_library_test.go +++ b/clusters/resource_library_test.go @@ -17,7 +17,7 @@ func TestLibraryCreate(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: ClusterInfo{ State: ClusterStateRunning, @@ -65,7 +65,7 @@ func TestLibraryDelete(t *testing.T) { Fixtures: []qa.HTTPFixture{ { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=abc", + Resource: "/api/2.1/clusters/get?cluster_id=abc", ReuseRequest: true, Response: ClusterInfo{ State: ClusterStateRunning, diff --git a/common/client_test.go b/common/client_test.go index 26f99871d2..fcb8b09569 100644 --- a/common/client_test.go +++ b/common/client_test.go @@ -301,6 +301,7 @@ func TestGetJWTProperty_Authenticate_Fail(t *testing.T) { p, _ := filepath.Abs("./testdata") t.Setenv("PATH", p+":/bin") t.Setenv("FAIL", "yes") + t.Setenv("ARM_TENANT_ID", "tenant-id") client := &DatabricksClient{ DatabricksClient: &client.DatabricksClient{ diff --git a/docs/resources/volume.md b/docs/resources/volume.md index b046a97329..a95fd5fac9 100644 --- a/docs/resources/volume.md +++ b/docs/resources/volume.md @@ -61,7 +61,7 @@ resource "databricks_storage_credential" "external" { } resource "databricks_external_location" "some" { - name = "external-location" + name = "external_location" url = "s3://${aws_s3_bucket.external.id}/some" credential_name = databricks_storage_credential.external.name } diff --git a/exporter/exporter_test.go b/exporter/exporter_test.go index 0cbc2535ac..f179d419f7 100644 --- a/exporter/exporter_test.go +++ b/exporter/exporter_test.go @@ -180,7 +180,7 @@ func TestImportingMounts(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: compute.GetSparkVersionsResponse{ Versions: []compute.SparkVersion{ { @@ -192,7 +192,7 @@ func TestImportingMounts(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { @@ -827,13 +827,13 @@ func TestImportingClusters(t *testing.T) { }, { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=test1", + Resource: "/api/2.1/clusters/get?cluster_id=test1", Response: getJSONObject("test-data/get-cluster-test1-response.json"), ReuseRequest: true, }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", Response: compute.GetEvents{}, }, { @@ -861,12 +861,12 @@ func TestImportingClusters(t *testing.T) { }, { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=test2", + Resource: "/api/2.1/clusters/get?cluster_id=test2", Response: getJSONObject("test-data/get-cluster-test2-response.json"), }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "test2", Order: compute.GetEventsOrderDesc, @@ -878,7 +878,7 @@ func TestImportingClusters(t *testing.T) { }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "test1", Order: compute.GetEventsOrderDesc, @@ -910,12 +910,12 @@ func TestImportingClusters(t *testing.T) { }, { Method: "GET", - Resource: "/api/2.0/clusters/get?cluster_id=awscluster", + Resource: "/api/2.1/clusters/get?cluster_id=awscluster", Response: getJSONObject("test-data/get-cluster-awscluster-response.json"), }, { Method: "POST", - Resource: "/api/2.0/clusters/events", + Resource: "/api/2.1/clusters/events", ExpectedRequest: compute.GetEvents{ ClusterId: "awscluster", Order: compute.GetEventsOrderDesc, diff --git a/exporter/importables.go b/exporter/importables.go index 231619a15f..0e92aad0bb 100644 --- a/exporter/importables.go +++ b/exporter/importables.go @@ -1892,7 +1892,7 @@ var resourcesMap map[string]importable = map[string]importable{ return d.Get("name").(string) + "_" + d.Id() }, List: func(ic *importContext) error { - alerts, err := ic.workspaceClient.Alerts.List(ic.Context) + alerts, err := ic.workspaceClient.AlertsLegacy.List(ic.Context) if err != nil { return err } @@ -2416,7 +2416,7 @@ var resourcesMap map[string]importable = map[string]importable{ securable := "catalog" bindings, err := ic.workspaceClient.WorkspaceBindings.GetBindings(ic.Context, catalog.GetBindingsRequest{ SecurableName: cat.Name, - SecurableType: securable, + SecurableType: catalog.GetBindingsSecurableType(securable), }) if err == nil { for _, binding := range bindings.Bindings { diff --git a/go.mod b/go.mod index 1947785570..6355e62ddc 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/databricks/terraform-provider-databricks go 1.22 require ( - github.com/databricks/databricks-sdk-go v0.43.2 + github.com/databricks/databricks-sdk-go v0.43.3-0.20240722114738-7650ccc7998a github.com/golang-jwt/jwt/v4 v4.5.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/hcl v1.0.0 @@ -13,7 +13,6 @@ require ( github.com/stretchr/testify v1.9.0 github.com/zclconf/go-cty v1.14.4 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - golang.org/x/mod v0.19.0 ) require ( @@ -70,17 +69,19 @@ require ( go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.26.0 // indirect golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/api v0.182.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect - google.golang.org/grpc v1.64.0 // indirect + google.golang.org/grpc v1.64.1 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 6571a14507..9e185a86dd 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBS github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/databricks/databricks-sdk-go v0.43.2 h1:4B+sHAYO5kFqwZNQRmsF70eecqsFX6i/0KfXoDFQT/E= -github.com/databricks/databricks-sdk-go v0.43.2/go.mod h1:nlzeOEgJ1Tmb5HyknBJ3GEorCZKWqEBoHprvPmTSNq8= +github.com/databricks/databricks-sdk-go v0.43.3-0.20240722114738-7650ccc7998a h1:ZeQihrvQqGf3CWs8gTZhAMmwCnh+RQThp/joeHJssWQ= +github.com/databricks/databricks-sdk-go v0.43.3-0.20240722114738-7650ccc7998a/go.mod h1:ds+zbv5mlQG7nFEU5ojLtgN/u0/9YzZmKQES/CfedzU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -223,8 +223,8 @@ go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= @@ -243,8 +243,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= @@ -269,19 +269,19 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -291,8 +291,8 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.182.0 h1:if5fPvudRQ78GeRx3RayIoiuV7modtErPIZC/T2bIvE= @@ -311,8 +311,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/internal/acceptance/workspace_binding_test.go b/internal/acceptance/workspace_binding_test.go index 24636da693..24fcd5bb01 100644 --- a/internal/acceptance/workspace_binding_test.go +++ b/internal/acceptance/workspace_binding_test.go @@ -52,13 +52,13 @@ func workspaceBindingTemplateWithWorkspaceId(workspaceId string) string { resource "databricks_workspace_binding" "ext" { securable_name = databricks_external_location.some.id - securable_type = "external-location" + securable_type = "external_location" workspace_id = %s } resource "databricks_workspace_binding" "cred" { securable_name = databricks_storage_credential.external.id - securable_type = "storage-credential" + securable_type = "storage_credential" workspace_id = %s } `, workspaceId, workspaceId, workspaceId, workspaceId) diff --git a/provider/provider_test.go b/provider/provider_test.go index bb52d36727..ddc2cf5bce 100644 --- a/provider/provider_test.go +++ b/provider/provider_test.go @@ -312,9 +312,10 @@ func TestConfig_AzureCliHost(t *testing.T) { "PATH": p, "HOME": p, }, - assertAzure: true, - assertHost: "https://x", - assertAuth: "azure-cli", + assertAzure: true, + assertHost: "https://x", + assertAuth: "azure-cli", + azureTenantID: "tenant-id", }.apply(t) } @@ -369,9 +370,10 @@ func TestConfig_AzureCliHostAndResourceID(t *testing.T) { "PATH": p, "HOME": p, }, - assertAzure: true, - assertHost: "https://x", - assertAuth: "azure-cli", + assertAzure: true, + azureTenantID: "tenant-id", + assertHost: "https://x", + assertAuth: "azure-cli", }.apply(t) } @@ -408,7 +410,7 @@ func shortLivedOAuthHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") fmt.Fprint(w, `{"access_token": "x", "token_type": "Bearer", "expires_in": 3}`) return - } else if r.RequestURI == "/api/2.0/clusters/get?cluster_id=123" { + } else if r.RequestURI == "/api/2.1/clusters/get?cluster_id=123" { w.Header().Set("Content-Type", "application/json") fmt.Fprint(w, `{"cluster_id": "123"}`) return diff --git a/sql/resource_sql_alerts.go b/sql/resource_sql_alerts.go index c7f7426884..156834bd44 100644 --- a/sql/resource_sql_alerts.go +++ b/sql/resource_sql_alerts.go @@ -81,7 +81,7 @@ func (a *AlertEntity) toEditAlertApiObject(s map[string]*schema.Schema, data *sc return ea, err } -func (a *AlertEntity) fromAPIObject(apiAlert *sql.Alert, s map[string]*schema.Schema, data *schema.ResourceData) error { +func (a *AlertEntity) fromAPIObject(apiAlert *sql.LegacyAlert, s map[string]*schema.Schema, data *schema.ResourceData) error { a.Name = apiAlert.Name a.Parent = apiAlert.Parent if apiAlert.Query != nil { @@ -139,7 +139,7 @@ func ResourceSqlAlert() common.Resource { if err != nil { return err } - apiAlert, err := w.Alerts.Create(ctx, ca) + apiAlert, err := w.AlertsLegacy.Create(ctx, ca) if err != nil { return err } @@ -151,7 +151,7 @@ func ResourceSqlAlert() common.Resource { if err != nil { return err } - apiAlert, err := w.Alerts.GetByAlertId(ctx, data.Id()) + apiAlert, err := w.AlertsLegacy.GetByAlertId(ctx, data.Id()) if err != nil { log.Printf("[WARN] error getting alert by ID: %v", err) return err @@ -169,14 +169,14 @@ func ResourceSqlAlert() common.Resource { if err != nil { return err } - return w.Alerts.Update(ctx, ca) + return w.AlertsLegacy.Update(ctx, ca) }, Delete: func(ctx context.Context, data *schema.ResourceData, c *common.DatabricksClient) error { w, err := c.WorkspaceClient() if err != nil { return err } - return w.Alerts.DeleteByAlertId(ctx, data.Id()) + return w.AlertsLegacy.DeleteByAlertId(ctx, data.Id()) }, Schema: s, } diff --git a/sql/resource_sql_alerts_test.go b/sql/resource_sql_alerts_test.go index c7827f313b..8b30db6878 100644 --- a/sql/resource_sql_alerts_test.go +++ b/sql/resource_sql_alerts_test.go @@ -14,7 +14,7 @@ func TestSqlAlertReadStringValue(t *testing.T) { { Method: "GET", Resource: "/api/2.0/preview/sql/alerts/xyz?", - Response: sql.Alert{ + Response: sql.LegacyAlert{ CreatedAt: "2020-01-01T00:00:00.000Z", Id: "xyz", Parent: "abc", @@ -45,7 +45,7 @@ func TestSqlAlertReadNumberValue(t *testing.T) { { Method: "GET", Resource: "/api/2.0/preview/sql/alerts/xyz?", - Response: sql.Alert{ + Response: sql.LegacyAlert{ CreatedAt: "2020-01-01T00:00:00.000Z", Id: "xyz", Parent: "abc", @@ -76,7 +76,7 @@ func TestSqlAlertReadBoolValue(t *testing.T) { { Method: "GET", Resource: "/api/2.0/preview/sql/alerts/xyz?", - Response: sql.Alert{ + Response: sql.LegacyAlert{ CreatedAt: "2020-01-01T00:00:00.000Z", Id: "xyz", Parent: "abc", diff --git a/storage/gs_test.go b/storage/gs_test.go index 4d090cd0f4..740623f886 100644 --- a/storage/gs_test.go +++ b/storage/gs_test.go @@ -47,12 +47,12 @@ func TestCreateOrValidateClusterForGoogleStorage_WorksOnDeletedCluster(t *testin { ReuseRequest: true, Method: "GET", - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", }, { ReuseRequest: true, Method: "GET", - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", }, { Method: "POST", diff --git a/storage/mounts_test.go b/storage/mounts_test.go index a829e50469..3060c33a1b 100644 --- a/storage/mounts_test.go +++ b/storage/mounts_test.go @@ -173,7 +173,7 @@ func TestDeletedMountClusterRecreates(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: compute.GetSparkVersionsResponse{ Versions: []compute.SparkVersion{ { @@ -186,7 +186,7 @@ func TestDeletedMountClusterRecreates(t *testing.T) { { Method: "GET", ReuseRequest: true, - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", Response: compute.ListNodeTypesResponse{ NodeTypes: []compute.NodeType{ { diff --git a/storage/resource_mount_test.go b/storage/resource_mount_test.go index 24bf5ca37c..5a19e2d000 100644 --- a/storage/resource_mount_test.go +++ b/storage/resource_mount_test.go @@ -271,13 +271,13 @@ func TestResourceAwsS3MountGenericCreate_WithInstanceProfile(t *testing.T) { }, { Method: "GET", - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: sparkVersionsResponse, ReuseRequest: true, }, { Method: "GET", - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", ReuseRequest: true, Response: nodeListResponse, }, @@ -1480,13 +1480,13 @@ func TestResourceGcsMountGenericCreate_WithServiceAccount(t *testing.T) { }, { Method: "GET", - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", Response: sparkVersionsResponse, ReuseRequest: true, }, { Method: "GET", - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", ReuseRequest: true, Response: nodeListResponse, }, diff --git a/storage/s3_test.go b/storage/s3_test.go index 38fa1bb86f..729354771a 100644 --- a/storage/s3_test.go +++ b/storage/s3_test.go @@ -47,12 +47,12 @@ func TestPreprocessS3MountOnDeletedClusterWorks(t *testing.T) { { ReuseRequest: true, Method: "GET", - Resource: "/api/2.0/clusters/spark-versions", + Resource: "/api/2.1/clusters/spark-versions", }, { ReuseRequest: true, Method: "GET", - Resource: "/api/2.0/clusters/list-node-types", + Resource: "/api/2.1/clusters/list-node-types", }, { Method: "POST",