diff --git a/.changelog/3486.txt b/.changelog/3486.txt new file mode 100644 index 0000000000..ff19eeb75c --- /dev/null +++ b/.changelog/3486.txt @@ -0,0 +1,27 @@ +```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_user_vpc_connection +``` + +```release-note:new-resource +tencentcloud_dlc_standard_engine_resource_group +``` + +```release-note:new-resource +tencentcloud_dlc_data_mask_strategy +``` + +```release-note:new-resource +tencentcloud_dlc_attach_data_mask_policy +``` diff --git a/go.mod b/go.mod index 41ffbe0d90..bcbe2fc496 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.31 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.35 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.35 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 980ad3b5eb..2fe4c5a6a2 100644 --- a/go.sum +++ b/go.sum @@ -946,6 +946,14 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.31 h1:PKa4c github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.31/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.27 h1:FG3AiNSNW5tG+mtTSE+dBc5ZhHwlYUW0Z6oSkfAWV0A= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.27/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/common v1.1.25 h1:bTN1RYwKti9GX4qdI/yd+ybh0QY/BkoGSG+wgArS0L8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.25/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.35 h1:gcnqnP30UeTFn1Jm1yMiAOlX7x1r12KAQ3cNIQTg/Gc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.35/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= @@ -968,6 +976,12 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dcdb v1.0.673 h1:YyjGLj github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dcdb v1.0.673/go.mod h1:hXPMop1kJFqAvHj+7TyxxxXS/HGUP4SuKx5gGoAl0Zc= 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/dlc v1.1.25 h1:QdwCXRsSroZNFq+yYhT38LhFKoM0pSPycUoM4Xm5kyI= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.25/go.mod h1:9XFynyALKk12v5qu8Z49cOmRLQd/SlVZxLMfb/goarY= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.35 h1:YBartSeOD6M1hFzVytGXcILAlXfzzrCxdjcAAbcHi5U= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.35/go.mod h1:Hb8V1r7scNF9Zjk0fiEavzW2dx+Lr2FEYrXDPa9f0TE= 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 110659abc8..3444b2cc73 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(), @@ -2242,6 +2245,10 @@ 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_user_vpc_connection": dlc.ResourceTencentCloudDlcUserVpcConnection(), + "tencentcloud_dlc_standard_engine_resource_group": dlc.ResourceTencentCloudDlcStandardEngineResourceGroup(), + "tencentcloud_dlc_data_mask_strategy": dlc.ResourceTencentCloudDlcDataMaskStrategy(), + "tencentcloud_dlc_attach_data_mask_policy": dlc.ResourceTencentCloudDlcAttachDataMaskPolicy(), "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 12e04ff2b2..1beb4d1bc9 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -2147,6 +2147,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 @@ -2166,6 +2169,10 @@ 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_user_vpc_connection +tencentcloud_dlc_standard_engine_resource_group +tencentcloud_dlc_data_mask_strategy +tencentcloud_dlc_attach_data_mask_policy 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_attach_data_mask_policy.go b/tencentcloud/services/dlc/resource_tc_dlc_attach_data_mask_policy.go new file mode 100644 index 0000000000..bd4050578b --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_attach_data_mask_policy.go @@ -0,0 +1,298 @@ +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 ResourceTencentCloudDlcAttachDataMaskPolicy() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcAttachDataMaskPolicyCreate, + Read: resourceTencentCloudDlcAttachDataMaskPolicyRead, + Delete: resourceTencentCloudDlcAttachDataMaskPolicyDelete, + Schema: map[string]*schema.Schema{ + "data_mask_strategy_policy_set": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + Description: "A collection of data masking policy permission objects to be bound.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "policy_info": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + Description: "Data masking permission object.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the database to be authorized. Use * to represent all databases under the current Catalog. For administrator-level authorization, only * is allowed. For data connection-level authorization, leave it empty. For other types, specify the database name.", + }, + "catalog": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the data source to be authorized. For administrator-level authorization, only * is allowed (representing all resources at this level). For data source-level and database-level authorization, only COSDataCatalog or * is allowed. For table-level authorization, custom data sources can be specified. Defaults to DataLakeCatalog if not specified. Note: For custom data sources, DLC can only manage a subset of permissions provided by the user during data source integration.", + }, + "table": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the table to be authorized. Use * to represent all tables under the current Database. For administrator-level authorization, only * is allowed. For data connection-level and database-level authorization, leave it empty. For other types, specify the table name.", + }, + "column": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The name of the column to be authorized. Use * to represent all columns. For administrator-level authorization, only * is allowed.", + }, + }, + }, + }, + "data_mask_strategy_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The ID of the data masking strategy.", + }, + "column_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The type of the bound field.", + }, + }, + }, + }, + }, + } +} + +func resourceTencentCloudDlcAttachDataMaskPolicyCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_attach_data_mask_policy.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewAttachDataMaskPolicyRequest() + catalog string + dataBase string + table string + column string + dataMaskStrategyId string + ) + + if v, ok := d.GetOk("data_mask_strategy_policy_set"); ok { + for _, item := range v.([]interface{}) { + dataMaskStrategyPolicySetMap := item.(map[string]interface{}) + dataMaskStrategyPolicy := dlcv20210125.DataMaskStrategyPolicy{} + if policyInfoMap, ok := helper.ConvertInterfacesHeadToMap(dataMaskStrategyPolicySetMap["policy_info"]); ok { + policy := dlcv20210125.Policy{} + if v, ok := policyInfoMap["database"].(string); ok && v != "" { + policy.Database = helper.String(v) + dataBase = v + } + + if v, ok := policyInfoMap["catalog"].(string); ok && v != "" { + policy.Catalog = helper.String(v) + catalog = v + } + + if v, ok := policyInfoMap["table"].(string); ok && v != "" { + policy.Table = helper.String(v) + table = v + } + + if v, ok := policyInfoMap["column"].(string); ok && v != "" { + policy.Column = helper.String(v) + column = v + } + + policy.Operation = helper.String("SELECT") + policy.PolicyType = helper.String("DATAMASK") + dataMaskStrategyPolicy.PolicyInfo = &policy + } + + if v, ok := dataMaskStrategyPolicySetMap["data_mask_strategy_id"].(string); ok && v != "" { + dataMaskStrategyPolicy.DataMaskStrategyId = helper.String(v) + } + + if v, ok := dataMaskStrategyPolicySetMap["column_type"].(string); ok && v != "" { + dataMaskStrategyPolicy.ColumnType = helper.String(v) + } + + request.DataMaskStrategyPolicySet = append(request.DataMaskStrategyPolicySet, &dataMaskStrategyPolicy) + } + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().AttachDataMaskPolicyWithContext(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 attach data mask policy failed, reason:%+v", logId, reqErr) + return reqErr + } + + policyInfoStr := strings.Join([]string{catalog, dataBase, table, column}, tccommon.COMMA_SP) + d.SetId(strings.Join([]string{policyInfoStr, dataMaskStrategyId}, tccommon.FILED_SP)) + return resourceTencentCloudDlcAttachDataMaskPolicyRead(d, meta) +} + +func resourceTencentCloudDlcAttachDataMaskPolicyRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_attach_data_mask_policy.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()) + } + + policyInfoStr := idSplit[0] + secIdSplit := strings.Split(policyInfoStr, tccommon.COMMA_SP) + if len(secIdSplit) != 4 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + catalog := secIdSplit[0] + dataBase := secIdSplit[1] + table := secIdSplit[2] + column := secIdSplit[3] + + respData, err := service.DescribeDlcAttachDataMaskPolicyById(ctx, catalog, dataBase, table) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_dlc_attach_data_mask_policy` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.Columns != nil { + for _, item := range respData.Columns { + if item.Name != nil && *item.Name == column { + tmpList := make([]map[string]interface{}, 0, 1) + dMap := make(map[string]interface{}, 0) + policyInfoList := make([]map[string]interface{}, 0, 1) + policyInfoMap := make(map[string]interface{}, 0) + policyInfoMap["catalog"] = catalog + policyInfoMap["database"] = dataBase + policyInfoMap["table"] = table + policyInfoMap["column"] = column + + policyInfoList = append(policyInfoList, policyInfoMap) + dMap["policy_info"] = policyInfoList + + if item.DataMaskStrategyInfo != nil && item.DataMaskStrategyInfo.StrategyId != nil { + dMap["data_mask_strategy_id"] = item.DataMaskStrategyInfo.StrategyId + } + + if item.Type != nil { + dMap["column_type"] = item.Type + } + + tmpList = append(tmpList, dMap) + _ = d.Set("data_mask_strategy_policy_set", tmpList) + } + } + } + + return nil +} + +func resourceTencentCloudDlcAttachDataMaskPolicyDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_attach_data_mask_policy.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewAttachDataMaskPolicyRequest() + ) + + idSplit := strings.Split(d.Id(), tccommon.FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + policyInfoStr := idSplit[0] + secIdSplit := strings.Split(policyInfoStr, tccommon.COMMA_SP) + if len(secIdSplit) != 4 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + catalog := secIdSplit[0] + dataBase := secIdSplit[1] + table := secIdSplit[2] + column := secIdSplit[3] + + if v, ok := d.GetOk("data_mask_strategy_policy_set"); ok { + for _, item := range v.([]interface{}) { + dataMaskStrategyPolicySetMap := item.(map[string]interface{}) + dataMaskStrategyPolicy := dlcv20210125.DataMaskStrategyPolicy{} + policy := dlcv20210125.Policy{} + policy.Database = &dataBase + policy.Catalog = &catalog + policy.Table = &table + policy.Column = &column + policy.Operation = helper.String("SELECT") + policy.PolicyType = helper.String("DATAMASK") + dataMaskStrategyPolicy.PolicyInfo = &policy + dataMaskStrategyPolicy.DataMaskStrategyId = helper.String("-1") + + if v, ok := dataMaskStrategyPolicySetMap["column_type"].(string); ok && v != "" { + dataMaskStrategyPolicy.ColumnType = helper.String(v) + } + + request.DataMaskStrategyPolicySet = append(request.DataMaskStrategyPolicySet, &dataMaskStrategyPolicy) + } + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().AttachDataMaskPolicyWithContext(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 attach data mask policy failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_attach_data_mask_policy.md b/tencentcloud/services/dlc/resource_tc_dlc_attach_data_mask_policy.md new file mode 100644 index 0000000000..fd5af618fa --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_attach_data_mask_policy.md @@ -0,0 +1,30 @@ +Provides a resource to create a DLC attach data mask policy + +Example Usage + +```hcl +resource "tencentcloud_dlc_data_mask_strategy" "example" { + strategy { + strategy_name = "tf-example" + strategy_desc = "description." + groups { + work_group_id = 70220 + strategy_type = "MASK" + } + } +} + +resource "tencentcloud_dlc_attach_data_mask_policy" "example" { + data_mask_strategy_policy_set { + policy_info { + database = "tf-example" + catalog = "DataLakeCatalog" + table = "tf-example" + column = "id" + } + + data_mask_strategy_id = tencentcloud_dlc_data_mask_strategy.example.id + column_type = "string" + } +} +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_attach_data_mask_policy_test.go b/tencentcloud/services/dlc/resource_tc_dlc_attach_data_mask_policy_test.go new file mode 100644 index 0000000000..deed6b4e30 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_attach_data_mask_policy_test.go @@ -0,0 +1,55 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcAttachDataMaskPolicyResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDlcAttachDataMaskPolicy, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_attach_data_mask_policy.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_attach_data_mask_policy.example", "data_mask_strategy_policy_set.#"), + ), + }, + }, + }) +} + +const testAccDlcAttachDataMaskPolicy = ` +resource "tencentcloud_dlc_data_mask_strategy" "example" { + strategy { + strategy_name = "tf-example" + strategy_desc = "description." + groups { + work_group_id = 70220 + strategy_type = "MASK" + } + } +} + +resource "tencentcloud_dlc_attach_data_mask_policy" "example" { + data_mask_strategy_policy_set { + policy_info { + database = "test" + catalog = "DataLakeCatalog" + table = "test" + column = "id" + } + + data_mask_strategy_id = tencentcloud_dlc_data_mask_strategy.example.id + column_type = "string" + } +} +` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy.go b/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy.go new file mode 100644 index 0000000000..a1f5c3c568 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy.go @@ -0,0 +1,305 @@ +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 ResourceTencentCloudDlcDataMaskStrategy() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudDlcDataMaskStrategyCreate, + Read: resourceTencentCloudDlcDataMaskStrategyRead, + Update: resourceTencentCloudDlcDataMaskStrategyUpdate, + Delete: resourceTencentCloudDlcDataMaskStrategyDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "strategy": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "The data masking strategy.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "strategy_name": { + Type: schema.TypeString, + Optional: true, + Description: "The name of the data masking strategy.", + }, + "strategy_desc": { + Type: schema.TypeString, + Optional: true, + Description: "The description of the data masking strategy.", + }, + "groups": { + Type: schema.TypeList, + Optional: true, + Description: "Collection of bound working groups.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "work_group_id": { + Type: schema.TypeInt, + Optional: true, + Description: "The unique ID of the work group.", + }, + "strategy_type": { + Type: schema.TypeString, + Optional: true, + Description: "The type of the data masking strategy. Supported value: MASK/MASK_NONE/MASK_NULL/MASK_HASH/MASK_SHOW_LAST_4/MASK_SHOW_FIRST_4/MASK_DATE_SHOW_YEAR.", + }, + }, + }, + }, + "strategy_id": { + Type: schema.TypeString, + Computed: true, + Description: "The ID of the data masking strategy.", + }, + }, + }, + }, + }, + } +} + +func resourceTencentCloudDlcDataMaskStrategyCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_data_mask_strategy.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewCreateDataMaskStrategyRequest() + response = dlcv20210125.NewCreateDataMaskStrategyResponse() + strategyId string + ) + + if strategyMap, ok := helper.InterfacesHeadMap(d, "strategy"); ok { + dataMaskStrategyInfo := dlcv20210125.DataMaskStrategyInfo{} + if v, ok := strategyMap["strategy_name"].(string); ok && v != "" { + dataMaskStrategyInfo.StrategyName = helper.String(v) + } + + if v, ok := strategyMap["strategy_desc"].(string); ok && v != "" { + dataMaskStrategyInfo.StrategyDesc = helper.String(v) + } + + if v, ok := strategyMap["groups"]; ok { + for _, item := range v.([]interface{}) { + groupsMap := item.(map[string]interface{}) + groupInfo := dlcv20210125.GroupInfo{} + if v, ok := groupsMap["work_group_id"].(int); ok { + groupInfo.WorkGroupId = helper.IntInt64(v) + } + + if v, ok := groupsMap["strategy_type"].(string); ok && v != "" { + groupInfo.StrategyType = helper.String(v) + } + + dataMaskStrategyInfo.Groups = append(dataMaskStrategyInfo.Groups, &groupInfo) + } + } + + request.Strategy = &dataMaskStrategyInfo + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().CreateDataMaskStrategyWithContext(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 data mask strategy failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create dlc data mask strategy failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.StrategyId == nil { + return fmt.Errorf("StrategyId is nil.") + } + + strategyId = *response.Response.StrategyId + d.SetId(strategyId) + return resourceTencentCloudDlcDataMaskStrategyRead(d, meta) +} + +func resourceTencentCloudDlcDataMaskStrategyRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_data_mask_strategy.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()} + strategyId = d.Id() + ) + + respData, err := service.DescribeDlcDataMaskStrategyById(ctx, strategyId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_dlc_data_mask_strategy` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + strategiesList := make([]map[string]interface{}, 0, 1) + strategiesMap := map[string]interface{}{} + if respData.StrategyName != nil { + strategiesMap["strategy_name"] = respData.StrategyName + } + + if respData.StrategyDesc != nil { + strategiesMap["strategy_desc"] = respData.StrategyDesc + } + + if respData.Groups != nil { + groupsList := make([]map[string]interface{}, 0, len(respData.Groups)) + for _, groups := range respData.Groups { + groupsMap := map[string]interface{}{} + if groups.WorkGroupId != nil { + groupsMap["work_group_id"] = groups.WorkGroupId + } + + if groups.StrategyType != nil { + groupsMap["strategy_type"] = groups.StrategyType + } + + groupsList = append(groupsList, groupsMap) + } + + strategiesMap["groups"] = groupsList + } + + if respData.StrategyId != nil { + strategiesMap["strategy_id"] = respData.StrategyId + } + + strategiesList = append(strategiesList, strategiesMap) + _ = d.Set("strategy", strategiesList) + + return nil +} + +func resourceTencentCloudDlcDataMaskStrategyUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_data_mask_strategy.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + strategyId = d.Id() + ) + + needChange := false + mutableArgs := []string{"strategy"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := dlcv20210125.NewUpdateDataMaskStrategyRequest() + if strategyMap, ok := helper.InterfacesHeadMap(d, "strategy"); ok { + dataMaskStrategyInfo := dlcv20210125.DataMaskStrategyInfo{} + if v, ok := strategyMap["strategy_name"].(string); ok && v != "" { + dataMaskStrategyInfo.StrategyName = helper.String(v) + } + + if v, ok := strategyMap["strategy_desc"].(string); ok && v != "" { + dataMaskStrategyInfo.StrategyDesc = helper.String(v) + } + + if v, ok := strategyMap["groups"]; ok { + for _, item := range v.([]interface{}) { + groupsMap := item.(map[string]interface{}) + groupInfo := dlcv20210125.GroupInfo{} + if v, ok := groupsMap["work_group_id"].(int); ok { + groupInfo.WorkGroupId = helper.IntInt64(v) + } + + if v, ok := groupsMap["strategy_type"].(string); ok && v != "" { + groupInfo.StrategyType = helper.String(v) + } + + dataMaskStrategyInfo.Groups = append(dataMaskStrategyInfo.Groups, &groupInfo) + } + } + + dataMaskStrategyInfo.StrategyId = &strategyId + request.Strategy = &dataMaskStrategyInfo + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateDataMaskStrategyWithContext(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 data mask strategy failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + return resourceTencentCloudDlcDataMaskStrategyRead(d, meta) +} + +func resourceTencentCloudDlcDataMaskStrategyDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_dlc_data_mask_strategy.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = dlcv20210125.NewDeleteDataMaskStrategyRequest() + strategyId = d.Id() + ) + + request.StrategyId = &strategyId + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().DeleteDataMaskStrategyWithContext(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 data mask strategy failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy.md b/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy.md new file mode 100644 index 0000000000..c5061f1a00 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy.md @@ -0,0 +1,24 @@ +Provides a resource to create a DLC data mask strategy + +Example Usage + +```hcl +resource "tencentcloud_dlc_data_mask_strategy" "example" { + strategy { + strategy_name = "tf-example" + strategy_desc = "description." + groups { + work_group_id = 70220 + strategy_type = "MASK" + } + } +} +``` + +Import + +DLC data mask strategy can be imported using the id, e.g. + +``` +terraform import tencentcloud_dlc_data_mask_strategy.example 2fcab650-11a8-44ef-bf58-19c22af601b6 +``` diff --git a/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy_test.go b/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy_test.go new file mode 100644 index 0000000000..62aea65ff0 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_data_mask_strategy_test.go @@ -0,0 +1,66 @@ +package dlc_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudDlcDataMaskStrategyResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDlcDataMaskStrategy, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_data_mask_strategy.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_data_mask_strategy.example", "strategy.#"), + ), + }, + { + Config: testAccDlcDataMaskStrategyUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_dlc_data_mask_strategy.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_dlc_data_mask_strategy.example", "strategy.#"), + ), + }, + { + ResourceName: "tencentcloud_dlc_data_mask_strategy.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccDlcDataMaskStrategy = ` +resource "tencentcloud_dlc_data_mask_strategy" "example" { + strategy { + strategy_name = "tf-example" + strategy_desc = "description." + groups { + work_group_id = 70220 + strategy_type = "MASK" + } + } +} +` + +const testAccDlcDataMaskStrategyUpdate = ` +resource "tencentcloud_dlc_data_mask_strategy" "example" { + strategy { + strategy_name = "tf-example-update" + strategy_desc = "description update." + groups { + work_group_id = 70219 + strategy_type = "MASK_NONE" + } + } +} +` 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..ee78f4ecdb --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.go @@ -0,0 +1,970 @@ +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. \nExample value: image-xxx. If using a built-in image (ImageType is built-in), the ImageName for different frameworks is: machine-learning: pytorch-v2.5.1, scikit-learn-v1.6.0, tensorflow-v2.18.0, python: python-v3.10, spark-m: Standard-S 1.1.", + }, + + "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", "static_config_pairs", "dynamic_config_pairs", "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 + } + } + + if d.HasChange("auto_pause") || d.HasChange("auto_launch") || d.HasChange("auto_pause_time") || d.HasChange("max_concurrency") { + var ( + autoPause int + autoLaunch int + ) + + request := dlcv20210125.NewUpdateStandardEngineResourceGroupBaseInfoRequest() + if v, ok := d.GetOkExists("auto_pause"); ok { + autoPause = v.(int) + } + + if v, ok := d.GetOkExists("auto_launch"); ok { + autoLaunch = v.(int) + } + + if v, ok := d.GetOkExists("auto_pause_time"); ok { + request.AutoPauseTime = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("max_concurrency"); ok { + request.MaxConcurrency = helper.IntInt64(v.(int)) + } + + request.AutoPause = helper.IntInt64(autoPause) + request.AutoLaunch = helper.IntInt64(autoLaunch) + request.EngineResourceGroupName = &engineResourceGroupName + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().UpdateStandardEngineResourceGroupBaseInfoWithContext(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 base info 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() + ) + + // pause first + pauseRequest := dlcv20210125.NewPauseStandardEngineResourceGroupsRequest() + pauseRequest.EngineResourceGroupNames = helper.Strings([]string{engineResourceGroupName}) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseDlcClient().PauseStandardEngineResourceGroupsWithContext(ctx, pauseRequest) + 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 pause 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 == 3 { + return nil + } + } else { + return resource.NonRetryableError(fmt.Errorf("ResourceGroupState is nil.")) + } + + return resource.RetryableError(fmt.Errorf("UserEngineResourceGroupInfos is not pause, state:%d", *state)) + }) + + if waitErr != nil { + log.Printf("[CRITAL]%s wait for dlc standard engine resource group pause failed, reason:%+v", logId, waitErr) + return waitErr + } + + // delete end + 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..90bfe7f26c --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group.md @@ -0,0 +1,51 @@ +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. + +~> **NOTE:** Field `auto_pause_time` is meaningful only when the values ​​of fields `auto_launch` and `auto_pause` are 0. + +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 + 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..fa0569eabd --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_standard_engine_resource_group_test.go @@ -0,0 +1,97 @@ +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.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"), + ), + }, + { + Config: testAccDlcStandardEngineResourceGroupUpdate, + 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" "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 { + config_item = "key" + config_value = "value" + } + max_concurrency = 5 + resource_group_scene = "SparkSQL" + spark_spec_mode = "fast" + spark_size = 16 +} +` + +const testAccDlcStandardEngineResourceGroupUpdate = ` +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 = 20 + static_config_pairs { + config_item = "key" + config_value = "value" + } + + dynamic_config_pairs { + config_item = "key" + config_value = "value" + } + max_concurrency = 10 + resource_group_scene = "SparkSQL" + spark_spec_mode = "fast" + spark_size = 16 +} +` 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..4a83cc6181 --- /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..6b633ab909 --- /dev/null +++ b/tencentcloud/services/dlc/resource_tc_dlc_user_vpc_connection.md @@ -0,0 +1,24 @@ +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" +} +``` + +Or + +```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" + user_vpc_endpoint_vip = "10.0.1.10" +} +``` 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 d2474610a0..ca1ef3e5de 100644 --- a/tencentcloud/services/dlc/service_tencentcloud_dlc.go +++ b/tencentcloud/services/dlc/service_tencentcloud_dlc.go @@ -1120,3 +1120,318 @@ 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 +} + +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 +} + +func (me *DlcService) DescribeDlcDataMaskStrategyById(ctx context.Context, strategyId string) (ret *dlc.DataMaskStrategy, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := dlc.NewDescribeDataMaskStrategiesRequest() + response := dlc.NewDescribeDataMaskStrategiesResponse() + request.Filters = []*dlc.Filter{ + { + Name: helper.String("strategy-id"), + Values: helper.Strings([]string{strategyId}), + }, + } + + 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().DescribeDataMaskStrategies(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 data mask strategies failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + log.Printf("[CRITAL]%s describe dlc data mask strategies failed, reason:%+v", logId, errRet) + return + } + + if len(response.Response.Strategies) != 1 { + return + } + + ret = response.Response.Strategies[0] + return +} + +func (me *DlcService) DescribeDlcAttachDataMaskPolicyById(ctx context.Context, catalog, dataBase, table string) (ret *dlc.TableResponseInfo, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := dlc.NewDescribeTableRequest() + response := dlc.NewDescribeTableResponse() + request.DatasourceConnectionName = &catalog + request.DatabaseName = &dataBase + request.TableName = &table + + 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().DescribeTable(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 table failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + log.Printf("[CRITAL]%s describe dlc table failed, reason:%+v", logId, errRet) + return + } + + ret = response.Response.Table + 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 8e7f55a9f3..44211e6b93 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.31" + params["RequestClient"] = "SDK_GO_1.1.35" 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..28bbd3048b 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" @@ -3026,6 +3150,7 @@ func NewCreateTasksResponse() (response *CreateTasksResponse) { // INTERNALERROR_DBERROR = "InternalError.DBError" // INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_CONFIGKEYPROHIBITED = "InvalidParameter.ConfigKeyProhibited" // INVALIDPARAMETER_DATAENGINEONLYSUPPORTSQL = "InvalidParameter.DataEngineOnlySupportSQL" // INVALIDPARAMETER_IMAGEENGINETYPENOTMATCH = "InvalidParameter.ImageEngineTypeNotMatch" // INVALIDPARAMETER_IMAGEISPUBLICNOTMATCH = "InvalidParameter.ImageIsPublicNotMatch" @@ -3068,6 +3193,7 @@ func (c *Client) CreateTasks(request *CreateTasksRequest) (response *CreateTasks // INTERNALERROR_DBERROR = "InternalError.DBError" // INTERNALERROR_INTERNALSYSTEMEXCEPTION = "InternalError.InternalSystemException" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_CONFIGKEYPROHIBITED = "InvalidParameter.ConfigKeyProhibited" // INVALIDPARAMETER_DATAENGINEONLYSUPPORTSQL = "InvalidParameter.DataEngineOnlySupportSQL" // INVALIDPARAMETER_IMAGEENGINETYPENOTMATCH = "InvalidParameter.ImageEngineTypeNotMatch" // INVALIDPARAMETER_IMAGEISPUBLICNOTMATCH = "InvalidParameter.ImageIsPublicNotMatch" @@ -3177,6 +3303,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 +3737,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 +5317,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{}, @@ -7339,6 +7641,62 @@ func (c *Client) DescribeTaskMonitorInfosWithContext(ctx context.Context, reques return } +func NewDescribeTaskResourceUsageRequest() (request *DescribeTaskResourceUsageRequest) { + request = &DescribeTaskResourceUsageRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("dlc", APIVersion, "DescribeTaskResourceUsage") + + + return +} + +func NewDescribeTaskResourceUsageResponse() (response *DescribeTaskResourceUsageResponse) { + response = &DescribeTaskResourceUsageResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeTaskResourceUsage +// 返回任务洞察资源用量 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_HTTPCLIENTDOREQUESTFAILED = "FailedOperation.HttpClientDoRequestFailed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER_TASKNOTFOUND = "InvalidParameter.TaskNotFound" +func (c *Client) DescribeTaskResourceUsage(request *DescribeTaskResourceUsageRequest) (response *DescribeTaskResourceUsageResponse, err error) { + return c.DescribeTaskResourceUsageWithContext(context.Background(), request) +} + +// DescribeTaskResourceUsage +// 返回任务洞察资源用量 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_HTTPCLIENTDOREQUESTFAILED = "FailedOperation.HttpClientDoRequestFailed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER_TASKNOTFOUND = "InvalidParameter.TaskNotFound" +func (c *Client) DescribeTaskResourceUsageWithContext(ctx context.Context, request *DescribeTaskResourceUsageRequest) (response *DescribeTaskResourceUsageResponse, err error) { + if request == nil { + request = NewDescribeTaskResourceUsageRequest() + } + c.InitBaseRequest(&request.BaseRequest, "dlc", APIVersion, "DescribeTaskResourceUsage") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeTaskResourceUsage require credential") + } + + request.SetContext(ctx) + + response = NewDescribeTaskResourceUsageResponse() + err = c.Send(request, response) + return +} + func NewDescribeTaskResultRequest() (request *DescribeTaskResultRequest) { request = &DescribeTaskResultRequest{ BaseRequest: &tchttp.BaseRequest{}, @@ -7364,6 +7722,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 +7739,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" @@ -7510,9 +7870,12 @@ func NewDescribeTasksAnalysisResponse() (response *DescribeTasksAnalysisResponse // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_FILTERSVALUESNUMBEROUTOFLIMIT = "InvalidParameter.FiltersValuesNumberOutOfLimit" // INVALIDPARAMETER_INVALIDFILTERLENGTH = "InvalidParameter.InvalidFilterLength" +// INVALIDPARAMETER_INVALIDPARAMETER_SQLTASKANALYSISSORTBYTYPENOTMATCH = "InvalidParameter.InvalidParameter_SQLTaskAnalysisSortByTypeNotMatch" // INVALIDPARAMETER_INVALIDTIMEFORMAT = "InvalidParameter.InvalidTimeFormat" // INVALIDPARAMETER_PARAMETERBASE64DECODEFAILED = "InvalidParameter.ParameterBase64DecodeFailed" +// INVALIDPARAMETER_PARAMETERILLEGAL = "InvalidParameter.ParameterIllegal" // INVALIDPARAMETER_PARAMETERNOTFOUNDORBENONE = "InvalidParameter.ParameterNotFoundOrBeNone" +// INVALIDPARAMETER_SQLTASKANALYSISFILTERSKEYTYPENOTMATH = "InvalidParameter.SQLTaskAnalysisFiltersKeyTypeNotMath" // INVALIDPARAMETER_SQLTASKFILTERSKEYTYPENOTMATH = "InvalidParameter.SQLTaskFiltersKeyTypeNotMath" // INVALIDPARAMETER_SQLTASKNOTFOUND = "InvalidParameter.SQLTaskNotFound" // INVALIDPARAMETER_SQLTASKSORTBYTYPENOTMATCH = "InvalidParameter.SQLTaskSortByTypeNotMatch" @@ -7533,9 +7896,12 @@ func (c *Client) DescribeTasksAnalysis(request *DescribeTasksAnalysisRequest) (r // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_FILTERSVALUESNUMBEROUTOFLIMIT = "InvalidParameter.FiltersValuesNumberOutOfLimit" // INVALIDPARAMETER_INVALIDFILTERLENGTH = "InvalidParameter.InvalidFilterLength" +// INVALIDPARAMETER_INVALIDPARAMETER_SQLTASKANALYSISSORTBYTYPENOTMATCH = "InvalidParameter.InvalidParameter_SQLTaskAnalysisSortByTypeNotMatch" // INVALIDPARAMETER_INVALIDTIMEFORMAT = "InvalidParameter.InvalidTimeFormat" // INVALIDPARAMETER_PARAMETERBASE64DECODEFAILED = "InvalidParameter.ParameterBase64DecodeFailed" +// INVALIDPARAMETER_PARAMETERILLEGAL = "InvalidParameter.ParameterIllegal" // INVALIDPARAMETER_PARAMETERNOTFOUNDORBENONE = "InvalidParameter.ParameterNotFoundOrBeNone" +// INVALIDPARAMETER_SQLTASKANALYSISFILTERSKEYTYPENOTMATH = "InvalidParameter.SQLTaskAnalysisFiltersKeyTypeNotMath" // INVALIDPARAMETER_SQLTASKFILTERSKEYTYPENOTMATH = "InvalidParameter.SQLTaskFiltersKeyTypeNotMath" // INVALIDPARAMETER_SQLTASKNOTFOUND = "InvalidParameter.SQLTaskNotFound" // INVALIDPARAMETER_SQLTASKSORTBYTYPENOTMATCH = "InvalidParameter.SQLTaskSortByTypeNotMatch" @@ -7665,6 +8031,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 +8044,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 +8119,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 +11279,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 +11703,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..d719e59029 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" @@ -170,6 +176,9 @@ const ( // 交互式SQL任务指定SortBy类型不匹配,当前仅支持: create-time/resource-usage INVALIDPARAMETER_BATCHSQLTASKSORTBYTYPENOTMATCH = "InvalidParameter.BatchSQLTaskSortByTypeNotMatch" + // 当前配置不被允许 + INVALIDPARAMETER_CONFIGKEYPROHIBITED = "InvalidParameter.ConfigKeyProhibited" + // 指定集群资源类型不匹配,当前仅支持: spark_cu(对应Spark集群),presto_cu(对应Presto集群) INVALIDPARAMETER_DATAENGINECLUSTERTYPENOTMATCH = "InvalidParameter.DataEngineClusterTypeNotMatch" @@ -362,6 +371,9 @@ const ( // 无效的Offset值。 INVALIDPARAMETER_INVALIDOFFSET = "InvalidParameter.InvalidOffset" + // 排序列不合法 + INVALIDPARAMETER_INVALIDPARAMETER_SQLTASKANALYSISSORTBYTYPENOTMATCH = "InvalidParameter.InvalidParameter_SQLTaskAnalysisSortByTypeNotMatch" + // 无效的计费模式。 INVALIDPARAMETER_INVALIDPAYMODE = "InvalidParameter.InvalidPayMode" @@ -419,6 +431,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 +473,9 @@ const ( // 指定参数Base64解析失败 INVALIDPARAMETER_PARAMETERBASE64DECODEFAILED = "InvalidParameter.ParameterBase64DecodeFailed" + // 传入参数不合法 + INVALIDPARAMETER_PARAMETERILLEGAL = "InvalidParameter.ParameterIllegal" + // 找不到参数或参数为空 INVALIDPARAMETER_PARAMETERNOTFOUNDORBENONE = "InvalidParameter.ParameterNotFoundOrBeNone" @@ -467,6 +485,9 @@ const ( // SQL参数预处理失败 INVALIDPARAMETER_SQLPARAMETERPREPROCESSINGFAILED = "InvalidParameter.SQLParameterPreprocessingFailed" + // 不支持的过滤类型或者参数不合法 + INVALIDPARAMETER_SQLTASKANALYSISFILTERSKEYTYPENOTMATH = "InvalidParameter.SQLTaskAnalysisFiltersKeyTypeNotMath" + // 指定的Filter.Key不匹配,当前仅支持: task-id/task-sql-keyword/task-kind/task-operator/batch-id/session-id/task-state INVALIDPARAMETER_SQLTASKFILTERSKEYTYPENOTMATH = "InvalidParameter.SQLTaskFiltersKeyTypeNotMath" @@ -500,6 +521,9 @@ const ( // 任务已经结束,不能取消。 INVALIDPARAMETER_TASKALREADYFINISHED = "InvalidParameter.TaskAlreadyFinished" + // 任务不存在。 + INVALIDPARAMETER_TASKNOTFOUND = "InvalidParameter.TaskNotFound" + // 指定的任务状态不匹配,当前仅支持: 0:初始化, 1:运行中, 2:成功, 3:数据写入中, 4:排队中, -1:失败, -3:删除 INVALIDPARAMETER_TASKSTATETYPENOTMATH = "InvalidParameter.TaskStateTypeNotMath" @@ -623,6 +647,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..3db2fde2fd 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接口查看。 @@ -1747,6 +1801,14 @@ type CommonMetrics struct { ProcessedRows *int64 `json:"ProcessedRows,omitnil,omitempty" name:"ProcessedRows"` } +type CoreInfo struct { + // 时间戳(毫秒)数组 + Timestamp []*int64 `json:"Timestamp,omitnil,omitempty" name:"Timestamp"` + + // core 用量 + CoreUsage []*int64 `json:"CoreUsage,omitnil,omitempty" name:"CoreUsage"` +} + type CosPermission struct { // cos路径 // 注意:此字段可能返回 null,表示取不到有效值。 @@ -2130,10 +2192,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 +2213,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 +2295,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 +2316,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 +2435,63 @@ 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 + StrategyId *string `json:"StrategyId,omitnil,omitempty" name:"StrategyId"` + + // 唯一请求 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 { // 数据库基础信息 @@ -3855,6 +3974,21 @@ type CreateStandardEngineResourceGroupRequestParams struct { // 仅SQL资源组资源上限,仅用于快速模块 SparkSize *int64 `json:"SparkSize,omitnil,omitempty" name:"SparkSize"` + + // GPUDriver规格 + DriverGPUSpec *int64 `json:"DriverGPUSpec,omitnil,omitempty" name:"DriverGPUSpec"` + + // GPUExecutor规格 + ExecutorGPUSpec *int64 `json:"ExecutorGPUSpec,omitnil,omitempty" name:"ExecutorGPUSpec"` + + // GPU上限 + GPULimitSize *int64 `json:"GPULimitSize,omitnil,omitempty" name:"GPULimitSize"` + + // GPU规格 + GPUSize *int64 `json:"GPUSize,omitnil,omitempty" name:"GPUSize"` + + // Pod GPU规格上限 + PythonGPUSpec *int64 `json:"PythonGPUSpec,omitnil,omitempty" name:"PythonGPUSpec"` } type CreateStandardEngineResourceGroupRequest struct { @@ -3939,6 +4073,21 @@ type CreateStandardEngineResourceGroupRequest struct { // 仅SQL资源组资源上限,仅用于快速模块 SparkSize *int64 `json:"SparkSize,omitnil,omitempty" name:"SparkSize"` + + // GPUDriver规格 + DriverGPUSpec *int64 `json:"DriverGPUSpec,omitnil,omitempty" name:"DriverGPUSpec"` + + // GPUExecutor规格 + ExecutorGPUSpec *int64 `json:"ExecutorGPUSpec,omitnil,omitempty" name:"ExecutorGPUSpec"` + + // GPU上限 + GPULimitSize *int64 `json:"GPULimitSize,omitnil,omitempty" name:"GPULimitSize"` + + // GPU规格 + GPUSize *int64 `json:"GPUSize,omitnil,omitempty" name:"GPUSize"` + + // Pod GPU规格上限 + PythonGPUSpec *int64 `json:"PythonGPUSpec,omitnil,omitempty" name:"PythonGPUSpec"` } func (r *CreateStandardEngineResourceGroupRequest) ToJsonString() string { @@ -3979,6 +4128,11 @@ func (r *CreateStandardEngineResourceGroupRequest) FromJsonString(s string) erro delete(f, "PythonCuSpec") delete(f, "SparkSpecMode") delete(f, "SparkSize") + delete(f, "DriverGPUSpec") + delete(f, "ExecutorGPUSpec") + delete(f, "GPULimitSize") + delete(f, "GPUSize") + delete(f, "PythonGPUSpec") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateStandardEngineResourceGroupRequest has unknown keys!", "") } @@ -4386,6 +4540,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 +4782,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 +5551,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 +5622,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 +5975,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 +8006,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。 @@ -10002,14 +10442,59 @@ func (r *DescribeSubUserAccessPolicyResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } -// Predefined struct for user -type DescribeTablePartitionsRequestParams struct { +// Predefined struct for user +type DescribeTablePartitionsRequestParams struct { + // 数据目录名称 + Catalog *string `json:"Catalog,omitnil,omitempty" name:"Catalog"` + + // 数据库名称 + Database *string `json:"Database,omitnil,omitempty" name:"Database"` + + // 数据表名称 + Table *string `json:"Table,omitnil,omitempty" name:"Table"` + + // 查询偏移位置 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 当次查询的数量限制 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 模糊查询的分区名称 + FuzzyPartition *string `json:"FuzzyPartition,omitnil,omitempty" name:"FuzzyPartition"` + + // 排序信息 + Sorts []*Sort `json:"Sorts,omitnil,omitempty" name:"Sorts"` + + // 分页查询的游标信息 + Cursor *string `json:"Cursor,omitnil,omitempty" name:"Cursor"` +} + +type DescribeTablePartitionsRequest struct { + *tchttp.BaseRequest + + // 数据目录名称 + Catalog *string `json:"Catalog,omitnil,omitempty" name:"Catalog"` + + // 数据库名称 + Database *string `json:"Database,omitnil,omitempty" name:"Database"` + + // 数据表名称 + Table *string `json:"Table,omitnil,omitempty" name:"Table"` + + // 查询偏移位置 + Offset *int64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 当次查询的数量限制 + Limit *int64 `json:"Limit,omitnil,omitempty" name:"Limit"` -} + // 模糊查询的分区名称 + FuzzyPartition *string `json:"FuzzyPartition,omitnil,omitempty" name:"FuzzyPartition"` -type DescribeTablePartitionsRequest struct { - *tchttp.BaseRequest - + // 排序信息 + Sorts []*Sort `json:"Sorts,omitnil,omitempty" name:"Sorts"` + + // 分页查询的游标信息 + Cursor *string `json:"Cursor,omitnil,omitempty" name:"Cursor"` } func (r *DescribeTablePartitionsRequest) ToJsonString() string { @@ -10024,7 +10509,14 @@ func (r *DescribeTablePartitionsRequest) FromJsonString(s string) error { if err := json.Unmarshal([]byte(s), &f); err != nil { return err } - + delete(f, "Catalog") + delete(f, "Database") + delete(f, "Table") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "FuzzyPartition") + delete(f, "Sorts") + delete(f, "Cursor") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTablePartitionsRequest has unknown keys!", "") } @@ -10033,6 +10525,9 @@ func (r *DescribeTablePartitionsRequest) FromJsonString(s string) error { // Predefined struct for user type DescribeTablePartitionsResponseParams struct { + // 分区信息值 + MixedPartitions *MixedTablePartitions `json:"MixedPartitions,omitnil,omitempty" name:"MixedPartitions"` + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` } @@ -10611,6 +11106,63 @@ func (r *DescribeTaskMonitorInfosResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +// Predefined struct for user +type DescribeTaskResourceUsageRequestParams struct { + // 任务 id + TaskInstanceId *string `json:"TaskInstanceId,omitnil,omitempty" name:"TaskInstanceId"` +} + +type DescribeTaskResourceUsageRequest struct { + *tchttp.BaseRequest + + // 任务 id + TaskInstanceId *string `json:"TaskInstanceId,omitnil,omitempty" name:"TaskInstanceId"` +} + +func (r *DescribeTaskResourceUsageRequest) 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 *DescribeTaskResourceUsageRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "TaskInstanceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTaskResourceUsageRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeTaskResourceUsageResponseParams struct { + // core 用量信息 + CoreInfo *CoreInfo `json:"CoreInfo,omitnil,omitempty" name:"CoreInfo"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeTaskResourceUsageResponse struct { + *tchttp.BaseResponse + Response *DescribeTaskResourceUsageResponseParams `json:"Response"` +} + +func (r *DescribeTaskResourceUsageResponse) 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 *DescribeTaskResourceUsageResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + // Predefined struct for user type DescribeTaskResultRequestParams struct { // 任务唯一ID,仅支持30天内的任务 @@ -11178,6 +11730,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 +12331,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 +12344,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 +12363,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!", "") } @@ -13056,6 +13686,26 @@ type HiveInfo struct { KerberosEnable *bool `json:"KerberosEnable,omitnil,omitempty" name:"KerberosEnable"` } +type HiveTablePartition struct { + // 分区信息名称 + Partition *string `json:"Partition,omitnil,omitempty" name:"Partition"` + + // 分区记录数 + Records *int64 `json:"Records,omitnil,omitempty" name:"Records"` + + // 分区数据文件存储量 + DataFileStorage *int64 `json:"DataFileStorage,omitnil,omitempty" name:"DataFileStorage"` + + // 分区创建时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 分区schema更新时间 + ModifiedTime *string `json:"ModifiedTime,omitnil,omitempty" name:"ModifiedTime"` + + // 最后一次分区更新的访问时间 + LastAccessTime *string `json:"LastAccessTime,omitnil,omitempty" name:"LastAccessTime"` +} + type HouseEventsInfo struct { // 事件时间 // 注意:此字段可能返回 null,表示取不到有效值。 @@ -13070,6 +13720,32 @@ type HouseEventsInfo struct { ClusterInfo []*string `json:"ClusterInfo,omitnil,omitempty" name:"ClusterInfo"` } +type IcebergTablePartition struct { + // 分区信息名称 + Partition *string `json:"Partition,omitnil,omitempty" name:"Partition"` + + // 分区记录数 + Records *int64 `json:"Records,omitnil,omitempty" name:"Records"` + + // 分区数据文件数量 + DataFileSize *int64 `json:"DataFileSize,omitnil,omitempty" name:"DataFileSize"` + + // 分区数据文件存储量 + DataFileStorage *int64 `json:"DataFileStorage,omitnil,omitempty" name:"DataFileStorage"` + + // 分区创建时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 分区更新时间 + UpdateTime *string `json:"UpdateTime,omitnil,omitempty" name:"UpdateTime"` + + // 最后一次分区更新的快照ID + LastUpdateSnapshotId *string `json:"LastUpdateSnapshotId,omitnil,omitempty" name:"LastUpdateSnapshotId"` + + // 分区的location + Location *LocationInfo `json:"Location,omitnil,omitempty" name:"Location"` +} + type IpPortPair struct { // ip信息 // 注意:此字段可能返回 null,表示取不到有效值。 @@ -13423,6 +14099,14 @@ func (r *ListTaskJobLogNameResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type LocationInfo struct { + // 桶名称 + Bucket *string `json:"Bucket,omitnil,omitempty" name:"Bucket"` + + // location路径 + DataLocation *string `json:"DataLocation,omitnil,omitempty" name:"DataLocation"` +} + type LockComponentInfo struct { // 数据库名称 DbName *string `json:"DbName,omitnil,omitempty" name:"DbName"` @@ -13537,6 +14221,23 @@ func (r *LockMetaDataResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } +type MixedTablePartitions struct { + // 数据表格式 + TableFormat *string `json:"TableFormat,omitnil,omitempty" name:"TableFormat"` + + // 分区总数 + TotalSize *int64 `json:"TotalSize,omitnil,omitempty" name:"TotalSize"` + + // 分页查询的游标信息,在获取下一页信息时需要回传到服务端 + NextCursor *string `json:"NextCursor,omitnil,omitempty" name:"NextCursor"` + + // iceberg表分区信息 + IcebergPartitions []*IcebergTablePartition `json:"IcebergPartitions,omitnil,omitempty" name:"IcebergPartitions"` + + // hive表分区信息 + HivePartitions []*HiveTablePartition `json:"HivePartitions,omitnil,omitempty" name:"HivePartitions"` +} + // Predefined struct for user type ModifyAdvancedStoreLocationRequestParams struct { // 查询结果保存cos路径 @@ -15626,6 +16327,14 @@ type SmartPolicyBaseInfo struct { AppId *string `json:"AppId,omitnil,omitempty" name:"AppId"` } +type Sort struct { + // 排序字段 + Field *string `json:"Field,omitnil,omitempty" name:"Field"` + + // 是否按照ASC排序,否则DESC排序 + Asc *bool `json:"Asc,omitnil,omitempty" name:"Asc"` +} + type SparkJobInfo struct { // spark作业ID JobId *string `json:"JobId,omitnil,omitempty" name:"JobId"` @@ -16642,6 +17351,9 @@ type TaskResponseInfo struct { // spark引擎资源组名称 ResourceGroupName *string `json:"ResourceGroupName,omitnil,omitempty" name:"ResourceGroupName"` + + // 任务执行耗时 + JobTimeSum *int64 `json:"JobTimeSum,omitnil,omitempty" name:"JobTimeSum"` } type TaskResultInfo struct { @@ -16705,6 +17417,9 @@ type TaskResultInfo struct { // 获取结果消耗的时间 QueryResultTime *float64 `json:"QueryResultTime,omitnil,omitempty" name:"QueryResultTime"` + + // base64 编码结果集 + ResultSetEncode *string `json:"ResultSetEncode,omitnil,omitempty" name:"ResultSetEncode"` } type TasksInfo struct { @@ -16769,6 +17484,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 +17907,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 @@ -17574,6 +18355,21 @@ type UpdateStandardEngineResourceGroupResourceInfoRequestParams struct { // 仅SQL资源组资源上限,仅用于快速模式 SparkSize *int64 `json:"SparkSize,omitnil,omitempty" name:"SparkSize"` + + // gpuDriver规格 + DriverGPUSpec *int64 `json:"DriverGPUSpec,omitnil,omitempty" name:"DriverGPUSpec"` + + // gpuExcutor 规格 + ExecutorGPUSpec *int64 `json:"ExecutorGPUSpec,omitnil,omitempty" name:"ExecutorGPUSpec"` + + // gpu 上限 + GPULimitSize *int64 `json:"GPULimitSize,omitnil,omitempty" name:"GPULimitSize"` + + // gpu 规格 + GPUSize *int64 `json:"GPUSize,omitnil,omitempty" name:"GPUSize"` + + // gpupod 规格 + PythonGPUSpec *int64 `json:"PythonGPUSpec,omitnil,omitempty" name:"PythonGPUSpec"` } type UpdateStandardEngineResourceGroupResourceInfoRequest struct { @@ -17631,6 +18427,21 @@ type UpdateStandardEngineResourceGroupResourceInfoRequest struct { // 仅SQL资源组资源上限,仅用于快速模式 SparkSize *int64 `json:"SparkSize,omitnil,omitempty" name:"SparkSize"` + + // gpuDriver规格 + DriverGPUSpec *int64 `json:"DriverGPUSpec,omitnil,omitempty" name:"DriverGPUSpec"` + + // gpuExcutor 规格 + ExecutorGPUSpec *int64 `json:"ExecutorGPUSpec,omitnil,omitempty" name:"ExecutorGPUSpec"` + + // gpu 上限 + GPULimitSize *int64 `json:"GPULimitSize,omitnil,omitempty" name:"GPULimitSize"` + + // gpu 规格 + GPUSize *int64 `json:"GPUSize,omitnil,omitempty" name:"GPUSize"` + + // gpupod 规格 + PythonGPUSpec *int64 `json:"PythonGPUSpec,omitnil,omitempty" name:"PythonGPUSpec"` } func (r *UpdateStandardEngineResourceGroupResourceInfoRequest) ToJsonString() string { @@ -17662,6 +18473,11 @@ func (r *UpdateStandardEngineResourceGroupResourceInfoRequest) FromJsonString(s delete(f, "PythonCuSpec") delete(f, "SparkSpecMode") delete(f, "SparkSize") + delete(f, "DriverGPUSpec") + delete(f, "ExecutorGPUSpec") + delete(f, "GPULimitSize") + delete(f, "GPUSize") + delete(f, "PythonGPUSpec") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpdateStandardEngineResourceGroupResourceInfoRequest has unknown keys!", "") } @@ -17690,6 +18506,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 42aee71366..049fb642ad 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.31 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.35 ## 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.35 ## 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/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_attach_data_mask_policy.html.markdown b/website/docs/r/dlc_attach_data_mask_policy.html.markdown new file mode 100644 index 0000000000..ac028ee436 --- /dev/null +++ b/website/docs/r/dlc_attach_data_mask_policy.html.markdown @@ -0,0 +1,69 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_attach_data_mask_policy" +sidebar_current: "docs-tencentcloud-resource-dlc_attach_data_mask_policy" +description: |- + Provides a resource to create a DLC attach data mask policy +--- + +# tencentcloud_dlc_attach_data_mask_policy + +Provides a resource to create a DLC attach data mask policy + +## Example Usage + +```hcl +resource "tencentcloud_dlc_data_mask_strategy" "example" { + strategy { + strategy_name = "tf-example" + strategy_desc = "description." + groups { + work_group_id = 70220 + strategy_type = "MASK" + } + } +} + +resource "tencentcloud_dlc_attach_data_mask_policy" "example" { + data_mask_strategy_policy_set { + policy_info { + database = "tf-example" + catalog = "DataLakeCatalog" + table = "tf-example" + column = "id" + } + + data_mask_strategy_id = tencentcloud_dlc_data_mask_strategy.example.id + column_type = "string" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `data_mask_strategy_policy_set` - (Optional, List, ForceNew) A collection of data masking policy permission objects to be bound. + +The `data_mask_strategy_policy_set` object supports the following: + +* `column_type` - (Optional, String, ForceNew) The type of the bound field. +* `data_mask_strategy_id` - (Optional, String, ForceNew) The ID of the data masking strategy. +* `policy_info` - (Optional, List, ForceNew) Data masking permission object. + +The `policy_info` object of `data_mask_strategy_policy_set` supports the following: + +* `catalog` - (Required, String, ForceNew) The name of the data source to be authorized. For administrator-level authorization, only * is allowed (representing all resources at this level). For data source-level and database-level authorization, only COSDataCatalog or * is allowed. For table-level authorization, custom data sources can be specified. Defaults to DataLakeCatalog if not specified. Note: For custom data sources, DLC can only manage a subset of permissions provided by the user during data source integration. +* `database` - (Required, String, ForceNew) The name of the database to be authorized. Use * to represent all databases under the current Catalog. For administrator-level authorization, only * is allowed. For data connection-level authorization, leave it empty. For other types, specify the database name. +* `table` - (Required, String, ForceNew) The name of the table to be authorized. Use * to represent all tables under the current Database. For administrator-level authorization, only * is allowed. For data connection-level and database-level authorization, leave it empty. For other types, specify the table name. +* `column` - (Optional, String, ForceNew) The name of the column to be authorized. Use * to represent all columns. For administrator-level authorization, only * is allowed. + +## 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_data_mask_strategy.html.markdown b/website/docs/r/dlc_data_mask_strategy.html.markdown new file mode 100644 index 0000000000..33ee8128e8 --- /dev/null +++ b/website/docs/r/dlc_data_mask_strategy.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "Data Lake Compute(DLC)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_dlc_data_mask_strategy" +sidebar_current: "docs-tencentcloud-resource-dlc_data_mask_strategy" +description: |- + Provides a resource to create a DLC data mask strategy +--- + +# tencentcloud_dlc_data_mask_strategy + +Provides a resource to create a DLC data mask strategy + +## Example Usage + +```hcl +resource "tencentcloud_dlc_data_mask_strategy" "example" { + strategy { + strategy_name = "tf-example" + strategy_desc = "description." + groups { + work_group_id = 70220 + strategy_type = "MASK" + } + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `strategy` - (Optional, List) The data masking strategy. + +The `groups` object of `strategy` supports the following: + +* `strategy_type` - (Optional, String) The type of the data masking strategy. Supported value: MASK/MASK_NONE/MASK_NULL/MASK_HASH/MASK_SHOW_LAST_4/MASK_SHOW_FIRST_4/MASK_DATE_SHOW_YEAR. +* `work_group_id` - (Optional, Int) The unique ID of the work group. + +The `strategy` object supports the following: + +* `groups` - (Optional, List) Collection of bound working groups. +* `strategy_desc` - (Optional, String) The description of the data masking strategy. +* `strategy_name` - (Optional, String) The name of the data masking strategy. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +DLC data mask strategy can be imported using the id, e.g. + +``` +terraform import tencentcloud_dlc_data_mask_strategy.example 2fcab650-11a8-44ef-bf58-19c22af601b6 +``` + 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..a645ccdca7 --- /dev/null +++ b/website/docs/r/dlc_standard_engine_resource_group.html.markdown @@ -0,0 +1,112 @@ +--- +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. + +~> **NOTE:** Field `auto_pause_time` is meaningful only when the values ​​of fields `auto_launch` and `auto_pause` are 0. + +## 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 + 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. +Example value: image-xxx. If using a built-in image (ImageType is built-in), the ImageName for different frameworks is: machine-learning: pytorch-v2.5.1, scikit-learn-v1.6.0, tensorflow-v2.18.0, python: python-v3.10, spark-m: Standard-S 1.1. +* `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_user_vpc_connection.html.markdown b/website/docs/r/dlc_user_vpc_connection.html.markdown new file mode 100644 index 0000000000..0aa243906e --- /dev/null +++ b/website/docs/r/dlc_user_vpc_connection.html.markdown @@ -0,0 +1,54 @@ +--- +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" +} +``` + +### Or + +```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" + user_vpc_endpoint_vip = "10.0.1.10" +} +``` + +## 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 656b6fdc43..8f582c53f1 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
  • @@ -2299,12 +2308,18 @@
  • tencentcloud_dlc_add_users_to_work_group_attachment
  • +
  • + tencentcloud_dlc_attach_data_mask_policy +
  • tencentcloud_dlc_bind_work_groups_to_user_attachment
  • tencentcloud_dlc_data_engine
  • +
  • + tencentcloud_dlc_data_mask_strategy +
  • tencentcloud_dlc_modify_data_engine_description_operation
  • @@ -2320,6 +2335,9 @@
  • tencentcloud_dlc_rollback_data_engine_image_operation
  • +
  • + tencentcloud_dlc_standard_engine_resource_group +
  • tencentcloud_dlc_store_location_config
  • @@ -2344,6 +2362,9 @@
  • tencentcloud_dlc_user_data_engine_config
  • +
  • + tencentcloud_dlc_user_vpc_connection +
  • tencentcloud_dlc_work_group