From 17f225ea1fd32874c08727cc8e18309427a6e8e4 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Wed, 20 Aug 2025 15:45:08 +0800 Subject: [PATCH 1/8] add --- tencentcloud/provider.go | 6 + tencentcloud/provider.md | 6 + .../data_source_tc_dlc_data_engine_network.go | 295 ++++++++++++++++++ .../data_source_tc_dlc_data_engine_network.md | 14 + ..._source_tc_dlc_data_engine_network_test.go | 36 +++ ...e_tc_dlc_data_engine_session_parameters.go | 239 ++++++++++++++ ...e_tc_dlc_data_engine_session_parameters.md | 9 + ...dlc_data_engine_session_parameters_test.go | 31 ++ ...ata_source_tc_dlc_session_image_version.go | 140 +++++++++ ...ata_source_tc_dlc_session_image_version.md | 10 + ...ource_tc_dlc_session_image_version_test.go | 32 ++ ...up_network_config_information_operation.go | 141 +++++++++ ...up_network_config_information_operation.md | 9 + ...twork_config_information_operation_test.go | 33 ++ ...urce_group_config_information_operation.go | 199 ++++++++++++ ...urce_group_config_information_operation.md | 17 + ...group_config_information_operation_test.go | 41 +++ ...ce_group_resource_information_operation.go | 288 +++++++++++++++++ ...ce_group_resource_information_operation.md | 9 + ...oup_resource_information_operation_test.go | 31 ++ .../services/dlc/service_tencentcloud_dlc.go | 134 ++++++++ .../d/dlc_data_engine_network.html.markdown | 47 +++ ...ta_engine_session_parameters.html.markdown | 36 +++ .../d/dlc_session_image_version.html.markdown | 37 +++ ...config_information_operation.html.markdown | 36 +++ ...config_information_operation.html.markdown | 55 ++++ ...source_information_operation.html.markdown | 52 +++ website/tencentcloud.erb | 18 ++ 28 files changed, 2001 insertions(+) create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.go create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.md create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network_test.go create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.go create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.md create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters_test.go create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.go create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.md create mode 100644 tencentcloud/services/dlc/data_source_tc_dlc_session_image_version_test.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go create mode 100644 website/docs/d/dlc_data_engine_network.html.markdown create mode 100644 website/docs/d/dlc_data_engine_session_parameters.html.markdown create mode 100644 website/docs/d/dlc_session_image_version.html.markdown create mode 100644 website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown create mode 100644 website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown create mode 100644 website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 7aca6e82d1..1767f95211 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1224,6 +1224,9 @@ func Provider() *schema.Provider { "tencentcloud_dlc_engine_node_specifications": dlc.DataSourceTencentCloudDlcEngineNodeSpecifications(), "tencentcloud_dlc_native_spark_sessions": dlc.DataSourceTencentCloudDlcNativeSparkSessions(), "tencentcloud_dlc_standard_engine_resource_group_config_information": dlc.DataSourceTencentCloudDlcStandardEngineResourceGroupConfigInformation(), + "tencentcloud_dlc_data_engine_network": dlc.DataSourceTencentCloudDlcDataEngineNetwork(), + "tencentcloud_dlc_data_engine_session_parameters": dlc.DataSourceTencentCloudDlcDataEngineSessionParameters(), + "tencentcloud_dlc_session_image_version": dlc.DataSourceTencentCloudDlcSessionImageVersion(), "tencentcloud_bi_project": bi.DataSourceTencentCloudBiProject(), "tencentcloud_bi_user_project": bi.DataSourceTencentCloudBiUserProject(), "tencentcloud_antiddos_basic_device_status": antiddos.DataSourceTencentCloudAntiddosBasicDeviceStatus(), @@ -2240,6 +2243,9 @@ func Provider() *schema.Provider { "tencentcloud_dlc_bind_work_groups_to_user_attachment": dlc.ResourceTencentCloudDlcBindWorkGroupsToUserAttachment(), "tencentcloud_dlc_update_row_filter_operation": dlc.ResourceTencentCloudDlcUpdateRowFilterOperation(), "tencentcloud_dlc_user_data_engine_config": dlc.ResourceTencentCloudDlcUserDataEngineConfig(), + "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation": dlc.ResourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperation(), + "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation": dlc.ResourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperation(), + "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation": dlc.ResourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperation(), "tencentcloud_waf_custom_rule": waf.ResourceTencentCloudWafCustomRule(), "tencentcloud_waf_custom_white_rule": waf.ResourceTencentCloudWafCustomWhiteRule(), "tencentcloud_waf_clb_domain": waf.ResourceTencentCloudWafClbDomain(), diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index c209f70fa1..6d35e56502 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -2143,6 +2143,9 @@ tencentcloud_dlc_task_result tencentcloud_dlc_engine_node_specifications tencentcloud_dlc_native_spark_sessions tencentcloud_dlc_standard_engine_resource_group_config_information +tencentcloud_dlc_data_engine_network +tencentcloud_dlc_data_engine_session_parameters +tencentcloud_dlc_session_image_version Resource tencentcloud_dlc_work_group @@ -2162,6 +2165,9 @@ tencentcloud_dlc_upgrade_data_engine_image_operation tencentcloud_dlc_user_data_engine_config tencentcloud_dlc_update_row_filter_operation tencentcloud_dlc_bind_work_groups_to_user_attachment +tencentcloud_dlc_update_engine_resource_group_network_config_information_operation +tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation +tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation Web Application Firewall(WAF) Data Source diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.go b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.go new file mode 100644 index 0000000000..636ead6fb3 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.go @@ -0,0 +1,295 @@ +package dlc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudDlcDataEngineNetwork() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDlcDataEngineNetworkRead, + Schema: map[string]*schema.Schema{ + "sort_by": { + Type: schema.TypeString, + Optional: true, + Description: "Sort Field.", + }, + + "sorting": { + Type: schema.TypeString, + Optional: true, + Description: "Sort order, asc or desc.", + }, + + "filters": { + Type: schema.TypeList, + Optional: true, + Description: "Filter conditions are optional, engine-network-id--engine network ID, engine-network-state--engine network status.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Attribute name, if there are multiple filters, the relationship between filters is a logical OR relationship.", + }, + "values": { + Type: schema.TypeList, + Required: true, + Description: "Attribute value, if there are multiple values, the relationship between values is a logical OR relationship.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + + "engine_networks_infos": { + Type: schema.TypeList, + Computed: true, + Description: "Engine network information list.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "engine_network_name": { + Type: schema.TypeString, + Optional: true, + Description: "Engine network name.", + }, + "engine_network_state": { + Type: schema.TypeInt, + Required: true, + Description: "Engine network status, 0--initialized, 2--available, -1--deleted.", + }, + "engine_network_cidr": { + Type: schema.TypeString, + Optional: true, + Description: "Engine network CIDR.", + }, + "engine_network_id": { + Type: schema.TypeString, + Optional: true, + Description: "Engine network ID.", + }, + "create_time": { + Type: schema.TypeInt, + Optional: true, + Description: "Creation time.", + }, + "update_time": { + Type: schema.TypeInt, + Optional: true, + Description: "Update time.", + }, + "private_link_number": { + Type: schema.TypeInt, + Optional: true, + Description: "Number of private links.", + }, + "engine_number": { + Type: schema.TypeInt, + Optional: true, + Description: "Number of engines.", + }, + "gate_way_info": { + Type: schema.TypeList, + Optional: true, + Description: "Gateway information list.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "gateway_id": { + Type: schema.TypeString, + Optional: true, + Description: "Gateway ID.", + }, + "gateway_name": { + Type: schema.TypeString, + Optional: true, + Description: "Gateway name.", + }, + "size": { + Type: schema.TypeInt, + Optional: true, + Description: "Gateway size.", + }, + "state": { + Type: schema.TypeInt, + Optional: true, + Description: "Gateway status: -1--Failed, -2--Deleted, 0--Init,1--Pause, 2--running, 3--ToBeDeleted, 4--Deleting, 5--Pausing, 6--Resuming, 7--Isolating, 8--Isolated, 9--Renewing, 10--Modifying, 11--Modified, 12--Restoring, 13--Restored, 14--ToBeRestored.", + }, + "pay_mode": { + Type: schema.TypeInt, + Optional: true, + Description: "Pay mode.", + }, + "mode": { + Type: schema.TypeInt, + Optional: true, + Description: "Gateway mode.", + }, + }, + }, + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudDlcDataEngineNetworkRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_dlc_data_engine_network.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = DlcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("sort_by"); ok { + paramMap["SortBy"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("sorting"); ok { + paramMap["Sorting"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("filters"); ok { + filtersSet := v.([]interface{}) + tmpSet := make([]*dlcv20210125.Filter, 0, len(filtersSet)) + for _, item := range filtersSet { + filtersMap := item.(map[string]interface{}) + filter := dlcv20210125.Filter{} + if v, ok := filtersMap["name"].(string); ok && v != "" { + filter.Name = helper.String(v) + } + + if v, ok := filtersMap["values"]; ok { + valuesSet := v.([]interface{}) + for i := range valuesSet { + values := valuesSet[i].(string) + filter.Values = append(filter.Values, helper.String(values)) + } + } + + tmpSet = append(tmpSet, &filter) + } + + paramMap["Filters"] = tmpSet + } + + var respData []*dlcv20210125.EngineNetworkInfo + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeDlcDataEngineNetworkByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + engineNetworkInfosList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, engineNetworkInfos := range respData { + engineNetworkInfosMap := map[string]interface{}{} + if engineNetworkInfos.EngineNetworkName != nil { + engineNetworkInfosMap["engine_network_name"] = engineNetworkInfos.EngineNetworkName + } + + if engineNetworkInfos.EngineNetworkState != nil { + engineNetworkInfosMap["engine_network_state"] = engineNetworkInfos.EngineNetworkState + } + + if engineNetworkInfos.EngineNetworkCidr != nil { + engineNetworkInfosMap["engine_network_cidr"] = engineNetworkInfos.EngineNetworkCidr + } + + if engineNetworkInfos.EngineNetworkId != nil { + engineNetworkInfosMap["engine_network_id"] = engineNetworkInfos.EngineNetworkId + } + + if engineNetworkInfos.CreateTime != nil { + engineNetworkInfosMap["create_time"] = engineNetworkInfos.CreateTime + } + + if engineNetworkInfos.UpdateTime != nil { + engineNetworkInfosMap["update_time"] = engineNetworkInfos.UpdateTime + } + + if engineNetworkInfos.PrivateLinkNumber != nil { + engineNetworkInfosMap["private_link_number"] = engineNetworkInfos.PrivateLinkNumber + } + + if engineNetworkInfos.EngineNumber != nil { + engineNetworkInfosMap["engine_number"] = engineNetworkInfos.EngineNumber + } + + gateWayInfoList := make([]map[string]interface{}, 0, len(engineNetworkInfos.GateWayInfo)) + if engineNetworkInfos.GateWayInfo != nil { + for _, gateWayInfo := range engineNetworkInfos.GateWayInfo { + gateWayInfoMap := map[string]interface{}{} + + if gateWayInfo.GatewayId != nil { + gateWayInfoMap["gateway_id"] = gateWayInfo.GatewayId + } + + if gateWayInfo.GatewayName != nil { + gateWayInfoMap["gateway_name"] = gateWayInfo.GatewayName + } + + if gateWayInfo.Size != nil { + gateWayInfoMap["size"] = gateWayInfo.Size + } + + if gateWayInfo.State != nil { + gateWayInfoMap["state"] = gateWayInfo.State + } + + if gateWayInfo.PayMode != nil { + gateWayInfoMap["pay_mode"] = gateWayInfo.PayMode + } + + if gateWayInfo.Mode != nil { + gateWayInfoMap["mode"] = gateWayInfo.Mode + } + + gateWayInfoList = append(gateWayInfoList, gateWayInfoMap) + } + + engineNetworkInfosMap["gate_way_info"] = gateWayInfoList + } + + engineNetworkInfosList = append(engineNetworkInfosList, engineNetworkInfosMap) + } + + _ = d.Set("engine_network_infos", engineNetworkInfosList) + } + + d.SetId(helper.BuildToken()) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), engineNetworkInfosList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.md b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.md new file mode 100644 index 0000000000..2b013f8b6f --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network.md @@ -0,0 +1,14 @@ +Use this data source to query detailed information of DLC data engine network + +Example Usage + +```hcl +data "tencentcloud_dlc_data_engine_network" "example" { + sort_by = "create-time" + sorting = "desc" + filters { + name = "engine-network-id" + values = ["DataEngine_Network-g1sxyw8v"] + } +} +``` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network_test.go b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network_test.go new file mode 100644 index 0000000000..c34b001471 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_network_test.go @@ -0,0 +1,36 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcDataEngineNetworkDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcDataEngineNetworkDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_dlc_data_engine_network.example"), + ), + }}, + }) +} + +const testAccDlcDataEngineNetworkDataSource = ` +data "tencentcloud_dlc_data_engine_network" "example" { + sort_by = "create-time" + sorting = "desc" + filters { + name = "engine-network-id" + values = ["DataEngine_Network-g1sxyw8v"] + } +} +` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.go b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.go new file mode 100644 index 0000000000..4b969dea5c --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.go @@ -0,0 +1,239 @@ +package dlc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudDlcDataEngineSessionParameters() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDlcDataEngineSessionParametersRead, + Schema: map[string]*schema.Schema{ + "data_engine_id": { + Type: schema.TypeString, + Required: true, + Description: "DataEngine Id.", + }, + + "data_engine_name": { + Type: schema.TypeString, + Optional: true, + Description: "Engine name. When the engine name is specified, the name is used first to obtain the configuration.", + }, + + "data_engine_parameters": { + Type: schema.TypeList, + Computed: true, + Description: "Engine Session Configuration List.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "parameter_id": { + Type: schema.TypeString, + Required: true, + Description: "Configuration ID.", + }, + "child_image_version_id": { + Type: schema.TypeString, + Required: true, + Description: "Minor version image ID.", + }, + "engine_type": { + Type: schema.TypeString, + Required: true, + Description: "Cluster type: SparkSQL/PrestoSQL/SparkBatch.", + }, + "key_name": { + Type: schema.TypeString, + Required: true, + Description: "Parameter key.", + }, + "key_description": { + Type: schema.TypeString, + Required: true, + Description: "Description of the key.", + }, + "value_type": { + Type: schema.TypeString, + Required: true, + Description: "Type of the value.", + }, + "value_length_limit": { + Type: schema.TypeString, + Required: true, + Description: "Length limit of the value.", + }, + "value_regexp_limit": { + Type: schema.TypeString, + Required: true, + Description: "Regular expression constraint for the value.", + }, + "value_default": { + Type: schema.TypeString, + Required: true, + Description: "Default value.", + }, + "is_public": { + Type: schema.TypeInt, + Required: true, + Description: "Whether it is a public version: 1 for public; 2 for private.", + }, + "parameter_type": { + Type: schema.TypeInt, + Required: true, + Description: "Configuration type: 1 for session config (default); 2 for common config; 3 for cluster config.", + }, + "submit_method": { + Type: schema.TypeString, + Required: true, + Description: "Submission method: User or BackGround.", + }, + "operator": { + Type: schema.TypeString, + Required: true, + Description: "Operator.", + }, + "insert_time": { + Type: schema.TypeString, + Required: true, + Description: "Insert time.", + }, + "update_time": { + Type: schema.TypeString, + Required: true, + Description: "Update time.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudDlcDataEngineSessionParametersRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_dlc_data_engine_session_parameters.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = DlcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + dataEngineId string + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("data_engine_id"); ok { + paramMap["DataEngineId"] = helper.String(v.(string)) + dataEngineId = v.(string) + } + + if v, ok := d.GetOk("data_engine_name"); ok { + paramMap["DataEngineName"] = helper.String(v.(string)) + } + + var respData []*dlcv20210125.DataEngineImageSessionParameter + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeDlcDataEngineSessionParametersByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + dataEngineParametersList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, dataEngineParameters := range respData { + dataEngineParametersMap := map[string]interface{}{} + if dataEngineParameters.ParameterId != nil { + dataEngineParametersMap["parameter_id"] = dataEngineParameters.ParameterId + } + + if dataEngineParameters.ChildImageVersionId != nil { + dataEngineParametersMap["child_image_version_id"] = dataEngineParameters.ChildImageVersionId + } + + if dataEngineParameters.EngineType != nil { + dataEngineParametersMap["engine_type"] = dataEngineParameters.EngineType + } + + if dataEngineParameters.KeyName != nil { + dataEngineParametersMap["key_name"] = dataEngineParameters.KeyName + } + + if dataEngineParameters.KeyDescription != nil { + dataEngineParametersMap["key_description"] = dataEngineParameters.KeyDescription + } + + if dataEngineParameters.ValueType != nil { + dataEngineParametersMap["value_type"] = dataEngineParameters.ValueType + } + + if dataEngineParameters.ValueLengthLimit != nil { + dataEngineParametersMap["value_length_limit"] = dataEngineParameters.ValueLengthLimit + } + + if dataEngineParameters.ValueRegexpLimit != nil { + dataEngineParametersMap["value_regexp_limit"] = dataEngineParameters.ValueRegexpLimit + } + + if dataEngineParameters.ValueDefault != nil { + dataEngineParametersMap["value_default"] = dataEngineParameters.ValueDefault + } + + if dataEngineParameters.IsPublic != nil { + dataEngineParametersMap["is_public"] = dataEngineParameters.IsPublic + } + + if dataEngineParameters.ParameterType != nil { + dataEngineParametersMap["parameter_type"] = dataEngineParameters.ParameterType + } + + if dataEngineParameters.SubmitMethod != nil { + dataEngineParametersMap["submit_method"] = dataEngineParameters.SubmitMethod + } + + if dataEngineParameters.Operator != nil { + dataEngineParametersMap["operator"] = dataEngineParameters.Operator + } + + if dataEngineParameters.InsertTime != nil { + dataEngineParametersMap["insert_time"] = dataEngineParameters.InsertTime + } + + if dataEngineParameters.UpdateTime != nil { + dataEngineParametersMap["update_time"] = dataEngineParameters.UpdateTime + } + + dataEngineParametersList = append(dataEngineParametersList, dataEngineParametersMap) + } + + _ = d.Set("data_engine_parameters", dataEngineParametersList) + } + + d.SetId(dataEngineId) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), dataEngineParametersList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.md b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.md new file mode 100644 index 0000000000..aab22d9bd5 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters.md @@ -0,0 +1,9 @@ +Use this data source to query detailed information of DLC data engine session parameters + +Example Usage + +```hcl +data "tencentcloud_dlc_data_engine_session_parameters" "example" { + data_engine_id = "DataEngine-public-1308726196" +} +``` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters_test.go b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters_test.go new file mode 100644 index 0000000000..cb4de62555 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_data_engine_session_parameters_test.go @@ -0,0 +1,31 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcDataEngineSessionParametersDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcDataEngineSessionParametersDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_dlc_data_engine_session_parameters.dlc_data_engine_session_parameters"), + ), + }}, + }) +} + +const testAccDlcDataEngineSessionParametersDataSource = ` +data "tencentcloud_dlc_data_engine_session_parameters" "example" { + data_engine_id = "DataEngine-public-1308726196" +} +` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.go b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.go new file mode 100644 index 0000000000..9197ade3be --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.go @@ -0,0 +1,140 @@ +package dlc + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudDlcSessionImageVersion() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudDlcSessionImageVersionRead, + Schema: map[string]*schema.Schema{ + "data_engine_id": { + Type: schema.TypeString, + Required: true, + Description: "Data engine ID.", + }, + + "framework_type": { + Type: schema.TypeString, + Required: true, + Description: "Framework type: machine learning, Python, Spark ML.", + }, + + "engine_session_images": { + Type: schema.TypeList, + Computed: true, + Description: "Engine session image information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "spark_image_id": { + Type: schema.TypeString, + Required: true, + Description: "Spark image ID.", + }, + "spark_image_version": { + Type: schema.TypeString, + Required: true, + Description: "Spark image version.", + }, + "spark_image_type": { + Type: schema.TypeInt, + Required: true, + Description: "Small version image type. 1: TensorFlow, 2: Pytorch, 3: SK-learn.", + }, + "spark_image_tag": { + Type: schema.TypeString, + Required: true, + Description: "Spark image tag.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudDlcSessionImageVersionRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_dlc_session_image_version.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = DlcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + dataEngineId string + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("data_engine_id"); ok { + paramMap["DataEngineId"] = helper.String(v.(string)) + dataEngineId = v.(string) + } + + if v, ok := d.GetOk("framework_type"); ok { + paramMap["FrameworkType"] = helper.String(v.(string)) + } + + var respData []*dlcv20210125.EngineSessionImage + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeDlcSessionImageVersionByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + engineSessionImagesList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, engineSessionImages := range respData { + engineSessionImagesMap := map[string]interface{}{} + if engineSessionImages.SparkImageId != nil { + engineSessionImagesMap["spark_image_id"] = engineSessionImages.SparkImageId + } + + if engineSessionImages.SparkImageVersion != nil { + engineSessionImagesMap["spark_image_version"] = engineSessionImages.SparkImageVersion + } + + if engineSessionImages.SparkImageType != nil { + engineSessionImagesMap["spark_image_type"] = engineSessionImages.SparkImageType + } + + if engineSessionImages.SparkImageTag != nil { + engineSessionImagesMap["spark_image_tag"] = engineSessionImages.SparkImageTag + } + + engineSessionImagesList = append(engineSessionImagesList, engineSessionImagesMap) + } + + _ = d.Set("engine_session_images", engineSessionImagesList) + } + + d.SetId(dataEngineId) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), engineSessionImagesList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.md b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.md new file mode 100644 index 0000000000..2e5050713d --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version.md @@ -0,0 +1,10 @@ +Use this data source to query detailed information of DLC session image version + +Example Usage + +```hcl +data "tencentcloud_dlc_session_image_version" "example" { + data_engine_id = "DataEngine-e482ijv6" + framework_type = "machine-learning" +} +``` diff --git a/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version_test.go b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version_test.go new file mode 100644 index 0000000000..9497a17b78 --- /dev/null +++ b/tencentcloud/services/dlc/data_source_tc_dlc_session_image_version_test.go @@ -0,0 +1,32 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcSessionImageVersionDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcSessionImageVersionDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_dlc_session_image_version.example"), + ), + }}, + }) +} + +const testAccDlcSessionImageVersionDataSource = ` +data "tencentcloud_dlc_session_image_version" "example" { + data_engine_id = "DataEngine-e482ijv6" + framework_type = "machine-learning" +} +` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go new file mode 100644 index 0000000000..40068adbef --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go @@ -0,0 +1,141 @@ +package dlc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationCreate, + Read: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead, + Delete: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationDelete, + Schema: map[string]*schema.Schema{ + "engine_resource_group_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Engine resource group ID.", + }, + + "network_config_names": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Description: "A collection of network configuration names bound to the resource group.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewUpdateEngineResourceGroupNetworkConfigInfoRequest() + engineResourceGroupId string + ) + + if v, ok := d.GetOk("engine_resource_group_id"); ok { + request.EngineResourceGroupId = helper.String(v.(string)) + engineResourceGroupId = v.(string) + } + + if v, ok := d.GetOk("network_config_names"); ok { + networkConfigNamesSet := v.(*schema.Set).List() + for i := range networkConfigNamesSet { + networkConfigNames := networkConfigNamesSet[i].(string) + request.NetworkConfigNames = append(request.NetworkConfigNames, helper.String(networkConfigNames)) + } + } + + request.IsEffectiveNow = helper.IntInt64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateEngineResourceGroupNetworkConfigInfoWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc update engine resource group network config information operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(engineResourceGroupId) + + // wait + waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() + waitReq.Filters = []*dlcv20210125.Filter{ + &dlcv20210125.Filter{ + Name: helper.String("engine-resource-group-id"), + Values: helper.Strings([]string{engineResourceGroupId}), + }, + } + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if *resourceGroupState == 2 { + return nil + } + + return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead(d, meta) +} + +func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md new file mode 100644 index 0000000000..f4658c3bed --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md @@ -0,0 +1,9 @@ +Provides a resource to create a DLC update engine resource group network config information operation + +Example Usage + +```hcl +resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { + engine_resource_group_id = "rg-b6fxxxxxx2a0" +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go new file mode 100644 index 0000000000..8ea2f51d7e --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go @@ -0,0 +1,33 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDlcUpdateEngineResourceGroupNetworkConfigInformationOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.example", "id"), + ), + }, + }, + }) +} + +const testAccDlcUpdateEngineResourceGroupNetworkConfigInformationOperation = ` +resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { + engine_resource_group_id = "rg-b6fxxxxxx2a0" +} +` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go new file mode 100644 index 0000000000..82bc9a441c --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go @@ -0,0 +1,199 @@ +package dlc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationCreate, + Read: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead, + Delete: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationDelete, + Schema: map[string]*schema.Schema{ + "engine_resource_group_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Engine resource group name.", + }, + + "update_conf_context": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + Description: "Configuration that needs to be updated.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "config_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Parameter type, optional: StaticConfigType, DynamicConfigType.", + }, + "params": { + Type: schema.TypeList, + Required: true, + Description: "Configuration array of parameters.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "config_item": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Parameter key.", + }, + "config_value": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Parameter value.", + }, + "operate": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Send operations, support: ADD, DELETE, MODIFY.", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewUpdateStandardEngineResourceGroupConfigInfoRequest() + engineResourceGroupName string + ) + + if v, ok := d.GetOk("engine_resource_group_name"); ok { + request.EngineResourceGroupName = helper.String(v.(string)) + engineResourceGroupName = v.(string) + } + + if v, ok := d.GetOk("update_conf_context"); ok { + for _, item := range v.([]interface{}) { + updateConfContextMap := item.(map[string]interface{}) + updateConfContext := dlcv20210125.UpdateConfContext{} + if v, ok := updateConfContextMap["config_type"].(string); ok && v != "" { + updateConfContext.ConfigType = helper.String(v) + } + + if v, ok := updateConfContextMap["params"]; ok { + for _, item := range v.([]interface{}) { + paramsMap := item.(map[string]interface{}) + param := dlcv20210125.Param{} + if v, ok := paramsMap["config_item"].(string); ok && v != "" { + param.ConfigItem = helper.String(v) + } + + if v, ok := paramsMap["config_value"].(string); ok && v != "" { + param.ConfigValue = helper.String(v) + } + + if v, ok := paramsMap["operate"].(string); ok && v != "" { + param.Operate = helper.String(v) + } + + updateConfContext.Params = append(updateConfContext.Params, ¶m) + } + } + + request.UpdateConfContext = append(request.UpdateConfContext, &updateConfContext) + } + } + + request.IsEffectiveNow = helper.IntInt64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateStandardEngineResourceGroupConfigInfoWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc update standard engine resource group config information operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(engineResourceGroupName) + + // wait + waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() + waitReq.Filters = []*dlcv20210125.Filter{ + &dlcv20210125.Filter{ + Name: helper.String("engine-resource-group-name-unique"), + Values: helper.Strings([]string{engineResourceGroupName}), + }, + } + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if *resourceGroupState == 2 { + return nil + } + + return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead(d, meta) +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md new file mode 100644 index 0000000000..4726464c57 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md @@ -0,0 +1,17 @@ +Provides a resource to create a DLC update standard engine resource group config information operation + +Example Usage + +```hcl +resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { + engine_resource_group_name = "tf-example" + update_conf_context { + config_type = "StaticConfigType" + params { + config_item = "spark.sql.shuffle.partitions" + config_value = "300" + operate = "ADD" + } + } +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go new file mode 100644 index 0000000000..77c1a0964d --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go @@ -0,0 +1,41 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDlcUpdateStandardEngineResourceGroupConfigInformationOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.example", "id"), + ), + }, + }, + }) +} + +const testAccDlcUpdateStandardEngineResourceGroupConfigInformationOperation = ` +resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { + engine_resource_group_name = "tf-example" + update_conf_context { + config_type = "StaticConfigType" + params { + config_item = "spark.sql.shuffle.partitions" + config_value = "300" + operate = "ADD" + } + } +} +` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go new file mode 100644 index 0000000000..d8b3cc14b4 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go @@ -0,0 +1,288 @@ +package dlc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationCreate, + Read: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead, + Delete: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationDelete, + Schema: map[string]*schema.Schema{ + "engine_resource_group_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Engine resource group name.", + }, + + "driver_cu_spec": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Driver CU specifications:\nCurrently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory).", + }, + + "executor_cu_spec": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Executor CU specifications:\nCurrently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory).", + }, + + "min_executor_nums": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "Minimum number of executors.", + }, + + "max_executor_nums": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "Maximum number of executors.", + }, + + "size": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "AI resource group resource limit.", + }, + + "image_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Image type, built-in image: built-in, custom image: custom.", + }, + + "image_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Image name.", + }, + + "image_version": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Image version, image id.", + }, + + "frame_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Framework Type.", + }, + + "public_domain": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Customized mirror domain name.", + }, + + "registry_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Custom image instance id.", + }, + + "region_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Customize the image region.", + }, + + "python_cu_spec": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The resource limit for a Python stand-alone node in a Python resource group must be smaller than the resource limit for the resource group. Small: 1cu Medium: 2cu Large: 4cu Xlarge: 8cu 4xlarge: 16cu 8xlarge: 32cu 16xlarge: 64cu. If the resource type is high memory, add m before the type.", + }, + + "spark_spec_mode": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Only SQL resource group resource configuration mode, fast: fast mode, custom: custom mode.", + }, + + "spark_size": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "SQL resource group resource limit only, only used in fast mode.", + }, + }, + } +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewUpdateStandardEngineResourceGroupResourceInfoRequest() + engineResourceGroupName string + ) + + if v, ok := d.GetOk("engine_resource_group_name"); ok { + request.EngineResourceGroupName = helper.String(v.(string)) + engineResourceGroupName = v.(string) + } + + if v, ok := d.GetOk("driver_cu_spec"); ok { + request.DriverCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOk("executor_cu_spec"); ok { + request.ExecutorCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("min_executor_nums"); ok { + request.MinExecutorNums = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("max_executor_nums"); ok { + request.MaxExecutorNums = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("size"); ok { + request.Size = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("image_type"); ok { + request.ImageType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_name"); ok { + request.ImageName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_version"); ok { + request.ImageVersion = helper.String(v.(string)) + } + + if v, ok := d.GetOk("frame_type"); ok { + request.FrameType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("public_domain"); ok { + request.PublicDomain = helper.String(v.(string)) + } + + if v, ok := d.GetOk("registry_id"); ok { + request.RegistryId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("region_name"); ok { + request.RegionName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("python_cu_spec"); ok { + request.PythonCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOk("spark_spec_mode"); ok { + request.SparkSpecMode = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("spark_size"); ok { + request.SparkSize = helper.IntInt64(v.(int)) + } + + request.IsEffectiveNow = helper.IntInt64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateStandardEngineResourceGroupResourceInfoWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc update standard engine resource group resource information operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(engineResourceGroupName) + + // wait + waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() + waitReq.Filters = []*dlcv20210125.Filter{ + &dlcv20210125.Filter{ + Name: helper.String("engine-resource-group-name-unique"), + Values: helper.Strings([]string{engineResourceGroupName}), + }, + } + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if *resourceGroupState == 2 { + return nil + } + + return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead(d, meta) +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md new file mode 100644 index 0000000000..e0981f9341 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md @@ -0,0 +1,9 @@ +Provides a resource to create a DLC update standard engine resource group resource information operation + +Example Usage + +```hcl +resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { + engine_resource_group_name = "tf-example" +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go new file mode 100644 index 0000000000..8b5de6224a --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go @@ -0,0 +1,31 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcUpdateStandardEngineResourceGroupResourceInformationOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.example", "id"), + ), + }}, + }) +} + +const testAccDlcUpdateStandardEngineResourceGroupResourceInformationOperation = ` +resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { + engine_resource_group_name = "test" +} +` diff --git a/tencentcloud/services/dlc/service_tencentcloud_dlc.go b/tencentcloud/services/dlc/service_tencentcloud_dlc.go index d2474610a0..a93bddae51 100644 --- a/tencentcloud/services/dlc/service_tencentcloud_dlc.go +++ b/tencentcloud/services/dlc/service_tencentcloud_dlc.go @@ -1120,3 +1120,137 @@ func (me *DlcService) DescribeDlcStandardEngineResourceGroupConfigInformationByF ret = response.Response return } + +func (me *DlcService) DescribeDlcDataEngineNetworkByFilter(ctx context.Context, param map[string]interface{}) (ret []*dlc.EngineNetworkInfo, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = dlc.NewDescribeEngineNetworksRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "SortBy" { + request.SortBy = v.(*string) + } + + if k == "Sorting" { + request.Sorting = v.(*string) + } + + if k == "Filters" { + request.Filters = v.([]*dlc.Filter) + } + } + + var ( + offset int64 = 0 + limit int64 = 100 + ) + + for { + request.Offset = &offset + request.Limit = &limit + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDlcClient().DescribeEngineNetworks(request) + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.EngineNetworkInfos) < 1 { + break + } + + ret = append(ret, response.Response.EngineNetworkInfos...) + if len(response.Response.EngineNetworkInfos) < int(limit) { + break + } + + offset += limit + } + + return +} + +func (me *DlcService) DescribeDlcDataEngineSessionParametersByFilter(ctx context.Context, param map[string]interface{}) (ret []*dlc.DataEngineImageSessionParameter, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = dlc.NewDescribeDataEngineSessionParametersRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "DataEngineId" { + request.DataEngineId = v.(*string) + } + + if k == "DataEngineName" { + request.DataEngineName = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDlcClient().DescribeDataEngineSessionParameters(request) + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + if len(response.Response.DataEngineParameters) < 1 { + return + } + + ret = response.Response.DataEngineParameters + return +} + +func (me *DlcService) DescribeDlcSessionImageVersionByFilter(ctx context.Context, param map[string]interface{}) (ret []*dlc.EngineSessionImage, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = dlc.NewDescribeSessionImageVersionRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "DataEngineId" { + request.DataEngineId = v.(*string) + } + + if k == "FrameworkType" { + request.FrameworkType = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + response, err := me.client.UseDlcClient().DescribeSessionImageVersion(request) + if err != nil { + errRet = err + return + } + + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + if len(response.Response.EngineSessionImages) < 1 { + return + } + + ret = response.Response.EngineSessionImages + return +} diff --git a/website/docs/d/dlc_data_engine_network.html.markdown b/website/docs/d/dlc_data_engine_network.html.markdown new file mode 100644 index 0000000000..29f64050d3 --- /dev/null +++ b/website/docs/d/dlc_data_engine_network.html.markdown @@ -0,0 +1,47 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_data_engine_network" +sidebar_current: "docs-tencentcloud-datasource-dlc_data_engine_network" +description: |- + Use this data source to query detailed information of DLC data engine network +--- + +# tencentcloud_dlc_data_engine_network + +Use this data source to query detailed information of DLC data engine network + +## Example Usage + +```hcl +data "tencentcloud_dlc_data_engine_network" "example" { + sort_by = "create-time" + sorting = "desc" + filters { + name = "engine-network-id" + values = ["DataEngine_Network-g1sxyw8v"] + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `filters` - (Optional, List) Filter conditions are optional, engine-network-id--engine network ID, engine-network-state--engine network status. +* `result_output_file` - (Optional, String) Used to save results. +* `sort_by` - (Optional, String) Sort Field. +* `sorting` - (Optional, String) Sort order, asc or desc. + +The `filters` object supports the following: + +* `name` - (Required, String) Attribute name, if there are multiple filters, the relationship between filters is a logical OR relationship. +* `values` - (Required, List) Attribute value, if there are multiple values, the relationship between values is a logical OR relationship. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `engine_networks_infos` - Engine network information list. + + diff --git a/website/docs/d/dlc_data_engine_session_parameters.html.markdown b/website/docs/d/dlc_data_engine_session_parameters.html.markdown new file mode 100644 index 0000000000..78dddc2775 --- /dev/null +++ b/website/docs/d/dlc_data_engine_session_parameters.html.markdown @@ -0,0 +1,36 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_data_engine_session_parameters" +sidebar_current: "docs-tencentcloud-datasource-dlc_data_engine_session_parameters" +description: |- + Use this data source to query detailed information of DLC data engine session parameters +--- + +# tencentcloud_dlc_data_engine_session_parameters + +Use this data source to query detailed information of DLC data engine session parameters + +## Example Usage + +```hcl +data "tencentcloud_dlc_data_engine_session_parameters" "example" { + data_engine_id = "DataEngine-public-1308726196" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `data_engine_id` - (Required, String) DataEngine Id. +* `data_engine_name` - (Optional, String) Engine name. When the engine name is specified, the name is used first to obtain the configuration. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `data_engine_parameters` - Engine Session Configuration List. + + diff --git a/website/docs/d/dlc_session_image_version.html.markdown b/website/docs/d/dlc_session_image_version.html.markdown new file mode 100644 index 0000000000..e6dadf7c72 --- /dev/null +++ b/website/docs/d/dlc_session_image_version.html.markdown @@ -0,0 +1,37 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_session_image_version" +sidebar_current: "docs-tencentcloud-datasource-dlc_session_image_version" +description: |- + Use this data source to query detailed information of DLC session image version +--- + +# tencentcloud_dlc_session_image_version + +Use this data source to query detailed information of DLC session image version + +## Example Usage + +```hcl +data "tencentcloud_dlc_session_image_version" "example" { + data_engine_id = "DataEngine-e482ijv6" + framework_type = "machine-learning" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `data_engine_id` - (Required, String) Data engine ID. +* `framework_type` - (Required, String) Framework type: machine learning, Python, Spark ML. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `engine_session_images` - Engine session image information. + + diff --git a/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown b/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown new file mode 100644 index 0000000000..f8198e5e33 --- /dev/null +++ b/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown @@ -0,0 +1,36 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" +sidebar_current: "docs-tencentcloud-resource-dlc_update_engine_resource_group_network_config_information_operation" +description: |- + Provides a resource to create a DLC update engine resource group network config information operation +--- + +# tencentcloud_dlc_update_engine_resource_group_network_config_information_operation + +Provides a resource to create a DLC update engine resource group network config information operation + +## Example Usage + +```hcl +resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { + engine_resource_group_id = "rg-b6fxxxxxx2a0" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `engine_resource_group_id` - (Required, String, ForceNew) Engine resource group ID. +* `network_config_names` - (Optional, Set: [`String`], ForceNew) A collection of network configuration names bound to the resource group. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown b/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown new file mode 100644 index 0000000000..20b3efc1ea --- /dev/null +++ b/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" +sidebar_current: "docs-tencentcloud-resource-dlc_update_standard_engine_resource_group_config_information_operation" +description: |- + Provides a resource to create a DLC update standard engine resource group config information operation +--- + +# tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation + +Provides a resource to create a DLC update standard engine resource group config information operation + +## Example Usage + +```hcl +resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { + engine_resource_group_name = "tf-example" + update_conf_context { + config_type = "StaticConfigType" + params { + config_item = "spark.sql.shuffle.partitions" + config_value = "300" + operate = "ADD" + } + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `engine_resource_group_name` - (Required, String, ForceNew) Engine resource group name. +* `update_conf_context` - (Required, List, ForceNew) Configuration that needs to be updated. + +The `params` object of `update_conf_context` supports the following: + +* `config_item` - (Optional, String, ForceNew) Parameter key. +* `config_value` - (Optional, String, ForceNew) Parameter value. +* `operate` - (Optional, String, ForceNew) Send operations, support: ADD, DELETE, MODIFY. + +The `update_conf_context` object supports the following: + +* `config_type` - (Required, String, ForceNew) Parameter type, optional: StaticConfigType, DynamicConfigType. +* `params` - (Required, List) Configuration array of parameters. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown b/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown new file mode 100644 index 0000000000..22eddaac95 --- /dev/null +++ b/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown @@ -0,0 +1,52 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" +sidebar_current: "docs-tencentcloud-resource-dlc_update_standard_engine_resource_group_resource_information_operation" +description: |- + Provides a resource to create a DLC update standard engine resource group resource information operation +--- + +# tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation + +Provides a resource to create a DLC update standard engine resource group resource information operation + +## Example Usage + +```hcl +resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { + engine_resource_group_name = "tf-example" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `engine_resource_group_name` - (Required, String, ForceNew) Engine resource group name. +* `driver_cu_spec` - (Optional, String, ForceNew) Driver CU specifications: +Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory). +* `executor_cu_spec` - (Optional, String, ForceNew) Executor CU specifications: +Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory). +* `frame_type` - (Optional, String, ForceNew) Framework Type. +* `image_name` - (Optional, String, ForceNew) Image name. +* `image_type` - (Optional, String, ForceNew) Image type, built-in image: built-in, custom image: custom. +* `image_version` - (Optional, String, ForceNew) Image version, image id. +* `max_executor_nums` - (Optional, Int, ForceNew) Maximum number of executors. +* `min_executor_nums` - (Optional, Int, ForceNew) Minimum number of executors. +* `public_domain` - (Optional, String, ForceNew) Customized mirror domain name. +* `python_cu_spec` - (Optional, String, ForceNew) The resource limit for a Python stand-alone node in a Python resource group must be smaller than the resource limit for the resource group. Small: 1cu Medium: 2cu Large: 4cu Xlarge: 8cu 4xlarge: 16cu 8xlarge: 32cu 16xlarge: 64cu. If the resource type is high memory, add m before the type. +* `region_name` - (Optional, String, ForceNew) Customize the image region. +* `registry_id` - (Optional, String, ForceNew) Custom image instance id. +* `size` - (Optional, Int, ForceNew) AI resource group resource limit. +* `spark_size` - (Optional, Int, ForceNew) SQL resource group resource limit only, only used in fast mode. +* `spark_spec_mode` - (Optional, String, ForceNew) Only SQL resource group resource configuration mode, fast: fast mode, custom: custom mode. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 375d970737..50320f2137 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -2249,6 +2249,12 @@
  • tencentcloud_dlc_check_data_engine_image_can_be_upgrade
  • +
  • + tencentcloud_dlc_data_engine_network +
  • +
  • + tencentcloud_dlc_data_engine_session_parameters +
  • tencentcloud_dlc_describe_data_engine
  • @@ -2285,6 +2291,9 @@
  • tencentcloud_dlc_native_spark_sessions
  • +
  • + tencentcloud_dlc_session_image_version +
  • tencentcloud_dlc_standard_engine_resource_group_config_information
  • @@ -2332,9 +2341,18 @@
  • tencentcloud_dlc_update_data_engine_config_operation
  • +
  • + tencentcloud_dlc_update_engine_resource_group_network_config_information_operation +
  • tencentcloud_dlc_update_row_filter_operation
  • +
  • + tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation +
  • +
  • + tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation +
  • tencentcloud_dlc_upgrade_data_engine_image_operation
  • From 82c6ba6a8f795bc43d15c06e281636b4774f2d8f Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Wed, 20 Aug 2025 15:48:35 +0800 Subject: [PATCH 2/8] add --- .changelog/3486.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .changelog/3486.txt diff --git a/.changelog/3486.txt b/.changelog/3486.txt new file mode 100644 index 0000000000..ad1b251417 --- /dev/null +++ b/.changelog/3486.txt @@ -0,0 +1,23 @@ +```release-note:new-data-source +tencentcloud_dlc_data_engine_network +``` + +```release-note:new-data-source +tencentcloud_dlc_data_engine_session_parameters +``` + +```release-note:new-data-source +tencentcloud_dlc_session_image_version +``` + +```release-note:new-resource +tencentcloud_dlc_update_engine_resource_group_network_config_information_operation +``` + +```release-note:new-resource +tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation +``` + +```release-note:new-resource +tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation +``` \ No newline at end of file From ea0c06dfb13800182b3083415257f3e91c2d8e0f Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Wed, 20 Aug 2025 16:46:02 +0800 Subject: [PATCH 3/8] add --- ...ngine_resource_group_network_config_information_operation.go | 2 +- ...andard_engine_resource_group_config_information_operation.go | 2 +- ...dard_engine_resource_group_resource_information_operation.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go index 40068adbef..07da74858c 100644 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go @@ -85,7 +85,7 @@ func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOpe // wait waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() waitReq.Filters = []*dlcv20210125.Filter{ - &dlcv20210125.Filter{ + { Name: helper.String("engine-resource-group-id"), Values: helper.Strings([]string{engineResourceGroupId}), }, diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go index 82bc9a441c..f41af1860c 100644 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go @@ -143,7 +143,7 @@ func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOp // wait waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() waitReq.Filters = []*dlcv20210125.Filter{ - &dlcv20210125.Filter{ + { Name: helper.String("engine-resource-group-name-unique"), Values: helper.Strings([]string{engineResourceGroupName}), }, diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go index d8b3cc14b4..0d15fbd35c 100644 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go +++ b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go @@ -232,7 +232,7 @@ func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformation // wait waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() waitReq.Filters = []*dlcv20210125.Filter{ - &dlcv20210125.Filter{ + { Name: helper.String("engine-resource-group-name-unique"), Values: helper.Strings([]string{engineResourceGroupName}), }, From bb662557638c583822443a4c81b8b5ad1309026e Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Mon, 8 Sep 2025 16:43:44 +0800 Subject: [PATCH 4/8] add --- go.mod | 4 +- go.sum | 4 + tencentcloud/provider.go | 5 +- tencentcloud/provider.md | 5 +- ...e_tc_dlc_standard_engine_resource_group.go | 817 ++++++++++++++++++ ...e_tc_dlc_standard_engine_resource_group.md | 50 ++ ...dlc_standard_engine_resource_group_test.go | 37 + ...up_network_config_information_operation.go | 141 --- ...up_network_config_information_operation.md | 9 - ...twork_config_information_operation_test.go | 33 - ...urce_group_config_information_operation.go | 199 ----- ...urce_group_config_information_operation.md | 17 - ...group_config_information_operation_test.go | 41 - ...ce_group_resource_information_operation.go | 288 ------ ...ce_group_resource_information_operation.md | 9 - ...oup_resource_information_operation_test.go | 31 - .../resource_tc_dlc_user_vpc_connection.go | 217 +++++ .../resource_tc_dlc_user_vpc_connection.md | 12 + ...esource_tc_dlc_user_vpc_connection_test.go | 40 + .../services/dlc/service_tencentcloud_dlc.go | 92 ++ .../tencentcloud/common/http/request.go | 2 +- .../tencentcloud/dlc/v20210125/client.go | 464 ++++++++++ .../tencentcloud/dlc/v20210125/errors.go | 15 + .../tencentcloud/dlc/v20210125/models.go | 631 +++++++++++++- vendor/modules.txt | 4 +- ...andard_engine_resource_group.html.markdown | 113 +++ ...config_information_operation.html.markdown | 36 - ...config_information_operation.html.markdown | 55 -- ...source_information_operation.html.markdown | 52 -- .../r/dlc_user_vpc_connection.html.markdown | 42 + website/tencentcloud.erb | 15 +- 31 files changed, 2543 insertions(+), 937 deletions(-) create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md delete mode 100644 tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.go create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.md create mode 100644 tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection_test.go create mode 100644 website/docs/r/dlc_standard_engine_resource_group.html.markdown delete mode 100644 website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown delete mode 100644 website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown delete mode 100644 website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown create mode 100644 website/docs/r/dlc_user_vpc_connection.html.markdown diff --git a/go.mod b/go.mod index 4b8fd41d95..d5a5952876 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1107 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.1033 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.1148 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.22 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.23 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.1206 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.762 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.1161 @@ -54,7 +54,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dbbrain v1.0.652 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dc v1.0.633 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dcdb v1.0.673 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.5 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.23 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1056 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain v1.0.414 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.0.628 diff --git a/go.sum b/go.sum index 1529a461cc..7383db28b0 100644 --- a/go.sum +++ b/go.sum @@ -961,6 +961,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.14 h1:+I+n8 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.14/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.22 h1:1unTmvNXynDN0mOZSWh9tL5Wp9Rb5paMGwFvua+HHoI= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.22/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.23 h1:YZOxepoaH/yNaD1sYpCXR6PuFd22hbKdlXAGXWre8aM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.23/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993 h1:WlPgXldQCxt7qi5Xrc6j6zTrsXWzN5BcOGs7Irq7fwQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993/go.mod h1:Z9U8zNtyuyKhjS0698wqsrG/kLx1TQ5CEixXBwVe7xY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860 h1:F3esKBIT3HW9+7Gt8cVgf8X06VdGIczpgLBUECzSEzU= @@ -987,6 +989,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.0.797 h1:6hfb2rn github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.0.797/go.mod h1:7nIkeQ6XbNx8aLuX5MxZExH0WVmQDIsHbb7Mk/JunPg= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.5 h1:0GJ2seyiCYrIfupZWb8CzMfTRw43K8PV41ISRaA81FU= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.5/go.mod h1:vipcBjuWWiD8NgkeDdflpmTAHFf/zH+chcpW4ADnwi4= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.23 h1:E2hkbinLJ2FDMjpX/RpWpqpwNbOTV4hnTmdeJm2Vj4k= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.23/go.mod h1:uR34lQsblkhjuZ68wkSsKw2uHJ7MG5aUoOdWPe3ILdw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1056 h1:kvJuKukDqbt1nKzaVRdcbvs3w9CoMz3V1oQp6jo3rSw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1056/go.mod h1:TLTlcL7Dr1p0vPg0NvOi1CJEx2xG1zTlP+4k+ggxnZE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain v1.0.414 h1:egwjvOEUKBaxsoRVn/YSEhp2E8qdh77Ous9A/wftDo0= diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 1767f95211..f424b3e170 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -2243,9 +2243,8 @@ func Provider() *schema.Provider { "tencentcloud_dlc_bind_work_groups_to_user_attachment": dlc.ResourceTencentCloudDlcBindWorkGroupsToUserAttachment(), "tencentcloud_dlc_update_row_filter_operation": dlc.ResourceTencentCloudDlcUpdateRowFilterOperation(), "tencentcloud_dlc_user_data_engine_config": dlc.ResourceTencentCloudDlcUserDataEngineConfig(), - "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation": dlc.ResourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperation(), - "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation": dlc.ResourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperation(), - "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation": dlc.ResourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperation(), + "tencentcloud_dlc_user_vpc_connection": dlc.ResourceTencentCloudDlcUserVpcConnection(), + "tencentcloud_dlc_standard_engine_resource_group": dlc.ResourceTencentCloudDlcStandardEngineResourceGroup(), "tencentcloud_waf_custom_rule": waf.ResourceTencentCloudWafCustomRule(), "tencentcloud_waf_custom_white_rule": waf.ResourceTencentCloudWafCustomWhiteRule(), "tencentcloud_waf_clb_domain": waf.ResourceTencentCloudWafClbDomain(), diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index 6d35e56502..47b3fda399 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -2165,9 +2165,8 @@ tencentcloud_dlc_upgrade_data_engine_image_operation tencentcloud_dlc_user_data_engine_config tencentcloud_dlc_update_row_filter_operation tencentcloud_dlc_bind_work_groups_to_user_attachment -tencentcloud_dlc_update_engine_resource_group_network_config_information_operation -tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation -tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation +tencentcloud_dlc_user_vpc_connection +tencentcloud_dlc_standard_engine_resource_group Web Application Firewall(WAF) Data Source diff --git a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go new file mode 100644 index 0000000000..55b8614ef2 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go @@ -0,0 +1,817 @@ +package dlc + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudDlcStandardEngineResourceGroup() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcStandardEngineResourceGroupCreate, + Read: resourceTencentCloudDlcStandardEngineResourceGroupRead, + Update: resourceTencentCloudDlcStandardEngineResourceGroupUpdate, + Delete: resourceTencentCloudDlcStandardEngineResourceGroupDelete, + Schema: map[string]*schema.Schema{ + "engine_resource_group_name": { + Type: schema.TypeString, + Required: true, + Description: "Standard engine resource group name.", + }, + + "data_engine_name": { + Type: schema.TypeString, + Required: true, + Description: "Standard engine name.", + }, + + "auto_launch": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Automatic start (task submission automatically pulls up the resource group) 0-automatic start, 1-not automatic start.", + }, + + "auto_pause": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Automatically suspend resource groups. 0 - Automatically suspend, 1 - Not automatically suspend.", + }, + + "driver_cu_spec": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Driver CU specifications: Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory).", + }, + + "executor_cu_spec": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Executor CU specifications: Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory).", + }, + + "min_executor_nums": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Minimum number of executors.", + }, + + "max_executor_nums": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Maximum number of executors.", + }, + + "auto_pause_time": { + Type: schema.TypeInt, + Optional: true, + Description: "Automatic suspension time, in minutes, with a value range of 1-999 (after no tasks have reached AutoPauseTime, the resource group will automatically suspend).", + }, + + "static_config_pairs": { + Type: schema.TypeList, + Optional: true, + Description: "Static parameters of the resource group, which require restarting the resource group to take effect.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "config_item": { + Type: schema.TypeString, + Required: true, + Description: "Configuration items.", + }, + "config_value": { + Type: schema.TypeString, + Required: true, + Description: "Configuration values.", + }, + }, + }, + }, + + "dynamic_config_pairs": { + Type: schema.TypeList, + Optional: true, + Description: "Dynamic parameters of the resource group, effective in the next task.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "config_item": { + Type: schema.TypeString, + Required: true, + Description: "Configuration items.", + }, + "config_value": { + Type: schema.TypeString, + Required: true, + Description: "Configuration values.", + }, + }, + }, + }, + + "max_concurrency": { + Type: schema.TypeInt, + Optional: true, + Description: "The number of concurrent tasks is 5 by default.", + }, + + "network_config_names": { + Type: schema.TypeSet, + Optional: true, + Description: "Network configuration name.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "public_domain": { + Type: schema.TypeString, + Optional: true, + Description: "Customized mirror domain name.", + }, + + "registry_id": { + Type: schema.TypeString, + Optional: true, + Description: "Custom image instance ID.", + }, + + "frame_type": { + Type: schema.TypeString, + Optional: true, + Description: "The framework type of the AI type resource group, machine-learning, python, spark-ml, if not filled in, the default is machine-learning.", + }, + + "image_type": { + Type: schema.TypeString, + Optional: true, + Description: "Image type, build-in: built-in, custom: custom, if not filled in, the default is build-in.", + }, + + "image_name": { + Type: schema.TypeString, + Optional: true, + Description: "Image name.\nmachine-learning: pytorch-v2.5.1, scikit-learn-v1.6.0, tensorflow-v2.18.0\nspark-ml: Standard-S 1.1\npython: python-v3.10.", + }, + + "image_version": { + Type: schema.TypeString, + Optional: true, + Description: "Image ID.", + }, + + "size": { + Type: schema.TypeInt, + Optional: true, + Description: "The AI resource group is valid, and the upper limit of available resources in the resource group must be less than the upper limit of engine resources.", + }, + + "resource_group_scene": { + Type: schema.TypeString, + Optional: true, + Description: "Resource group scenario.", + }, + + "region_name": { + Type: schema.TypeString, + Optional: true, + Description: "Custom image location.", + }, + + "python_cu_spec": { + Type: schema.TypeString, + Optional: true, + Description: "The resource limit for a Python stand-alone node in a Python resource group must be smaller than the resource limit for the resource group. Small: 1cu Medium: 2cu Large: 4cu Xlarge: 8cu 4xlarge: 16cu 8xlarge: 32cu 16xlarge: 64cu. If the resource type is high memory, add m before the type.", + }, + + "spark_spec_mode": { + Type: schema.TypeString, + Optional: true, + Description: "Only SQL resource group resource configuration mode, fast: fast mode, custom: custom mode.", + }, + + "spark_size": { + Type: schema.TypeInt, + Optional: true, + Description: "Only the SQL resource group resource limit, only used for the express module.", + }, + + // computed + "engine_resource_group_id": { + Type: schema.TypeString, + Computed: true, + Description: "Standard engine resource group ID.", + }, + }, + } +} + +func resourceTencentCloudDlcStandardEngineResourceGroupCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_standard_engine_resource_group.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewCreateStandardEngineResourceGroupRequest() + engineResourceGroupName string + ) + + if v, ok := d.GetOk("engine_resource_group_name"); ok { + request.EngineResourceGroupName = helper.String(v.(string)) + engineResourceGroupName = v.(string) + } + + if v, ok := d.GetOk("data_engine_name"); ok { + request.DataEngineName = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("auto_launch"); ok { + request.AutoLaunch = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("auto_pause"); ok { + request.AutoPause = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("driver_cu_spec"); ok { + request.DriverCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOk("executor_cu_spec"); ok { + request.ExecutorCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("min_executor_nums"); ok { + request.MinExecutorNums = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("max_executor_nums"); ok { + request.MaxExecutorNums = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("auto_pause_time"); ok { + request.AutoPauseTime = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("static_config_pairs"); ok { + for _, item := range v.([]interface{}) { + staticConfigPairsMap := item.(map[string]interface{}) + engineResourceGroupConfigPair := dlcv20210125.EngineResourceGroupConfigPair{} + if v, ok := staticConfigPairsMap["config_item"].(string); ok && v != "" { + engineResourceGroupConfigPair.ConfigItem = helper.String(v) + } + + if v, ok := staticConfigPairsMap["config_value"].(string); ok && v != "" { + engineResourceGroupConfigPair.ConfigValue = helper.String(v) + } + + request.StaticConfigPairs = append(request.StaticConfigPairs, &engineResourceGroupConfigPair) + } + } + + if v, ok := d.GetOk("dynamic_config_pairs"); ok { + for _, item := range v.([]interface{}) { + dynamicConfigPairsMap := item.(map[string]interface{}) + engineResourceGroupConfigPair := dlcv20210125.EngineResourceGroupConfigPair{} + if v, ok := dynamicConfigPairsMap["config_item"].(string); ok && v != "" { + engineResourceGroupConfigPair.ConfigItem = helper.String(v) + } + + if v, ok := dynamicConfigPairsMap["config_value"].(string); ok && v != "" { + engineResourceGroupConfigPair.ConfigValue = helper.String(v) + } + + request.DynamicConfigPairs = append(request.DynamicConfigPairs, &engineResourceGroupConfigPair) + } + } + + if v, ok := d.GetOkExists("max_concurrency"); ok { + request.MaxConcurrency = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("network_config_names"); ok { + networkConfigNamesSet := v.(*schema.Set).List() + for i := range networkConfigNamesSet { + if networkConfigNames, ok := networkConfigNamesSet[i].(string); ok && networkConfigNames != "" { + request.NetworkConfigNames = append(request.NetworkConfigNames, helper.String(networkConfigNames)) + } + } + } + + if v, ok := d.GetOk("public_domain"); ok { + request.PublicDomain = helper.String(v.(string)) + } + + if v, ok := d.GetOk("registry_id"); ok { + request.RegistryId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("frame_type"); ok { + request.FrameType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_type"); ok { + request.ImageType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_name"); ok { + request.ImageName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_version"); ok { + request.ImageVersion = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("size"); ok { + request.Size = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("resource_group_scene"); ok { + request.ResourceGroupScene = helper.String(v.(string)) + } + + if v, ok := d.GetOk("region_name"); ok { + request.RegionName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("python_cu_spec"); ok { + request.PythonCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOk("spark_spec_mode"); ok { + request.SparkSpecMode = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("spark_size"); ok { + request.SparkSize = helper.IntInt64(v.(int)) + } + + request.IsLaunchNow = helper.IntInt64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().CreateStandardEngineResourceGroupWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Create dlc standard engine resource group failed, Response is nil.")) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc standard engine resource group failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(engineResourceGroupName) + + // wait + waitErr := resource.Retry(tccommon.WriteRetryTimeout*4, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, &dlcv20210125.DescribeStandardEngineResourceGroupsRequest{ + Filters: []*dlcv20210125.Filter{ + { + Name: helper.String("engine-resource-group-name-unique"), + Values: helper.Strings([]string{engineResourceGroupName}), + }, + }, + }) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe dlc standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if len(result.Response.UserEngineResourceGroupInfos) != 1 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is not 1.")) + } + + state := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if state != nil { + if *state == 2 { + return nil + } + } else { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + return resource.RetryableError(fmt.Errorf("UserEngineResourceGroupInfos is not ready, state:%d", *state)) + }) + + if waitErr != nil { + log.Printf("[CRITAL]%s wait for dlc standard engine resource group failed, reason:%+v", logId, waitErr) + return waitErr + } + + return resourceTencentCloudDlcStandardEngineResourceGroupRead(d, meta) +} + +func resourceTencentCloudDlcStandardEngineResourceGroupRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_standard_engine_resource_group.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = DlcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + engineResourceGroupName = d.Id() + ) + + respData, err := service.DescribeDlcStandardEngineResourceGroupById(ctx, engineResourceGroupName) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_dlc_standard_engine_resource_group` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.EngineResourceGroupName != nil { + d.Set("engine_resource_group_name", respData.EngineResourceGroupName) + } + + if respData.DataEngineName != nil { + d.Set("data_engine_name", respData.DataEngineName) + } + + if respData.AutoLaunch != nil { + d.Set("auto_launch", respData.AutoLaunch) + } + + if respData.AutoPause != nil { + d.Set("auto_pause", respData.AutoPause) + } + + if respData.DriverCuSpec != nil { + d.Set("driver_cu_spec", respData.DriverCuSpec) + } + + if respData.ExecutorCuSpec != nil { + d.Set("executor_cu_spec", respData.ExecutorCuSpec) + } + + if respData.MinExecutorNums != nil { + d.Set("min_executor_nums", respData.MinExecutorNums) + } + + if respData.MaxExecutorNums != nil { + d.Set("max_executor_nums", respData.MaxExecutorNums) + } + + if respData.AutoPauseTime != nil { + d.Set("auto_pause_time", respData.AutoPauseTime) + } + + if respData.MaxConcurrency != nil { + d.Set("max_concurrency", respData.MaxConcurrency) + } + + if respData.NetworkConfigNames != nil { + d.Set("network_config_names", respData.NetworkConfigNames) + } + + if respData.PublicDomain != nil { + d.Set("public_domain", respData.PublicDomain) + } + + if respData.RegistryId != nil { + d.Set("registry_id", respData.RegistryId) + } + + if respData.FrameType != nil { + d.Set("frame_type", respData.FrameType) + } + + if respData.ImageType != nil { + d.Set("image_type", respData.ImageType) + } + + if respData.ImageName != nil { + d.Set("image_name", respData.ImageName) + } + + if respData.ImageVersion != nil { + d.Set("image_version", respData.ImageVersion) + } + + if respData.Size != nil { + d.Set("size", respData.Size) + } + + if respData.ResourceGroupScene != nil { + d.Set("resource_group_scene", respData.ResourceGroupScene) + } + + if respData.RegionName != nil { + d.Set("region_name", respData.RegionName) + } + + if respData.PythonCuSpec != nil { + d.Set("python_cu_spec", respData.PythonCuSpec) + } + + if respData.SparkSpecMode != nil { + d.Set("spark_spec_mode", respData.SparkSpecMode) + } + + if respData.SparkSize != nil { + d.Set("spark_size", respData.SparkSize) + } + + if respData.EngineResourceGroupId != nil { + d.Set("engine_resource_group_id", respData.EngineResourceGroupId) + } + + return nil +} + +func resourceTencentCloudDlcStandardEngineResourceGroupUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_standard_engine_resource_group.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + engineResourceGroupName = d.Id() + ) + + immutableArgs := []string{"engine_resource_group_name", "data_engine_name", "auto_launch", "auto_pause", "auto_pause_time", "static_config_pairs", "dynamic_config_pairs", "max_concurrency", "resource_group_scene"} + for _, v := range immutableArgs { + if d.HasChange(v) { + return fmt.Errorf("argument `%s` cannot be changed", v) + } + } + + needChange := false + mutableArgs := []string{"driver_cu_spec", "executor_cu_spec", "min_executor_nums", "max_executor_nums", "size", "image_type", "image_name", "image_version", "frame_type", "public_domain", "registry_id", "region_name", "python_cu_spec", "spark_spec_mode", "spark_size"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := dlcv20210125.NewUpdateStandardEngineResourceGroupResourceInfoRequest() + if v, ok := d.GetOk("driver_cu_spec"); ok { + request.DriverCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOk("executor_cu_spec"); ok { + request.ExecutorCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("min_executor_nums"); ok { + request.MinExecutorNums = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("max_executor_nums"); ok { + request.MaxExecutorNums = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("is_effective_now"); ok { + request.IsEffectiveNow = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("size"); ok { + request.Size = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("image_type"); ok { + request.ImageType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_name"); ok { + request.ImageName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("image_version"); ok { + request.ImageVersion = helper.String(v.(string)) + } + + if v, ok := d.GetOk("frame_type"); ok { + request.FrameType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("public_domain"); ok { + request.PublicDomain = helper.String(v.(string)) + } + + if v, ok := d.GetOk("registry_id"); ok { + request.RegistryId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("region_name"); ok { + request.RegionName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("python_cu_spec"); ok { + request.PythonCuSpec = helper.String(v.(string)) + } + + if v, ok := d.GetOk("spark_spec_mode"); ok { + request.SparkSpecMode = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("spark_size"); ok { + request.SparkSize = helper.IntInt64(v.(int)) + } + + request.EngineResourceGroupName = &engineResourceGroupName + request.IsEffectiveNow = helper.Int64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateStandardEngineResourceGroupResourceInfoWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s update dlc standard engine resource group failed, reason:%+v", logId, reqErr) + return reqErr + } + + // wait + waitErr := resource.Retry(tccommon.WriteRetryTimeout*4, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, &dlcv20210125.DescribeStandardEngineResourceGroupsRequest{ + Filters: []*dlcv20210125.Filter{ + { + Name: helper.String("engine-resource-group-name-unique"), + Values: helper.Strings([]string{engineResourceGroupName}), + }, + }, + }) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe dlc standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if len(result.Response.UserEngineResourceGroupInfos) != 1 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is not 1.")) + } + + state := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if state != nil { + if *state == 2 { + return nil + } + } else { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + return resource.RetryableError(fmt.Errorf("UserEngineResourceGroupInfos is not ready, state:%d", *state)) + }) + + if waitErr != nil { + log.Printf("[CRITAL]%s wait for dlc standard engine resource group failed, reason:%+v", logId, waitErr) + return waitErr + } + } + + if d.HasChange("network_config_names") { + request := dlcv20210125.NewUpdateEngineResourceGroupNetworkConfigInfoRequest() + if v, ok := d.GetOk("network_config_names"); ok { + networkConfigNamesSet := v.(*schema.Set).List() + for i := range networkConfigNamesSet { + if networkConfigNames, ok := networkConfigNamesSet[i].(string); ok && networkConfigNames != "" { + request.NetworkConfigNames = append(request.NetworkConfigNames, helper.String(networkConfigNames)) + } + } + } + + engineResourceGroupId := d.Get("engine_resource_group_id").(string) + request.EngineResourceGroupId = &engineResourceGroupId + request.IsEffectiveNow = helper.Int64(0) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateEngineResourceGroupNetworkConfigInfoWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s update dlc standard engine resource group network config names failed, reason:%+v", logId, reqErr) + return reqErr + } + + // wait + waitErr := resource.Retry(tccommon.WriteRetryTimeout*4, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, &dlcv20210125.DescribeStandardEngineResourceGroupsRequest{ + Filters: []*dlcv20210125.Filter{ + { + Name: helper.String("engine-resource-group-name-unique"), + Values: helper.Strings([]string{engineResourceGroupName}), + }, + }, + }) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe dlc standard engine resource groups failed, Response is nil.")) + } + + if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) + } + + if len(result.Response.UserEngineResourceGroupInfos) != 1 { + return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is not 1.")) + } + + state := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState + if state != nil { + if *state == 2 { + return nil + } + } else { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + return resource.RetryableError(fmt.Errorf("UserEngineResourceGroupInfos is not ready, state:%d", *state)) + }) + + if waitErr != nil { + log.Printf("[CRITAL]%s wait for dlc standard engine resource group failed, reason:%+v", logId, waitErr) + return waitErr + } + } + + return resourceTencentCloudDlcStandardEngineResourceGroupRead(d, meta) +} + +func resourceTencentCloudDlcStandardEngineResourceGroupDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_standard_engine_resource_group.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewDeleteStandardEngineResourceGroupRequest() + engineResourceGroupName = d.Id() + ) + + request.EngineResourceGroupName = &engineResourceGroupName + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DeleteStandardEngineResourceGroupWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s delete dlc standard engine resource group failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md new file mode 100644 index 0000000000..0eee5c9a41 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md @@ -0,0 +1,50 @@ +Provides a resource to create a DLC standard engine resource group + +~> **NOTE:** If you are creating a machine learning resource group for the first time, you need to contact DLC product for whitelisting. + +Example Usage + +Only SQL analysis resource group + +```hcl +resource "tencentcloud_dlc_standard_engine_resource_group" "example" { + engine_resource_group_name = "tf-example" + data_engine_name = "tf-engine" + auto_launch = 0 + auto_pause = 0 + is_launch_now = 1 + auto_pause_time = 10 + static_config_pairs { + config_item = "key" + config_value = "value" + } + + dynamic_config_pairs { + config_item = "key" + config_value = "value" + } + max_concurrency = 5 + resource_group_scene = "SparkSQL" + spark_spec_mode = "fast" + spark_size = 16 +} +``` + +Machine learning resource group + +```hcl +resource "tencentcloud_dlc_standard_engine_resource_group" "example" { + engine_resource_group_name = "tf-example" + data_engine_name = "tf-engine" + max_concurrency = 5 + resource_group_scene = "Artificial-Intelligence" + spark_spec_mode = "fast" + spark_size = 16 + frame_type = "machine-learning" + size = 16 + python_cu_spec = "large" + image_type = "built-in" + image_version = "97319759-0b80-48b4-a7a7-436d9ef3b666" + image_name = "pytorch-v2.5.1" +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go new file mode 100644 index 0000000000..c81ddea5b4 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go @@ -0,0 +1,37 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcStandardEngineResourceGroupResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccDlcStandardEngineResourceGroup, + Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.dlc_standard_engine_resource_group", "id")), + }, { + ResourceName: "tencentcloud_dlc_standard_engine_resource_group.dlc_standard_engine_resource_group", + ImportState: true, + ImportStateVerify: true, + }}, + }) +} + +const testAccDlcStandardEngineResourceGroup = ` + +resource "tencentcloud_dlc_standard_engine_resource_group" "dlc_standard_engine_resource_group" { + static_config_pairs = { + } + dynamic_config_pairs = { + } +} +` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go deleted file mode 100644 index 07da74858c..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.go +++ /dev/null @@ -1,141 +0,0 @@ -package dlc - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" - - tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" - "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" -) - -func ResourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperation() *schema.Resource { - return &schema.Resource{ - Create: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationCreate, - Read: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead, - Delete: resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationDelete, - Schema: map[string]*schema.Schema{ - "engine_resource_group_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Engine resource group ID.", - }, - - "network_config_names": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Description: "A collection of network configuration names bound to the resource group.", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - } -} - -func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.create")() - defer tccommon.InconsistentCheck(d, meta)() - - var ( - logId = tccommon.GetLogId(tccommon.ContextNil) - ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) - request = dlcv20210125.NewUpdateEngineResourceGroupNetworkConfigInfoRequest() - engineResourceGroupId string - ) - - if v, ok := d.GetOk("engine_resource_group_id"); ok { - request.EngineResourceGroupId = helper.String(v.(string)) - engineResourceGroupId = v.(string) - } - - if v, ok := d.GetOk("network_config_names"); ok { - networkConfigNamesSet := v.(*schema.Set).List() - for i := range networkConfigNamesSet { - networkConfigNames := networkConfigNamesSet[i].(string) - request.NetworkConfigNames = append(request.NetworkConfigNames, helper.String(networkConfigNames)) - } - } - - request.IsEffectiveNow = helper.IntInt64(0) - reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { - result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateEngineResourceGroupNetworkConfigInfoWithContext(ctx, request) - if e != nil { - return tccommon.RetryError(e) - } else { - log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) - } - - return nil - }) - - if reqErr != nil { - log.Printf("[CRITAL]%s create dlc update engine resource group network config information operation failed, reason:%+v", logId, reqErr) - return reqErr - } - - d.SetId(engineResourceGroupId) - - // wait - waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() - waitReq.Filters = []*dlcv20210125.Filter{ - { - Name: helper.String("engine-resource-group-id"), - Values: helper.Strings([]string{engineResourceGroupId}), - }, - } - reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { - result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) - if e != nil { - return tccommon.RetryError(e) - } else { - log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) - } - - if result == nil || result.Response == nil { - return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) - } - - if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { - return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) - } - - if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { - return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) - } - - resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState - if *resourceGroupState == 2 { - return nil - } - - return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) - }) - - if reqErr != nil { - log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) - return reqErr - } - - return resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead(d, meta) -} - -func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationRead(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.read")() - defer tccommon.InconsistentCheck(d, meta)() - - return nil -} - -func resourceTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.delete")() - defer tccommon.InconsistentCheck(d, meta)() - - return nil -} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md deleted file mode 100644 index f4658c3bed..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation.md +++ /dev/null @@ -1,9 +0,0 @@ -Provides a resource to create a DLC update engine resource group network config information operation - -Example Usage - -```hcl -resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { - engine_resource_group_id = "rg-b6fxxxxxx2a0" -} -``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go deleted file mode 100644 index 8ea2f51d7e..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_engine_resource_group_network_config_information_operation_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package dlc_test - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - - tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" -) - -func TestAccTencentCloudDlcUpdateEngineResourceGroupNetworkConfigInformationOperationResource_basic(t *testing.T) { - t.Parallel() - resource.Test(t, resource.TestCase{ - PreCheck: func() { - tcacctest.AccPreCheck(t) - }, - Providers: tcacctest.AccProviders, - Steps: []resource.TestStep{ - { - Config: testAccDlcUpdateEngineResourceGroupNetworkConfigInformationOperation, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_engine_resource_group_network_config_information_operation.example", "id"), - ), - }, - }, - }) -} - -const testAccDlcUpdateEngineResourceGroupNetworkConfigInformationOperation = ` -resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { - engine_resource_group_id = "rg-b6fxxxxxx2a0" -} -` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go deleted file mode 100644 index f41af1860c..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.go +++ /dev/null @@ -1,199 +0,0 @@ -package dlc - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" - - tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" - "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" -) - -func ResourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperation() *schema.Resource { - return &schema.Resource{ - Create: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationCreate, - Read: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead, - Delete: resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationDelete, - Schema: map[string]*schema.Schema{ - "engine_resource_group_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Engine resource group name.", - }, - - "update_conf_context": { - Type: schema.TypeList, - Required: true, - ForceNew: true, - Description: "Configuration that needs to be updated.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "config_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Parameter type, optional: StaticConfigType, DynamicConfigType.", - }, - "params": { - Type: schema.TypeList, - Required: true, - Description: "Configuration array of parameters.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "config_item": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Parameter key.", - }, - "config_value": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Parameter value.", - }, - "operate": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Send operations, support: ADD, DELETE, MODIFY.", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.create")() - defer tccommon.InconsistentCheck(d, meta)() - - var ( - logId = tccommon.GetLogId(tccommon.ContextNil) - ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) - request = dlcv20210125.NewUpdateStandardEngineResourceGroupConfigInfoRequest() - engineResourceGroupName string - ) - - if v, ok := d.GetOk("engine_resource_group_name"); ok { - request.EngineResourceGroupName = helper.String(v.(string)) - engineResourceGroupName = v.(string) - } - - if v, ok := d.GetOk("update_conf_context"); ok { - for _, item := range v.([]interface{}) { - updateConfContextMap := item.(map[string]interface{}) - updateConfContext := dlcv20210125.UpdateConfContext{} - if v, ok := updateConfContextMap["config_type"].(string); ok && v != "" { - updateConfContext.ConfigType = helper.String(v) - } - - if v, ok := updateConfContextMap["params"]; ok { - for _, item := range v.([]interface{}) { - paramsMap := item.(map[string]interface{}) - param := dlcv20210125.Param{} - if v, ok := paramsMap["config_item"].(string); ok && v != "" { - param.ConfigItem = helper.String(v) - } - - if v, ok := paramsMap["config_value"].(string); ok && v != "" { - param.ConfigValue = helper.String(v) - } - - if v, ok := paramsMap["operate"].(string); ok && v != "" { - param.Operate = helper.String(v) - } - - updateConfContext.Params = append(updateConfContext.Params, ¶m) - } - } - - request.UpdateConfContext = append(request.UpdateConfContext, &updateConfContext) - } - } - - request.IsEffectiveNow = helper.IntInt64(0) - reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { - result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateStandardEngineResourceGroupConfigInfoWithContext(ctx, request) - if e != nil { - return tccommon.RetryError(e) - } else { - log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) - } - - return nil - }) - - if reqErr != nil { - log.Printf("[CRITAL]%s create dlc update standard engine resource group config information operation failed, reason:%+v", logId, reqErr) - return reqErr - } - - d.SetId(engineResourceGroupName) - - // wait - waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() - waitReq.Filters = []*dlcv20210125.Filter{ - { - Name: helper.String("engine-resource-group-name-unique"), - Values: helper.Strings([]string{engineResourceGroupName}), - }, - } - reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { - result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) - if e != nil { - return tccommon.RetryError(e) - } else { - log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) - } - - if result == nil || result.Response == nil { - return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) - } - - if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { - return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) - } - - if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { - return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) - } - - resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState - if *resourceGroupState == 2 { - return nil - } - - return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) - }) - - if reqErr != nil { - log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) - return reqErr - } - - return resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead(d, meta) -} - -func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationRead(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.read")() - defer tccommon.InconsistentCheck(d, meta)() - - return nil -} - -func resourceTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.delete")() - defer tccommon.InconsistentCheck(d, meta)() - - return nil -} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md deleted file mode 100644 index 4726464c57..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation.md +++ /dev/null @@ -1,17 +0,0 @@ -Provides a resource to create a DLC update standard engine resource group config information operation - -Example Usage - -```hcl -resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { - engine_resource_group_name = "tf-example" - update_conf_context { - config_type = "StaticConfigType" - params { - config_item = "spark.sql.shuffle.partitions" - config_value = "300" - operate = "ADD" - } - } -} -``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go deleted file mode 100644 index 77c1a0964d..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_config_information_operation_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package dlc_test - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - - tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" -) - -func TestAccTencentCloudDlcUpdateStandardEngineResourceGroupConfigInformationOperationResource_basic(t *testing.T) { - t.Parallel() - resource.Test(t, resource.TestCase{ - PreCheck: func() { - tcacctest.AccPreCheck(t) - }, - Providers: tcacctest.AccProviders, - Steps: []resource.TestStep{ - { - Config: testAccDlcUpdateStandardEngineResourceGroupConfigInformationOperation, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation.example", "id"), - ), - }, - }, - }) -} - -const testAccDlcUpdateStandardEngineResourceGroupConfigInformationOperation = ` -resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { - engine_resource_group_name = "tf-example" - update_conf_context { - config_type = "StaticConfigType" - params { - config_item = "spark.sql.shuffle.partitions" - config_value = "300" - operate = "ADD" - } - } -} -` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go deleted file mode 100644 index 0d15fbd35c..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.go +++ /dev/null @@ -1,288 +0,0 @@ -package dlc - -import ( - "context" - "fmt" - "log" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" - - tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" - "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" -) - -func ResourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperation() *schema.Resource { - return &schema.Resource{ - Create: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationCreate, - Read: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead, - Delete: resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationDelete, - Schema: map[string]*schema.Schema{ - "engine_resource_group_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Engine resource group name.", - }, - - "driver_cu_spec": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Driver CU specifications:\nCurrently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory).", - }, - - "executor_cu_spec": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Executor CU specifications:\nCurrently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory).", - }, - - "min_executor_nums": { - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - Description: "Minimum number of executors.", - }, - - "max_executor_nums": { - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - Description: "Maximum number of executors.", - }, - - "size": { - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - Description: "AI resource group resource limit.", - }, - - "image_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Image type, built-in image: built-in, custom image: custom.", - }, - - "image_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Image name.", - }, - - "image_version": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Image version, image id.", - }, - - "frame_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Framework Type.", - }, - - "public_domain": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Customized mirror domain name.", - }, - - "registry_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Custom image instance id.", - }, - - "region_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Customize the image region.", - }, - - "python_cu_spec": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "The resource limit for a Python stand-alone node in a Python resource group must be smaller than the resource limit for the resource group. Small: 1cu Medium: 2cu Large: 4cu Xlarge: 8cu 4xlarge: 16cu 8xlarge: 32cu 16xlarge: 64cu. If the resource type is high memory, add m before the type.", - }, - - "spark_spec_mode": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Only SQL resource group resource configuration mode, fast: fast mode, custom: custom mode.", - }, - - "spark_size": { - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - Description: "SQL resource group resource limit only, only used in fast mode.", - }, - }, - } -} - -func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationCreate(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.create")() - defer tccommon.InconsistentCheck(d, meta)() - - var ( - logId = tccommon.GetLogId(tccommon.ContextNil) - ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) - request = dlcv20210125.NewUpdateStandardEngineResourceGroupResourceInfoRequest() - engineResourceGroupName string - ) - - if v, ok := d.GetOk("engine_resource_group_name"); ok { - request.EngineResourceGroupName = helper.String(v.(string)) - engineResourceGroupName = v.(string) - } - - if v, ok := d.GetOk("driver_cu_spec"); ok { - request.DriverCuSpec = helper.String(v.(string)) - } - - if v, ok := d.GetOk("executor_cu_spec"); ok { - request.ExecutorCuSpec = helper.String(v.(string)) - } - - if v, ok := d.GetOkExists("min_executor_nums"); ok { - request.MinExecutorNums = helper.IntInt64(v.(int)) - } - - if v, ok := d.GetOkExists("max_executor_nums"); ok { - request.MaxExecutorNums = helper.IntInt64(v.(int)) - } - - if v, ok := d.GetOkExists("size"); ok { - request.Size = helper.IntInt64(v.(int)) - } - - if v, ok := d.GetOk("image_type"); ok { - request.ImageType = helper.String(v.(string)) - } - - if v, ok := d.GetOk("image_name"); ok { - request.ImageName = helper.String(v.(string)) - } - - if v, ok := d.GetOk("image_version"); ok { - request.ImageVersion = helper.String(v.(string)) - } - - if v, ok := d.GetOk("frame_type"); ok { - request.FrameType = helper.String(v.(string)) - } - - if v, ok := d.GetOk("public_domain"); ok { - request.PublicDomain = helper.String(v.(string)) - } - - if v, ok := d.GetOk("registry_id"); ok { - request.RegistryId = helper.String(v.(string)) - } - - if v, ok := d.GetOk("region_name"); ok { - request.RegionName = helper.String(v.(string)) - } - - if v, ok := d.GetOk("python_cu_spec"); ok { - request.PythonCuSpec = helper.String(v.(string)) - } - - if v, ok := d.GetOk("spark_spec_mode"); ok { - request.SparkSpecMode = helper.String(v.(string)) - } - - if v, ok := d.GetOkExists("spark_size"); ok { - request.SparkSize = helper.IntInt64(v.(int)) - } - - request.IsEffectiveNow = helper.IntInt64(0) - reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { - result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateStandardEngineResourceGroupResourceInfoWithContext(ctx, request) - if e != nil { - return tccommon.RetryError(e) - } else { - log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) - } - - return nil - }) - - if reqErr != nil { - log.Printf("[CRITAL]%s create dlc update standard engine resource group resource information operation failed, reason:%+v", logId, reqErr) - return reqErr - } - - d.SetId(engineResourceGroupName) - - // wait - waitReq := dlcv20210125.NewDescribeStandardEngineResourceGroupsRequest() - waitReq.Filters = []*dlcv20210125.Filter{ - { - Name: helper.String("engine-resource-group-name-unique"), - Values: helper.Strings([]string{engineResourceGroupName}), - }, - } - reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { - result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DescribeStandardEngineResourceGroupsWithContext(ctx, waitReq) - if e != nil { - return tccommon.RetryError(e) - } else { - log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) - } - - if result == nil || result.Response == nil { - return resource.NonRetryableError(fmt.Errorf("Describe standard engine resource groups failed, Response is nil.")) - } - - if result.Response.UserEngineResourceGroupInfos == nil || len(result.Response.UserEngineResourceGroupInfos) == 0 { - return resource.NonRetryableError(fmt.Errorf("UserEngineResourceGroupInfos is nil.")) - } - - if result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState == nil { - return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) - } - - resourceGroupState := result.Response.UserEngineResourceGroupInfos[0].ResourceGroupState - if *resourceGroupState == 2 { - return nil - } - - return resource.RetryableError(fmt.Errorf("ResourceGroupState is not running, current state is %d...", *resourceGroupState)) - }) - - if reqErr != nil { - log.Printf("[CRITAL]%s describe standard engine resource groups failed,, reason:%+v", logId, reqErr) - return reqErr - } - - return resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead(d, meta) -} - -func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationRead(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.read")() - defer tccommon.InconsistentCheck(d, meta)() - - return nil -} - -func resourceTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationDelete(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.delete")() - defer tccommon.InconsistentCheck(d, meta)() - - return nil -} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md deleted file mode 100644 index e0981f9341..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation.md +++ /dev/null @@ -1,9 +0,0 @@ -Provides a resource to create a DLC update standard engine resource group resource information operation - -Example Usage - -```hcl -resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { - engine_resource_group_name = "tf-example" -} -``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go b/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go deleted file mode 100644 index 8b5de6224a..0000000000 --- a/tencentcloud/services/dlc/resource_tc_dlc_update_standard_engine_resource_group_resource_information_operation_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package dlc_test - -import ( - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - - tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" -) - -func TestAccTencentCloudDlcUpdateStandardEngineResourceGroupResourceInformationOperationResource_basic(t *testing.T) { - t.Parallel() - resource.Test(t, resource.TestCase{ - PreCheck: func() { - tcacctest.AccPreCheck(t) - }, - Providers: tcacctest.AccProviders, - Steps: []resource.TestStep{{ - Config: testAccDlcUpdateStandardEngineResourceGroupResourceInformationOperation, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrSet("tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation.example", "id"), - ), - }}, - }) -} - -const testAccDlcUpdateStandardEngineResourceGroupResourceInformationOperation = ` -resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { - engine_resource_group_name = "test" -} -` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.go b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.go new file mode 100644 index 0000000000..500976c365 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.go @@ -0,0 +1,217 @@ +package dlc + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + dlcv20210125 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudDlcUserVpcConnection() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcUserVpcConnectionCreate, + Read: resourceTencentCloudDlcUserVpcConnectionRead, + Delete: resourceTencentCloudDlcUserVpcConnectionDelete, + Schema: map[string]*schema.Schema{ + "user_vpc_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "User vpc ID.", + }, + + "user_subnet_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "User subnet ID.", + }, + + "user_vpc_endpoint_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "User vpc endpoint name.", + }, + + "engine_network_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Engine network ID.", + }, + + "user_vpc_endpoint_vip": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Manually specify VIP, if not filled in, an IP address under the subnet will be automatically assigned.", + }, + + // computed + "user_vpc_endpoint_id": { + Type: schema.TypeString, + Computed: true, + Description: "User endpoint ID.", + }, + }, + } +} + +func resourceTencentCloudDlcUserVpcConnectionCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_user_vpc_connection.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewCreateUserVpcConnectionRequest() + response = dlcv20210125.NewCreateUserVpcConnectionResponse() + engineNetworkId string + userVpcEndpointId string + ) + + if v, ok := d.GetOk("user_vpc_id"); ok { + request.UserVpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("user_subnet_id"); ok { + request.UserSubnetId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("user_vpc_endpoint_name"); ok { + request.UserVpcEndpointName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("engine_network_id"); ok { + request.EngineNetworkId = helper.String(v.(string)) + engineNetworkId = v.(string) + } + + if v, ok := d.GetOk("user_vpc_endpoint_vip"); ok { + request.UserVpcEndpointVip = helper.String(v.(string)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().CreateUserVpcConnectionWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Create dlc user vpc connection failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc user vpc connection failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.UserVpcEndpointId == nil { + return fmt.Errorf("UserVpcEndpointId is nil.") + } + + userVpcEndpointId = *response.Response.UserVpcEndpointId + d.SetId(strings.Join([]string{engineNetworkId, userVpcEndpointId}, tccommon.FILED_SP)) + return resourceTencentCloudDlcUserVpcConnectionRead(d, meta) +} + +func resourceTencentCloudDlcUserVpcConnectionRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_user_vpc_connection.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = DlcService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + idSplit := strings.Split(d.Id(), tccommon.FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + engineNetworkId := idSplit[0] + userVpcEndpointId := idSplit[1] + + respData, err := service.DescribeDlcUserVpcConnectionById(ctx, engineNetworkId, userVpcEndpointId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_dlc_user_vpc_connection` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.UserVpcId != nil { + d.Set("user_vpc_id", respData.UserVpcId) + } + + if respData.UserVpcEndpointName != nil { + d.Set("user_vpc_endpoint_name", respData.UserVpcEndpointName) + } + + if respData.EngineNetworkId != nil { + d.Set("engine_network_id", respData.EngineNetworkId) + } + + if respData.UserVpcEndpointId != nil { + d.Set("user_vpc_endpoint_id", respData.UserVpcEndpointId) + } + + return nil +} + +func resourceTencentCloudDlcUserVpcConnectionDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_user_vpc_connection.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewDeleteUserVpcConnectionRequest() + ) + + idSplit := strings.Split(d.Id(), tccommon.FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + engineNetworkId := idSplit[0] + userVpcEndpointId := idSplit[1] + + request.EngineNetworkId = helper.String(engineNetworkId) + request.UserVpcEndpointId = helper.String(userVpcEndpointId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DeleteUserVpcConnectionWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s delete dlc user vpc connection failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.md b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.md new file mode 100644 index 0000000000..b165a5d8cb --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.md @@ -0,0 +1,12 @@ +Provides a resource to create a DLC user vpc connection + +Example Usage + +```hcl +resource "tencentcloud_dlc_user_vpc_connection" "example" { + user_vpc_id = "vpc-f7fa1fu5" + user_subnet_id = "subnet-ds2t3udw" + user_vpc_endpoint_name = "tf-example" + engine_network_id = "DataEngine-Network-2mfg9icb" +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection_test.go b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection_test.go new file mode 100644 index 0000000000..0c82932230 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection_test.go @@ -0,0 +1,40 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcUserVpcConnectionResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDlcUserVpcConnection, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_user_vpc_connection.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_user_vpc_connection.example", "user_vpc_id"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_user_vpc_connection.example", "user_subnet_id"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_user_vpc_connection.example", "user_vpc_endpoint_name"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_user_vpc_connection.example", "engine_network_id"), + ), + }, + }, + }) +} + +const testAccDlcUserVpcConnection = ` +resource "tencentcloud_dlc_user_vpc_connection" "example" { + user_vpc_id = "vpc-f7fa1fu5" + user_subnet_id = "subnet-ds2t3udw" + user_vpc_endpoint_name = "tf-example" + engine_network_id = "DataEngine-Network-2mfg9icb" +} +` diff --git a/tencentcloud/services/dlc/service_tencentcloud_dlc.go b/tencentcloud/services/dlc/service_tencentcloud_dlc.go index a93bddae51..ee9626022d 100644 --- a/tencentcloud/services/dlc/service_tencentcloud_dlc.go +++ b/tencentcloud/services/dlc/service_tencentcloud_dlc.go @@ -1254,3 +1254,95 @@ func (me *DlcService) DescribeDlcSessionImageVersionByFilter(ctx context.Context ret = response.Response.EngineSessionImages return } + +func (me *DlcService) DescribeDlcUserVpcConnectionById(ctx context.Context, engineNetworkId, userVpcEndpointId string) (ret *dlc.UserVpcConnectionInfo, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := dlc.NewDescribeUserVpcConnectionRequest() + response := dlc.NewDescribeUserVpcConnectionResponse() + request.EngineNetworkId = &engineNetworkId + request.UserVpcEndpointIds = helper.Strings([]string{userVpcEndpointId}) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + errRet = resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseDlcClient().DescribeUserVpcConnection(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe dlc user vpc connection failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + log.Printf("[CRITAL]%s describe dlc user vpc connection failed, reason:%+v", logId, errRet) + return + } + + if len(response.Response.UserVpcConnectionInfos) != 1 { + return + } + + ret = response.Response.UserVpcConnectionInfos[0] + return +} + +func (me *DlcService) DescribeDlcStandardEngineResourceGroupById(ctx context.Context, engineResourceGroupName string) (ret *dlc.StandardEngineResourceGroupInfo, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := dlc.NewDescribeStandardEngineResourceGroupsRequest() + response := dlc.NewDescribeStandardEngineResourceGroupsResponse() + request.Filters = []*dlc.Filter{ + { + Name: helper.String("engine-resource-group-name-unique"), + Values: helper.Strings([]string{engineResourceGroupName}), + }, + } + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + errRet = resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseDlcClient().DescribeStandardEngineResourceGroups(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe dlc standard engine resource groups failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + log.Printf("[CRITAL]%s describe dlc standard engine resource groups failed, reason:%+v", logId, errRet) + return + } + + if len(response.Response.UserEngineResourceGroupInfos) != 1 { + return + } + + ret = response.Response.UserEngineResourceGroupInfos[0] + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go index 47080ca054..5593fedcc1 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go @@ -265,7 +265,7 @@ func CompleteCommonParams(request Request, region string, requestClient string) params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_1.1.22" + params["RequestClient"] = "SDK_GO_1.1.23" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/client.go index 1660a1db64..4ce9debea4 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/client.go @@ -517,6 +517,74 @@ func (c *Client) AssociateDatasourceHouseWithContext(ctx context.Context, reques return } +func NewAttachDataMaskPolicyRequest() (request *AttachDataMaskPolicyRequest) { + request = &AttachDataMaskPolicyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "AttachDataMaskPolicy") + + + return +} + +func NewAttachDataMaskPolicyResponse() (response *AttachDataMaskPolicyResponse) { + response = &AttachDataMaskPolicyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// AttachDataMaskPolicy +// 绑定数据脱敏策略 +// +// 可能返回的错误码: +// FAILEDOPERATION_GETPOLICYFAILED = "FailedOperation.GetPolicyFailed" +// FAILEDOPERATION_GETUSERINFOFAILED = "FailedOperation.GetUserInfoFailed" +// FAILEDOPERATION_GETWORKGROUPINFOFAILED = "FailedOperation.GetWorkGroupInfoFailed" +// FAILEDOPERATION_GRANTPOLICYFAILED = "FailedOperation.GrantPolicyFailed" +// FAILEDOPERATION_REVOKEPOLICYFAILED = "FailedOperation.RevokePolicyFailed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER_INVALIDACCESSPOLICY = "InvalidParameter.InvalidAccessPolicy" +// INVALIDPARAMETER_INVALIDGROUPID = "InvalidParameter.InvalidGroupId" +// UNAUTHORIZEDOPERATION_GRANTPOLICY = "UnauthorizedOperation.GrantPolicy" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +func (c *Client) AttachDataMaskPolicy(request *AttachDataMaskPolicyRequest) (response *AttachDataMaskPolicyResponse, err error) { + return c.AttachDataMaskPolicyWithContext(context.Background(), request) +} + +// AttachDataMaskPolicy +// 绑定数据脱敏策略 +// +// 可能返回的错误码: +// FAILEDOPERATION_GETPOLICYFAILED = "FailedOperation.GetPolicyFailed" +// FAILEDOPERATION_GETUSERINFOFAILED = "FailedOperation.GetUserInfoFailed" +// FAILEDOPERATION_GETWORKGROUPINFOFAILED = "FailedOperation.GetWorkGroupInfoFailed" +// FAILEDOPERATION_GRANTPOLICYFAILED = "FailedOperation.GrantPolicyFailed" +// FAILEDOPERATION_REVOKEPOLICYFAILED = "FailedOperation.RevokePolicyFailed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER_INVALIDACCESSPOLICY = "InvalidParameter.InvalidAccessPolicy" +// INVALIDPARAMETER_INVALIDGROUPID = "InvalidParameter.InvalidGroupId" +// UNAUTHORIZEDOPERATION_GRANTPOLICY = "UnauthorizedOperation.GrantPolicy" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +func (c *Client) AttachDataMaskPolicyWithContext(ctx context.Context, request *AttachDataMaskPolicyRequest) (response *AttachDataMaskPolicyResponse, err error) { + if request == nil { + request = NewAttachDataMaskPolicyRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "AttachDataMaskPolicy") + + if c.GetCredential() == nil { + return nil, errors.New("AttachDataMaskPolicy require credential") + } + + request.SetContext(ctx) + + response = NewAttachDataMaskPolicyResponse() + err = c.Send(request, response) + return +} + func NewAttachUserPolicyRequest() (request *AttachUserPolicyRequest) { request = &AttachUserPolicyRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -1641,6 +1709,58 @@ func (c *Client) CreateDataEngineWithContext(ctx context.Context, request *Creat return } +func NewCreateDataMaskStrategyRequest() (request *CreateDataMaskStrategyRequest) { + request = &CreateDataMaskStrategyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "CreateDataMaskStrategy") + + + return +} + +func NewCreateDataMaskStrategyResponse() (response *CreateDataMaskStrategyResponse) { + response = &CreateDataMaskStrategyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateDataMaskStrategy +// 创建数据脱敏策略 +// +// 可能返回的错误码: +// INTERNALERROR_DBERROR = "InternalError.DBError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) CreateDataMaskStrategy(request *CreateDataMaskStrategyRequest) (response *CreateDataMaskStrategyResponse, err error) { + return c.CreateDataMaskStrategyWithContext(context.Background(), request) +} + +// CreateDataMaskStrategy +// 创建数据脱敏策略 +// +// 可能返回的错误码: +// INTERNALERROR_DBERROR = "InternalError.DBError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) CreateDataMaskStrategyWithContext(ctx context.Context, request *CreateDataMaskStrategyRequest) (response *CreateDataMaskStrategyResponse, err error) { + if request == nil { + request = NewCreateDataMaskStrategyRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "CreateDataMaskStrategy") + + if c.GetCredential() == nil { + return nil, errors.New("CreateDataMaskStrategy require credential") + } + + request.SetContext(ctx) + + response = NewCreateDataMaskStrategyResponse() + err = c.Send(request, response) + return +} + func NewCreateDatabaseRequest() (request *CreateDatabaseRequest) { request = &CreateDatabaseRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -2271,6 +2391,7 @@ func NewCreateSparkAppResponse() (response *CreateSparkAppResponse) { // INVALIDPARAMETER_INVALIDROLEARN = "InvalidParameter.InvalidRoleArn" // INVALIDPARAMETER_SPARKJOBNOTUNIQUE = "InvalidParameter.SparkJobNotUnique" // INVALIDPARAMETER_SPARKJOBONLYSUPPORTSPARKBATCHENGINE = "InvalidParameter.SparkJobOnlySupportSparkBatchEngine" +// RESOURCEINSUFFICIENT_SPARKJOBINSUFFICIENTRESOURCES = "ResourceInsufficient.SparkJobInsufficientResources" // RESOURCENOTFOUND_DATAENGINENOTFOUND = "ResourceNotFound.DataEngineNotFound" // RESOURCENOTFOUND_SESSIONINSUFFICIENTRESOURCES = "ResourceNotFound.SessionInsufficientResources" func (c *Client) CreateSparkApp(request *CreateSparkAppRequest) (response *CreateSparkAppResponse, err error) { @@ -2290,6 +2411,7 @@ func (c *Client) CreateSparkApp(request *CreateSparkAppRequest) (response *Creat // INVALIDPARAMETER_INVALIDROLEARN = "InvalidParameter.InvalidRoleArn" // INVALIDPARAMETER_SPARKJOBNOTUNIQUE = "InvalidParameter.SparkJobNotUnique" // INVALIDPARAMETER_SPARKJOBONLYSUPPORTSPARKBATCHENGINE = "InvalidParameter.SparkJobOnlySupportSparkBatchEngine" +// RESOURCEINSUFFICIENT_SPARKJOBINSUFFICIENTRESOURCES = "ResourceInsufficient.SparkJobInsufficientResources" // RESOURCENOTFOUND_DATAENGINENOTFOUND = "ResourceNotFound.DataEngineNotFound" // RESOURCENOTFOUND_SESSIONINSUFFICIENTRESOURCES = "ResourceNotFound.SessionInsufficientResources" func (c *Client) CreateSparkAppWithContext(ctx context.Context, request *CreateSparkAppRequest) (response *CreateSparkAppResponse, err error) { @@ -2617,6 +2739,7 @@ func NewCreateSparkSubmitTaskResponse() (response *CreateSparkSubmitTaskResponse // RESOURCENOTFOUND_RESOURCEUSAGEOUTOFLIMIT = "ResourceNotFound.ResourceUsageOutOfLimit" // RESOURCENOTFOUND_SESSIONINSUFFICIENTRESOURCES = "ResourceNotFound.SessionInsufficientResources" // RESOURCENOTFOUND_SHUFFLEDIRNOTFOUND = "ResourceNotFound.ShuffleDirNotFound" +// RESOURCENOTFOUND_SPARKJOBINSUFFICIENTRESOURCES = "ResourceNotFound.SparkJobInsufficientResources" // RESOURCENOTFOUND_WAREHOUSEDIRNOTFOUND = "ResourceNotFound.WarehouseDirNotFound" // RESOURCEUNAVAILABLE = "ResourceUnavailable" // UNAUTHORIZEDOPERATION_USECOMPUTINGENGINE = "UnauthorizedOperation.UseComputingEngine" @@ -2667,6 +2790,7 @@ func (c *Client) CreateSparkSubmitTask(request *CreateSparkSubmitTaskRequest) (r // RESOURCENOTFOUND_RESOURCEUSAGEOUTOFLIMIT = "ResourceNotFound.ResourceUsageOutOfLimit" // RESOURCENOTFOUND_SESSIONINSUFFICIENTRESOURCES = "ResourceNotFound.SessionInsufficientResources" // RESOURCENOTFOUND_SHUFFLEDIRNOTFOUND = "ResourceNotFound.ShuffleDirNotFound" +// RESOURCENOTFOUND_SPARKJOBINSUFFICIENTRESOURCES = "ResourceNotFound.SparkJobInsufficientResources" // RESOURCENOTFOUND_WAREHOUSEDIRNOTFOUND = "ResourceNotFound.WarehouseDirNotFound" // RESOURCEUNAVAILABLE = "ResourceUnavailable" // UNAUTHORIZEDOPERATION_USECOMPUTINGENGINE = "UnauthorizedOperation.UseComputingEngine" @@ -3177,6 +3301,78 @@ func (c *Client) CreateTasksInOrderWithContext(ctx context.Context, request *Cre return } +func NewCreateTcIcebergTableRequest() (request *CreateTcIcebergTableRequest) { + request = &CreateTcIcebergTableRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "CreateTcIcebergTable") + + + return +} + +func NewCreateTcIcebergTableResponse() (response *CreateTcIcebergTableResponse) { + response = &CreateTcIcebergTableResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateTcIcebergTable +// 创建TIceberg表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_INVALIDCOLUMNNAMELENGTH = "InvalidParameter.InvalidColumnNameLength" +// INVALIDPARAMETER_INVALIDCOLUMNNUMBER = "InvalidParameter.InvalidColumnNumber" +// INVALIDPARAMETER_INVALIDDECIMALTYPE = "InvalidParameter.InvalidDecimalType" +// INVALIDPARAMETER_INVALIDTABLENAMELENGTH = "InvalidParameter.InvalidTableNameLength" +// INVALIDPARAMETER_PARAMETERNOTFOUNDORBENONE = "InvalidParameter.ParameterNotFoundOrBeNone" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateTcIcebergTable(request *CreateTcIcebergTableRequest) (response *CreateTcIcebergTableResponse, err error) { + return c.CreateTcIcebergTableWithContext(context.Background(), request) +} + +// CreateTcIcebergTable +// 创建TIceberg表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_INVALIDCOLUMNNAMELENGTH = "InvalidParameter.InvalidColumnNameLength" +// INVALIDPARAMETER_INVALIDCOLUMNNUMBER = "InvalidParameter.InvalidColumnNumber" +// INVALIDPARAMETER_INVALIDDECIMALTYPE = "InvalidParameter.InvalidDecimalType" +// INVALIDPARAMETER_INVALIDTABLENAMELENGTH = "InvalidParameter.InvalidTableNameLength" +// INVALIDPARAMETER_PARAMETERNOTFOUNDORBENONE = "InvalidParameter.ParameterNotFoundOrBeNone" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateTcIcebergTableWithContext(ctx context.Context, request *CreateTcIcebergTableRequest) (response *CreateTcIcebergTableResponse, err error) { + if request == nil { + request = NewCreateTcIcebergTableRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "CreateTcIcebergTable") + + if c.GetCredential() == nil { + return nil, errors.New("CreateTcIcebergTable require credential") + } + + request.SetContext(ctx) + + response = NewCreateTcIcebergTableResponse() + err = c.Send(request, response) + return +} + func NewCreateUserRequest() (request *CreateUserRequest) { request = &CreateUserRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -3539,6 +3735,58 @@ func (c *Client) DeleteDataEngineWithContext(ctx context.Context, request *Delet return } +func NewDeleteDataMaskStrategyRequest() (request *DeleteDataMaskStrategyRequest) { + request = &DeleteDataMaskStrategyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "DeleteDataMaskStrategy") + + + return +} + +func NewDeleteDataMaskStrategyResponse() (response *DeleteDataMaskStrategyResponse) { + response = &DeleteDataMaskStrategyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteDataMaskStrategy +// 删除数据脱敏策略 +// +// 可能返回的错误码: +// INTERNALERROR_DBERROR = "InternalError.DBError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) DeleteDataMaskStrategy(request *DeleteDataMaskStrategyRequest) (response *DeleteDataMaskStrategyResponse, err error) { + return c.DeleteDataMaskStrategyWithContext(context.Background(), request) +} + +// DeleteDataMaskStrategy +// 删除数据脱敏策略 +// +// 可能返回的错误码: +// INTERNALERROR_DBERROR = "InternalError.DBError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) DeleteDataMaskStrategyWithContext(ctx context.Context, request *DeleteDataMaskStrategyRequest) (response *DeleteDataMaskStrategyResponse, err error) { + if request == nil { + request = NewDeleteDataMaskStrategyRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "DeleteDataMaskStrategy") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteDataMaskStrategy require credential") + } + + request.SetContext(ctx) + + response = NewDeleteDataMaskStrategyResponse() + err = c.Send(request, response) + return +} + func NewDeleteNativeSparkSessionRequest() (request *DeleteNativeSparkSessionRequest) { request = &DeleteNativeSparkSessionRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -5067,6 +5315,58 @@ func (c *Client) DescribeDataEnginesScaleDetailWithContext(ctx context.Context, return } +func NewDescribeDataMaskStrategiesRequest() (request *DescribeDataMaskStrategiesRequest) { + request = &DescribeDataMaskStrategiesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "DescribeDataMaskStrategies") + + + return +} + +func NewDescribeDataMaskStrategiesResponse() (response *DescribeDataMaskStrategiesResponse) { + response = &DescribeDataMaskStrategiesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDataMaskStrategies +// 查询数据脱敏列表接口 +// +// 可能返回的错误码: +// INTERNALERROR_DBERROR = "InternalError.DBError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) DescribeDataMaskStrategies(request *DescribeDataMaskStrategiesRequest) (response *DescribeDataMaskStrategiesResponse, err error) { + return c.DescribeDataMaskStrategiesWithContext(context.Background(), request) +} + +// DescribeDataMaskStrategies +// 查询数据脱敏列表接口 +// +// 可能返回的错误码: +// INTERNALERROR_DBERROR = "InternalError.DBError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) DescribeDataMaskStrategiesWithContext(ctx context.Context, request *DescribeDataMaskStrategiesRequest) (response *DescribeDataMaskStrategiesResponse, err error) { + if request == nil { + request = NewDescribeDataMaskStrategiesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "DescribeDataMaskStrategies") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDataMaskStrategies require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDataMaskStrategiesResponse() + err = c.Send(request, response) + return +} + func NewDescribeDatabasesRequest() (request *DescribeDatabasesRequest) { request = &DescribeDatabasesRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -7364,6 +7664,7 @@ func NewDescribeTaskResultResponse() (response *DescribeTaskResultResponse) { // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_HTTPCLIENTDOREQUESTFAILED = "FailedOperation.HttpClientDoRequestFailed" +// FAILEDOPERATION_RESULTEXPIRED = "FailedOperation.ResultExpired" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_INVALIDMAXRESULTS = "InvalidParameter.InvalidMaxResults" @@ -7380,6 +7681,7 @@ func (c *Client) DescribeTaskResult(request *DescribeTaskResultRequest) (respons // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_HTTPCLIENTDOREQUESTFAILED = "FailedOperation.HttpClientDoRequestFailed" +// FAILEDOPERATION_RESULTEXPIRED = "FailedOperation.ResultExpired" // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_INVALIDMAXRESULTS = "InvalidParameter.InvalidMaxResults" @@ -7512,6 +7814,7 @@ func NewDescribeTasksAnalysisResponse() (response *DescribeTasksAnalysisResponse // INVALIDPARAMETER_INVALIDFILTERLENGTH = "InvalidParameter.InvalidFilterLength" // INVALIDPARAMETER_INVALIDTIMEFORMAT = "InvalidParameter.InvalidTimeFormat" // INVALIDPARAMETER_PARAMETERBASE64DECODEFAILED = "InvalidParameter.ParameterBase64DecodeFailed" +// INVALIDPARAMETER_PARAMETERILLEGAL = "InvalidParameter.ParameterIllegal" // INVALIDPARAMETER_PARAMETERNOTFOUNDORBENONE = "InvalidParameter.ParameterNotFoundOrBeNone" // INVALIDPARAMETER_SQLTASKFILTERSKEYTYPENOTMATH = "InvalidParameter.SQLTaskFiltersKeyTypeNotMath" // INVALIDPARAMETER_SQLTASKNOTFOUND = "InvalidParameter.SQLTaskNotFound" @@ -7535,6 +7838,7 @@ func (c *Client) DescribeTasksAnalysis(request *DescribeTasksAnalysisRequest) (r // INVALIDPARAMETER_INVALIDFILTERLENGTH = "InvalidParameter.InvalidFilterLength" // INVALIDPARAMETER_INVALIDTIMEFORMAT = "InvalidParameter.InvalidTimeFormat" // INVALIDPARAMETER_PARAMETERBASE64DECODEFAILED = "InvalidParameter.ParameterBase64DecodeFailed" +// INVALIDPARAMETER_PARAMETERILLEGAL = "InvalidParameter.ParameterIllegal" // INVALIDPARAMETER_PARAMETERNOTFOUNDORBENONE = "InvalidParameter.ParameterNotFoundOrBeNone" // INVALIDPARAMETER_SQLTASKFILTERSKEYTYPENOTMATH = "InvalidParameter.SQLTaskFiltersKeyTypeNotMath" // INVALIDPARAMETER_SQLTASKNOTFOUND = "InvalidParameter.SQLTaskNotFound" @@ -7665,6 +7969,7 @@ func NewDescribeTasksOverviewResponse() (response *DescribeTasksOverviewResponse // INTERNALERROR = "InternalError" // INTERNALERROR_DBERROR = "InternalError.DBError" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_INVALIDTASKSFILTERLENGTH = "InvalidParameter.InvalidTasksFilterLength" // RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) DescribeTasksOverview(request *DescribeTasksOverviewRequest) (response *DescribeTasksOverviewResponse, err error) { return c.DescribeTasksOverviewWithContext(context.Background(), request) @@ -7677,6 +7982,7 @@ func (c *Client) DescribeTasksOverview(request *DescribeTasksOverviewRequest) (r // INTERNALERROR = "InternalError" // INTERNALERROR_DBERROR = "InternalError.DBError" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_INVALIDTASKSFILTERLENGTH = "InvalidParameter.InvalidTasksFilterLength" // RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) DescribeTasksOverviewWithContext(ctx context.Context, request *DescribeTasksOverviewRequest) (response *DescribeTasksOverviewResponse, err error) { if request == nil { @@ -7751,6 +8057,58 @@ func (c *Client) DescribeThirdPartyAccessUserWithContext(ctx context.Context, re return } +func NewDescribeUDFPolicyRequest() (request *DescribeUDFPolicyRequest) { + request = &DescribeUDFPolicyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "DescribeUDFPolicy") + + + return +} + +func NewDescribeUDFPolicyResponse() (response *DescribeUDFPolicyResponse) { + response = &DescribeUDFPolicyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUDFPolicy +// 获取UDF权限信息 +// +// 可能返回的错误码: +// FAILEDOPERATION_GETPOLICYFAILED = "FailedOperation.GetPolicyFailed" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) DescribeUDFPolicy(request *DescribeUDFPolicyRequest) (response *DescribeUDFPolicyResponse, err error) { + return c.DescribeUDFPolicyWithContext(context.Background(), request) +} + +// DescribeUDFPolicy +// 获取UDF权限信息 +// +// 可能返回的错误码: +// FAILEDOPERATION_GETPOLICYFAILED = "FailedOperation.GetPolicyFailed" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) DescribeUDFPolicyWithContext(ctx context.Context, request *DescribeUDFPolicyRequest) (response *DescribeUDFPolicyResponse, err error) { + if request == nil { + request = NewDescribeUDFPolicyRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "DescribeUDFPolicy") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUDFPolicy require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUDFPolicyResponse() + err = c.Send(request, response) + return +} + func NewDescribeUpdatableDataEnginesRequest() (request *DescribeUpdatableDataEnginesRequest) { request = &DescribeUpdatableDataEnginesRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -10859,6 +11217,58 @@ func (c *Client) UpdateDataEngineConfigWithContext(ctx context.Context, request return } +func NewUpdateDataMaskStrategyRequest() (request *UpdateDataMaskStrategyRequest) { + request = &UpdateDataMaskStrategyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "UpdateDataMaskStrategy") + + + return +} + +func NewUpdateDataMaskStrategyResponse() (response *UpdateDataMaskStrategyResponse) { + response = &UpdateDataMaskStrategyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// UpdateDataMaskStrategy +// 更新数据脱敏策略 +// +// 可能返回的错误码: +// INTERNALERROR_DBERROR = "InternalError.DBError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) UpdateDataMaskStrategy(request *UpdateDataMaskStrategyRequest) (response *UpdateDataMaskStrategyResponse, err error) { + return c.UpdateDataMaskStrategyWithContext(context.Background(), request) +} + +// UpdateDataMaskStrategy +// 更新数据脱敏策略 +// +// 可能返回的错误码: +// INTERNALERROR_DBERROR = "InternalError.DBError" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) UpdateDataMaskStrategyWithContext(ctx context.Context, request *UpdateDataMaskStrategyRequest) (response *UpdateDataMaskStrategyResponse, err error) { + if request == nil { + request = NewUpdateDataMaskStrategyRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "UpdateDataMaskStrategy") + + if c.GetCredential() == nil { + return nil, errors.New("UpdateDataMaskStrategy require credential") + } + + request.SetContext(ctx) + + response = NewUpdateDataMaskStrategyResponse() + err = c.Send(request, response) + return +} + func NewUpdateEngineResourceGroupNetworkConfigInfoRequest() (request *UpdateEngineResourceGroupNetworkConfigInfoRequest) { request = &UpdateEngineResourceGroupNetworkConfigInfoRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -11231,6 +11641,60 @@ func (c *Client) UpdateStandardEngineResourceGroupResourceInfoWithContext(ctx co return } +func NewUpdateUDFPolicyRequest() (request *UpdateUDFPolicyRequest) { + request = &UpdateUDFPolicyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "UpdateUDFPolicy") + + + return +} + +func NewUpdateUDFPolicyResponse() (response *UpdateUDFPolicyResponse) { + response = &UpdateUDFPolicyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// UpdateUDFPolicy +// UDP权限修改 +// +// 可能返回的错误码: +// FAILEDOPERATION_GETPOLICYFAILED = "FailedOperation.GetPolicyFailed" +// FAILEDOPERATION_UPDATEPOLICYFAILED = "FailedOperation.UpdatePolicyFailed" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) UpdateUDFPolicy(request *UpdateUDFPolicyRequest) (response *UpdateUDFPolicyResponse, err error) { + return c.UpdateUDFPolicyWithContext(context.Background(), request) +} + +// UpdateUDFPolicy +// UDP权限修改 +// +// 可能返回的错误码: +// FAILEDOPERATION_GETPOLICYFAILED = "FailedOperation.GetPolicyFailed" +// FAILEDOPERATION_UPDATEPOLICYFAILED = "FailedOperation.UpdatePolicyFailed" +// INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" +func (c *Client) UpdateUDFPolicyWithContext(ctx context.Context, request *UpdateUDFPolicyRequest) (response *UpdateUDFPolicyResponse, err error) { + if request == nil { + request = NewUpdateUDFPolicyRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "UpdateUDFPolicy") + + if c.GetCredential() == nil { + return nil, errors.New("UpdateUDFPolicy require credential") + } + + request.SetContext(ctx) + + response = NewUpdateUDFPolicyResponse() + err = c.Send(request, response) + return +} + func NewUpdateUserDataEngineConfigRequest() (request *UpdateUserDataEngineConfigRequest) { request = &UpdateUserDataEngineConfigRequest{ BaseRequest: &tchttp.BaseRequest{}, diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/errors.go index 8a9ac2320c..682d022a07 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/errors.go @@ -125,6 +125,9 @@ const ( // 退押金失败。 FAILEDOPERATION_REFUNDDEPOSITFAILED = "FailedOperation.RefundDepositFailed" + // 结果过期 + FAILEDOPERATION_RESULTEXPIRED = "FailedOperation.ResultExpired" + // 取消授权失败。 FAILEDOPERATION_REVOKEPOLICYFAILED = "FailedOperation.RevokePolicyFailed" @@ -149,6 +152,9 @@ const ( // 标签数量超出限制。 FAILEDOPERATION_TOOMANYTAGS = "FailedOperation.TooManyTags" + // 更新权限信息失败。 + FAILEDOPERATION_UPDATEPOLICYFAILED = "FailedOperation.UpdatePolicyFailed" + // 内部错误。 INTERNALERROR = "InternalError" @@ -419,6 +425,9 @@ const ( // 任务类型TaskType错误,Spark引擎任务类型为SparkSQLTask,Presto引擎任务类型为SQLTask INVALIDPARAMETER_INVALIDTASKTYPE = "InvalidParameter.InvalidTaskType" + // 任务长度超限 + INVALIDPARAMETER_INVALIDTASKSFILTERLENGTH = "InvalidParameter.InvalidTasksFilterLength" + // 指定的TCR Spark镜像格式不匹配,参考样例: my-image/ndf/python/latest INVALIDPARAMETER_INVALIDTCRSPARKIMAGEFORMAT = "InvalidParameter.InvalidTcrSparkImageFormat" @@ -458,6 +467,9 @@ const ( // 指定参数Base64解析失败 INVALIDPARAMETER_PARAMETERBASE64DECODEFAILED = "InvalidParameter.ParameterBase64DecodeFailed" + // 传入参数不合法 + INVALIDPARAMETER_PARAMETERILLEGAL = "InvalidParameter.ParameterIllegal" + // 找不到参数或参数为空 INVALIDPARAMETER_PARAMETERNOTFOUNDORBENONE = "InvalidParameter.ParameterNotFoundOrBeNone" @@ -623,6 +635,9 @@ const ( // 找不到Spark Shuffle存储路径,请到控制台->数据探索页面->存储配置中设置 RESOURCENOTFOUND_SHUFFLEDIRNOTFOUND = "ResourceNotFound.ShuffleDirNotFound" + // 任务资源不足,请调整driver或executor指定规格大小 + RESOURCENOTFOUND_SPARKJOBINSUFFICIENTRESOURCES = "ResourceNotFound.SparkJobInsufficientResources" + // 表不存在,请重试,或者提交工单联系我们 RESOURCENOTFOUND_TABLENOTFOUND = "ResourceNotFound.TableNotFound" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/models.go index 74cd0a117d..0e600df0fa 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125/models.go @@ -839,6 +839,60 @@ func (r *AssociateDatasourceHouseResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type AttachDataMaskPolicyRequestParams struct { + // 要绑定的数据脱敏策略权限对象集合 + DataMaskStrategyPolicySet []*DataMaskStrategyPolicy `json:"DataMaskStrategyPolicySet,omitnil,omitempty" name:"DataMaskStrategyPolicySet"` +} + +type AttachDataMaskPolicyRequest struct { + *tchttp.BaseRequest + + // 要绑定的数据脱敏策略权限对象集合 + DataMaskStrategyPolicySet []*DataMaskStrategyPolicy `json:"DataMaskStrategyPolicySet,omitnil,omitempty" name:"DataMaskStrategyPolicySet"` +} + +func (r *AttachDataMaskPolicyRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *AttachDataMaskPolicyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DataMaskStrategyPolicySet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AttachDataMaskPolicyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AttachDataMaskPolicyResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type AttachDataMaskPolicyResponse struct { + *tchttp.BaseResponse + Response *AttachDataMaskPolicyResponseParams `json:"Response"` +} + +func (r *AttachDataMaskPolicyResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *AttachDataMaskPolicyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type AttachUserPolicyRequestParams struct { // 用户Id,和子用户uin相同,需要先使用CreateUser接口创建用户。可以使用DescribeUsers接口查看。 @@ -2130,10 +2184,10 @@ type CreateDataEngineRequestParams struct { // 计费类型,后付费:0,预付费:1。当前只支持后付费,不填默认为后付费。 PayMode *int64 `json:"PayMode,omitnil,omitempty" name:"PayMode"` - // 资源使用时长,后付费:固定填3600,预付费:最少填1,代表购买资源一个月,最长不超过120。默认1 + // 资源使用时长,后付费:固定填1,预付费:最少填1,代表购买资源一个月,最长不超过120。默认1 TimeSpan *int64 `json:"TimeSpan,omitnil,omitempty" name:"TimeSpan"` - // 资源使用时长的单位,后付费:s,预付费:m。默认为s + // 资源使用时长的单位,后付费:h,预付费:m。默认为h TimeUnit *string `json:"TimeUnit,omitnil,omitempty" name:"TimeUnit"` // 资源的自动续费标志。后付费无需续费,固定填0;预付费下:0表示手动续费、1代表自动续费、2代表不续费,在0下如果是大客户,会自动帮大客户续费。默认为0 @@ -2151,7 +2205,7 @@ type CreateDataEngineRequestParams struct { // 定时启停策略,复杂类型:包含启停时间、挂起集群策略 CrontabResumeSuspendStrategy *CrontabResumeSuspendStrategy `json:"CrontabResumeSuspendStrategy,omitnil,omitempty" name:"CrontabResumeSuspendStrategy"` - // 引擎执行任务类型,有效值:SQL/BATCH,默认为SQL + // 引擎执行任务类型,有效值:SQL/BATCH,标准引擎默认为BATCH EngineExecType *string `json:"EngineExecType,omitnil,omitempty" name:"EngineExecType"` // 单个集群最大并发任务数,默认5 @@ -2233,10 +2287,10 @@ type CreateDataEngineRequest struct { // 计费类型,后付费:0,预付费:1。当前只支持后付费,不填默认为后付费。 PayMode *int64 `json:"PayMode,omitnil,omitempty" name:"PayMode"` - // 资源使用时长,后付费:固定填3600,预付费:最少填1,代表购买资源一个月,最长不超过120。默认1 + // 资源使用时长,后付费:固定填1,预付费:最少填1,代表购买资源一个月,最长不超过120。默认1 TimeSpan *int64 `json:"TimeSpan,omitnil,omitempty" name:"TimeSpan"` - // 资源使用时长的单位,后付费:s,预付费:m。默认为s + // 资源使用时长的单位,后付费:h,预付费:m。默认为h TimeUnit *string `json:"TimeUnit,omitnil,omitempty" name:"TimeUnit"` // 资源的自动续费标志。后付费无需续费,固定填0;预付费下:0表示手动续费、1代表自动续费、2代表不续费,在0下如果是大客户,会自动帮大客户续费。默认为0 @@ -2254,7 +2308,7 @@ type CreateDataEngineRequest struct { // 定时启停策略,复杂类型:包含启停时间、挂起集群策略 CrontabResumeSuspendStrategy *CrontabResumeSuspendStrategy `json:"CrontabResumeSuspendStrategy,omitnil,omitempty" name:"CrontabResumeSuspendStrategy"` - // 引擎执行任务类型,有效值:SQL/BATCH,默认为SQL + // 引擎执行任务类型,有效值:SQL/BATCH,标准引擎默认为BATCH EngineExecType *string `json:"EngineExecType,omitnil,omitempty" name:"EngineExecType"` // 单个集群最大并发任务数,默认5 @@ -2373,6 +2427,60 @@ func (r *CreateDataEngineResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type CreateDataMaskStrategyRequestParams struct { + // 数据脱敏策略详情 + Strategy *DataMaskStrategyInfo `json:"Strategy,omitnil,omitempty" name:"Strategy"` +} + +type CreateDataMaskStrategyRequest struct { + *tchttp.BaseRequest + + // 数据脱敏策略详情 + Strategy *DataMaskStrategyInfo `json:"Strategy,omitnil,omitempty" name:"Strategy"` +} + +func (r *CreateDataMaskStrategyRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDataMaskStrategyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Strategy") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDataMaskStrategyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDataMaskStrategyResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateDataMaskStrategyResponse struct { + *tchttp.BaseResponse + Response *CreateDataMaskStrategyResponseParams `json:"Response"` +} + +func (r *CreateDataMaskStrategyResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDataMaskStrategyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type CreateDatabaseRequestParams struct { // 数据库基础信息 @@ -4386,6 +4494,97 @@ func (r *CreateTasksResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type CreateTcIcebergTableRequestParams struct { + // 表基本信息 + TableBaseInfo *TableBaseInfo `json:"TableBaseInfo,omitnil,omitempty" name:"TableBaseInfo"` + + // 表字段信息 + Columns []*TColumn `json:"Columns,omitnil,omitempty" name:"Columns"` + + // 为true时只获取sql而不执行 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 表分区信息 + Partitions []*TPartition `json:"Partitions,omitnil,omitempty" name:"Partitions"` + + // 表属性信息 + Properties []*Property `json:"Properties,omitnil,omitempty" name:"Properties"` +} + +type CreateTcIcebergTableRequest struct { + *tchttp.BaseRequest + + // 表基本信息 + TableBaseInfo *TableBaseInfo `json:"TableBaseInfo,omitnil,omitempty" name:"TableBaseInfo"` + + // 表字段信息 + Columns []*TColumn `json:"Columns,omitnil,omitempty" name:"Columns"` + + // 为true时只获取sql而不执行 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 表分区信息 + Partitions []*TPartition `json:"Partitions,omitnil,omitempty" name:"Partitions"` + + // 表属性信息 + Properties []*Property `json:"Properties,omitnil,omitempty" name:"Properties"` +} + +func (r *CreateTcIcebergTableRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateTcIcebergTableRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "TableBaseInfo") + delete(f, "Columns") + delete(f, "DryRun") + delete(f, "Partitions") + delete(f, "Properties") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateTcIcebergTableRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateTcIcebergTableResponseParams struct { + // amoro的SessionId + SessionId *string `json:"SessionId,omitnil,omitempty" name:"SessionId"` + + // 执行的sql + SQL *string `json:"SQL,omitnil,omitempty" name:"SQL"` + + // 为true时只返回sql而不实际执行 + DryRun *bool `json:"DryRun,omitnil,omitempty" name:"DryRun"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateTcIcebergTableResponse struct { + *tchttp.BaseResponse + Response *CreateTcIcebergTableResponseParams `json:"Response"` +} + +func (r *CreateTcIcebergTableResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateTcIcebergTableResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type CreateUserRequestParams struct { // 需要授权的子用户uin,可以通过腾讯云控制台右上角 → “账号信息” → “账号ID进行查看”。 @@ -4537,6 +4736,9 @@ func (r *CreateUserVpcConnectionRequest) FromJsonString(s string) error { // Predefined struct for user type CreateUserVpcConnectionResponseParams struct { + // 终端节点IP + UserVpcEndpointId *string `json:"UserVpcEndpointId,omitnil,omitempty" name:"UserVpcEndpointId"` + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` } @@ -5303,6 +5505,56 @@ type DataGovernPolicy struct { GovernEngine *string `json:"GovernEngine,omitnil,omitempty" name:"GovernEngine"` } +type DataMaskStrategy struct { + // 策略ID + // 注意:此字段可能返回 null,表示取不到有效值。 + StrategyId *string `json:"StrategyId,omitnil,omitempty" name:"StrategyId"` + + // 用户AppId + // 注意:此字段可能返回 null,表示取不到有效值。 + UserAppId *string `json:"UserAppId,omitnil,omitempty" name:"UserAppId"` + + // 用户Uin + // 注意:此字段可能返回 null,表示取不到有效值。 + Uin *string `json:"Uin,omitnil,omitempty" name:"Uin"` + + // 操作用户子账号uin + // 注意:此字段可能返回 null,表示取不到有效值。 + SubAccountUin *string `json:"SubAccountUin,omitnil,omitempty" name:"SubAccountUin"` + + // 策略名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + StrategyName *string `json:"StrategyName,omitnil,omitempty" name:"StrategyName"` + + // MASK_SHOW_FIRST_4; MASK_SHOW_LAST_4;MASK_HASH; MASK_DATE_SHOW_YEAR; MASK_NULL; MASK_DEFAULT 等 + // 注意:此字段可能返回 null,表示取不到有效值。 + StrategyType *string `json:"StrategyType,omitnil,omitempty" name:"StrategyType"` + + // 策略描述 + // 注意:此字段可能返回 null,表示取不到有效值。 + StrategyDesc *string `json:"StrategyDesc,omitnil,omitempty" name:"StrategyDesc"` + + // 用户组策略列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + Groups []*GroupInfo `json:"Groups,omitnil,omitempty" name:"Groups"` + + // 用户子账号uin列表,按;拼接 + // 注意:此字段可能返回 null,表示取不到有效值。 + Users *string `json:"Users,omitnil,omitempty" name:"Users"` + + // 1: 生效中; 0:已删除 + // 注意:此字段可能返回 null,表示取不到有效值。 + State *int64 `json:"State,omitnil,omitempty" name:"State"` + + // 策略创建时间,毫秒时间戳 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreateTime *int64 `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 策略更新时间,毫秒时间戳 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdateTime *int64 `json:"UpdateTime,omitnil,omitempty" name:"UpdateTime"` +} + type DataMaskStrategyInfo struct { // 策略名称 StrategyName *string `json:"StrategyName,omitnil,omitempty" name:"StrategyName"` @@ -5324,6 +5576,20 @@ type DataMaskStrategyInfo struct { StrategyId *string `json:"StrategyId,omitnil,omitempty" name:"StrategyId"` } +type DataMaskStrategyPolicy struct { + // 数据脱敏权限对象 + // 注意:此字段可能返回 null,表示取不到有效值。 + PolicyInfo *Policy `json:"PolicyInfo,omitnil,omitempty" name:"PolicyInfo"` + + // 数据脱敏策略ID + // 注意:此字段可能返回 null,表示取不到有效值。 + DataMaskStrategyId *string `json:"DataMaskStrategyId,omitnil,omitempty" name:"DataMaskStrategyId"` + + // 绑定字段类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ColumnType *string `json:"ColumnType,omitnil,omitempty" name:"ColumnType"` +} + type DataSourceInfo struct { // 数据源实例的唯一ID // 注意:此字段可能返回 null,表示取不到有效值。 @@ -5663,6 +5929,60 @@ func (r *DeleteDataEngineResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type DeleteDataMaskStrategyRequestParams struct { + // 数据脱敏策略Id + StrategyId *string `json:"StrategyId,omitnil,omitempty" name:"StrategyId"` +} + +type DeleteDataMaskStrategyRequest struct { + *tchttp.BaseRequest + + // 数据脱敏策略Id + StrategyId *string `json:"StrategyId,omitnil,omitempty" name:"StrategyId"` +} + +func (r *DeleteDataMaskStrategyRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDataMaskStrategyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "StrategyId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDataMaskStrategyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDataMaskStrategyResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteDataMaskStrategyResponse struct { + *tchttp.BaseResponse + Response *DeleteDataMaskStrategyResponseParams `json:"Response"` +} + +func (r *DeleteDataMaskStrategyResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDataMaskStrategyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type DeleteNativeSparkSessionRequestParams struct { // 引擎id @@ -7640,6 +7960,80 @@ func (r *DescribeDataEnginesScaleDetailResponse) FromJsonString(s string) error return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type DescribeDataMaskStrategiesRequestParams struct { + // 分页参数,单页返回数据量,默认10 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页参数,数据便偏移量,默认0 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 过滤字段,strategy-name: 按策略名称搜索 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` +} + +type DescribeDataMaskStrategiesRequest struct { + *tchttp.BaseRequest + + // 分页参数,单页返回数据量,默认10 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页参数,数据便偏移量,默认0 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 过滤字段,strategy-name: 按策略名称搜索 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` +} + +func (r *DescribeDataMaskStrategiesRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDataMaskStrategiesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Limit") + delete(f, "Offset") + delete(f, "Filters") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDataMaskStrategiesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDataMaskStrategiesResponseParams struct { + // 总数据脱敏策略数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 数据脱敏策略列表 + Strategies []*DataMaskStrategy `json:"Strategies,omitnil,omitempty" name:"Strategies"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDataMaskStrategiesResponse struct { + *tchttp.BaseResponse + Response *DescribeDataMaskStrategiesResponseParams `json:"Response"` +} + +func (r *DescribeDataMaskStrategiesResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDataMaskStrategiesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type DescribeDatabasesRequestParams struct { // 返回数量,默认为10,最大值为100。 @@ -11178,6 +11572,77 @@ func (r *DescribeThirdPartyAccessUserResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type DescribeUDFPolicyRequestParams struct { + // udf名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 数据库名(全局UDF:global-function) + DatabaseName *string `json:"DatabaseName,omitnil,omitempty" name:"DatabaseName"` + + // 数据目录名 + CatalogName *string `json:"CatalogName,omitnil,omitempty" name:"CatalogName"` +} + +type DescribeUDFPolicyRequest struct { + *tchttp.BaseRequest + + // udf名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 数据库名(全局UDF:global-function) + DatabaseName *string `json:"DatabaseName,omitnil,omitempty" name:"DatabaseName"` + + // 数据目录名 + CatalogName *string `json:"CatalogName,omitnil,omitempty" name:"CatalogName"` +} + +func (r *DescribeUDFPolicyRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUDFPolicyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Name") + delete(f, "DatabaseName") + delete(f, "CatalogName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUDFPolicyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUDFPolicyResponseParams struct { + // UDF权限信息 + UDFPolicyInfos []*UDFPolicyInfo `json:"UDFPolicyInfos,omitnil,omitempty" name:"UDFPolicyInfos"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeUDFPolicyResponse struct { + *tchttp.BaseResponse + Response *DescribeUDFPolicyResponseParams `json:"Response"` +} + +func (r *DescribeUDFPolicyResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUDFPolicyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type DescribeUpdatableDataEnginesRequestParams struct { // 引擎配置操作命令,UpdateSparkSQLLakefsPath 更新托管表路径,UpdateSparkSQLResultPath 更新结果桶路径 @@ -11708,6 +12173,9 @@ type DescribeUserVpcConnectionRequestParams struct { // 引擎ID集合 DataEngineIds []*string `json:"DataEngineIds,omitnil,omitempty" name:"DataEngineIds"` + + // 终端节点ID集合 + UserVpcEndpointIds []*string `json:"UserVpcEndpointIds,omitnil,omitempty" name:"UserVpcEndpointIds"` } type DescribeUserVpcConnectionRequest struct { @@ -11718,6 +12186,9 @@ type DescribeUserVpcConnectionRequest struct { // 引擎ID集合 DataEngineIds []*string `json:"DataEngineIds,omitnil,omitempty" name:"DataEngineIds"` + + // 终端节点ID集合 + UserVpcEndpointIds []*string `json:"UserVpcEndpointIds,omitnil,omitempty" name:"UserVpcEndpointIds"` } func (r *DescribeUserVpcConnectionRequest) ToJsonString() string { @@ -11734,6 +12205,7 @@ func (r *DescribeUserVpcConnectionRequest) FromJsonString(s string) error { } delete(f, "EngineNetworkId") delete(f, "DataEngineIds") + delete(f, "UserVpcEndpointIds") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserVpcConnectionRequest has unknown keys!", "") } @@ -16642,6 +17114,9 @@ type TaskResponseInfo struct { // spark引擎资源组名称 ResourceGroupName *string `json:"ResourceGroupName,omitnil,omitempty" name:"ResourceGroupName"` + + // 任务执行耗时 + JobTimeSum *int64 `json:"JobTimeSum,omitnil,omitempty" name:"JobTimeSum"` } type TaskResultInfo struct { @@ -16769,6 +17244,18 @@ type TextFile struct { Regex *string `json:"Regex,omitnil,omitempty" name:"Regex"` } +type UDFPolicyInfo struct { + // 权限类型 + // 示例:select,alter,drop + Accesses []*string `json:"Accesses,omitnil,omitempty" name:"Accesses"` + + // 拥有权限的用户信息 + Users []*string `json:"Users,omitnil,omitempty" name:"Users"` + + // 拥有权限的工作组的信息 + Groups []*string `json:"Groups,omitnil,omitempty" name:"Groups"` +} + // Predefined struct for user type UnbindWorkGroupsFromUserRequestParams struct { // 解绑的工作组Id和用户Id的关联关系 @@ -17180,6 +17667,60 @@ func (r *UpdateDataEngineResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type UpdateDataMaskStrategyRequestParams struct { + // 数据脱敏策略详情 + Strategy *DataMaskStrategyInfo `json:"Strategy,omitnil,omitempty" name:"Strategy"` +} + +type UpdateDataMaskStrategyRequest struct { + *tchttp.BaseRequest + + // 数据脱敏策略详情 + Strategy *DataMaskStrategyInfo `json:"Strategy,omitnil,omitempty" name:"Strategy"` +} + +func (r *UpdateDataMaskStrategyRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *UpdateDataMaskStrategyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Strategy") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpdateDataMaskStrategyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type UpdateDataMaskStrategyResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type UpdateDataMaskStrategyResponse struct { + *tchttp.BaseResponse + Response *UpdateDataMaskStrategyResponseParams `json:"Response"` +} + +func (r *UpdateDataMaskStrategyResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *UpdateDataMaskStrategyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type UpdateEngineResourceGroupNetworkConfigInfoRequestParams struct { // 引擎资源组ID @@ -17690,6 +18231,84 @@ func (r *UpdateStandardEngineResourceGroupResourceInfoResponse) FromJsonString(s return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type UpdateUDFPolicyRequestParams struct { + // UDF名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 数据库名 + DatabaseName *string `json:"DatabaseName,omitnil,omitempty" name:"DatabaseName"` + + // 数据目录名 + CatalogName *string `json:"CatalogName,omitnil,omitempty" name:"CatalogName"` + + // UDF权限信息 + UDFPolicyInfos []*UDFPolicyInfo `json:"UDFPolicyInfos,omitnil,omitempty" name:"UDFPolicyInfos"` +} + +type UpdateUDFPolicyRequest struct { + *tchttp.BaseRequest + + // UDF名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 数据库名 + DatabaseName *string `json:"DatabaseName,omitnil,omitempty" name:"DatabaseName"` + + // 数据目录名 + CatalogName *string `json:"CatalogName,omitnil,omitempty" name:"CatalogName"` + + // UDF权限信息 + UDFPolicyInfos []*UDFPolicyInfo `json:"UDFPolicyInfos,omitnil,omitempty" name:"UDFPolicyInfos"` +} + +func (r *UpdateUDFPolicyRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *UpdateUDFPolicyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Name") + delete(f, "DatabaseName") + delete(f, "CatalogName") + delete(f, "UDFPolicyInfos") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpdateUDFPolicyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type UpdateUDFPolicyResponseParams struct { + // UDF权限信息 + UDFPolicyInfos []*UDFPolicyInfo `json:"UDFPolicyInfos,omitnil,omitempty" name:"UDFPolicyInfos"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type UpdateUDFPolicyResponse struct { + *tchttp.BaseResponse + Response *UpdateUDFPolicyResponseParams `json:"Response"` +} + +func (r *UpdateUDFPolicyResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *UpdateUDFPolicyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type UpdateUserDataEngineConfigRequestParams struct { // 引擎ID diff --git a/vendor/modules.txt b/vendor/modules.txt index e9e150a405..093e17779c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1170,7 +1170,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.1148 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.22 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.23 ## explicit; go 1.11 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors @@ -1208,7 +1208,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dc/v20180410 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dcdb v1.0.673 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dcdb/v20180411 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.5 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.23 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc/v20210125 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1056 diff --git a/website/docs/r/dlc_standard_engine_resource_group.html.markdown b/website/docs/r/dlc_standard_engine_resource_group.html.markdown new file mode 100644 index 0000000000..e30d17e676 --- /dev/null +++ b/website/docs/r/dlc_standard_engine_resource_group.html.markdown @@ -0,0 +1,113 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_standard_engine_resource_group" +sidebar_current: "docs-tencentcloud-resource-dlc_standard_engine_resource_group" +description: |- + Provides a resource to create a DLC standard engine resource group +--- + +# tencentcloud_dlc_standard_engine_resource_group + +Provides a resource to create a DLC standard engine resource group + +~> **NOTE:** If you are creating a machine learning resource group for the first time, you need to contact DLC product for whitelisting. + +## Example Usage + +### Only SQL analysis resource group + +```hcl +resource "tencentcloud_dlc_standard_engine_resource_group" "example" { + engine_resource_group_name = "tf-example" + data_engine_name = "tf-engine" + auto_launch = 0 + auto_pause = 0 + is_launch_now = 1 + auto_pause_time = 10 + static_config_pairs { + config_item = "key" + config_value = "value" + } + + dynamic_config_pairs { + config_item = "key" + config_value = "value" + } + max_concurrency = 5 + resource_group_scene = "SparkSQL" + spark_spec_mode = "fast" + spark_size = 16 +} +``` + +### Machine learning resource group + +```hcl +resource "tencentcloud_dlc_standard_engine_resource_group" "example" { + engine_resource_group_name = "tf-example" + data_engine_name = "tf-engine" + max_concurrency = 5 + resource_group_scene = "Artificial-Intelligence" + spark_spec_mode = "fast" + spark_size = 16 + frame_type = "machine-learning" + size = 16 + python_cu_spec = "large" + image_type = "built-in" + image_version = "97319759-0b80-48b4-a7a7-436d9ef3b666" + image_name = "pytorch-v2.5.1" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `data_engine_name` - (Required, String) Standard engine name. +* `engine_resource_group_name` - (Required, String) Standard engine resource group name. +* `auto_launch` - (Optional, Int) Automatic start (task submission automatically pulls up the resource group) 0-automatic start, 1-not automatic start. +* `auto_pause_time` - (Optional, Int) Automatic suspension time, in minutes, with a value range of 1-999 (after no tasks have reached AutoPauseTime, the resource group will automatically suspend). +* `auto_pause` - (Optional, Int) Automatically suspend resource groups. 0 - Automatically suspend, 1 - Not automatically suspend. +* `driver_cu_spec` - (Optional, String) Driver CU specifications: Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory). +* `dynamic_config_pairs` - (Optional, List) Dynamic parameters of the resource group, effective in the next task. +* `executor_cu_spec` - (Optional, String) Executor CU specifications: Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory). +* `frame_type` - (Optional, String) The framework type of the AI type resource group, machine-learning, python, spark-ml, if not filled in, the default is machine-learning. +* `image_name` - (Optional, String) Image name. +machine-learning: pytorch-v2.5.1, scikit-learn-v1.6.0, tensorflow-v2.18.0 +spark-ml: Standard-S 1.1 +python: python-v3.10. +* `image_type` - (Optional, String) Image type, build-in: built-in, custom: custom, if not filled in, the default is build-in. +* `image_version` - (Optional, String) Image ID. +* `max_concurrency` - (Optional, Int) The number of concurrent tasks is 5 by default. +* `max_executor_nums` - (Optional, Int) Maximum number of executors. +* `min_executor_nums` - (Optional, Int) Minimum number of executors. +* `network_config_names` - (Optional, Set: [`String`]) Network configuration name. +* `public_domain` - (Optional, String) Customized mirror domain name. +* `python_cu_spec` - (Optional, String) The resource limit for a Python stand-alone node in a Python resource group must be smaller than the resource limit for the resource group. Small: 1cu Medium: 2cu Large: 4cu Xlarge: 8cu 4xlarge: 16cu 8xlarge: 32cu 16xlarge: 64cu. If the resource type is high memory, add m before the type. +* `region_name` - (Optional, String) Custom image location. +* `registry_id` - (Optional, String) Custom image instance ID. +* `resource_group_scene` - (Optional, String) Resource group scenario. +* `size` - (Optional, Int) The AI resource group is valid, and the upper limit of available resources in the resource group must be less than the upper limit of engine resources. +* `spark_size` - (Optional, Int) Only the SQL resource group resource limit, only used for the express module. +* `spark_spec_mode` - (Optional, String) Only SQL resource group resource configuration mode, fast: fast mode, custom: custom mode. +* `static_config_pairs` - (Optional, List) Static parameters of the resource group, which require restarting the resource group to take effect. + +The `dynamic_config_pairs` object supports the following: + +* `config_item` - (Required, String) Configuration items. +* `config_value` - (Required, String) Configuration values. + +The `static_config_pairs` object supports the following: + +* `config_item` - (Required, String) Configuration items. +* `config_value` - (Required, String) Configuration values. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `engine_resource_group_id` - Standard engine resource group ID. + + diff --git a/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown b/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown deleted file mode 100644 index f8198e5e33..0000000000 --- a/website/docs/r/dlc_update_engine_resource_group_network_config_information_operation.html.markdown +++ /dev/null @@ -1,36 +0,0 @@ ---- -subcategory: "Data Lake Compute(DLC)" -layout: "tencentcloud" -page_title: "TencentCloud: tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" -sidebar_current: "docs-tencentcloud-resource-dlc_update_engine_resource_group_network_config_information_operation" -description: |- - Provides a resource to create a DLC update engine resource group network config information operation ---- - -# tencentcloud_dlc_update_engine_resource_group_network_config_information_operation - -Provides a resource to create a DLC update engine resource group network config information operation - -## Example Usage - -```hcl -resource "tencentcloud_dlc_update_engine_resource_group_network_config_information_operation" "example" { - engine_resource_group_id = "rg-b6fxxxxxx2a0" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `engine_resource_group_id` - (Required, String, ForceNew) Engine resource group ID. -* `network_config_names` - (Optional, Set: [`String`], ForceNew) A collection of network configuration names bound to the resource group. - -## Attributes Reference - -In addition to all arguments above, the following attributes are exported: - -* `id` - ID of the resource. - - - diff --git a/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown b/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown deleted file mode 100644 index 20b3efc1ea..0000000000 --- a/website/docs/r/dlc_update_standard_engine_resource_group_config_information_operation.html.markdown +++ /dev/null @@ -1,55 +0,0 @@ ---- -subcategory: "Data Lake Compute(DLC)" -layout: "tencentcloud" -page_title: "TencentCloud: tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" -sidebar_current: "docs-tencentcloud-resource-dlc_update_standard_engine_resource_group_config_information_operation" -description: |- - Provides a resource to create a DLC update standard engine resource group config information operation ---- - -# tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation - -Provides a resource to create a DLC update standard engine resource group config information operation - -## Example Usage - -```hcl -resource "tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation" "example" { - engine_resource_group_name = "tf-example" - update_conf_context { - config_type = "StaticConfigType" - params { - config_item = "spark.sql.shuffle.partitions" - config_value = "300" - operate = "ADD" - } - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `engine_resource_group_name` - (Required, String, ForceNew) Engine resource group name. -* `update_conf_context` - (Required, List, ForceNew) Configuration that needs to be updated. - -The `params` object of `update_conf_context` supports the following: - -* `config_item` - (Optional, String, ForceNew) Parameter key. -* `config_value` - (Optional, String, ForceNew) Parameter value. -* `operate` - (Optional, String, ForceNew) Send operations, support: ADD, DELETE, MODIFY. - -The `update_conf_context` object supports the following: - -* `config_type` - (Required, String, ForceNew) Parameter type, optional: StaticConfigType, DynamicConfigType. -* `params` - (Required, List) Configuration array of parameters. - -## Attributes Reference - -In addition to all arguments above, the following attributes are exported: - -* `id` - ID of the resource. - - - diff --git a/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown b/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown deleted file mode 100644 index 22eddaac95..0000000000 --- a/website/docs/r/dlc_update_standard_engine_resource_group_resource_information_operation.html.markdown +++ /dev/null @@ -1,52 +0,0 @@ ---- -subcategory: "Data Lake Compute(DLC)" -layout: "tencentcloud" -page_title: "TencentCloud: tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" -sidebar_current: "docs-tencentcloud-resource-dlc_update_standard_engine_resource_group_resource_information_operation" -description: |- - Provides a resource to create a DLC update standard engine resource group resource information operation ---- - -# tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation - -Provides a resource to create a DLC update standard engine resource group resource information operation - -## Example Usage - -```hcl -resource "tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation" "example" { - engine_resource_group_name = "tf-example" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `engine_resource_group_name` - (Required, String, ForceNew) Engine resource group name. -* `driver_cu_spec` - (Optional, String, ForceNew) Driver CU specifications: -Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory). -* `executor_cu_spec` - (Optional, String, ForceNew) Executor CU specifications: -Currently supported: small (default, 1 CU), medium (2 CU), large (4 CU), xlarge (8 CU). Memory CUs are CPUs with a ratio of 1:8, m.small (1 CU memory), m.medium (2 CU memory), m.large (4 CU memory), and m.xlarge (8 CU memory). -* `frame_type` - (Optional, String, ForceNew) Framework Type. -* `image_name` - (Optional, String, ForceNew) Image name. -* `image_type` - (Optional, String, ForceNew) Image type, built-in image: built-in, custom image: custom. -* `image_version` - (Optional, String, ForceNew) Image version, image id. -* `max_executor_nums` - (Optional, Int, ForceNew) Maximum number of executors. -* `min_executor_nums` - (Optional, Int, ForceNew) Minimum number of executors. -* `public_domain` - (Optional, String, ForceNew) Customized mirror domain name. -* `python_cu_spec` - (Optional, String, ForceNew) The resource limit for a Python stand-alone node in a Python resource group must be smaller than the resource limit for the resource group. Small: 1cu Medium: 2cu Large: 4cu Xlarge: 8cu 4xlarge: 16cu 8xlarge: 32cu 16xlarge: 64cu. If the resource type is high memory, add m before the type. -* `region_name` - (Optional, String, ForceNew) Customize the image region. -* `registry_id` - (Optional, String, ForceNew) Custom image instance id. -* `size` - (Optional, Int, ForceNew) AI resource group resource limit. -* `spark_size` - (Optional, Int, ForceNew) SQL resource group resource limit only, only used in fast mode. -* `spark_spec_mode` - (Optional, String, ForceNew) Only SQL resource group resource configuration mode, fast: fast mode, custom: custom mode. - -## Attributes Reference - -In addition to all arguments above, the following attributes are exported: - -* `id` - ID of the resource. - - - diff --git a/website/docs/r/dlc_user_vpc_connection.html.markdown b/website/docs/r/dlc_user_vpc_connection.html.markdown new file mode 100644 index 0000000000..18ab008529 --- /dev/null +++ b/website/docs/r/dlc_user_vpc_connection.html.markdown @@ -0,0 +1,42 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_user_vpc_connection" +sidebar_current: "docs-tencentcloud-resource-dlc_user_vpc_connection" +description: |- + Provides a resource to create a DLC user vpc connection +--- + +# tencentcloud_dlc_user_vpc_connection + +Provides a resource to create a DLC user vpc connection + +## Example Usage + +```hcl +resource "tencentcloud_dlc_user_vpc_connection" "example" { + user_vpc_id = "vpc-f7fa1fu5" + user_subnet_id = "subnet-ds2t3udw" + user_vpc_endpoint_name = "tf-example" + engine_network_id = "DataEngine-Network-2mfg9icb" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `engine_network_id` - (Required, String, ForceNew) Engine network ID. +* `user_subnet_id` - (Required, String, ForceNew) User subnet ID. +* `user_vpc_endpoint_name` - (Required, String, ForceNew) User vpc endpoint name. +* `user_vpc_id` - (Required, String, ForceNew) User vpc ID. +* `user_vpc_endpoint_vip` - (Optional, String, ForceNew) Manually specify VIP, if not filled in, an IP address under the subnet will be automatically assigned. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `user_vpc_endpoint_id` - User endpoint ID. + + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 50320f2137..faaf7d5b04 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -2329,6 +2329,9 @@
  • tencentcloud_dlc_rollback_data_engine_image_operation
  • +
  • + tencentcloud_dlc_standard_engine_resource_group +
  • tencentcloud_dlc_store_location_config
  • @@ -2341,18 +2344,9 @@
  • tencentcloud_dlc_update_data_engine_config_operation
  • -
  • - tencentcloud_dlc_update_engine_resource_group_network_config_information_operation -
  • tencentcloud_dlc_update_row_filter_operation
  • -
  • - tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation -
  • -
  • - tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation -
  • tencentcloud_dlc_upgrade_data_engine_image_operation
  • @@ -2362,6 +2356,9 @@
  • tencentcloud_dlc_user_data_engine_config
  • +
  • + tencentcloud_dlc_user_vpc_connection +
  • tencentcloud_dlc_work_group
  • From da15da9fcd1331f12347fb25fb73a081ae771498 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Mon, 8 Sep 2025 16:44:49 +0800 Subject: [PATCH 5/8] add --- .changelog/3486.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.changelog/3486.txt b/.changelog/3486.txt index ad1b251417..e15859cdd9 100644 --- a/.changelog/3486.txt +++ b/.changelog/3486.txt @@ -11,13 +11,9 @@ tencentcloud_dlc_session_image_version ``` ```release-note:new-resource -tencentcloud_dlc_update_engine_resource_group_network_config_information_operation +tencentcloud_dlc_user_vpc_connection ``` ```release-note:new-resource -tencentcloud_dlc_update_standard_engine_resource_group_config_information_operation +tencentcloud_dlc_standard_engine_resource_group ``` - -```release-note:new-resource -tencentcloud_dlc_update_standard_engine_resource_group_resource_information_operation -``` \ No newline at end of file From 9760bbbea79611226b234cf33a5f670a8313c4d6 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Mon, 8 Sep 2025 16:52:24 +0800 Subject: [PATCH 6/8] add --- ...e_tc_dlc_standard_engine_resource_group.md | 1 - ...dlc_standard_engine_resource_group_test.go | 46 ++++++++++++++----- ...andard_engine_resource_group.html.markdown | 1 - 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md index 0eee5c9a41..1b5211aee4 100644 --- a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md @@ -12,7 +12,6 @@ resource "tencentcloud_dlc_standard_engine_resource_group" "example" { data_engine_name = "tf-engine" auto_launch = 0 auto_pause = 0 - is_launch_now = 1 auto_pause_time = 10 static_config_pairs { config_item = "key" diff --git a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go index c81ddea5b4..43b762c6c6 100644 --- a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go @@ -15,23 +15,45 @@ func TestAccTencentCloudDlcStandardEngineResourceGroupResource_basic(t *testing. tcacctest.AccPreCheck(t) }, Providers: tcacctest.AccProviders, - Steps: []resource.TestStep{{ - Config: testAccDlcStandardEngineResourceGroup, - Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.dlc_standard_engine_resource_group", "id")), - }, { - ResourceName: "tencentcloud_dlc_standard_engine_resource_group.dlc_standard_engine_resource_group", - ImportState: true, - ImportStateVerify: true, - }}, + Steps: []resource.TestStep{ + { + Config: testAccDlcStandardEngineResourceGroup, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "engine_resource_group_name"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "data_engine_name"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "auto_launch"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "auto_pause"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "auto_pause_time"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "max_concurrency"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "resource_group_scene"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "spark_spec_mode"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_standard_engine_resource_group.example", "spark_size"), + ), + }, + }, }) } const testAccDlcStandardEngineResourceGroup = ` - -resource "tencentcloud_dlc_standard_engine_resource_group" "dlc_standard_engine_resource_group" { - static_config_pairs = { +resource "tencentcloud_dlc_standard_engine_resource_group" "example" { + engine_resource_group_name = "tf-example" + data_engine_name = "tf-engine" + auto_launch = 0 + auto_pause = 0 + auto_pause_time = 10 + static_config_pairs { + config_item = "key" + config_value = "value" } - dynamic_config_pairs = { + + dynamic_config_pairs { + config_item = "key" + config_value = "value" } + max_concurrency = 5 + resource_group_scene = "SparkSQL" + spark_spec_mode = "fast" + spark_size = 16 } ` diff --git a/website/docs/r/dlc_standard_engine_resource_group.html.markdown b/website/docs/r/dlc_standard_engine_resource_group.html.markdown index e30d17e676..bea6e665e4 100644 --- a/website/docs/r/dlc_standard_engine_resource_group.html.markdown +++ b/website/docs/r/dlc_standard_engine_resource_group.html.markdown @@ -23,7 +23,6 @@ resource "tencentcloud_dlc_standard_engine_resource_group" "example" { data_engine_name = "tf-engine" auto_launch = 0 auto_pause = 0 - is_launch_now = 1 auto_pause_time = 10 static_config_pairs { config_item = "key" From 586a58b6e6fc05ac763d31ae7a0623e1b9115fd3 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Mon, 8 Sep 2025 17:02:34 +0800 Subject: [PATCH 7/8] add --- ...e_tc_dlc_standard_engine_resource_group.go | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go index 55b8614ef2..f7fdb9998a 100644 --- a/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go @@ -452,99 +452,99 @@ func resourceTencentCloudDlcStandardEngineResourceGroupRead(d *schema.ResourceDa } if respData.EngineResourceGroupName != nil { - d.Set("engine_resource_group_name", respData.EngineResourceGroupName) + _ = d.Set("engine_resource_group_name", respData.EngineResourceGroupName) } if respData.DataEngineName != nil { - d.Set("data_engine_name", respData.DataEngineName) + _ = d.Set("data_engine_name", respData.DataEngineName) } if respData.AutoLaunch != nil { - d.Set("auto_launch", respData.AutoLaunch) + _ = d.Set("auto_launch", respData.AutoLaunch) } if respData.AutoPause != nil { - d.Set("auto_pause", respData.AutoPause) + _ = d.Set("auto_pause", respData.AutoPause) } if respData.DriverCuSpec != nil { - d.Set("driver_cu_spec", respData.DriverCuSpec) + _ = d.Set("driver_cu_spec", respData.DriverCuSpec) } if respData.ExecutorCuSpec != nil { - d.Set("executor_cu_spec", respData.ExecutorCuSpec) + _ = d.Set("executor_cu_spec", respData.ExecutorCuSpec) } if respData.MinExecutorNums != nil { - d.Set("min_executor_nums", respData.MinExecutorNums) + _ = d.Set("min_executor_nums", respData.MinExecutorNums) } if respData.MaxExecutorNums != nil { - d.Set("max_executor_nums", respData.MaxExecutorNums) + _ = d.Set("max_executor_nums", respData.MaxExecutorNums) } if respData.AutoPauseTime != nil { - d.Set("auto_pause_time", respData.AutoPauseTime) + _ = d.Set("auto_pause_time", respData.AutoPauseTime) } if respData.MaxConcurrency != nil { - d.Set("max_concurrency", respData.MaxConcurrency) + _ = d.Set("max_concurrency", respData.MaxConcurrency) } if respData.NetworkConfigNames != nil { - d.Set("network_config_names", respData.NetworkConfigNames) + _ = d.Set("network_config_names", respData.NetworkConfigNames) } if respData.PublicDomain != nil { - d.Set("public_domain", respData.PublicDomain) + _ = d.Set("public_domain", respData.PublicDomain) } if respData.RegistryId != nil { - d.Set("registry_id", respData.RegistryId) + _ = d.Set("registry_id", respData.RegistryId) } if respData.FrameType != nil { - d.Set("frame_type", respData.FrameType) + _ = d.Set("frame_type", respData.FrameType) } if respData.ImageType != nil { - d.Set("image_type", respData.ImageType) + _ = d.Set("image_type", respData.ImageType) } if respData.ImageName != nil { - d.Set("image_name", respData.ImageName) + _ = d.Set("image_name", respData.ImageName) } if respData.ImageVersion != nil { - d.Set("image_version", respData.ImageVersion) + _ = d.Set("image_version", respData.ImageVersion) } if respData.Size != nil { - d.Set("size", respData.Size) + _ = d.Set("size", respData.Size) } if respData.ResourceGroupScene != nil { - d.Set("resource_group_scene", respData.ResourceGroupScene) + _ = d.Set("resource_group_scene", respData.ResourceGroupScene) } if respData.RegionName != nil { - d.Set("region_name", respData.RegionName) + _ = d.Set("region_name", respData.RegionName) } if respData.PythonCuSpec != nil { - d.Set("python_cu_spec", respData.PythonCuSpec) + _ = d.Set("python_cu_spec", respData.PythonCuSpec) } if respData.SparkSpecMode != nil { - d.Set("spark_spec_mode", respData.SparkSpecMode) + _ = d.Set("spark_spec_mode", respData.SparkSpecMode) } if respData.SparkSize != nil { - d.Set("spark_size", respData.SparkSize) + _ = d.Set("spark_size", respData.SparkSize) } if respData.EngineResourceGroupId != nil { - d.Set("engine_resource_group_id", respData.EngineResourceGroupId) + _ = d.Set("engine_resource_group_id", respData.EngineResourceGroupId) } return nil From 60a66b7a9ee4c171feb6aed73cc0bd910abc9079 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Mon, 8 Sep 2025 17:31:30 +0800 Subject: [PATCH 8/8] add --- .../services/dlc/resource_tc_dlc_user_vpc_connection.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.go b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.go index 500976c365..4a83cc6181 100644 --- a/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.go +++ b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.go @@ -159,19 +159,19 @@ func resourceTencentCloudDlcUserVpcConnectionRead(d *schema.ResourceData, meta i } if respData.UserVpcId != nil { - d.Set("user_vpc_id", respData.UserVpcId) + _ = d.Set("user_vpc_id", respData.UserVpcId) } if respData.UserVpcEndpointName != nil { - d.Set("user_vpc_endpoint_name", respData.UserVpcEndpointName) + _ = d.Set("user_vpc_endpoint_name", respData.UserVpcEndpointName) } if respData.EngineNetworkId != nil { - d.Set("engine_network_id", respData.EngineNetworkId) + _ = d.Set("engine_network_id", respData.EngineNetworkId) } if respData.UserVpcEndpointId != nil { - d.Set("user_vpc_endpoint_id", respData.UserVpcEndpointId) + _ = d.Set("user_vpc_endpoint_id", respData.UserVpcEndpointId) } return nil