diff --git a/.changelog/3549.txt b/.changelog/3549.txt new file mode 100644 index 0000000000..c477a2df81 --- /dev/null +++ b/.changelog/3549.txt @@ -0,0 +1,27 @@ +```release-note:new-data-source +tencentcloud_wedata_projects +``` + +```release-note:new-data-source +tencentcloud_wedata_data_sources +``` + +```release-note:new-data-source +tencentcloud_wedata_project_roles +``` + +```release-note:new-data-source +tencentcloud_wedata_tenant_roles +``` + +```release-note:new-data-source +tencentcloud_wedata_resource_group_metrics +``` + +```release-note:new-resource +tencentcloud_wedata_project +``` + +```release-note:new-resource +tencentcloud_wedata_project_member +``` diff --git a/go.mod b/go.mod index 8f05d9d07c..842a4286d4 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.40 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.42 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 @@ -98,7 +98,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.860 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf v1.0.1170 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.40 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.42 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199 github.com/tencentyun/cos-go-sdk-v5 v0.7.66 github.com/yangwenmai/ratelimit v0.0.0-20180104140304-44221c2292e1 diff --git a/go.sum b/go.sum index 9690122c33..222f12b08b 100644 --- a/go.sum +++ b/go.sum @@ -957,8 +957,12 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.35 h1:gcnqn github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.35/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.36 h1:9zBwuj7prOhpObcw8idPnTn78TbNeK2RfAYoUaB6O/o= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.36/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.39 h1:D7qtbjv0+L8r+Wrenk+SAsAwLVPRUkePROGWUrZY5QE= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.39/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.40 h1:mNP6SgjUucirQfsAtChZ0bG6Cd2XcgJvHXW8IaChxtM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.40/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.42 h1:zOTQCji3vmxrZPkDPfqs2cklL0ZwZYABvWPdm1NQ9lk= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.42/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= @@ -1092,8 +1096,12 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.0.792 h1:NLgK github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.0.792/go.mod h1:Xz6vPV3gHlzPwtEcmWdWO1EUXJDgn2p7UMCXbJiVioQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.31 h1:5mDWm86NA0etP4ictillWtZgyCHiK9hpCmj+qEYeowc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.31/go.mod h1:+DhuFrNBquvUs+QSbtVMe1tzJZq5donfipnzo3Luo9Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.39 h1:24yWzFxh/KW9CvYv9MLVFyUOIR6xqzO4meXGsP5t8Jo= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.39/go.mod h1:32C+QaoFmT1pvuIv1bkPi8Nc0f5btvMgzwX5AGwG74M= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.40 h1:ZHESnPRiyV9+HYSArZKPmliSjy85/El899LKGSsyxSw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.40/go.mod h1:ROVq1WJulfJonhjNE6olW+xEBHPxqgAoYhpMZ7gFHO8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.42 h1:UccqwoaGyksPVmFyCFOWLCpLJqpcLFvG/9KnZne2zR8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.42/go.mod h1:w5V5Vo3d+7UVFIEq3crWPb7tElu2TaG23u+Fq/eo26w= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199 h1:hMBLtiJPnZ9GvA677cTB6ELBR6B68wCR2QY1sNoGQc4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199/go.mod h1:nnY91/H3j/Gu7V/oCA6Zeg8T5D3q36EUdBh4EjmHwqY= github.com/tencentyun/cos-go-sdk-v5 v0.7.66 h1:O4O6EsozBoDjxWbltr3iULgkI7WPj/BFNlYTXDuE64E= diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index c7cc309675..2f3742f4a8 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1188,6 +1188,11 @@ func Provider() *schema.Provider { "tencentcloud_wedata_task_instance_executions": wedata.DataSourceTencentCloudWedataTaskInstanceExecutions(), "tencentcloud_wedata_data_source_list": wedata.DataSourceTencentCloudWedataDataSourceList(), "tencentcloud_wedata_sql_script_runs": wedata.DataSourceTencentCloudWedataSqlScriptRuns(), + "tencentcloud_wedata_projects": wedata.DataSourceTencentCloudWedataProjects(), + "tencentcloud_wedata_data_sources": wedata.DataSourceTencentCloudWedataDataSources(), + "tencentcloud_wedata_project_roles": wedata.DataSourceTencentCloudWedataProjectRoles(), + "tencentcloud_wedata_tenant_roles": wedata.DataSourceTencentCloudWedataTenantRoles(), + "tencentcloud_wedata_resource_group_metrics": wedata.DataSourceTencentCloudWedataResourceGroupMetrics(), "tencentcloud_private_dns_records": privatedns.DataSourceTencentCloudPrivateDnsRecords(), "tencentcloud_private_dns_private_zone_list": privatedns.DataSourceTencentCloudPrivateDnsPrivateZoneList(), "tencentcloud_private_dns_forward_rules": privatedns.DataSourceTencentCloudPrivateDnsForwardRules(), @@ -2323,6 +2328,11 @@ func Provider() *schema.Provider { "tencentcloud_wedata_ops_task": wedata.ResourceTencentCloudWedataOpsTask(), "tencentcloud_wedata_integration_offline_task": wedata.ResourceTencentCloudWedataIntegrationOfflineTask(), "tencentcloud_wedata_integration_realtime_task": wedata.ResourceTencentCloudWedataIntegrationRealtimeTask(), + "tencentcloud_wedata_project": wedata.ResourceTencentCloudWedataProject(), + "tencentcloud_wedata_data_source": wedata.ResourceTencentCloudWedataDataSource(), + "tencentcloud_wedata_project_member": wedata.ResourceTencentCloudWedataProjectMember(), + "tencentcloud_wedata_resource_group": wedata.ResourceTencentCloudWedataResourceGroup(), + "tencentcloud_wedata_resource_group_to_project_attachment": wedata.ResourceTencentCloudWedataResourceGroupToProjectAttachment(), "tencentcloud_wedata_integration_task_node": wedata.ResourceTencentCloudWedataIntegrationTaskNode(), "tencentcloud_wedata_sql_folder": wedata.ResourceTencentCloudWedataSqlFolder(), "tencentcloud_wedata_sql_script": wedata.ResourceTencentCloudWedataSqlScript(), diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index 60173dd9e7..09811efdda 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -2249,6 +2249,11 @@ tencentcloud_wedata_downstream_task_instances tencentcloud_wedata_task_instance_executions tencentcloud_wedata_data_source_list tencentcloud_wedata_sql_script_runs +tencentcloud_wedata_projects +tencentcloud_wedata_data_sources +tencentcloud_wedata_project_roles +tencentcloud_wedata_tenant_roles +tencentcloud_wedata_resource_group_metrics Resource tencentcloud_wedata_submit_task_operation @@ -2278,6 +2283,8 @@ tencentcloud_wedata_code_folder tencentcloud_wedata_code_file tencentcloud_wedata_run_sql_script_operation tencentcloud_wedata_stop_sql_script_run_operation +tencentcloud_wedata_project +tencentcloud_wedata_project_member Cloud Firewall(CFW) Data Source diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_data_sources.go b/tencentcloud/services/wedata/data_source_tc_wedata_data_sources.go new file mode 100644 index 0000000000..3093a38d3a --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_data_sources.go @@ -0,0 +1,268 @@ +package wedata + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudWedataDataSources() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudWedataDataSourcesRead, + Schema: map[string]*schema.Schema{ + "project_id": { + Type: schema.TypeString, + Required: true, + Description: "Project ID.", + }, + + "name": { + Type: schema.TypeString, + Optional: true, + Description: "Data source name.", + }, + + "display_name": { + Type: schema.TypeString, + Optional: true, + Description: "Data source display name.", + }, + + "type": { + Type: schema.TypeSet, + Optional: true, + Description: "Data source type: enumeration values.\n\n- MYSQL\n- TENCENT_MYSQL\n- POSTGRE\n- ORACLE\n- SQLSERVER\n- FTP\n- HIVE\n- HUDI\n- HDFS\n- ICEBERG\n- KAFKA\n- HBASE\n- SPARK\n- VIRTUAL\n- TBASE\n- DB2\n- DM\n- GAUSSDB\n- GBASE\n- IMPALA\n- ES\n- TENCENT_ES\n- GREENPLUM\n- PHOENIX\n- SAP_HANA\n- SFTP\n- OCEANBASE\n- CLICKHOUSE\n- KUDU\n- VERTICA\n- REDIS\n- COS\n- DLC\n- DORIS\n- CKAFKA\n- S3\n- TDSQL\n- TDSQL_MYSQL\n- MONGODB\n- TENCENT_MONGODB\n- REST_API\n- SuperSQL\n- PRESTO\n- TiDB\n- StarRocks\n- Trino\n- Kyuubi\n- TCHOUSE_X\n- TCHOUSE_P\n- TCHOUSE_C\n- TCHOUSE_D\n- INFLUXDB\n- BIG_QUERY\n- SSH\n- BLOB.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "creator": { + Type: schema.TypeString, + Optional: true, + Description: "Creator.", + }, + + "items": { + Type: schema.TypeList, + Computed: true, + Description: "Data source list.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "project_id": { + Type: schema.TypeString, + Computed: true, + Description: "Belonging project ID.", + }, + "id": { + Type: schema.TypeInt, + Computed: true, + Description: "Data source ID.", + }, + "type": { + Type: schema.TypeString, + Computed: true, + Description: "Data source type: enumeration values.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Data source name.", + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + Description: "Data source display name, for visual viewing.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Data source description information.", + }, + "project_name": { + Type: schema.TypeString, + Computed: true, + Description: "Belonging project name.", + }, + "create_user": { + Type: schema.TypeString, + Computed: true, + Description: "Data source creator.", + }, + "create_time": { + Type: schema.TypeString, + Computed: true, + Description: "Time.", + }, + "modify_user": { + Type: schema.TypeString, + Computed: true, + Description: "Modifier.", + }, + "modify_time": { + Type: schema.TypeString, + Computed: true, + Description: "Modification time.", + }, + "prod_con_properties": { + Type: schema.TypeString, + Computed: true, + Description: "Data source configuration information, stored in JSON KV format, varies by data source type.", + }, + "dev_con_properties": { + Type: schema.TypeString, + Computed: true, + Description: "Same as params, contains data for development data source.", + }, + "category": { + Type: schema.TypeString, + Computed: true, + Description: "Data source category:\n\n- DB - custom source\n- CLUSTER - system source.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudWedataDataSourcesRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_wedata_data_sources.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + projectId string + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("project_id"); ok { + paramMap["ProjectId"] = helper.String(v.(string)) + projectId = v.(string) + } + + if v, ok := d.GetOk("name"); ok { + paramMap["Name"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("display_name"); ok { + paramMap["DisplayName"] = helper.String(v.(string)) + } + + if v, ok := d.GetOk("type"); ok { + typeList := []*string{} + typeSet := v.(*schema.Set).List() + for i := range typeSet { + tmpType := typeSet[i].(string) + typeList = append(typeList, helper.String(tmpType)) + } + + paramMap["Type"] = typeList + } + + if v, ok := d.GetOk("creator"); ok { + paramMap["Creator"] = helper.String(v.(string)) + } + + var respData []*wedatav20250806.DataSource + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeWedataDataSourcesByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + itemsList := make([]map[string]interface{}, 0, len(respData)) + for _, items := range respData { + itemsMap := map[string]interface{}{} + if items.ProjectId != nil { + itemsMap["project_id"] = items.ProjectId + } + + if items.Id != nil { + itemsMap["id"] = items.Id + } + + if items.Type != nil { + itemsMap["type"] = items.Type + } + + if items.Name != nil { + itemsMap["name"] = items.Name + } + + if items.DisplayName != nil { + itemsMap["display_name"] = items.DisplayName + } + + if items.Description != nil { + itemsMap["description"] = items.Description + } + + if items.ProjectName != nil { + itemsMap["project_name"] = items.ProjectName + } + + if items.CreateUser != nil { + itemsMap["create_user"] = items.CreateUser + } + + if items.CreateTime != nil { + itemsMap["create_time"] = items.CreateTime + } + + if items.ModifyUser != nil { + itemsMap["modify_user"] = items.ModifyUser + } + + if items.ModifyTime != nil { + itemsMap["modify_time"] = items.ModifyTime + } + + if items.ProdConProperties != nil { + itemsMap["prod_con_properties"] = items.ProdConProperties + } + + if items.DevConProperties != nil { + itemsMap["dev_con_properties"] = items.DevConProperties + } + + if items.Category != nil { + itemsMap["category"] = items.Category + } + + itemsList = append(itemsList, itemsMap) + } + + _ = d.Set("items", itemsList) + + d.SetId(projectId) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), itemsList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_data_sources.md b/tencentcloud/services/wedata/data_source_tc_wedata_data_sources.md new file mode 100644 index 0000000000..ecedaf43a8 --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_data_sources.md @@ -0,0 +1,13 @@ +Use this data source to query detailed information of WeData data sources + +Example Usage + +```hcl +data "tencentcloud_wedata_data_sources" "example" { + project_id = "2982667120655491072" + name = "tf_example" + display_name = "display_name" + type = ["MYSQL", "ORACLE"] + creator = "user" +} +``` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_data_sources_test.go b/tencentcloud/services/wedata/data_source_tc_wedata_data_sources_test.go new file mode 100644 index 0000000000..0b2cf103cc --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_data_sources_test.go @@ -0,0 +1,35 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataDataSourcesDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccWedataDataSourcesDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_wedata_data_sources.example"), + ), + }}, + }) +} + +const testAccWedataDataSourcesDataSource = ` +data "tencentcloud_wedata_data_sources" "example" { + project_id = "2982667120655491072" + name = "tf_example" + display_name = "display_name" + type = ["MYSQL", "ORACLE"] + creator = "user" +} +` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_project_roles.go b/tencentcloud/services/wedata/data_source_tc_wedata_project_roles.go new file mode 100644 index 0000000000..f58cdc75cd --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_project_roles.go @@ -0,0 +1,140 @@ +package wedata + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudWedataProjectRoles() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudWedataProjectRolesRead, + Schema: map[string]*schema.Schema{ + "project_id": { + Type: schema.TypeString, + Required: true, + Description: "Project ID.", + }, + + "role_display_name": { + Type: schema.TypeString, + Optional: true, + Description: "Role Chinese display name fuzzy search, can only pass one value.", + }, + + "items": { + Type: schema.TypeList, + Computed: true, + Description: "Role information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "role_id": { + Type: schema.TypeString, + Computed: true, + Description: "Role ID.", + }, + "role_name": { + Type: schema.TypeString, + Computed: true, + Description: "Role name.", + }, + "role_display_name": { + Type: schema.TypeString, + Computed: true, + Description: "Role display name.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Description.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudWedataProjectRolesRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_wedata_project_roles.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + projectId string + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("project_id"); ok { + paramMap["ProjectId"] = helper.String(v.(string)) + projectId = v.(string) + } + + if v, ok := d.GetOk("role_display_name"); ok { + paramMap["RoleDisplayName"] = helper.String(v.(string)) + } + + var respData []*wedatav20250806.SystemRole + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeWedataProjectRolesByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + itemsList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, items := range respData { + itemsMap := map[string]interface{}{} + if items.RoleId != nil { + itemsMap["role_id"] = items.RoleId + } + + if items.RoleName != nil { + itemsMap["role_name"] = items.RoleName + } + + if items.RoleDisplayName != nil { + itemsMap["role_display_name"] = items.RoleDisplayName + } + + if items.Description != nil { + itemsMap["description"] = items.Description + } + + itemsList = append(itemsList, itemsMap) + } + + _ = d.Set("items", itemsList) + } + + d.SetId(projectId) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), itemsList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_project_roles.md b/tencentcloud/services/wedata/data_source_tc_wedata_project_roles.md new file mode 100644 index 0000000000..f80360c2ad --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_project_roles.md @@ -0,0 +1,10 @@ +Use this data source to query detailed information of WeData project roles + +Example Usage + +```hcl +data "tencentcloud_wedata_project_roles" "example" { + project_id = "2982667120655491072" + role_display_name = "tf_example" +} +``` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_project_roles_test.go b/tencentcloud/services/wedata/data_source_tc_wedata_project_roles_test.go new file mode 100644 index 0000000000..f1f6d28af8 --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_project_roles_test.go @@ -0,0 +1,32 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataProjectRolesDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccWedataProjectRolesDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_wedata_project_roles.example"), + ), + }}, + }) +} + +const testAccWedataProjectRolesDataSource = ` +data "tencentcloud_wedata_project_roles" "example" { + project_id = "2982667120655491072" + role_display_name = "tf_example" +} +` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_projects.go b/tencentcloud/services/wedata/data_source_tc_wedata_projects.go new file mode 100644 index 0000000000..13b4c9efe3 --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_projects.go @@ -0,0 +1,211 @@ +package wedata + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudWedataProjects() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudWedataProjectsRead, + Schema: map[string]*schema.Schema{ + "project_ids": { + Type: schema.TypeSet, + Optional: true, + Description: "List of project IDs.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "project_name": { + Type: schema.TypeString, + Optional: true, + Description: "Project name or unique identifier name, supports fuzzy search.", + }, + + "status": { + Type: schema.TypeInt, + Optional: true, + Description: "Project status, optional values: 0 (disabled), 1 (normal).", + }, + + "project_model": { + Type: schema.TypeString, + Optional: true, + Description: "Project model, optional values: SIMPLE, STANDARD.", + }, + + "items": { + Type: schema.TypeList, + Computed: true, + Description: "List of data sources.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "project_id": { + Type: schema.TypeString, + Computed: true, + Description: "Project ID.", + }, + "project_name": { + Type: schema.TypeString, + Computed: true, + Description: "Project identifier, English name.", + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + Description: "Project display name, can be Chinese name.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Remarks.", + }, + "create_time": { + Type: schema.TypeString, + Computed: true, + Description: "Creation time.", + }, + "creator_uin": { + Type: schema.TypeString, + Computed: true, + Description: "Project creator ID.", + }, + "project_owner_uin": { + Type: schema.TypeString, + Computed: true, + Description: "Project owner ID.", + }, + "status": { + Type: schema.TypeInt, + Computed: true, + Description: "Project status: 0: disabled, 1: enabled, -3: disabling, 2: enabling.", + }, + "project_model": { + Type: schema.TypeString, + Computed: true, + Description: "Project model, SIMPLE: simple mode, STANDARD: standard mode.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudWedataProjectsRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_wedata_projects.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("project_ids"); ok { + projectIdsList := []*string{} + projectIdsSet := v.(*schema.Set).List() + for i := range projectIdsSet { + projectIds := projectIdsSet[i].(string) + projectIdsList = append(projectIdsList, helper.String(projectIds)) + } + + paramMap["ProjectIds"] = projectIdsList + } + + if v, ok := d.GetOk("project_name"); ok { + paramMap["ProjectName"] = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("status"); ok { + paramMap["Status"] = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("project_model"); ok { + paramMap["ProjectModel"] = helper.String(v.(string)) + } + + var respData []*wedatav20250806.Project + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeWedataProjectsByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + itemsList := make([]map[string]interface{}, 0, len(respData)) + for _, items := range respData { + itemsMap := map[string]interface{}{} + if items.ProjectId != nil { + itemsMap["project_id"] = items.ProjectId + } + + if items.ProjectName != nil { + itemsMap["project_name"] = items.ProjectName + } + + if items.DisplayName != nil { + itemsMap["display_name"] = items.DisplayName + } + + if items.Description != nil { + itemsMap["description"] = items.Description + } + + if items.CreateTime != nil { + itemsMap["create_time"] = items.CreateTime + } + + if items.CreatorUin != nil { + itemsMap["creator_uin"] = items.CreatorUin + } + + if items.ProjectOwnerUin != nil { + itemsMap["project_owner_uin"] = items.ProjectOwnerUin + } + + if items.Status != nil { + itemsMap["status"] = items.Status + } + + if items.ProjectModel != nil { + itemsMap["project_model"] = items.ProjectModel + } + + itemsList = append(itemsList, itemsMap) + } + + _ = d.Set("items", itemsList) + + d.SetId(helper.BuildToken()) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), itemsList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_projects.md b/tencentcloud/services/wedata/data_source_tc_wedata_projects.md new file mode 100644 index 0000000000..9d4626c3cc --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_projects.md @@ -0,0 +1,24 @@ +Use this data source to query detailed information of WeData projects + +Example Usage + +Query all projects + +```hcl +data "tencentcloud_wedata_projects" "example" {} +``` + +Query projects by filter + +```hcl +data "tencentcloud_wedata_projects" "example" { + project_ids = [ + "2982667120655491072", + "2853989879663501312" + ] + + project_name = "tf_example" + status = 1 + project_model = "SIMPLE" +} +``` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_projects_test.go b/tencentcloud/services/wedata/data_source_tc_wedata_projects_test.go new file mode 100644 index 0000000000..6c5ab96eed --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_projects_test.go @@ -0,0 +1,29 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataProjectsDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccWedataProjectsDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_wedata_projects.example"), + ), + }}, + }) +} + +const testAccWedataProjectsDataSource = ` +data "tencentcloud_wedata_projects" "example" {} +` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics.go b/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics.go new file mode 100644 index 0000000000..36c3d3721c --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics.go @@ -0,0 +1,258 @@ +package wedata + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudWedataResourceGroupMetrics() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudWedataResourceGroupMetricsRead, + Schema: map[string]*schema.Schema{ + "resource_group_id": { + Type: schema.TypeString, + Required: true, + Description: "Execution resource group ID.", + }, + + "start_time": { + Type: schema.TypeInt, + Optional: true, + Description: "Usage trend start time (milliseconds), default to the last hour.", + }, + + "end_time": { + Type: schema.TypeInt, + Optional: true, + Description: "Usage trend end time (milliseconds), default to current time.", + }, + + "metric_type": { + Type: schema.TypeString, + Optional: true, + Description: "Metric dimension.\n\n- all --- All\n- task --- Task metrics\n- system --- System metrics.", + }, + + "granularity": { + Type: schema.TypeInt, + Optional: true, + Description: "Metric collection granularity, unit in minutes, default 1 minute.", + }, + + "data": { + Type: schema.TypeList, + Computed: true, + Description: "Execution group metric information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "cpu_num": { + Type: schema.TypeInt, + Computed: true, + Description: "Resource group specification related: CPU count.", + }, + "disk_volume": { + Type: schema.TypeInt, + Computed: true, + Description: "Resource group specification related: disk specification.", + }, + "mem_size": { + Type: schema.TypeInt, + Computed: true, + Description: "Resource group specification related: memory size, unit: G.", + }, + "life_cycle": { + Type: schema.TypeInt, + Computed: true, + Description: "Resource group lifecycle, unit: days.", + }, + "maximum_concurrency": { + Type: schema.TypeInt, + Computed: true, + Description: "Resource group specification related: maximum concurrency.", + }, + "status": { + Type: schema.TypeInt, + Computed: true, + Description: "Resource group status.\n\n- 0 --- Initializing\n- 1 --- Running\n- 2 --- Running abnormally\n- 3 --- Releasing\n- 4 --- Released\n- 5 --- Creating\n- 6 --- Creation failed\n- 7 --- Updating\n- 8 --- Update failed\n- 9 --- Expired\n- 10 --- Release failed\n- 11 --- In use\n- 12 --- Not in use.", + }, + "metric_snapshots": { + Type: schema.TypeList, + Computed: true, + Description: "Metric details.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "metric_name": { + Type: schema.TypeString, + Computed: true, + Description: "Metric name.\n\n- ConcurrencyUsage --- Concurrency usage rate\n- CpuCoreUsage --- CPU usage rate\n- CpuLoad --- CPU load\n- DevelopQueueTask --- Number of development tasks in queue\n- DevelopRunningTask --- Number of running development tasks\n- DevelopSchedulingTask --- Number of scheduling development tasks\n- DiskUsage --- Disk usage\n- DiskUsed --- Disk used amount\n- MaximumConcurrency --- Maximum concurrency\n- MemoryLoad --- Memory load\n- MemoryUsage --- Memory usage.", + }, + "snapshot_value": { + Type: schema.TypeInt, + Computed: true, + Description: "Current value.", + }, + "trend_list": { + Type: schema.TypeList, + Computed: true, + Description: "Metric trend.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "timestamp": { + Type: schema.TypeInt, + Computed: true, + Description: "Timestamp.", + }, + "value": { + Type: schema.TypeInt, + Computed: true, + Description: "Metric value.", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudWedataResourceGroupMetricsRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_wedata_resource_group_metrics.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + resourceGroupId string + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("resource_group_id"); ok { + paramMap["ResourceGroupId"] = helper.String(v.(string)) + resourceGroupId = v.(string) + } + + if v, ok := d.GetOkExists("start_time"); ok { + paramMap["StartTime"] = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOkExists("end_time"); ok { + paramMap["EndTime"] = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("metric_type"); ok { + paramMap["MetricType"] = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("granularity"); ok { + paramMap["Granularity"] = helper.IntUint64(v.(int)) + } + + var respData *wedatav20250806.ResourceGroupMetrics + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeWedataResourceGroupMetricsByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + dataMap := map[string]interface{}{} + if respData != nil { + if respData.CpuNum != nil { + dataMap["cpu_num"] = respData.CpuNum + } + + if respData.DiskVolume != nil { + dataMap["disk_volume"] = respData.DiskVolume + } + + if respData.MemSize != nil { + dataMap["mem_size"] = respData.MemSize + } + + if respData.LifeCycle != nil { + dataMap["life_cycle"] = respData.LifeCycle + } + + if respData.MaximumConcurrency != nil { + dataMap["maximum_concurrency"] = respData.MaximumConcurrency + } + + if respData.Status != nil { + dataMap["status"] = respData.Status + } + + metricSnapshotsList := make([]map[string]interface{}, 0, len(respData.MetricSnapshots)) + if respData.MetricSnapshots != nil { + for _, metricSnapshots := range respData.MetricSnapshots { + metricSnapshotsMap := map[string]interface{}{} + if metricSnapshots.MetricName != nil { + metricSnapshotsMap["metric_name"] = metricSnapshots.MetricName + } + + if metricSnapshots.SnapshotValue != nil { + metricSnapshotsMap["snapshot_value"] = metricSnapshots.SnapshotValue + } + + trendListList := make([]map[string]interface{}, 0, len(metricSnapshots.TrendList)) + if metricSnapshots.TrendList != nil { + for _, trendList := range metricSnapshots.TrendList { + trendListMap := map[string]interface{}{} + + if trendList.Timestamp != nil { + trendListMap["timestamp"] = trendList.Timestamp + } + + if trendList.Value != nil { + trendListMap["value"] = trendList.Value + } + + trendListList = append(trendListList, trendListMap) + } + + metricSnapshotsMap["trend_list"] = trendListList + } + + metricSnapshotsList = append(metricSnapshotsList, metricSnapshotsMap) + } + + dataMap["metric_snapshots"] = metricSnapshotsList + } + + _ = d.Set("data", []interface{}{dataMap}) + } + + d.SetId(resourceGroupId) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), dataMap); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics.md b/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics.md new file mode 100644 index 0000000000..867b52eace --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics.md @@ -0,0 +1,9 @@ +Use this data source to query detailed information of WeData resource group metrics + +Example Usage + +```hcl +data "tencentcloud_wedata_resource_group_metrics" "example" { + resource_group_id = "20250909193110713075" +} +``` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics_test.go b/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics_test.go new file mode 100644 index 0000000000..763d3c9a99 --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_resource_group_metrics_test.go @@ -0,0 +1,31 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataResourceGroupMetricsDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccWedataResourceGroupMetricsDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_wedata_resource_group_metrics.example"), + ), + }}, + }) +} + +const testAccWedataResourceGroupMetricsDataSource = ` +data "tencentcloud_wedata_resource_group_metrics" "example" { + resource_group_id = "20250909193110713075" +} +` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles.go b/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles.go new file mode 100644 index 0000000000..d79b1587e4 --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles.go @@ -0,0 +1,128 @@ +package wedata + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudWedataTenantRoles() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudWedataTenantRolesRead, + Schema: map[string]*schema.Schema{ + "role_display_name": { + Type: schema.TypeString, + Optional: true, + Description: "Role Chinese display name fuzzy search, can only pass one value.", + }, + + "data": { + Type: schema.TypeList, + Computed: true, + Description: "Main account role list.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "role_id": { + Type: schema.TypeString, + Computed: true, + Description: "Role ID.", + }, + "role_name": { + Type: schema.TypeString, + Computed: true, + Description: "Role name.", + }, + "role_display_name": { + Type: schema.TypeString, + Computed: true, + Description: "Role display name.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Description.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudWedataTenantRolesRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_wedata_tenant_roles.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOk("role_display_name"); ok { + paramMap["RoleDisplayName"] = helper.String(v.(string)) + } + + var respData []*wedatav20250806.SystemRole + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeWedataTenantRolesByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + dataList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, data := range respData { + dataMap := map[string]interface{}{} + if data.RoleId != nil { + dataMap["role_id"] = data.RoleId + } + + if data.RoleName != nil { + dataMap["role_name"] = data.RoleName + } + + if data.RoleDisplayName != nil { + dataMap["role_display_name"] = data.RoleDisplayName + } + + if data.Description != nil { + dataMap["description"] = data.Description + } + + dataList = append(dataList, dataMap) + } + + _ = d.Set("data", dataList) + } + + d.SetId(helper.BuildToken()) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), dataList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles.md b/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles.md new file mode 100644 index 0000000000..af10881e0d --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles.md @@ -0,0 +1,9 @@ +Use this data source to query detailed information of WeData tenant roles + +Example Usage + +```hcl +data "tencentcloud_wedata_tenant_roles" "example" { + role_display_name = "tf_example" +} +``` diff --git a/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles_test.go b/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles_test.go new file mode 100644 index 0000000000..bfcaec1e3d --- /dev/null +++ b/tencentcloud/services/wedata/data_source_tc_wedata_tenant_roles_test.go @@ -0,0 +1,31 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataTenantRolesDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccWedataTenantRolesDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_wedata_tenant_roles.example"), + ), + }}, + }) +} + +const testAccWedataTenantRolesDataSource = ` +data "tencentcloud_wedata_tenant_roles" "example" { + role_display_name = "tf_example" +} +` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_code_file.go b/tencentcloud/services/wedata/resource_tc_wedata_code_file.go index dd4e393532..d7f05642b2 100644 --- a/tencentcloud/services/wedata/resource_tc_wedata_code_file.go +++ b/tencentcloud/services/wedata/resource_tc_wedata_code_file.go @@ -170,7 +170,7 @@ func resourceTencentCloudWedataCodeFileCreate(d *schema.ResourceData, meta inter } if result == nil || result.Response == nil || result.Response.Data == nil { - return tccommon.RetryError(fmt.Errorf("create wedata code file failed, Response is nil.")) + return resource.NonRetryableError(fmt.Errorf("create wedata code file failed, Response is nil.")) } response = result @@ -381,14 +381,10 @@ func resourceTencentCloudWedataCodeFileDelete(d *schema.ResourceData, meta inter 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 || result.Response.Data == nil { + if result == nil || result.Response == nil || result.Response.Data == nil || result.Response.Data.Status == nil { return resource.NonRetryableError(fmt.Errorf("Delete wedata code file failed, Response is nil.")) } - if result.Response.Data.Status == nil { - return resource.NonRetryableError(fmt.Errorf("Delete wedata code file failed, Status is nil.")) - } - if !*result.Response.Data.Status { return resource.NonRetryableError(fmt.Errorf("Delete wedata code file failed, Status is false.")) } diff --git a/tencentcloud/services/wedata/resource_tc_wedata_code_folder.go b/tencentcloud/services/wedata/resource_tc_wedata_code_folder.go index e2d010fa1d..3665c8c9b6 100644 --- a/tencentcloud/services/wedata/resource_tc_wedata_code_folder.go +++ b/tencentcloud/services/wedata/resource_tc_wedata_code_folder.go @@ -107,7 +107,7 @@ func resourceTencentCloudWedataCodeFolderCreate(d *schema.ResourceData, meta int } if result == nil || result.Response == nil || result.Response.Data == nil { - return tccommon.RetryError(fmt.Errorf("create wedata code folder failed, Response is nil.")) + return resource.NonRetryableError(fmt.Errorf("create wedata code folder failed, Response is nil.")) } response = result @@ -223,14 +223,10 @@ func resourceTencentCloudWedataCodeFolderUpdate(d *schema.ResourceData, meta int 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 || result.Response.Data == nil { + if result == nil || result.Response == nil || result.Response.Data == nil || result.Response.Data.Status == nil { return resource.NonRetryableError(fmt.Errorf("Update wedata code folder failed, Response is nil.")) } - if result.Response.Data.Status == nil { - return resource.NonRetryableError(fmt.Errorf("Update wedata code folder failed, Status is nil.")) - } - if !*result.Response.Data.Status { return resource.NonRetryableError(fmt.Errorf("Update wedata code folder failed, Status is false.")) } @@ -275,14 +271,10 @@ func resourceTencentCloudWedataCodeFolderDelete(d *schema.ResourceData, meta int 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 || result.Response.Data == nil { + if result == nil || result.Response == nil || result.Response.Data == nil || result.Response.Data.Status == nil { return resource.NonRetryableError(fmt.Errorf("Delete wedata code folder failed, Response is nil.")) } - if result.Response.Data.Status == nil { - return resource.NonRetryableError(fmt.Errorf("Delete wedata code folder failed, Status is nil.")) - } - if !*result.Response.Data.Status { return resource.NonRetryableError(fmt.Errorf("Delete wedata code folder failed, Status is false.")) } diff --git a/tencentcloud/services/wedata/resource_tc_wedata_data_source.go b/tencentcloud/services/wedata/resource_tc_wedata_data_source.go new file mode 100644 index 0000000000..04a6c11c90 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_data_source.go @@ -0,0 +1,649 @@ +package wedata + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudWedataDataSource() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudWedataDataSourceCreate, + Read: resourceTencentCloudWedataDataSourceRead, + Update: resourceTencentCloudWedataDataSourceUpdate, + Delete: resourceTencentCloudWedataDataSourceDelete, + Schema: map[string]*schema.Schema{ + "project_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Data source project ID.", + }, + + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Data source name.", + }, + + "type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Data source type: enumeration values.\n\n- MYSQL\n- TENCENT_MYSQL\n- POSTGRE\n- ORACLE\n- SQLSERVER\n- FTP\n- HIVE\n- HUDI\n- HDFS\n- ICEBERG\n- KAFKA\n- DTS_KAFKA\n- HBASE\n- SPARK\n- TBASE\n- DB2\n- DM\n- GAUSSDB\n- GBASE\n- IMPALA\n- ES\n- TENCENT_ES\n- GREENPLUM\n- SAP_HANA\n- SFTP\n- OCEANBASE\n- CLICKHOUSE\n- KUDU\n- VERTICA\n- REDIS\n- COS\n- DLC\n- DORIS\n- CKAFKA\n- S3_DATAINSIGHT\n- TDSQL\n- TDSQL_MYSQL\n- MONGODB\n- TENCENT_MONGODB\n- REST_API\n- TiDB\n- StarRocks\n- Trino\n- Kyuubi\n- TCHOUSE_X\n- TCHOUSE_P\n- TCHOUSE_C\n- TCHOUSE_D\n- INFLUXDB\n- BIG_QUERY\n- SSH\n- BLOB\n- TDSQL_POSTGRE\n- GDB\n- TDENGINE\n- TDSQLC.", + }, + + "prod_con_properties": { + Type: schema.TypeString, + Required: true, + Description: "Data source configuration information, stored in JSON KV format, with different KV storage information for each data source type.\n\n> deployType: \nCONNSTR_PUBLICDB(Public network instance) \nCONNSTR_CVMDB(Self-built instance)\nINSTANCE(Cloud instance)\n\n```\nmysql: Self-built instance\n{\n \"deployType\": \"CONNSTR_CVMDB\",\n \"url\": \"jdbc:mysql://1.1.1.1:1111/database\",\n \"username\": \"root\",\n \"password\": \"root\",\n \"region\": \"ap-shanghai\",\n \"vpcId\": \"vpc-kprq42yo\",\n \"type\": \"MYSQL\"\n}\nmysql: Cloud instance\n{\n \"instanceid\": \"cdb-12uxdo5e\",\n \"db\": \"db\",\n \"region\": \"ap-shanghai\",\n \"username\": \"msyql\",\n \"password\": \"mysql\",\n \"deployType\": \"INSTANCE\",\n \"type\": \"TENCENT_MYSQL\"\n}\nsql_server: \n{\n \"deployType\": \"CONNSTR_PUBLICDB\",\n \"url\": \"jdbc:sqlserver://1.1.1.1:223;DatabaseName=database\",\n \"username\": \"user_1\",\n \"password\": \"pass_2\",\n \"type\": \"SQLSERVER\"\n}\nredis:\n redisType:\n -NO_ACCOUT(No account)\n -SELF_ACCOUNT(Custom account)\n{\n \"deployType\": \"CONNSTR_PUBLICDB\",\n \"username\":\"\"\n \"password\": \"pass\",\n \"ip\": \"1.1.1.1\",\n \"port\": \"6379\",\n \"redisType\": \"NO_ACCOUT\",\n \"type\": \"REDIS\"\n}\noracle: \n{\n \"deployType\": \"CONNSTR_CVMDB\",\n \"url\": \"jdbc:oracle:thin:@1.1.1.1:1521:prod\",\n \"username\": \"oracle\",\n \"password\": \"pass\",\n \"region\": \"ap-shanghai\",\n \"vpcId\": \"vpc-kprq42yo\",\n \"type\": \"ORACLE\"\n}\nmongodb:\n advanceParams(Custom parameters, will be appended to the URL)\n{\n \"advanceParams\": [\n {\n \"key\": \"authSource\",\n \"value\": \"auth\"\n }\n ],\n \"db\": \"admin\",\n \"deployType\": \"CONNSTR_PUBLICDB\",\n \"username\": \"user\",\n \"password\": \"pass\",\n \"type\": \"MONGODB\",\n \"host\": \"1.1.1.1:9200\"\n}\npostgresql:\n{\n \"deployType\": \"CONNSTR_PUBLICDB\",\n \"url\": \"jdbc:postgresql://1.1.1.1:1921/database\",\n \"username\": \"user\",\n \"password\": \"pass\",\n \"type\": \"POSTGRE\"\n}\nkafka:\n authType:\n - sasl\n - jaas\n - sasl_plaintext\n - sasl_ssl\n - GSSAPI\n ssl:\n -PLAIN\n -GSSAPI\n{\n \"deployType\": \"CONNSTR_PUBLICDB\",\n \"host\": \"1.1.1.1:9092\",\n \"ssl\": \"GSSAPI\",\n \"authType\": \"sasl\",\n \"type\": \"KAFKA\",\n \"principal\": \"aaaa\",\n \"serviceName\": \"kafka\"\n}\n\ncos:\n{\n \"region\": \"ap-shanghai\",\n \"deployType\": \"INSTANCE\",\n \"secretId\": \"aaaaa\",\n \"secretKey\": \"sssssss\",\n \"bucket\": \"aaa\",\n \"type\": \"COS\"\n}\n\n```.", + }, + + "dev_con_properties": { + Type: schema.TypeString, + Optional: true, + Description: "Development environment data source configuration information, required if the project is in standard mode.", + }, + + "prod_file_upload": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Production environment data source file upload.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "trust_store": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Truststore authentication file, default filename truststore.jks.", + }, + "key_store": { + Type: schema.TypeString, + Optional: true, + Description: "Keystore authentication file, default filename keystore.jks.", + }, + "core_site": { + Type: schema.TypeString, + Optional: true, + Description: "core-site.xml file.", + }, + "hdfs_site": { + Type: schema.TypeString, + Optional: true, + Description: "hdfs-site.xml file.", + }, + "hive_site": { + Type: schema.TypeString, + Optional: true, + Description: "hive-site.xml file.", + }, + "hbase_site": { + Type: schema.TypeString, + Optional: true, + Description: "hbase-site file.", + }, + "key_tab": { + Type: schema.TypeString, + Optional: true, + Description: "keytab file, default filename [data source name].keytab.", + }, + "krb5_conf": { + Type: schema.TypeString, + Optional: true, + Description: "krb5.conf file.", + }, + "private_key": { + Type: schema.TypeString, + Optional: true, + Description: "Private key, default filename private_key.pem.", + }, + "public_key": { + Type: schema.TypeString, + Optional: true, + Description: "Public key, default filename public_key.pem.", + }, + }, + }, + }, + + "dev_file_upload": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Development environment data source file upload.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "trust_store": { + Type: schema.TypeString, + Optional: true, + Description: "Truststore authentication file, default filename truststore.jks.", + }, + "key_store": { + Type: schema.TypeString, + Optional: true, + Description: "Keystore authentication file, default filename keystore.jks.", + }, + "core_site": { + Type: schema.TypeString, + Optional: true, + Description: "core-site.xml file.", + }, + "hdfs_site": { + Type: schema.TypeString, + Optional: true, + Description: "hdfs-site.xml file.", + }, + "hive_site": { + Type: schema.TypeString, + Optional: true, + Description: "hive-site.xml file.", + }, + "hbase_site": { + Type: schema.TypeString, + Optional: true, + Description: "hbase-site file.", + }, + "key_tab": { + Type: schema.TypeString, + Optional: true, + Description: "keytab file, default filename [data source name].keytab.", + }, + "krb5_conf": { + Type: schema.TypeString, + Optional: true, + Description: "krb5.conf file.", + }, + "private_key": { + Type: schema.TypeString, + Optional: true, + Description: "Private key, default filename private_key.pem.", + }, + "public_key": { + Type: schema.TypeString, + Optional: true, + Description: "Public key, default filename public_key.pem.", + }, + }, + }, + }, + + "display_name": { + Type: schema.TypeString, + Optional: true, + Description: "Data source display name, for visual viewing.", + }, + + "description": { + Type: schema.TypeString, + Optional: true, + Description: "Data source description information.", + }, + + // computed + "data_source_id": { + Type: schema.TypeInt, + Computed: true, + Description: "Data source ID.", + }, + }, + } +} + +func resourceTencentCloudWedataDataSourceCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_data_source.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewCreateDataSourceRequest() + response = wedatav20250806.NewCreateDataSourceResponse() + projectId string + datasourceId string + ) + + if v, ok := d.GetOk("project_id"); ok { + request.ProjectId = helper.String(v.(string)) + projectId = v.(string) + } + + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOk("type"); ok { + request.Type = helper.String(v.(string)) + } + + if v, ok := d.GetOk("prod_con_properties"); ok { + request.ProdConProperties = helper.String(v.(string)) + } + + if v, ok := d.GetOk("dev_con_properties"); ok { + request.DevConProperties = helper.String(v.(string)) + } + + if prodFileUploadMap, ok := helper.InterfacesHeadMap(d, "prod_file_upload"); ok { + dataSourceFileUpload := wedatav20250806.DataSourceFileUpload{} + if v, ok := prodFileUploadMap["trust_store"].(string); ok && v != "" { + dataSourceFileUpload.TrustStore = helper.String(v) + } + + if v, ok := prodFileUploadMap["key_store"].(string); ok && v != "" { + dataSourceFileUpload.KeyStore = helper.String(v) + } + + if v, ok := prodFileUploadMap["core_site"].(string); ok && v != "" { + dataSourceFileUpload.CoreSite = helper.String(v) + } + + if v, ok := prodFileUploadMap["hdfs_site"].(string); ok && v != "" { + dataSourceFileUpload.HdfsSite = helper.String(v) + } + + if v, ok := prodFileUploadMap["hive_site"].(string); ok && v != "" { + dataSourceFileUpload.HiveSite = helper.String(v) + } + + if v, ok := prodFileUploadMap["hbase_site"].(string); ok && v != "" { + dataSourceFileUpload.HBASESite = helper.String(v) + } + + if v, ok := prodFileUploadMap["key_tab"].(string); ok && v != "" { + dataSourceFileUpload.KeyTab = helper.String(v) + } + + if v, ok := prodFileUploadMap["krb5_conf"].(string); ok && v != "" { + dataSourceFileUpload.KRB5Conf = helper.String(v) + } + + if v, ok := prodFileUploadMap["private_key"].(string); ok && v != "" { + dataSourceFileUpload.PrivateKey = helper.String(v) + } + + if v, ok := prodFileUploadMap["public_key"].(string); ok && v != "" { + dataSourceFileUpload.PublicKey = helper.String(v) + } + + request.ProdFileUpload = &dataSourceFileUpload + } + + if devFileUploadMap, ok := helper.InterfacesHeadMap(d, "dev_file_upload"); ok { + dataSourceFileUpload2 := wedatav20250806.DataSourceFileUpload{} + if v, ok := devFileUploadMap["trust_store"].(string); ok && v != "" { + dataSourceFileUpload2.TrustStore = helper.String(v) + } + + if v, ok := devFileUploadMap["key_store"].(string); ok && v != "" { + dataSourceFileUpload2.KeyStore = helper.String(v) + } + + if v, ok := devFileUploadMap["core_site"].(string); ok && v != "" { + dataSourceFileUpload2.CoreSite = helper.String(v) + } + + if v, ok := devFileUploadMap["hdfs_site"].(string); ok && v != "" { + dataSourceFileUpload2.HdfsSite = helper.String(v) + } + + if v, ok := devFileUploadMap["hive_site"].(string); ok && v != "" { + dataSourceFileUpload2.HiveSite = helper.String(v) + } + + if v, ok := devFileUploadMap["hbase_site"].(string); ok && v != "" { + dataSourceFileUpload2.HBASESite = helper.String(v) + } + + if v, ok := devFileUploadMap["key_tab"].(string); ok && v != "" { + dataSourceFileUpload2.KeyTab = helper.String(v) + } + + if v, ok := devFileUploadMap["krb5_conf"].(string); ok && v != "" { + dataSourceFileUpload2.KRB5Conf = helper.String(v) + } + + if v, ok := devFileUploadMap["private_key"].(string); ok && v != "" { + dataSourceFileUpload2.PrivateKey = helper.String(v) + } + + if v, ok := devFileUploadMap["public_key"].(string); ok && v != "" { + dataSourceFileUpload2.PublicKey = helper.String(v) + } + + request.DevFileUpload = &dataSourceFileUpload2 + } + + if v, ok := d.GetOk("display_name"); ok { + request.DisplayName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("description"); ok { + request.Description = helper.String(v.(string)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().CreateDataSourceWithContext(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Create wedata data source failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create wedata data source failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.Data.Status == nil || !*response.Response.Data.Status { + return fmt.Errorf("Create wedata data source failed, Status is false") + } + + if response.Response.Data.DataSourceId == nil { + return fmt.Errorf("DataSourceId is nil.") + } + + datasourceIdInt64 := *response.Response.Data.DataSourceId + datasourceId = strconv.FormatInt(datasourceIdInt64, 10) + d.SetId(strings.Join([]string{projectId, datasourceId}, tccommon.FILED_SP)) + return resourceTencentCloudWedataDataSourceRead(d, meta) +} + +func resourceTencentCloudWedataDataSourceRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_data_source.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{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()) + } + + projectId := idSplit[0] + datasourceId := idSplit[1] + + respData, err := service.DescribeWedataDataSourceById(ctx, projectId, datasourceId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_wedata_data_source` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.ProjectId != nil { + _ = d.Set("project_id", respData.ProjectId) + } + + if respData.Name != nil { + _ = d.Set("name", respData.Name) + } + + if respData.Type != nil { + _ = d.Set("type", respData.Type) + } + + if respData.ProdConProperties != nil { + _ = d.Set("prod_con_properties", respData.ProdConProperties) + } + + if respData.DevConProperties != nil { + _ = d.Set("dev_con_properties", respData.DevConProperties) + } + + if respData.DisplayName != nil { + _ = d.Set("display_name", respData.DisplayName) + } + + if respData.Description != nil { + _ = d.Set("description", respData.Description) + } + + if respData.Id != nil { + _ = d.Set("data_source_id", respData.Id) + } + + return nil +} + +func resourceTencentCloudWedataDataSourceUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_data_source.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + ) + + idSplit := strings.Split(d.Id(), tccommon.FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + projectId := idSplit[0] + datasourceId := idSplit[1] + datasourceIdUint64 := helper.StrToUint64Point(datasourceId) + + needChange := false + mutableArgs := []string{"prod_con_properties", "dev_con_properties", "prod_file_upload", "dev_file_upload", "display_name", "description"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := wedatav20250806.NewUpdateDataSourceRequest() + response := wedatav20250806.NewUpdateDataSourceResponse() + if v, ok := d.GetOk("prod_con_properties"); ok { + request.ProdConProperties = helper.String(v.(string)) + } + + if v, ok := d.GetOk("dev_con_properties"); ok { + request.DevConProperties = helper.String(v.(string)) + } + + if prodFileUploadMap, ok := helper.InterfacesHeadMap(d, "prod_file_upload"); ok { + dataSourceFileUpload := wedatav20250806.DataSourceFileUpload{} + if v, ok := prodFileUploadMap["trust_store"].(string); ok && v != "" { + dataSourceFileUpload.TrustStore = helper.String(v) + } + + if v, ok := prodFileUploadMap["key_store"].(string); ok && v != "" { + dataSourceFileUpload.KeyStore = helper.String(v) + } + + if v, ok := prodFileUploadMap["core_site"].(string); ok && v != "" { + dataSourceFileUpload.CoreSite = helper.String(v) + } + + if v, ok := prodFileUploadMap["hdfs_site"].(string); ok && v != "" { + dataSourceFileUpload.HdfsSite = helper.String(v) + } + + if v, ok := prodFileUploadMap["hive_site"].(string); ok && v != "" { + dataSourceFileUpload.HiveSite = helper.String(v) + } + + if v, ok := prodFileUploadMap["hbase_site"].(string); ok && v != "" { + dataSourceFileUpload.HBASESite = helper.String(v) + } + + if v, ok := prodFileUploadMap["key_tab"].(string); ok && v != "" { + dataSourceFileUpload.KeyTab = helper.String(v) + } + + if v, ok := prodFileUploadMap["krb5_conf"].(string); ok && v != "" { + dataSourceFileUpload.KRB5Conf = helper.String(v) + } + + if v, ok := prodFileUploadMap["private_key"].(string); ok && v != "" { + dataSourceFileUpload.PrivateKey = helper.String(v) + } + + if v, ok := prodFileUploadMap["public_key"].(string); ok && v != "" { + dataSourceFileUpload.PublicKey = helper.String(v) + } + + request.ProdFileUpload = &dataSourceFileUpload + } + + if devFileUploadMap, ok := helper.InterfacesHeadMap(d, "dev_file_upload"); ok { + dataSourceFileUpload2 := wedatav20250806.DataSourceFileUpload{} + if v, ok := devFileUploadMap["trust_store"].(string); ok && v != "" { + dataSourceFileUpload2.TrustStore = helper.String(v) + } + + if v, ok := devFileUploadMap["key_store"].(string); ok && v != "" { + dataSourceFileUpload2.KeyStore = helper.String(v) + } + + if v, ok := devFileUploadMap["core_site"].(string); ok && v != "" { + dataSourceFileUpload2.CoreSite = helper.String(v) + } + + if v, ok := devFileUploadMap["hdfs_site"].(string); ok && v != "" { + dataSourceFileUpload2.HdfsSite = helper.String(v) + } + + if v, ok := devFileUploadMap["hive_site"].(string); ok && v != "" { + dataSourceFileUpload2.HiveSite = helper.String(v) + } + + if v, ok := devFileUploadMap["hbase_site"].(string); ok && v != "" { + dataSourceFileUpload2.HBASESite = helper.String(v) + } + + if v, ok := devFileUploadMap["key_tab"].(string); ok && v != "" { + dataSourceFileUpload2.KeyTab = helper.String(v) + } + + if v, ok := devFileUploadMap["krb5_conf"].(string); ok && v != "" { + dataSourceFileUpload2.KRB5Conf = helper.String(v) + } + + if v, ok := devFileUploadMap["private_key"].(string); ok && v != "" { + dataSourceFileUpload2.PrivateKey = helper.String(v) + } + + if v, ok := devFileUploadMap["public_key"].(string); ok && v != "" { + dataSourceFileUpload2.PublicKey = helper.String(v) + } + + request.DevFileUpload = &dataSourceFileUpload2 + } + + if v, ok := d.GetOk("display_name"); ok { + request.DisplayName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("description"); ok { + request.Description = helper.String(v.(string)) + } + + request.ProjectId = &projectId + request.Id = datasourceIdUint64 + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().UpdateDataSourceWithContext(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 || result.Response.Data == nil || result.Response.Data.Status == nil { + return resource.NonRetryableError(fmt.Errorf("Update data source failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s update wedata data source failed, reason:%+v", logId, reqErr) + return reqErr + } + + if !*response.Response.Data.Status { + return fmt.Errorf("Update data source %s failed, Status is false.", datasourceId) + } + } + + return resourceTencentCloudWedataDataSourceRead(d, meta) +} + +func resourceTencentCloudWedataDataSourceDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_data_source.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewDeleteDataSourceRequest() + response = wedatav20250806.NewDeleteDataSourceResponse() + ) + + idSplit := strings.Split(d.Id(), tccommon.FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + projectId := idSplit[0] + datasourceId := idSplit[1] + datasourceIdUint64 := helper.StrToUint64Point(datasourceId) + + request.ProjectId = &projectId + request.Id = datasourceIdUint64 + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().DeleteDataSourceWithContext(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 || result.Response.Data == nil || result.Response.Data.Status == nil { + return resource.NonRetryableError(fmt.Errorf("Delete data source failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s delete wedata data source failed, reason:%+v", logId, reqErr) + return reqErr + } + + if *response.Response.Data.Status { + return nil + } + + return fmt.Errorf("Delete data source %s failed, Status is false.", datasourceId) +} diff --git a/tencentcloud/services/wedata/resource_tc_wedata_data_source.md b/tencentcloud/services/wedata/resource_tc_wedata_data_source.md new file mode 100644 index 0000000000..a1193e438e --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_data_source.md @@ -0,0 +1,26 @@ +Provides a resource to create a WeData data source + +Example Usage + +```hcl +resource "tencentcloud_wedata_data_source" "example" { + project_id = "2983848457986924544" + name = "tf_example" + type = "MYSQL" + prod_con_properties = jsonencode({ + "deployType" : "CONNSTR_PUBLICDB", + "url" : "jdbc:mysql://1.1.1.1:1111/database", + "username" : "root", + "password" : "root" + }) + + display_name = "display_name" + description = "description" + + lifecycle { + ignore_changes = [ + prod_con_properties, + ] + } +} +``` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_data_source_test.go b/tencentcloud/services/wedata/resource_tc_wedata_data_source_test.go new file mode 100644 index 0000000000..a3f309dd5d --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_data_source_test.go @@ -0,0 +1,62 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataDataSourceResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccWedataDataSource, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_data_source.example", "id"), + ), + }, + { + Config: testAccWedataDataSourceUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_data_source.example", "id"), + ), + }, + { + ResourceName: "tencentcloud_wedata_data_source.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccWedataDataSource = ` +resource "tencentcloud_wedata_data_source" "example" { + project_id = "2982667120655491072" + name = "tf_example" + type = "MYSQL" + prod_con_properties = "" + dev_con_properties = "" + display_name = "display_name" + description = "description" +} +` + +const testAccWedataDataSourceUpdate = ` +resource "tencentcloud_wedata_data_source" "example" { + project_id = "2982667120655491072" + name = "tf_example" + type = "MYSQL" + prod_con_properties = "" + dev_con_properties = "" + display_name = "display_name" + description = "description" +} +` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_project.go b/tencentcloud/services/wedata/resource_tc_wedata_project.go new file mode 100644 index 0000000000..c518bbe20b --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_project.go @@ -0,0 +1,408 @@ +package wedata + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudWedataProject() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudWedataProjectCreate, + Read: resourceTencentCloudWedataProjectRead, + Update: resourceTencentCloudWedataProjectUpdate, + Delete: resourceTencentCloudWedataProjectDelete, + Schema: map[string]*schema.Schema{ + "project": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Description: "Project basic information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "project_name": { + Type: schema.TypeString, + Required: true, + Description: "Project identifier, English name starting with a letter, can contain letters, numbers, and underscores, cannot exceed 32 characters.", + }, + "display_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Project display name, can be Chinese name starting with a letter, can contain letters, numbers, and underscores, cannot exceed 32 characters.", + }, + "project_model": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Project mode, SIMPLE (default): Simple mode STANDARD: Standard mode.", + }, + }, + }, + }, + + "dlc_info": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "DLC binding cluster information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "compute_resources": { + Type: schema.TypeSet, + Required: true, + Description: "DLC resource name (need to add role Uin to DLC, otherwise may not be able to obtain resources).", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "region": { + Type: schema.TypeString, + Required: true, + Description: "DLC region.", + }, + "default_database": { + Type: schema.TypeString, + Required: true, + Description: "Specify the default database for DLC cluster.", + }, + "standard_mode_env_tag": { + Type: schema.TypeString, + Optional: true, + Description: "Cluster configuration tag (only effective for standard mode projects and required for standard mode). Enum values:\n- Prod (Production environment)\n- Dev (Development environment).", + }, + "access_account": { + Type: schema.TypeString, + Optional: true, + Description: "Access account (only effective for standard mode projects and required for standard mode), used to submit DLC tasks.\nIt is recommended to use a specified sub-account and set corresponding database table permissions for the sub-account; task runner mode may cause task failure when the responsible person leaves; main account mode is not easy for permission control when multiple projects have different permissions.\n\nEnum values:\n- TASK_RUNNER (Task Runner)\n- OWNER (Main Account Mode)\n- SUB (Sub Account Mode).", + }, + "sub_account_uin": { + Type: schema.TypeString, + Optional: true, + Description: "Sub-account ID (only effective for standard mode projects), when AccessAccount is in sub-account mode, the sub-account ID information needs to be specified, other modes do not need to be specified.", + }, + }, + }, + }, + + "resource_ids": { + Type: schema.TypeSet, + Optional: true, + Description: "List of bound resource group IDs.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "status": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ValidateFunc: tccommon.ValidateAllowedIntValue([]int{0, 1}), + Description: "Item status: 0: disabled, 1: enabled.", + }, + + // computed + "project_id": { + Type: schema.TypeString, + Computed: true, + Description: "Project ID.", + }, + }, + } +} + +func resourceTencentCloudWedataProjectCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_project.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewCreateProjectRequest() + response = wedatav20250806.NewCreateProjectResponse() + projectId string + ) + + if projectMap, ok := helper.InterfacesHeadMap(d, "project"); ok { + projectRequest := wedatav20250806.ProjectRequest{} + if v, ok := projectMap["project_name"].(string); ok && v != "" { + projectRequest.ProjectName = helper.String(v) + } + + if v, ok := projectMap["display_name"].(string); ok && v != "" { + projectRequest.DisplayName = helper.String(v) + } + + if v, ok := projectMap["project_model"].(string); ok && v != "" { + projectRequest.ProjectModel = helper.String(v) + } + + request.Project = &projectRequest + } + + if dLCInfoMap, ok := helper.InterfacesHeadMap(d, "dlc_info"); ok { + dLCClusterInfo := wedatav20250806.DLCClusterInfo{} + if v, ok := dLCInfoMap["compute_resources"]; ok { + computeResourcesSet := v.(*schema.Set).List() + for i := range computeResourcesSet { + computeResources := computeResourcesSet[i].(string) + dLCClusterInfo.ComputeResources = append(dLCClusterInfo.ComputeResources, helper.String(computeResources)) + } + } + + if v, ok := dLCInfoMap["region"].(string); ok && v != "" { + dLCClusterInfo.Region = helper.String(v) + } + + if v, ok := dLCInfoMap["default_database"].(string); ok && v != "" { + dLCClusterInfo.DefaultDatabase = helper.String(v) + } + + if v, ok := dLCInfoMap["standard_mode_env_tag"].(string); ok && v != "" { + dLCClusterInfo.StandardModeEnvTag = helper.String(v) + } + + if v, ok := dLCInfoMap["access_account"].(string); ok && v != "" { + dLCClusterInfo.AccessAccount = helper.String(v) + } + + if v, ok := dLCInfoMap["sub_account_uin"].(string); ok && v != "" { + dLCClusterInfo.SubAccountUin = helper.String(v) + } + + request.DLCInfo = &dLCClusterInfo + } + + if v, ok := d.GetOk("resource_ids"); ok { + resourceIdsSet := v.(*schema.Set).List() + for i := range resourceIdsSet { + resourceIds := resourceIdsSet[i].(string) + request.ResourceIds = append(request.ResourceIds, helper.String(resourceIds)) + } + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().CreateProjectWithContext(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Create wedata project failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create wedata project failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.Data.ProjectId == nil { + return fmt.Errorf("ProjectId is nil.") + } + + projectId = *response.Response.Data.ProjectId + d.SetId(projectId) + + // set status + if v, ok := d.GetOkExists("status"); ok { + if v.(int) == 0 { + disableReq := wedatav20250806.NewDisableProjectRequest() + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().DisableProjectWithContext(ctx, disableReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, disableReq.GetAction(), disableReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Disable wedata project failed, Response is nil.")) + } + + if result.Response.Data.Status != nil && *result.Response.Data.Status { + return nil + } + + return resource.NonRetryableError(fmt.Errorf("Disable wedata project failed, Status is false.")) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s disable wedata project failed, reason:%+v", logId, reqErr) + return reqErr + } + } + } + + return resourceTencentCloudWedataProjectRead(d, meta) +} + +func resourceTencentCloudWedataProjectRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_project.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + projectId = d.Id() + ) + + respData, err := service.DescribeWedataProjectById(ctx, projectId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_wedata_project` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + dMapProject := make(map[string]interface{}, 0) + if respData.ProjectName != nil { + dMapProject["project_name"] = *respData.ProjectName + } + + if respData.DisplayName != nil { + dMapProject["display_name"] = *respData.DisplayName + } + + if respData.ProjectModel != nil { + dMapProject["project_model"] = *respData.ProjectModel + } + + _ = d.Set("project", []interface{}{dMapProject}) + + if respData.Status != nil { + _ = d.Set("status", respData.Status) + } + + if respData.ProjectId != nil { + _ = d.Set("project_id", respData.ProjectId) + } + + return nil +} + +func resourceTencentCloudWedataProjectUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_project.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + projectId = d.Id() + ) + + immutableArgs := []string{"dlc_info", "resource_ids"} + for _, v := range immutableArgs { + if d.HasChange(v) { + return fmt.Errorf("argument `%s` cannot be changed", v) + } + } + + if d.HasChange("project.0.display_name") { + request := wedatav20250806.NewUpdateProjectRequest() + if v, ok := d.GetOk("project.0.display_name"); ok { + request.DisplayName = helper.String(v.(string)) + } + + request.ProjectId = &projectId + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().UpdateProjectWithContext(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 wedata project failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + if d.HasChange("status") { + if v, ok := d.GetOkExists("status"); ok { + if v.(int) == 1 { + enableReq := wedatav20250806.NewEnableProjectRequest() + enableReq.ProjectId = &projectId + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().EnableProjectWithContext(ctx, enableReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, enableReq.GetAction(), enableReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Enable wedata project failed, Response is nil.")) + } + + if result.Response.Data.Status != nil && *result.Response.Data.Status { + return nil + } + + return resource.NonRetryableError(fmt.Errorf("Enable wedata project failed, Status is false.")) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s enable wedata project failed, reason:%+v", logId, reqErr) + return reqErr + } + } else { + disableReq := wedatav20250806.NewDisableProjectRequest() + disableReq.ProjectId = &projectId + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().DisableProjectWithContext(ctx, disableReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, disableReq.GetAction(), disableReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Disable wedata project failed, Response is nil.")) + } + + if result.Response.Data.Status != nil && *result.Response.Data.Status { + return nil + } + + return resource.NonRetryableError(fmt.Errorf("Disable wedata project failed, Status is false.")) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s disable wedata project failed, reason:%+v", logId, reqErr) + return reqErr + } + } + } + } + + return resourceTencentCloudWedataProjectRead(d, meta) +} + +func resourceTencentCloudWedataProjectDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_project.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return fmt.Errorf("tencentcloud wedata project not supported delete, please contact the work order for processing") +} diff --git a/tencentcloud/services/wedata/resource_tc_wedata_project.md b/tencentcloud/services/wedata/resource_tc_wedata_project.md new file mode 100644 index 0000000000..0c688a9c3d --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_project.md @@ -0,0 +1,30 @@ +Provides a resource to create a WeData project + +~> **NOTE:** Currently, executing the `terraform destroy` command to delete this resource is not supported. If you need to destroy it, please contact Tencent Cloud Wedata through a ticket. + +Example Usage + +```hcl +resource "tencentcloud_wedata_project" "example" { + project { + project_name = "tf_example" + display_name = "display_name" + project_model = "SIMPLE" + } + + dlc_info { + compute_resources = ["svmgao_stability"] + region = "ap-guangzhou" + default_database = "db_name" + standard_mode_env_tag = "Dev" + access_account = "OWNER" + } + + resource_ids = [ + "20250909193110713075", + "20250820215449817917" + ] + + status = 1 +} +``` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_project_member.go b/tencentcloud/services/wedata/resource_tc_wedata_project_member.go new file mode 100644 index 0000000000..db2ab3eb79 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_project_member.go @@ -0,0 +1,273 @@ +package wedata + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudWedataProjectMember() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudWedataProjectMemberCreate, + Read: resourceTencentCloudWedataProjectMemberRead, + Update: resourceTencentCloudWedataProjectMemberUpdate, + Delete: resourceTencentCloudWedataProjectMemberDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "project_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Project ID.", + }, + + "user_uin": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "User ID.", + }, + + "role_ids": { + Type: schema.TypeSet, + Required: true, + Description: "Role ID.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func resourceTencentCloudWedataProjectMemberCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_project_member.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewCreateProjectMemberRequest() + projectId string + userUin string + ) + + if v, ok := d.GetOk("project_id"); ok { + request.ProjectId = helper.String(v.(string)) + projectId = v.(string) + } + + if v, ok := d.GetOk("user_uin"); ok { + request.UserUins = append(request.UserUins, helper.String(v.(string))) + userUin = v.(string) + } + + if v, ok := d.GetOk("role_ids"); ok { + roleIdsSet := v.(*schema.Set).List() + for i := range roleIdsSet { + roleIds := roleIdsSet[i].(string) + request.RoleIds = append(request.RoleIds, helper.String(roleIds)) + } + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().CreateProjectMemberWithContext(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 || result.Response.Data == nil || result.Response.Data.Status == nil { + return resource.NonRetryableError(fmt.Errorf("Create wedata project member failed, Response is nil.")) + } + + if !*result.Response.Data.Status { + return resource.NonRetryableError(fmt.Errorf("Create wedata project member failed, Status is false")) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create wedata project member failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(strings.Join([]string{projectId, userUin}, tccommon.FILED_SP)) + return resourceTencentCloudWedataProjectMemberRead(d, meta) +} + +func resourceTencentCloudWedataProjectMemberRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_project_member.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{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()) + } + + projectId := idSplit[0] + userUin := idSplit[1] + + respData, err := service.DescribeWedataProjectMemberById(ctx, projectId, userUin) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_wedata_project_member` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + _ = d.Set("project_id", projectId) + _ = d.Set("user_uin", userUin) + roleList := make([]interface{}, 0) + for _, items := range respData { + if items.Roles != nil { + for _, roles := range items.Roles { + if roles.RoleId != nil { + roleList = append(roleList, roles.RoleId) + } + } + } + } + + _ = d.Set("role_ids", roleList) + + return nil +} + +func resourceTencentCloudWedataProjectMemberUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_project_member.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + ) + + idSplit := strings.Split(d.Id(), tccommon.FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + projectId := idSplit[0] + userUin := idSplit[1] + + if d.HasChange("role_ids") { + oldInterface, newInterface := d.GetChange("role_ids") + oldInstances := oldInterface.(*schema.Set) + newInstances := newInterface.(*schema.Set) + remove := oldInstances.Difference(newInstances).List() + add := newInstances.Difference(oldInstances).List() + + if len(add) > 0 { + request := wedatav20250806.NewGrantMemberProjectRoleRequest() + request.ProjectId = &projectId + request.UserUin = &userUin + for _, item := range add { + request.RoleIds = append(request.RoleIds, helper.String(item.(string))) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().GrantMemberProjectRoleWithContext(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 wedata project member failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + if len(remove) > 0 { + request := wedatav20250806.NewRemoveMemberProjectRoleRequest() + request.ProjectId = &projectId + request.UserUin = &userUin + for _, item := range remove { + request.RoleIds = append(request.RoleIds, helper.String(item.(string))) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().RemoveMemberProjectRoleWithContext(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 wedata project member failed, reason:%+v", logId, reqErr) + return reqErr + } + } + } + + return resourceTencentCloudWedataProjectMemberRead(d, meta) +} + +func resourceTencentCloudWedataProjectMemberDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_project_member.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewDeleteProjectMemberRequest() + ) + + idSplit := strings.Split(d.Id(), tccommon.FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + projectId := idSplit[0] + userUin := idSplit[1] + + request.ProjectId = &projectId + request.UserUins = append(request.UserUins, &userUin) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().DeleteProjectMemberWithContext(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 wedata project member failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/wedata/resource_tc_wedata_project_member.md b/tencentcloud/services/wedata/resource_tc_wedata_project_member.md new file mode 100644 index 0000000000..bb0e1a56e4 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_project_member.md @@ -0,0 +1,47 @@ +Provides a resource to create a WeData project member + +~> **NOTE:** This resource must exclusive in one share unit, do not declare additional roleIds resources of this project member elsewhere. + +Example Usage + +```hcl +resource "tencentcloud_wedata_project" "example" { + project { + project_name = "tf_example" + display_name = "display_name" + project_model = "SIMPLE" + } + + dlc_info { + compute_resources = ["svmgao_stability"] + region = "ap-guangzhou" + default_database = "db_name" + standard_mode_env_tag = "Dev" + access_account = "OWNER" + } + + resource_ids = [ + "20250909193110713075", + "20250820215449817917" + ] + + status = 1 +} + +resource "tencentcloud_wedata_project_member" "example" { + project_id = tencentcloud_wedata_project.example.id + user_uin = "100044238258" + role_ids = [ + "308335260274237440", + "308335260844662784" + ] +} +``` + +Import + +WeData project member can be imported using the projectId#userUin, e.g. + +``` +terraform import tencentcloud_wedata_project_member.example 2983848457986924544#100044238258 +``` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_project_member_test.go b/tencentcloud/services/wedata/resource_tc_wedata_project_member_test.go new file mode 100644 index 0000000000..38d65ebbf6 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_project_member_test.go @@ -0,0 +1,59 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataProjectMemberResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccWedataProjectMember, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_project_member.example", "id"), + ), + }, + { + Config: testAccWedataProjectMemberUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_project_member.example", "id"), + ), + }, + { + ResourceName: "tencentcloud_wedata_project_member.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccWedataProjectMember = ` +resource "tencentcloud_wedata_project_member" "example" { + project_id = "2983848457986924544" + user_uin = "100044238258" + role_ids = [ + "308335260274237440", + "308335260844662784" + ] +} +` + +const testAccWedataProjectMemberUpdate = ` +resource "tencentcloud_wedata_project_member" "example" { + project_id = "2983848457986924544" + user_uin = "100044238258" + role_ids = [ + "308335260274237440", + ] +} +` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_project_test.go b/tencentcloud/services/wedata/resource_tc_wedata_project_test.go new file mode 100644 index 0000000000..8f5f7f244d --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_project_test.go @@ -0,0 +1,62 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataProjectResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccWedataProject, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_project.example", "id"), + ), + }, + { + Config: testAccWedataProjectUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_project.example", "id"), + ), + }, + { + ResourceName: "tencentcloud_wedata_project.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccWedataProject = ` +resource "tencentcloud_wedata_project" "example" { + project { + project_name = "tf_example" + display_name = "display_name" + project_model = "SIMPLE" + } + + status = 0 +} +` + +const testAccWedataProjectUpdate = ` +resource "tencentcloud_wedata_project" "example" { + project { + project_name = "tf_example" + display_name = "display_name_update" + project_model = "SIMPLE" + } + + status = 1 +} +` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_resource_group.go b/tencentcloud/services/wedata/resource_tc_wedata_resource_group.go new file mode 100644 index 0000000000..8e1aafc121 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_resource_group.go @@ -0,0 +1,478 @@ +package wedata + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudWedataResourceGroup() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudWedataResourceGroupCreate, + Read: resourceTencentCloudWedataResourceGroupRead, + Update: resourceTencentCloudWedataResourceGroupUpdate, + Delete: resourceTencentCloudWedataResourceGroupDelete, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Resource group name. The name for creating a general resource group must start with a letter, can contain letters, numbers, underscores (_), and up to 64 characters.", + }, + + "type": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + MaxItems: 1, + Description: "Information about the activated resource group.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "resource_group_type": { + Type: schema.TypeString, + Required: true, + Description: "Resource group type.\n\n- Schedule --- Scheduling resource group\n- Integration --- Integration resource group \n- DataService -- Data service resource group.", + }, + "integration": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Integration resource group, subdivided into real-time resource group and offline resource group (Integration, scheduling, and data service resource groups cannot be purchased simultaneously).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "real_time_data_sync": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Real-time integration resource group.\n\n- i32c (Real-time data synchronization - 16C64G).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "specification": { + Type: schema.TypeString, + Required: true, + Description: "Resource group specification.", + }, + "number": { + Type: schema.TypeInt, + Required: true, + Description: "Quantity.", + }, + }, + }, + }, + "offline_data_sync": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Offline integration resource group.\n\n- integrated (Offline data synchronization - 8C16G)\n- i16 (Offline data synchronization - 8C32G).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "specification": { + Type: schema.TypeString, + Required: true, + Description: "Resource group specification.", + }, + "number": { + Type: schema.TypeInt, + Required: true, + Description: "Quantity.", + }, + }, + }, + }, + }, + }, + }, + "schedule": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Scheduling resource group (Integration, scheduling, and data service resource groups cannot be purchased simultaneously).\n\n- s_test (Test specification)\n- s_small (Basic specification)\n- s_medium (Popular specification)\n- s_large (Professional specification).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "specification": { + Type: schema.TypeString, + Required: true, + Description: "Resource group specification.", + }, + "number": { + Type: schema.TypeInt, + Required: true, + Description: "Quantity.", + }, + }, + }, + }, + "data_service": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Data service resource group (Integration, scheduling, and data service resource groups cannot be purchased simultaneously).\n\n- ds_t (Test specification)\n- ds_s (Basic specification)\n- ds_m (Popular specification)\n- ds_l (Professional specification).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "specification": { + Type: schema.TypeString, + Required: true, + Description: "Resource group specification.", + }, + "number": { + Type: schema.TypeInt, + Required: true, + Description: "Quantity.", + }, + }, + }, + }, + }, + }, + }, + + "auto_renew_enabled": { + Type: schema.TypeBool, + Required: true, + Description: "Whether auto-renewal is enabled.", + }, + + "purchase_period": { + Type: schema.TypeInt, + Required: true, + Description: "Purchase duration, in months.", + }, + + "vpc_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "VPC ID.", + }, + + "subnet": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Subnet.", + }, + + "resource_region": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Resource purchase region.", + }, + + "associated_project_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Associated project space project ID.", + }, + + "description": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Resource group description.", + }, + + // computed + "resource_group_id": { + Type: schema.TypeString, + Computed: true, + Description: "Resource group ID.", + }, + }, + } +} + +func resourceTencentCloudWedataResourceGroupCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_resource_group.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewCreateResourceGroupRequest() + response = wedatav20250806.NewCreateResourceGroupResponse() + resourceGroupId string + ) + + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if typeMap, ok := helper.InterfacesHeadMap(d, "type"); ok { + resourceType := wedatav20250806.ResourceType{} + if v, ok := typeMap["resource_group_type"].(string); ok && v != "" { + resourceType.ResourceGroupType = helper.String(v) + } + + if integrationMap, ok := helper.ConvertInterfacesHeadToMap(typeMap["integration"]); ok { + integrationResource := wedatav20250806.IntegrationResource{} + if realTimeDataSyncMap, ok := helper.ConvertInterfacesHeadToMap(integrationMap["real_time_data_sync"]); ok { + resourceGroupSpecification := wedatav20250806.ResourceGroupSpecification{} + if v, ok := realTimeDataSyncMap["specification"].(string); ok && v != "" { + resourceGroupSpecification.Specification = helper.String(v) + } + + if v, ok := realTimeDataSyncMap["number"].(int); ok { + resourceGroupSpecification.Number = helper.IntInt64(v) + } + + integrationResource.RealTimeDataSync = &resourceGroupSpecification + } + + if offlineDataSyncMap, ok := helper.ConvertInterfacesHeadToMap(integrationMap["offline_data_sync"]); ok { + resourceGroupSpecification2 := wedatav20250806.ResourceGroupSpecification{} + if v, ok := offlineDataSyncMap["specification"].(string); ok && v != "" { + resourceGroupSpecification2.Specification = helper.String(v) + } + + if v, ok := offlineDataSyncMap["number"].(int); ok { + resourceGroupSpecification2.Number = helper.IntInt64(v) + } + + integrationResource.OfflineDataSync = &resourceGroupSpecification2 + } + + resourceType.Integration = &integrationResource + } + + if scheduleMap, ok := helper.ConvertInterfacesHeadToMap(typeMap["schedule"]); ok { + resourceGroupSpecification3 := wedatav20250806.ResourceGroupSpecification{} + if v, ok := scheduleMap["specification"].(string); ok && v != "" { + resourceGroupSpecification3.Specification = helper.String(v) + } + + if v, ok := scheduleMap["number"].(int); ok { + resourceGroupSpecification3.Number = helper.IntInt64(v) + } + + resourceType.Schedule = &resourceGroupSpecification3 + } + + if dataServiceMap, ok := helper.ConvertInterfacesHeadToMap(typeMap["data_service"]); ok { + resourceGroupSpecification4 := wedatav20250806.ResourceGroupSpecification{} + if v, ok := dataServiceMap["specification"].(string); ok && v != "" { + resourceGroupSpecification4.Specification = helper.String(v) + } + + if v, ok := dataServiceMap["number"].(int); ok { + resourceGroupSpecification4.Number = helper.IntInt64(v) + } + + resourceType.DataService = &resourceGroupSpecification4 + } + + request.Type = &resourceType + } + + if v, ok := d.GetOkExists("auto_renew_enabled"); ok { + request.AutoRenewEnabled = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOkExists("purchase_period"); ok { + request.PurchasePeriod = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("vpc_id"); ok { + request.VpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("subnet"); ok { + request.SubNet = helper.String(v.(string)) + } + + if v, ok := d.GetOk("resource_region"); ok { + request.ResourceRegion = helper.String(v.(string)) + } + + if v, ok := d.GetOk("associated_project_id"); ok { + request.AssociatedProjectId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("description"); ok { + request.Description = helper.String(v.(string)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().CreateResourceGroupWithContext(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 || result.Response.Data == nil || result.Response.Data.Status == nil { + return resource.NonRetryableError(fmt.Errorf("Create wedata resource group failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create wedata resource group failed, reason:%+v", logId, reqErr) + return reqErr + } + + if !*response.Response.Data.Status { + return fmt.Errorf("Create wedata resource group failed, Status is false.") + } + + if response.Response.Data.ResourceGroupId == nil || *response.Response.Data.ResourceGroupId == "" { + return fmt.Errorf("ResourceGroupId is nil.") + } + + resourceGroupId = *response.Response.Data.ResourceGroupId + d.SetId(resourceGroupId) + return resourceTencentCloudWedataResourceGroupRead(d, meta) +} + +func resourceTencentCloudWedataResourceGroupRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_resource_group.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + resourceGroupId = d.Id() + ) + + respData, err := service.DescribeWedataResourceGroupById(ctx, resourceGroupId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_wedata_resource_group` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + for _, items := range respData { + if items.Name != nil { + _ = d.Set("name", items.Name) + } + + if items.AutoRenewEnabled != nil { + _ = d.Set("auto_renew_enabled", items.AutoRenewEnabled) + } + + if items.VpcId != nil { + _ = d.Set("vpc_id", items.VpcId) + } + + if items.SubNet != nil { + _ = d.Set("subnet", items.SubNet) + } + + if items.Region != nil { + _ = d.Set("resource_region", items.Region) + } + + if items.Description != nil { + _ = d.Set("description", items.Description) + } + + if items.Id != nil { + _ = d.Set("resource_group_id", items.Id) + } + } + + return nil +} + +func resourceTencentCloudWedataResourceGroupUpdate(d *schema.ResourceData, meta interface{}) error { + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + resourceGroupId = d.Id() + ) + + if d.HasChange("auto_renew_enabled") || d.HasChange("purchase_period") { + request := wedatav20250806.NewUpdateResourceGroupRequest() + if v, ok := d.GetOkExists("auto_renew_enabled"); ok { + request.AutoRenewEnabled = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOkExists("purchase_period"); ok { + request.PurchasePeriod = helper.IntInt64(v.(int)) + } + + request.Id = &resourceGroupId + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().UpdateResourceGroupWithContext(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 || result.Response.Data == nil || result.Response.Data.Status == nil { + return resource.NonRetryableError(fmt.Errorf("Update wedata resource group failed, Response is nil.")) + } + + if !*result.Response.Data.Status { + return resource.NonRetryableError(fmt.Errorf("Update wedata resource group failed, Status is false.")) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s update wedata resource group failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + return resourceTencentCloudWedataResourceGroupRead(d, meta) +} + +func resourceTencentCloudWedataResourceGroupDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_resource_group.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewDeleteResourceGroupRequest() + response = wedatav20250806.NewDeleteResourceGroupResponse() + resourceGroupId = d.Id() + ) + + request.Id = &resourceGroupId + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().DeleteResourceGroupWithContext(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Delete wedata resource group failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s delete wedata resource group failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.Data.Status != nil && *response.Response.Data.Status == true { + return nil + } + + return fmt.Errorf("Delete wedata resource group failed, Status is false.") +} diff --git a/tencentcloud/services/wedata/resource_tc_wedata_resource_group.md b/tencentcloud/services/wedata/resource_tc_wedata_resource_group.md new file mode 100644 index 0000000000..3d432240f2 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_resource_group.md @@ -0,0 +1,30 @@ +Provides a resource to create a WeData resource group + +Example Usage + +```hcl +resource "tencentcloud_wedata_resource_group" "example" { + name = "tf_example" + type { + resource_group_type = "Integration" + integration { + real_time_data_sync { + specification = "i32c" + number = 1 + } + + offline_data_sync { + specification = "integrated" + number = 2 + } + } + } + + auto_renew_enabled = false + purchase_period = 1 + vpc_id = "vpc-ds5rpnxh" + subnet = "subnet-fz7rw5zq" + resource_region = "ap-beijing-fsi" + description = "description." +} +``` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_resource_group_test.go b/tencentcloud/services/wedata/resource_tc_wedata_resource_group_test.go new file mode 100644 index 0000000000..d61cb989eb --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_resource_group_test.go @@ -0,0 +1,87 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataResourceGroupResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccWedataResourceGroup, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_resource_group.example", "id"), + ), + }, + { + Config: testAccWedataResourceGroupUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_resource_group.example", "id"), + ), + }, + }, + }) +} + +const testAccWedataResourceGroup = ` +resource "tencentcloud_wedata_resource_group" "example" { + name = "tf_example" + type { + resource_group_type = "Integration" + integration { + real_time_data_sync { + specification = "i32c" + number = 1 + } + + offline_data_sync { + specification = "integrated" + number = 2 + } + } + } + + auto_renew_enabled = false + purchase_period = 1 + vpc_id = "vpc-ds5rpnxh" + subnet = "subnet-fz7rw5zq" + resource_region = "ap-beijing-fsi" + description = "description." +} +` + +const testAccWedataResourceGroupUpdate = ` +resource "tencentcloud_wedata_resource_group" "example" { + name = "tf_example" + type { + resource_group_type = "Integration" + integration { + real_time_data_sync { + specification = "i32c" + number = 1 + } + + offline_data_sync { + specification = "integrated" + number = 2 + } + } + } + + auto_renew_enabled = true + purchase_period = 2 + vpc_id = "vpc-ds5rpnxh" + subnet = "subnet-fz7rw5zq" + resource_region = "ap-beijing-fsi" + description = "description." +} +` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment.go b/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment.go new file mode 100644 index 0000000000..65e777bfa4 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment.go @@ -0,0 +1,177 @@ +package wedata + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudWedataResourceGroupToProjectAttachment() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudWedataResourceGroupToProjectAttachmentCreate, + Read: resourceTencentCloudWedataResourceGroupToProjectAttachmentRead, + Delete: resourceTencentCloudWedataResourceGroupToProjectAttachmentDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "resource_group_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Resource group ID.", + }, + + "project_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Project ID.", + }, + }, + } +} + +func resourceTencentCloudWedataResourceGroupToProjectAttachmentCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_resource_group_to_project_attachment.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewAssociateResourceGroupToProjectRequest() + resourceGroupId string + projectId string + ) + + if v, ok := d.GetOk("resource_group_id"); ok { + request.ResourceGroupId = helper.String(v.(string)) + resourceGroupId = v.(string) + } + + if v, ok := d.GetOk("project_id"); ok { + request.ProjectId = helper.String(v.(string)) + projectId = v.(string) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().AssociateResourceGroupToProjectWithContext(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 || result.Response.Data == nil || result.Response.Data.Status == nil { + return resource.NonRetryableError(fmt.Errorf("Create wedata resource group to project attachment failed, Response is nil.")) + } + + if !*result.Response.Data.Status { + return resource.NonRetryableError(fmt.Errorf("Create wedata resource group to project attachment failed, Status is false.")) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create wedata resource group to project attachment failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(strings.Join([]string{resourceGroupId, projectId}, tccommon.FILED_SP)) + return resourceTencentCloudWedataResourceGroupToProjectAttachmentRead(d, meta) +} + +func resourceTencentCloudWedataResourceGroupToProjectAttachmentRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_resource_group_to_project_attachment.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = WedataService{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()) + } + + resourceGroupId := idSplit[0] + projectId := idSplit[1] + + respData, err := service.DescribeWedataResourceGroupToProjectAttachmentById(ctx, resourceGroupId, projectId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_wedata_resource_group_to_project_attachment` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.ProjectId != nil { + _ = d.Set("project_id", respData.ProjectId) + } + + _ = d.Set("project_id", respData.ProjectId) + _ = d.Set("resource_group_id", resourceGroupId) + + return nil +} + +func resourceTencentCloudWedataResourceGroupToProjectAttachmentDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_resource_group_to_project_attachment.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewDissociateResourceGroupFromProjectRequest() + ) + + idSplit := strings.Split(d.Id(), tccommon.FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + + resourceGroupId := idSplit[0] + projectId := idSplit[1] + + request.ResourceGroupId = &resourceGroupId + request.ProjectId = &projectId + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().DissociateResourceGroupFromProjectWithContext(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 || result.Response.Data == nil || result.Response.Data.Status == nil { + return resource.NonRetryableError(fmt.Errorf("Delete wedata resource group to project attachment failed, Response is nil.")) + } + + if !*result.Response.Data.Status { + return resource.NonRetryableError(fmt.Errorf("Delete wedata resource group to project attachment failed, Status is false.")) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s delete wedata resource group to project attachment failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment.md b/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment.md new file mode 100644 index 0000000000..9810a52702 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment.md @@ -0,0 +1,18 @@ +Provides a resource to create a WeData resource group to project attachment + +Example Usage + +```hcl +resource "tencentcloud_wedata_resource_group_to_project_attachment" "example" { + resource_group_id = "20250909161820129828" + project_id = "2983848457986924544" +} +``` + +Import + +WeData resource group to project attachment can be imported using the resourceGroupId#projectId, e.g. + +``` +terraform import tencentcloud_wedata_resource_group_to_project_attachment.example 20250909161820129828#2983848457986924544 +``` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment_test.go b/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment_test.go new file mode 100644 index 0000000000..765e7db9e6 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_resource_group_to_project_attachment_test.go @@ -0,0 +1,41 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataResourceGroupToProjectAttachmentResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccWedataResourceGroupToProjectAttachment, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_resource_group_to_project_attachment.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_wedata_resource_group_to_project_attachment.example", "resource_group_id"), + resource.TestCheckResourceAttrSet("tencentcloud_wedata_resource_group_to_project_attachment.example", "project_id"), + ), + }, + { + ResourceName: "tencentcloud_wedata_resource_group_to_project_attachment.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccWedataResourceGroupToProjectAttachment = ` +resource "tencentcloud_wedata_resource_group_to_project_attachment" "example" { + resource_group_id = "20250909161820129828" + project_id = "2983848457986924544" +} +` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_sql_folder.go b/tencentcloud/services/wedata/resource_tc_wedata_sql_folder.go index aee78863a9..234ee72fcc 100644 --- a/tencentcloud/services/wedata/resource_tc_wedata_sql_folder.go +++ b/tencentcloud/services/wedata/resource_tc_wedata_sql_folder.go @@ -230,14 +230,10 @@ func resourceTencentCloudWedataSqlFolderUpdate(d *schema.ResourceData, meta inte 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 || result.Response.Data == nil { + if result == nil || result.Response == nil || result.Response.Data == nil || result.Response.Data.Status == nil { return resource.NonRetryableError(fmt.Errorf("Update wedata sql folder failed, Response is nil.")) } - if result.Response.Data.Status == nil { - return resource.NonRetryableError(fmt.Errorf("Update wedata sql folder failed, Status is nil.")) - } - if !*result.Response.Data.Status { return resource.NonRetryableError(fmt.Errorf("Update wedata sql folder failed, Status is false.")) } @@ -282,14 +278,10 @@ func resourceTencentCloudWedataSqlFolderDelete(d *schema.ResourceData, meta inte 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 || result.Response.Data == nil { + if result == nil || result.Response == nil || result.Response.Data == nil || result.Response.Data.Status == nil { return resource.NonRetryableError(fmt.Errorf("Delete wedata sql folder failed, Response is nil.")) } - if result.Response.Data.Status == nil { - return resource.NonRetryableError(fmt.Errorf("Delete wedata sql folder failed, Status is nil.")) - } - if !*result.Response.Data.Status { return resource.NonRetryableError(fmt.Errorf("Delete wedata sql folder failed, Status is false.")) } diff --git a/tencentcloud/services/wedata/resource_tc_wedata_sql_script.go b/tencentcloud/services/wedata/resource_tc_wedata_sql_script.go index f3712ecbed..68b69f444a 100644 --- a/tencentcloud/services/wedata/resource_tc_wedata_sql_script.go +++ b/tencentcloud/services/wedata/resource_tc_wedata_sql_script.go @@ -416,14 +416,10 @@ func resourceTencentCloudWedataSqlScriptDelete(d *schema.ResourceData, meta inte 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 || result.Response.Data == nil { + if result == nil || result.Response == nil || result.Response.Data == nil || result.Response.Data.Status == nil { return resource.NonRetryableError(fmt.Errorf("Delete wedata sql script failed, Response is nil.")) } - if result.Response.Data.Status == nil { - return resource.NonRetryableError(fmt.Errorf("Delete wedata sql script failed, Status is nil.")) - } - if !*result.Response.Data.Status { return resource.NonRetryableError(fmt.Errorf("Delete wedata sql script failed, Status is false.")) } diff --git a/tencentcloud/services/wedata/resource_tc_wedata_stop_sql_script_run_operation.go b/tencentcloud/services/wedata/resource_tc_wedata_stop_sql_script_run_operation.go index f6847d93fd..6f1a81474a 100644 --- a/tencentcloud/services/wedata/resource_tc_wedata_stop_sql_script_run_operation.go +++ b/tencentcloud/services/wedata/resource_tc_wedata_stop_sql_script_run_operation.go @@ -2,6 +2,7 @@ package wedata import ( "context" + "fmt" "log" "strings" @@ -66,6 +67,14 @@ func resourceTencentCloudWedataStopSqlScriptRunOperationCreate(d *schema.Resourc 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 || result.Response.Data == nil || result.Response.Data.Status == nil { + return resource.NonRetryableError(fmt.Errorf("Create wedata stop sql script run operation failed, Response is nil.")) + } + + if !*result.Response.Data.Status { + return resource.NonRetryableError(fmt.Errorf("Create wedata stop sql script run operation failed, Status is false.")) + } + return nil }) diff --git a/tencentcloud/services/wedata/service_tencentcloud_wedata.go b/tencentcloud/services/wedata/service_tencentcloud_wedata.go index 51caf7bfeb..fe0766be2b 100644 --- a/tencentcloud/services/wedata/service_tencentcloud_wedata.go +++ b/tencentcloud/services/wedata/service_tencentcloud_wedata.go @@ -1694,6 +1694,477 @@ func (me *WedataService) DeleteWedataIntegrationRealtimeTaskById(ctx context.Con return } +func (me *WedataService) DescribeWedataProjectsByFilter(ctx context.Context, param map[string]interface{}) (ret []*wedatav20250806.Project, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = wedatav20250806.NewListProjectsRequest() + ) + + 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 == "ProjectIds" { + request.ProjectIds = v.([]*string) + } + + if k == "ProjectName" { + request.ProjectName = v.(*string) + } + + if k == "Status" { + request.Status = v.(*int64) + } + + if k == "ProjectModel" { + request.ProjectModel = v.(*string) + } + } + + var ( + pageNumber uint64 = 1 + pageSize uint64 = 50 + ) + for { + request.PageNumber = &pageNumber + request.PageSize = &pageSize + response, err := me.client.UseWedataV20250806Client().ListProjects(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 || response.Response == nil || response.Response.Data == nil || len(response.Response.Data.Items) < 1 { + break + } + + ret = append(ret, response.Response.Data.Items...) + if len(response.Response.Data.Items) < int(pageSize) { + break + } + + pageNumber += pageSize + } + + return +} + +func (me *WedataService) DescribeWedataDataSourcesByFilter(ctx context.Context, param map[string]interface{}) (ret []*wedatav20250806.DataSource, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = wedatav20250806.NewListDataSourcesRequest() + ) + + 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 == "ProjectId" { + request.ProjectId = v.(*string) + } + + if k == "Name" { + request.Name = v.(*string) + } + + if k == "DisplayName" { + request.DisplayName = v.(*string) + } + + if k == "Type" { + request.Type = v.([]*string) + } + + if k == "Creator" { + request.Creator = v.(*string) + } + } + + var ( + pageNumber uint64 = 1 + pageSize uint64 = 50 + ) + for { + request.PageNumber = &pageNumber + request.PageSize = &pageSize + response, err := me.client.UseWedataV20250806Client().ListDataSources(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 || response.Response == nil || response.Response.Data == nil || len(response.Response.Data.Items) < 1 { + break + } + + ret = append(ret, response.Response.Data.Items...) + if len(response.Response.Data.Items) < int(pageSize) { + break + } + + pageNumber += pageSize + } + + return +} + +func (me *WedataService) DescribeWedataProjectById(ctx context.Context, projectId string) (ret *wedatav20250806.Project, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := wedatav20250806.NewGetProjectRequest() + response := wedatav20250806.NewGetProjectResponse() + request.ProjectId = &projectId + + 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.UseWedataV20250806Client().GetProject(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Describe wedata project failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + return + } + + ret = response.Response.Data + return +} + +func (me *WedataService) DescribeWedataDataSourceById(ctx context.Context, projectId, datasourceId string) (ret *wedatav20250806.DataSource, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := wedatav20250806.NewGetDataSourceRequest() + response := wedatav20250806.NewGetDataSourceResponse() + request.ProjectId = &projectId + datasourceIdInt64 := helper.StrToInt64Point(datasourceId) + request.Id = datasourceIdInt64 + + 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.UseWedataV20250806Client().GetDataSource(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Describe wedata data source failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + return + } + + ret = response.Response.Data + return +} + +func (me *WedataService) DescribeWedataProjectMemberById(ctx context.Context, projectId, userUin string) (ret []*wedatav20250806.ProjectUserRole, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := wedatav20250806.NewListProjectMembersRequest() + response := wedatav20250806.NewListProjectMembersResponse() + request.ProjectId = &projectId + request.UserUin = &userUin + + 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.UseWedataV20250806Client().ListProjectMembers(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Describe wedata project member failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + return + } + + ret = response.Response.Data.Items + return +} + +func (me *WedataService) DescribeWedataProjectRolesByFilter(ctx context.Context, param map[string]interface{}) (ret []*wedatav20250806.SystemRole, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = wedatav20250806.NewListProjectRolesRequest() + ) + + 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 == "ProjectId" { + request.ProjectId = v.(*string) + } + if k == "RoleDisplayName" { + request.RoleDisplayName = v.(*string) + } + } + + var ( + pageNumber int64 = 1 + pageSize int64 = 50 + ) + for { + request.PageNumber = &pageNumber + request.PageSize = &pageSize + response, err := me.client.UseWedataV20250806Client().ListProjectRoles(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 || response.Response == nil || response.Response.Data == nil || len(response.Response.Data.Items) < 1 { + break + } + + ret = append(ret, response.Response.Data.Items...) + if len(response.Response.Data.Items) < int(pageSize) { + break + } + + pageNumber += pageSize + } + + return +} + +func (me *WedataService) DescribeWedataTenantRolesByFilter(ctx context.Context, param map[string]interface{}) (ret []*wedatav20250806.SystemRole, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = wedatav20250806.NewListTenantRolesRequest() + ) + + 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 == "RoleDisplayName" { + request.RoleDisplayName = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + response, err := me.client.UseWedataV20250806Client().ListTenantRoles(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.Data) < 1 { + return + } + + ret = response.Response.Data + return +} + +func (me *WedataService) DescribeWedataResourceGroupById(ctx context.Context, resourceGroupId string) (ret []*wedatav20250806.ExecutorResourceGroupInfo, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := wedatav20250806.NewListResourceGroupsRequest() + response := wedatav20250806.NewListResourceGroupsResponse() + request.Id = &resourceGroupId + + 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.UseWedataV20250806Client().ListResourceGroups(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Describe wedata resource groups failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + return + } + + ret = response.Response.Data.Items + return +} + +func (me *WedataService) DescribeWedataResourceGroupToProjectAttachmentById(ctx context.Context, resourceGroupId, projectId string) (ret *wedatav20250806.BindProject, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := wedatav20250806.NewListResourceGroupsRequest() + response := wedatav20250806.NewListResourceGroupsResponse() + request.Id = &resourceGroupId + request.ProjectIds = helper.Strings([]string{projectId}) + + 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.UseWedataV20250806Client().ListResourceGroups(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Describe wedata resource groups failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + return + } + + if response.Response.Data.Items == nil { + return + } + + item := response.Response.Data.Items[0] + for _, item := range item.AssociateProjects { + if item.ProjectId != nil && *item.ProjectId == projectId { + ret = item + break + } + } + + return +} + +func (me *WedataService) DescribeWedataResourceGroupMetricsByFilter(ctx context.Context, param map[string]interface{}) (ret *wedatav20250806.ResourceGroupMetrics, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = wedatav20250806.NewGetResourceGroupMetricsRequest() + response = wedatav20250806.NewGetResourceGroupMetricsResponse() + ) + + 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 == "ResourceGroupId" { + request.ResourceGroupId = v.(*string) + } + if k == "StartTime" { + request.StartTime = v.(*uint64) + } + if k == "EndTime" { + request.EndTime = v.(*uint64) + } + if k == "MetricType" { + request.MetricType = v.(*string) + } + if k == "Granularity" { + request.Granularity = v.(*uint64) + } + } + + errRet = resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseWedataV20250806Client().GetResourceGroupMetrics(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 || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Describe wedata resource group metrics failed, Response is nil.")) + } + + response = result + return nil + }) + + if errRet != nil { + return + } + + ret = response.Response.Data + return +} + func (me *WedataService) DescribeWedataIntegrationTaskNodeById(ctx context.Context, projectId, nodeId string) (integrationTaskNode *wedata.DescribeIntegrationNodeResponseParams, errRet error) { logId := tccommon.GetLogId(ctx) 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 6806eef77a..cd3cd16471 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.40" + params["RequestClient"] = "SDK_GO_1.1.42" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/client.go index ee06c099d1..61ce0bca78 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/client.go @@ -172,6 +172,8 @@ func NewBatchCreateTaskVersionAsyncResponse() (response *BatchCreateTaskVersionA // AUTHFAILURE_SIGNATUREEXPIRE = "AuthFailure.SignatureExpire" // FAILEDOPERATION = "FailedOperation" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) BatchCreateTaskVersionAsync(request *BatchCreateTaskVersionAsyncRequest) (response *BatchCreateTaskVersionAsyncResponse, err error) { return c.BatchCreateTaskVersionAsyncWithContext(context.Background(), request) @@ -185,6 +187,8 @@ func (c *Client) BatchCreateTaskVersionAsync(request *BatchCreateTaskVersionAsyn // AUTHFAILURE_SIGNATUREEXPIRE = "AuthFailure.SignatureExpire" // FAILEDOPERATION = "FailedOperation" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) BatchCreateTaskVersionAsyncWithContext(ctx context.Context, request *BatchCreateTaskVersionAsyncRequest) (response *BatchCreateTaskVersionAsyncResponse, err error) { if request == nil { @@ -1597,6 +1601,9 @@ func NewCreateCustomFunctionResponse() (response *CreateCustomFunctionResponse) // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) CreateCustomFunction(request *CreateCustomFunctionRequest) (response *CreateCustomFunctionResponse, err error) { return c.CreateCustomFunctionWithContext(context.Background(), request) } @@ -1606,6 +1613,9 @@ func (c *Client) CreateCustomFunction(request *CreateCustomFunctionRequest) (res // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) CreateCustomFunctionWithContext(ctx context.Context, request *CreateCustomFunctionRequest) (response *CreateCustomFunctionResponse, err error) { if request == nil { request = NewCreateCustomFunctionRequest() @@ -2375,6 +2385,9 @@ func NewCreateTaskFolderResponse() (response *CreateTaskFolderResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) CreateTaskFolder(request *CreateTaskFolderRequest) (response *CreateTaskFolderResponse, err error) { return c.CreateTaskFolderWithContext(context.Background(), request) } @@ -2384,6 +2397,9 @@ func (c *Client) CreateTaskFolder(request *CreateTaskFolderRequest) (response *C // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) CreateTaskFolderWithContext(ctx context.Context, request *CreateTaskFolderRequest) (response *CreateTaskFolderResponse, err error) { if request == nil { request = NewCreateTaskFolderRequest() @@ -2485,6 +2501,8 @@ func NewCreateTaskVersionDsResponse() (response *CreateTaskVersionDsResponse) { // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_NOLOCK = "FailedOperation.NoLock" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) CreateTaskVersionDs(request *CreateTaskVersionDsRequest) (response *CreateTaskVersionDsResponse, err error) { return c.CreateTaskVersionDsWithContext(context.Background(), request) @@ -2499,6 +2517,8 @@ func (c *Client) CreateTaskVersionDs(request *CreateTaskVersionDsRequest) (respo // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_NOLOCK = "FailedOperation.NoLock" // INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // RESOURCENOTFOUND = "ResourceNotFound" func (c *Client) CreateTaskVersionDsWithContext(ctx context.Context, request *CreateTaskVersionDsRequest) (response *CreateTaskVersionDsResponse, err error) { if request == nil { @@ -2691,6 +2711,9 @@ func NewDeleteCustomFunctionResponse() (response *DeleteCustomFunctionResponse) // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteCustomFunction(request *DeleteCustomFunctionRequest) (response *DeleteCustomFunctionResponse, err error) { return c.DeleteCustomFunctionWithContext(context.Background(), request) } @@ -2700,6 +2723,9 @@ func (c *Client) DeleteCustomFunction(request *DeleteCustomFunctionRequest) (res // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteCustomFunctionWithContext(ctx context.Context, request *DeleteCustomFunctionRequest) (response *DeleteCustomFunctionResponse, err error) { if request == nil { request = NewDeleteCustomFunctionRequest() @@ -2843,6 +2869,9 @@ func NewDeleteDsFolderResponse() (response *DeleteDsFolderResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteDsFolder(request *DeleteDsFolderRequest) (response *DeleteDsFolderResponse, err error) { return c.DeleteDsFolderWithContext(context.Background(), request) } @@ -2852,6 +2881,9 @@ func (c *Client) DeleteDsFolder(request *DeleteDsFolderRequest) (response *Delet // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteDsFolderWithContext(ctx context.Context, request *DeleteDsFolderRequest) (response *DeleteDsFolderResponse, err error) { if request == nil { request = NewDeleteDsFolderRequest() @@ -2897,6 +2929,7 @@ func NewDeleteFileResponse() (response *DeleteFileResponse) { // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_DATAENGINEINSTANCENOTEXISTS = "InvalidParameter.DataEngineInstanceNotExists" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" // MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteFile(request *DeleteFileRequest) (response *DeleteFileResponse, err error) { return c.DeleteFileWithContext(context.Background(), request) @@ -2911,6 +2944,7 @@ func (c *Client) DeleteFile(request *DeleteFileRequest) (response *DeleteFileRes // INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETER_DATAENGINEINSTANCENOTEXISTS = "InvalidParameter.DataEngineInstanceNotExists" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" // MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteFileWithContext(ctx context.Context, request *DeleteFileRequest) (response *DeleteFileResponse, err error) { if request == nil { @@ -2953,6 +2987,9 @@ func NewDeleteFilePathResponse() (response *DeleteFilePathResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteFilePath(request *DeleteFilePathRequest) (response *DeleteFilePathResponse, err error) { return c.DeleteFilePathWithContext(context.Background(), request) } @@ -2962,6 +2999,9 @@ func (c *Client) DeleteFilePath(request *DeleteFilePathRequest) (response *Delet // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteFilePathWithContext(ctx context.Context, request *DeleteFilePathRequest) (response *DeleteFilePathResponse, err error) { if request == nil { request = NewDeleteFilePathRequest() @@ -3427,6 +3467,9 @@ func NewDeleteResourceFileResponse() (response *DeleteResourceFileResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteResourceFile(request *DeleteResourceFileRequest) (response *DeleteResourceFileResponse, err error) { return c.DeleteResourceFileWithContext(context.Background(), request) } @@ -3436,6 +3479,9 @@ func (c *Client) DeleteResourceFile(request *DeleteResourceFileRequest) (respons // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteResourceFileWithContext(ctx context.Context, request *DeleteResourceFileRequest) (response *DeleteResourceFileResponse, err error) { if request == nil { request = NewDeleteResourceFileRequest() @@ -3477,6 +3523,9 @@ func NewDeleteResourceFilesResponse() (response *DeleteResourceFilesResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteResourceFiles(request *DeleteResourceFilesRequest) (response *DeleteResourceFilesResponse, err error) { return c.DeleteResourceFilesWithContext(context.Background(), request) } @@ -3486,6 +3535,9 @@ func (c *Client) DeleteResourceFiles(request *DeleteResourceFilesRequest) (respo // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteResourceFilesWithContext(ctx context.Context, request *DeleteResourceFilesRequest) (response *DeleteResourceFilesResponse, err error) { if request == nil { request = NewDeleteResourceFilesRequest() @@ -3705,6 +3757,9 @@ func NewDeleteTaskDsResponse() (response *DeleteTaskDsResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteTaskDs(request *DeleteTaskDsRequest) (response *DeleteTaskDsResponse, err error) { return c.DeleteTaskDsWithContext(context.Background(), request) } @@ -3714,6 +3769,9 @@ func (c *Client) DeleteTaskDs(request *DeleteTaskDsRequest) (response *DeleteTas // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DeleteTaskDsWithContext(ctx context.Context, request *DeleteTaskDsRequest) (response *DeleteTaskDsResponse, err error) { if request == nil { request = NewDeleteTaskDsRequest() @@ -5041,6 +5099,9 @@ func NewDescribeDsParentFolderTreeResponse() (response *DescribeDsParentFolderTr // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeDsParentFolderTree(request *DescribeDsParentFolderTreeRequest) (response *DescribeDsParentFolderTreeResponse, err error) { return c.DescribeDsParentFolderTreeWithContext(context.Background(), request) } @@ -5050,6 +5111,9 @@ func (c *Client) DescribeDsParentFolderTree(request *DescribeDsParentFolderTreeR // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeDsParentFolderTreeWithContext(ctx context.Context, request *DescribeDsParentFolderTreeRequest) (response *DescribeDsParentFolderTreeResponse, err error) { if request == nil { request = NewDescribeDsParentFolderTreeRequest() @@ -5091,6 +5155,9 @@ func NewDescribeDsTaskVersionInfoResponse() (response *DescribeDsTaskVersionInfo // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeDsTaskVersionInfo(request *DescribeDsTaskVersionInfoRequest) (response *DescribeDsTaskVersionInfoResponse, err error) { return c.DescribeDsTaskVersionInfoWithContext(context.Background(), request) } @@ -5100,6 +5167,9 @@ func (c *Client) DescribeDsTaskVersionInfo(request *DescribeDsTaskVersionInfoReq // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeDsTaskVersionInfoWithContext(ctx context.Context, request *DescribeDsTaskVersionInfoRequest) (response *DescribeDsTaskVersionInfoResponse, err error) { if request == nil { request = NewDescribeDsTaskVersionInfoRequest() @@ -5752,6 +5822,10 @@ func NewDescribeFunctionTypesResponse() (response *DescribeFunctionTypesResponse // 查询函数类型 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // OPERATIONDENIED_USERNOTINWHITELISTERROR = "OperationDenied.UserNotInWhitelistError" func (c *Client) DescribeFunctionTypes(request *DescribeFunctionTypesRequest) (response *DescribeFunctionTypesResponse, err error) { return c.DescribeFunctionTypesWithContext(context.Background(), request) @@ -5761,6 +5835,10 @@ func (c *Client) DescribeFunctionTypes(request *DescribeFunctionTypesRequest) (r // 查询函数类型 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // OPERATIONDENIED_USERNOTINWHITELISTERROR = "OperationDenied.UserNotInWhitelistError" func (c *Client) DescribeFunctionTypesWithContext(ctx context.Context, request *DescribeFunctionTypesRequest) (response *DescribeFunctionTypesResponse, err error) { if request == nil { @@ -5802,6 +5880,10 @@ func NewDescribeInstanceByCycleResponse() (response *DescribeInstanceByCycleResp // 根据周期类型查询所有实例 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // OPERATIONDENIED_USERNOTINWHITELISTERROR = "OperationDenied.UserNotInWhitelistError" func (c *Client) DescribeInstanceByCycle(request *DescribeInstanceByCycleRequest) (response *DescribeInstanceByCycleResponse, err error) { return c.DescribeInstanceByCycleWithContext(context.Background(), request) @@ -5811,6 +5893,10 @@ func (c *Client) DescribeInstanceByCycle(request *DescribeInstanceByCycleRequest // 根据周期类型查询所有实例 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // OPERATIONDENIED_USERNOTINWHITELISTERROR = "OperationDenied.UserNotInWhitelistError" func (c *Client) DescribeInstanceByCycleWithContext(ctx context.Context, request *DescribeInstanceByCycleRequest) (response *DescribeInstanceByCycleResponse, err error) { if request == nil { @@ -5852,6 +5938,10 @@ func NewDescribeInstanceDetailInfoResponse() (response *DescribeInstanceDetailIn // 实例详情页,返回某个实例所有生命周期信息 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // OPERATIONDENIED_USERNOTINWHITELISTERROR = "OperationDenied.UserNotInWhitelistError" func (c *Client) DescribeInstanceDetailInfo(request *DescribeInstanceDetailInfoRequest) (response *DescribeInstanceDetailInfoResponse, err error) { return c.DescribeInstanceDetailInfoWithContext(context.Background(), request) @@ -5861,6 +5951,10 @@ func (c *Client) DescribeInstanceDetailInfo(request *DescribeInstanceDetailInfoR // 实例详情页,返回某个实例所有生命周期信息 // // 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" // OPERATIONDENIED_USERNOTINWHITELISTERROR = "OperationDenied.UserNotInWhitelistError" func (c *Client) DescribeInstanceDetailInfoWithContext(ctx context.Context, request *DescribeInstanceDetailInfoRequest) (response *DescribeInstanceDetailInfoResponse, err error) { if request == nil { @@ -7895,7 +7989,7 @@ func NewDescribeReportTaskDetailResponse() (response *DescribeReportTaskDetailRe } // DescribeReportTaskDetail -// 查询上报任务详情 +// 查询上报任务详情,注意:任务执行完后,任务详情上报存在10分钟的延迟,使用接口查询任务详情时需等待任务运行完10分钟后查询 // // 可能返回的错误码: // AUTHFAILURE = "AuthFailure" @@ -7908,7 +8002,7 @@ func (c *Client) DescribeReportTaskDetail(request *DescribeReportTaskDetailReque } // DescribeReportTaskDetail -// 查询上报任务详情 +// 查询上报任务详情,注意:任务执行完后,任务详情上报存在10分钟的延迟,使用接口查询任务详情时需等待任务运行完10分钟后查询 // // 可能返回的错误码: // AUTHFAILURE = "AuthFailure" @@ -8015,6 +8109,9 @@ func NewDescribeResourceManagePathTreesResponse() (response *DescribeResourceMan // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeResourceManagePathTrees(request *DescribeResourceManagePathTreesRequest) (response *DescribeResourceManagePathTreesResponse, err error) { return c.DescribeResourceManagePathTreesWithContext(context.Background(), request) } @@ -8024,6 +8121,9 @@ func (c *Client) DescribeResourceManagePathTrees(request *DescribeResourceManage // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeResourceManagePathTreesWithContext(ctx context.Context, request *DescribeResourceManagePathTreesRequest) (response *DescribeResourceManagePathTreesResponse, err error) { if request == nil { request = NewDescribeResourceManagePathTreesRequest() @@ -10815,6 +10915,9 @@ func NewDescribeTestRunningRecordResponse() (response *DescribeTestRunningRecord // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeTestRunningRecord(request *DescribeTestRunningRecordRequest) (response *DescribeTestRunningRecordResponse, err error) { return c.DescribeTestRunningRecordWithContext(context.Background(), request) } @@ -10824,6 +10927,9 @@ func (c *Client) DescribeTestRunningRecord(request *DescribeTestRunningRecordReq // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeTestRunningRecordWithContext(ctx context.Context, request *DescribeTestRunningRecordRequest) (response *DescribeTestRunningRecordResponse, err error) { if request == nil { request = NewDescribeTestRunningRecordRequest() @@ -11020,6 +11126,9 @@ func NewDescribeWorkflowByFordIdsResponse() (response *DescribeWorkflowByFordIds // 可能返回的错误码: // AUTHFAILURE = "AuthFailure" // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeWorkflowByFordIds(request *DescribeWorkflowByFordIdsRequest) (response *DescribeWorkflowByFordIdsResponse, err error) { return c.DescribeWorkflowByFordIdsWithContext(context.Background(), request) } @@ -11030,6 +11139,9 @@ func (c *Client) DescribeWorkflowByFordIds(request *DescribeWorkflowByFordIdsReq // 可能返回的错误码: // AUTHFAILURE = "AuthFailure" // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) DescribeWorkflowByFordIdsWithContext(ctx context.Context, request *DescribeWorkflowByFordIdsRequest) (response *DescribeWorkflowByFordIdsResponse, err error) { if request == nil { request = NewDescribeWorkflowByFordIdsRequest() @@ -11693,6 +11805,9 @@ func NewFindAllFolderResponse() (response *FindAllFolderResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) FindAllFolder(request *FindAllFolderRequest) (response *FindAllFolderResponse, err error) { return c.FindAllFolderWithContext(context.Background(), request) } @@ -11702,6 +11817,9 @@ func (c *Client) FindAllFolder(request *FindAllFolderRequest) (response *FindAll // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) FindAllFolderWithContext(ctx context.Context, request *FindAllFolderRequest) (response *FindAllFolderResponse, err error) { if request == nil { request = NewFindAllFolderRequest() @@ -11893,6 +12011,9 @@ func NewGetBatchDetailErrorLogResponse() (response *GetBatchDetailErrorLogRespon // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) GetBatchDetailErrorLog(request *GetBatchDetailErrorLogRequest) (response *GetBatchDetailErrorLogResponse, err error) { return c.GetBatchDetailErrorLogWithContext(context.Background(), request) } @@ -11902,6 +12023,9 @@ func (c *Client) GetBatchDetailErrorLog(request *GetBatchDetailErrorLogRequest) // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) GetBatchDetailErrorLogWithContext(ctx context.Context, request *GetBatchDetailErrorLogRequest) (response *GetBatchDetailErrorLogResponse, err error) { if request == nil { request = NewGetBatchDetailErrorLogRequest() @@ -12003,6 +12127,9 @@ func NewGetFileInfoResponse() (response *GetFileInfoResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) GetFileInfo(request *GetFileInfoRequest) (response *GetFileInfoResponse, err error) { return c.GetFileInfoWithContext(context.Background(), request) } @@ -12012,6 +12139,9 @@ func (c *Client) GetFileInfo(request *GetFileInfoRequest) (response *GetFileInfo // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) GetFileInfoWithContext(ctx context.Context, request *GetFileInfoRequest) (response *GetFileInfoResponse, err error) { if request == nil { request = NewGetFileInfoRequest() @@ -12368,23 +12498,10 @@ func NewGetPaginationTaskScriptResponse() (response *GetPaginationTaskScriptResp // 获取带分页的任务脚本 // // 可能返回的错误码: -// AUTHFAILURE = "AuthFailure" -// AUTHFAILURE_SIGNATUREEXPIRE = "AuthFailure.SignatureExpire" // FAILEDOPERATION = "FailedOperation" -// INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" -// LIMITEXCEEDED = "LimitExceeded" // MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED = "OperationDenied" -// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" func (c *Client) GetPaginationTaskScript(request *GetPaginationTaskScriptRequest) (response *GetPaginationTaskScriptResponse, err error) { return c.GetPaginationTaskScriptWithContext(context.Background(), request) } @@ -12393,23 +12510,10 @@ func (c *Client) GetPaginationTaskScript(request *GetPaginationTaskScriptRequest // 获取带分页的任务脚本 // // 可能返回的错误码: -// AUTHFAILURE = "AuthFailure" -// AUTHFAILURE_SIGNATUREEXPIRE = "AuthFailure.SignatureExpire" // FAILEDOPERATION = "FailedOperation" -// INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" -// LIMITEXCEEDED = "LimitExceeded" // MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED = "OperationDenied" -// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" func (c *Client) GetPaginationTaskScriptWithContext(ctx context.Context, request *GetPaginationTaskScriptRequest) (response *GetPaginationTaskScriptResponse, err error) { if request == nil { request = NewGetPaginationTaskScriptRequest() @@ -12651,6 +12755,9 @@ func NewListBatchDetailResponse() (response *ListBatchDetailResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) ListBatchDetail(request *ListBatchDetailRequest) (response *ListBatchDetailResponse, err error) { return c.ListBatchDetailWithContext(context.Background(), request) } @@ -12660,6 +12767,9 @@ func (c *Client) ListBatchDetail(request *ListBatchDetailRequest) (response *Lis // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) ListBatchDetailWithContext(ctx context.Context, request *ListBatchDetailRequest) (response *ListBatchDetailResponse, err error) { if request == nil { request = NewListBatchDetailRequest() @@ -12833,6 +12943,7 @@ func NewModifyApproveStatusResponse() (response *ModifyApproveStatusResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// UNSUPPORTEDOPERATION_FAILEDCHECKTASKDEPENDENCETIMEZONE = "UnsupportedOperation.FailedCheckTaskDependenceTimeZone" func (c *Client) ModifyApproveStatus(request *ModifyApproveStatusRequest) (response *ModifyApproveStatusResponse, err error) { return c.ModifyApproveStatusWithContext(context.Background(), request) } @@ -12842,6 +12953,7 @@ func (c *Client) ModifyApproveStatus(request *ModifyApproveStatusRequest) (respo // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// UNSUPPORTEDOPERATION_FAILEDCHECKTASKDEPENDENCETIMEZONE = "UnsupportedOperation.FailedCheckTaskDependenceTimeZone" func (c *Client) ModifyApproveStatusWithContext(ctx context.Context, request *ModifyApproveStatusRequest) (response *ModifyApproveStatusResponse, err error) { if request == nil { request = NewModifyApproveStatusRequest() @@ -12991,6 +13103,9 @@ func NewModifyDsFolderResponse() (response *ModifyDsFolderResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) ModifyDsFolder(request *ModifyDsFolderRequest) (response *ModifyDsFolderResponse, err error) { return c.ModifyDsFolderWithContext(context.Background(), request) } @@ -13000,6 +13115,9 @@ func (c *Client) ModifyDsFolder(request *ModifyDsFolderRequest) (response *Modif // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) ModifyDsFolderWithContext(ctx context.Context, request *ModifyDsFolderRequest) (response *ModifyDsFolderResponse, err error) { if request == nil { request = NewModifyDsFolderRequest() @@ -13760,6 +13878,9 @@ func NewModifyTaskLinksDsResponse() (response *ModifyTaskLinksDsResponse) { // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_NOLOCK = "FailedOperation.NoLock" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) ModifyTaskLinksDs(request *ModifyTaskLinksDsRequest) (response *ModifyTaskLinksDsResponse, err error) { return c.ModifyTaskLinksDsWithContext(context.Background(), request) } @@ -13770,6 +13891,9 @@ func (c *Client) ModifyTaskLinksDs(request *ModifyTaskLinksDsRequest) (response // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_NOLOCK = "FailedOperation.NoLock" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) ModifyTaskLinksDsWithContext(ctx context.Context, request *ModifyTaskLinksDsRequest) (response *ModifyTaskLinksDsResponse, err error) { if request == nil { request = NewModifyTaskLinksDsRequest() @@ -14065,6 +14189,9 @@ func NewRegisterDsEventResponse() (response *RegisterDsEventResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) RegisterDsEvent(request *RegisterDsEventRequest) (response *RegisterDsEventResponse, err error) { return c.RegisterDsEventWithContext(context.Background(), request) } @@ -14074,6 +14201,9 @@ func (c *Client) RegisterDsEvent(request *RegisterDsEventRequest) (response *Reg // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) RegisterDsEventWithContext(ctx context.Context, request *RegisterDsEventRequest) (response *RegisterDsEventResponse, err error) { if request == nil { request = NewRegisterDsEventRequest() @@ -14116,6 +14246,9 @@ func NewRegisterDsEventListenerResponse() (response *RegisterDsEventListenerResp // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_NOLOCK = "FailedOperation.NoLock" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) RegisterDsEventListener(request *RegisterDsEventListenerRequest) (response *RegisterDsEventListenerResponse, err error) { return c.RegisterDsEventListenerWithContext(context.Background(), request) } @@ -14126,6 +14259,9 @@ func (c *Client) RegisterDsEventListener(request *RegisterDsEventListenerRequest // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" // FAILEDOPERATION_NOLOCK = "FailedOperation.NoLock" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) RegisterDsEventListenerWithContext(ctx context.Context, request *RegisterDsEventListenerRequest) (response *RegisterDsEventListenerResponse, err error) { if request == nil { request = NewRegisterDsEventListenerRequest() @@ -14425,6 +14561,9 @@ func NewRemoveWorkflowDsResponse() (response *RemoveWorkflowDsResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) RemoveWorkflowDs(request *RemoveWorkflowDsRequest) (response *RemoveWorkflowDsResponse, err error) { return c.RemoveWorkflowDsWithContext(context.Background(), request) } @@ -14434,6 +14573,9 @@ func (c *Client) RemoveWorkflowDs(request *RemoveWorkflowDsRequest) (response *R // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) RemoveWorkflowDsWithContext(ctx context.Context, request *RemoveWorkflowDsRequest) (response *RemoveWorkflowDsResponse, err error) { if request == nil { request = NewRemoveWorkflowDsRequest() @@ -14475,6 +14617,9 @@ func NewRenewWorkflowOwnerDsResponse() (response *RenewWorkflowOwnerDsResponse) // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) RenewWorkflowOwnerDs(request *RenewWorkflowOwnerDsRequest) (response *RenewWorkflowOwnerDsResponse, err error) { return c.RenewWorkflowOwnerDsWithContext(context.Background(), request) } @@ -14484,6 +14629,9 @@ func (c *Client) RenewWorkflowOwnerDs(request *RenewWorkflowOwnerDsRequest) (res // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) RenewWorkflowOwnerDsWithContext(ctx context.Context, request *RenewWorkflowOwnerDsRequest) (response *RenewWorkflowOwnerDsResponse, err error) { if request == nil { request = NewRenewWorkflowOwnerDsRequest() @@ -15065,6 +15213,9 @@ func NewSaveCustomFunctionResponse() (response *SaveCustomFunctionResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) SaveCustomFunction(request *SaveCustomFunctionRequest) (response *SaveCustomFunctionResponse, err error) { return c.SaveCustomFunctionWithContext(context.Background(), request) } @@ -15074,6 +15225,9 @@ func (c *Client) SaveCustomFunction(request *SaveCustomFunctionRequest) (respons // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) SaveCustomFunctionWithContext(ctx context.Context, request *SaveCustomFunctionRequest) (response *SaveCustomFunctionResponse, err error) { if request == nil { request = NewSaveCustomFunctionRequest() @@ -15117,6 +15271,9 @@ func NewSetTaskAlarmNewResponse() (response *SetTaskAlarmNewResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) SetTaskAlarmNew(request *SetTaskAlarmNewRequest) (response *SetTaskAlarmNewResponse, err error) { return c.SetTaskAlarmNewWithContext(context.Background(), request) } @@ -15128,6 +15285,9 @@ func (c *Client) SetTaskAlarmNew(request *SetTaskAlarmNewRequest) (response *Set // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) SetTaskAlarmNewWithContext(ctx context.Context, request *SetTaskAlarmNewRequest) (response *SetTaskAlarmNewResponse, err error) { if request == nil { request = NewSetTaskAlarmNewRequest() @@ -15332,23 +15492,10 @@ func NewSubmitCustomFunctionResponse() (response *SubmitCustomFunctionResponse) // 提交自定义函数 // // 可能返回的错误码: -// AUTHFAILURE = "AuthFailure" -// AUTHFAILURE_SIGNATUREEXPIRE = "AuthFailure.SignatureExpire" // FAILEDOPERATION = "FailedOperation" -// INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" -// LIMITEXCEEDED = "LimitExceeded" // MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED = "OperationDenied" -// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" func (c *Client) SubmitCustomFunction(request *SubmitCustomFunctionRequest) (response *SubmitCustomFunctionResponse, err error) { return c.SubmitCustomFunctionWithContext(context.Background(), request) } @@ -15357,23 +15504,10 @@ func (c *Client) SubmitCustomFunction(request *SubmitCustomFunctionRequest) (res // 提交自定义函数 // // 可能返回的错误码: -// AUTHFAILURE = "AuthFailure" -// AUTHFAILURE_SIGNATUREEXPIRE = "AuthFailure.SignatureExpire" // FAILEDOPERATION = "FailedOperation" -// INTERNALERROR = "InternalError" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" -// LIMITEXCEEDED = "LimitExceeded" // MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED = "OperationDenied" -// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" func (c *Client) SubmitCustomFunctionWithContext(ctx context.Context, request *SubmitCustomFunctionRequest) (response *SubmitCustomFunctionResponse, err error) { if request == nil { request = NewSubmitCustomFunctionRequest() @@ -15861,6 +15995,9 @@ func NewTriggerDsEventResponse() (response *TriggerDsEventResponse) { // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) TriggerDsEvent(request *TriggerDsEventRequest) (response *TriggerDsEventResponse, err error) { return c.TriggerDsEventWithContext(context.Background(), request) } @@ -15870,6 +16007,9 @@ func (c *Client) TriggerDsEvent(request *TriggerDsEventRequest) (response *Trigg // // 可能返回的错误码: // FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" func (c *Client) TriggerDsEventWithContext(ctx context.Context, request *TriggerDsEventRequest) (response *TriggerDsEventResponse, err error) { if request == nil { request = NewTriggerDsEventRequest() diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/errors.go index c077bd3899..9fbc4b7816 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/errors.go @@ -152,6 +152,9 @@ const ( // 操作不支持。 UNSUPPORTEDOPERATION = "UnsupportedOperation" + // 任务不在同一时区 + UNSUPPORTEDOPERATION_FAILEDCHECKTASKDEPENDENCETIMEZONE = "UnsupportedOperation.FailedCheckTaskDependenceTimeZone" + // 请先配置不少于一个规则。 UNSUPPORTEDOPERATION_NORULEINRULEGROUP = "UnsupportedOperation.NoRuleInRuleGroup" ) diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/models.go index e17161d3a2..3c526019dc 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820/models.go @@ -1069,6 +1069,9 @@ type BatchCreateTaskVersionAsyncRequestParams struct { // 是否需要校验父任务已经提交到调度 NeedCheckParentSubmitted *bool `json:"NeedCheckParentSubmitted,omitnil,omitempty" name:"NeedCheckParentSubmitted"` + + // 是否需要补录中间实例 + EnableMakeUp *bool `json:"EnableMakeUp,omitnil,omitempty" name:"EnableMakeUp"` } type BatchCreateTaskVersionAsyncRequest struct { @@ -1091,6 +1094,9 @@ type BatchCreateTaskVersionAsyncRequest struct { // 是否需要校验父任务已经提交到调度 NeedCheckParentSubmitted *bool `json:"NeedCheckParentSubmitted,omitnil,omitempty" name:"NeedCheckParentSubmitted"` + + // 是否需要补录中间实例 + EnableMakeUp *bool `json:"EnableMakeUp,omitnil,omitempty" name:"EnableMakeUp"` } func (r *BatchCreateTaskVersionAsyncRequest) ToJsonString() string { @@ -1111,6 +1117,7 @@ func (r *BatchCreateTaskVersionAsyncRequest) FromJsonString(s string) error { delete(f, "AlarmWays") delete(f, "AlarmRecipientTypes") delete(f, "NeedCheckParentSubmitted") + delete(f, "EnableMakeUp") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "BatchCreateTaskVersionAsyncRequest has unknown keys!", "") } @@ -3422,6 +3429,24 @@ type ColumnMeta struct { // influxdb字段类别 // 注意:此字段可能返回 null,表示取不到有效值。 InfluxCategory *string `json:"InfluxCategory,omitnil,omitempty" name:"InfluxCategory"` + + // 字段使用说明 + // 注意:此字段可能返回 null,表示取不到有效值。 + Specification *string `json:"Specification,omitnil,omitempty" name:"Specification"` +} + +type ColumnValueConfig struct { + // 字段值key + // 注意:此字段可能返回 null,表示取不到有效值。 + FieldKey *string `json:"FieldKey,omitnil,omitempty" name:"FieldKey"` + + // 字段值 + // 注意:此字段可能返回 null,表示取不到有效值。 + FieldValue *string `json:"FieldValue,omitnil,omitempty" name:"FieldValue"` + + // 字段值类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + FieldDataType *string `json:"FieldDataType,omitnil,omitempty" name:"FieldDataType"` } // Predefined struct for user @@ -4758,6 +4783,9 @@ type CreateHiveTableRequestParams struct { // 项目Id ProjectId *string `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` + // 数据库类型 + Type *string `json:"Type,omitnil,omitempty" name:"Type"` + // 责任人 Incharge *string `json:"Incharge,omitnil,omitempty" name:"Incharge"` @@ -4792,6 +4820,9 @@ type CreateHiveTableRequest struct { // 项目Id ProjectId *string `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` + // 数据库类型 + Type *string `json:"Type,omitnil,omitempty" name:"Type"` + // 责任人 Incharge *string `json:"Incharge,omitnil,omitempty" name:"Incharge"` @@ -4825,6 +4856,7 @@ func (r *CreateHiveTableRequest) FromJsonString(s string) error { delete(f, "DDLSql") delete(f, "Privilege") delete(f, "ProjectId") + delete(f, "Type") delete(f, "Incharge") delete(f, "DataOptimizationResource") delete(f, "SmartOptimizerWritten") @@ -6167,6 +6199,9 @@ type CreateTaskVersionDsRequestParams struct { // 是否需要校验循环依赖,默认为 true,如果使用了 CheckTaskCycleLink 和 CheckTaskCycleConfiguration 两个接口校验成功可以传 false,后台服务器不再做校验 EnableCheckTaskCycleLink *bool `json:"EnableCheckTaskCycleLink,omitnil,omitempty" name:"EnableCheckTaskCycleLink"` + + // 是否需要补录中间实例 + EnableMakeUp *bool `json:"EnableMakeUp,omitnil,omitempty" name:"EnableMakeUp"` } type CreateTaskVersionDsRequest struct { @@ -6195,6 +6230,9 @@ type CreateTaskVersionDsRequest struct { // 是否需要校验循环依赖,默认为 true,如果使用了 CheckTaskCycleLink 和 CheckTaskCycleConfiguration 两个接口校验成功可以传 false,后台服务器不再做校验 EnableCheckTaskCycleLink *bool `json:"EnableCheckTaskCycleLink,omitnil,omitempty" name:"EnableCheckTaskCycleLink"` + + // 是否需要补录中间实例 + EnableMakeUp *bool `json:"EnableMakeUp,omitnil,omitempty" name:"EnableMakeUp"` } func (r *CreateTaskVersionDsRequest) ToJsonString() string { @@ -6217,6 +6255,7 @@ func (r *CreateTaskVersionDsRequest) FromJsonString(s string) error { delete(f, "AlarmWays") delete(f, "AlarmRecipientTypes") delete(f, "EnableCheckTaskCycleLink") + delete(f, "EnableMakeUp") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateTaskVersionDsRequest has unknown keys!", "") } @@ -7037,6 +7076,18 @@ type DatabaseMeta struct { // 库guid // 注意:此字段可能返回 null,表示取不到有效值。 DatabaseGuid *string `json:"DatabaseGuid,omitnil,omitempty" name:"DatabaseGuid"` + + // 环境,取值 prod或者 dev + // 注意:此字段可能返回 null,表示取不到有效值。 + Environment *string `json:"Environment,omitnil,omitempty" name:"Environment"` + + // Owner的账户信息:账号信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + OwnerAccount *uint64 `json:"OwnerAccount,omitnil,omitempty" name:"OwnerAccount"` + + // 操作权限 + // 注意:此字段可能返回 null,表示取不到有效值。 + OperateOption *OperateOption `json:"OperateOption,omitnil,omitempty" name:"OperateOption"` } type DatabaseSchemaIInfo struct { @@ -11638,6 +11689,9 @@ type DescribeEventCasesRequestParams struct { // 排序顺序 SortType *string `json:"SortType,omitnil,omitempty" name:"SortType"` + + // 有效次数 + ConsumeCount *string `json:"ConsumeCount,omitnil,omitempty" name:"ConsumeCount"` } type DescribeEventCasesRequest struct { @@ -11706,6 +11760,9 @@ type DescribeEventCasesRequest struct { // 排序顺序 SortType *string `json:"SortType,omitnil,omitempty" name:"SortType"` + + // 有效次数 + ConsumeCount *string `json:"ConsumeCount,omitnil,omitempty" name:"ConsumeCount"` } func (r *DescribeEventCasesRequest) ToJsonString() string { @@ -11739,6 +11796,7 @@ func (r *DescribeEventCasesRequest) FromJsonString(s string) error { delete(f, "TimeToLive") delete(f, "SortItem") delete(f, "SortType") + delete(f, "ConsumeCount") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeEventCasesRequest has unknown keys!", "") } @@ -14370,6 +14428,9 @@ type DescribeOperateOpsTasksRequestParams struct { // 时区 ScheduleTimeZone *string `json:"ScheduleTimeZone,omitnil,omitempty" name:"ScheduleTimeZone"` + + // 根据任务优先级筛选 + RunPriorityList []*int64 `json:"RunPriorityList,omitnil,omitempty" name:"RunPriorityList"` } type DescribeOperateOpsTasksRequest struct { @@ -14458,6 +14519,9 @@ type DescribeOperateOpsTasksRequest struct { // 时区 ScheduleTimeZone *string `json:"ScheduleTimeZone,omitnil,omitempty" name:"ScheduleTimeZone"` + + // 根据任务优先级筛选 + RunPriorityList []*int64 `json:"RunPriorityList,omitnil,omitempty" name:"RunPriorityList"` } func (r *DescribeOperateOpsTasksRequest) ToJsonString() string { @@ -14500,6 +14564,7 @@ func (r *DescribeOperateOpsTasksRequest) FromJsonString(s string) error { delete(f, "ProjectIds") delete(f, "BlackTaskIdList") delete(f, "ScheduleTimeZone") + delete(f, "RunPriorityList") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeOperateOpsTasksRequest has unknown keys!", "") } @@ -16292,9 +16357,6 @@ func (r *DescribeRelatedTasksByTaskIdResponse) FromJsonString(s string) error { // Predefined struct for user type DescribeReportTaskDetailRequestParams struct { - // 租户id - TenantId *string `json:"TenantId,omitnil,omitempty" name:"TenantId"` - // 引擎任务id EngineTaskId *string `json:"EngineTaskId,omitnil,omitempty" name:"EngineTaskId"` } @@ -16302,9 +16364,6 @@ type DescribeReportTaskDetailRequestParams struct { type DescribeReportTaskDetailRequest struct { *tchttp.BaseRequest - // 租户id - TenantId *string `json:"TenantId,omitnil,omitempty" name:"TenantId"` - // 引擎任务id EngineTaskId *string `json:"EngineTaskId,omitnil,omitempty" name:"EngineTaskId"` } @@ -16321,7 +16380,6 @@ func (r *DescribeReportTaskDetailRequest) FromJsonString(s string) error { if err := json.Unmarshal([]byte(s), &f); err != nil { return err } - delete(f, "TenantId") delete(f, "EngineTaskId") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeReportTaskDetailRequest has unknown keys!", "") @@ -17897,60 +17955,77 @@ type DescribeScheduleInstancesRequestParams struct { // 请求来源,WEB 前端;CLIENT 客户端 RequestFromSource *string `json:"RequestFromSource,omitnil,omitempty" name:"RequestFromSource"` - // 实例列表 + // 【已废弃参数,新用户接入无需关注】 + // 实例列表过滤条件 Instances []*InstanceOpsDto `json:"Instances,omitnil,omitempty" name:"Instances"` - // 检查父任务类型, true: 检查父任务; false: 不检查父任务 + // 【已废弃参数,新用户接入无需关注】 + // 检查父任务类型, true: 检查父任务类型; false: 不检查父任务类型 CheckFather *bool `json:"CheckFather,omitnil,omitempty" name:"CheckFather"` - // 重跑类型, 1: 自身; 3: 孩子; 2: 自身以及孩子 + // 【已废弃参数,新用户接入无需关注】 + // 重跑类型, 1: 仅重跑当前实例; 2: 重跑当前实例及其子实例; 3: 仅重跑子实例 RerunType *string `json:"RerunType,omitnil,omitempty" name:"RerunType"` - // 实例依赖方式, 1: 自依赖; 2: 任务依赖; 3: 自依赖及父子依赖 + // 【已废弃参数,新用户接入无需关注】 + // 实例依赖方式, 1: 任务自依赖; 2: 任务上游依赖; 3: 自依赖及其上游依赖 DependentWay *string `json:"DependentWay,omitnil,omitempty" name:"DependentWay"` - // 重跑忽略事件监听与否 + // 【已废弃参数,新用户接入无需关注】 + // 重跑时是否忽略事件监听 SkipEventListening *bool `json:"SkipEventListening,omitnil,omitempty" name:"SkipEventListening"` + // 【已废弃参数,新用户接入无需关注】 // 下游实例范围 1: 所在工作流 2: 所在项目 3: 所有跨工作流依赖的项目 SonInstanceType *string `json:"SonInstanceType,omitnil,omitempty" name:"SonInstanceType"` // 查询条件 SearchCondition *InstanceApiOpsRequest `json:"SearchCondition,omitnil,omitempty" name:"SearchCondition"` + // 【已废弃参数,新用户接入无需关注】 // 访问类型 OptType *string `json:"OptType,omitnil,omitempty" name:"OptType"` + // 【已废弃参数,新用户接入无需关注】 // 操作者名称 OperatorName *string `json:"OperatorName,omitnil,omitempty" name:"OperatorName"` + // 【已废弃参数,新用户接入无需关注】 // 操作者id OperatorId *string `json:"OperatorId,omitnil,omitempty" name:"OperatorId"` - // 项目id + // 项目ID ProjectId *string `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` - // 项目标志 + // 【必要参数】 + // 项目ID ProjectIdent *string `json:"ProjectIdent,omitnil,omitempty" name:"ProjectIdent"` + // 【已废弃参数,新用户接入无需关注】 // 项目名称 ProjectName *string `json:"ProjectName,omitnil,omitempty" name:"ProjectName"` - // 索引页码 + // 【必要参数】 + // 分页查询开始页页码,默认值为 1 PageIndex *int64 `json:"PageIndex,omitnil,omitempty" name:"PageIndex"` - // 页面大小 + // 【必要参数】 + // 分页查询每页返回的结果行数,默认值为 10 PageSize *int64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` + // 【已废弃参数,新用户接入无需关注】 // 数据总数 Count *int64 `json:"Count,omitnil,omitempty" name:"Count"` + // 【已废弃参数,新用户接入无需关注】 // 基础请求信息 RequestBaseInfo *ProjectBaseInfoOpsRequest `json:"RequestBaseInfo,omitnil,omitempty" name:"RequestBaseInfo"` + // 【已废弃参数,新用户接入无需关注】 // 是否计算总数 IsCount *bool `json:"IsCount,omitnil,omitempty" name:"IsCount"` + // 【已废弃参数,新用户接入无需关注】 // 项目ID列表,用于多项目实例列表筛选,请注意,该字段传入时 ProjectId 字段也必须传,且传入的 ProjectIds 中的项目ID必须是当前用户有权限的项目ID,否则会由于权限校验失败报错 ProjectIds []*string `json:"ProjectIds,omitnil,omitempty" name:"ProjectIds"` } @@ -17961,60 +18036,77 @@ type DescribeScheduleInstancesRequest struct { // 请求来源,WEB 前端;CLIENT 客户端 RequestFromSource *string `json:"RequestFromSource,omitnil,omitempty" name:"RequestFromSource"` - // 实例列表 + // 【已废弃参数,新用户接入无需关注】 + // 实例列表过滤条件 Instances []*InstanceOpsDto `json:"Instances,omitnil,omitempty" name:"Instances"` - // 检查父任务类型, true: 检查父任务; false: 不检查父任务 + // 【已废弃参数,新用户接入无需关注】 + // 检查父任务类型, true: 检查父任务类型; false: 不检查父任务类型 CheckFather *bool `json:"CheckFather,omitnil,omitempty" name:"CheckFather"` - // 重跑类型, 1: 自身; 3: 孩子; 2: 自身以及孩子 + // 【已废弃参数,新用户接入无需关注】 + // 重跑类型, 1: 仅重跑当前实例; 2: 重跑当前实例及其子实例; 3: 仅重跑子实例 RerunType *string `json:"RerunType,omitnil,omitempty" name:"RerunType"` - // 实例依赖方式, 1: 自依赖; 2: 任务依赖; 3: 自依赖及父子依赖 + // 【已废弃参数,新用户接入无需关注】 + // 实例依赖方式, 1: 任务自依赖; 2: 任务上游依赖; 3: 自依赖及其上游依赖 DependentWay *string `json:"DependentWay,omitnil,omitempty" name:"DependentWay"` - // 重跑忽略事件监听与否 + // 【已废弃参数,新用户接入无需关注】 + // 重跑时是否忽略事件监听 SkipEventListening *bool `json:"SkipEventListening,omitnil,omitempty" name:"SkipEventListening"` + // 【已废弃参数,新用户接入无需关注】 // 下游实例范围 1: 所在工作流 2: 所在项目 3: 所有跨工作流依赖的项目 SonInstanceType *string `json:"SonInstanceType,omitnil,omitempty" name:"SonInstanceType"` // 查询条件 SearchCondition *InstanceApiOpsRequest `json:"SearchCondition,omitnil,omitempty" name:"SearchCondition"` + // 【已废弃参数,新用户接入无需关注】 // 访问类型 OptType *string `json:"OptType,omitnil,omitempty" name:"OptType"` + // 【已废弃参数,新用户接入无需关注】 // 操作者名称 OperatorName *string `json:"OperatorName,omitnil,omitempty" name:"OperatorName"` + // 【已废弃参数,新用户接入无需关注】 // 操作者id OperatorId *string `json:"OperatorId,omitnil,omitempty" name:"OperatorId"` - // 项目id + // 项目ID ProjectId *string `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` - // 项目标志 + // 【必要参数】 + // 项目ID ProjectIdent *string `json:"ProjectIdent,omitnil,omitempty" name:"ProjectIdent"` + // 【已废弃参数,新用户接入无需关注】 // 项目名称 ProjectName *string `json:"ProjectName,omitnil,omitempty" name:"ProjectName"` - // 索引页码 + // 【必要参数】 + // 分页查询开始页页码,默认值为 1 PageIndex *int64 `json:"PageIndex,omitnil,omitempty" name:"PageIndex"` - // 页面大小 + // 【必要参数】 + // 分页查询每页返回的结果行数,默认值为 10 PageSize *int64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` + // 【已废弃参数,新用户接入无需关注】 // 数据总数 Count *int64 `json:"Count,omitnil,omitempty" name:"Count"` + // 【已废弃参数,新用户接入无需关注】 // 基础请求信息 RequestBaseInfo *ProjectBaseInfoOpsRequest `json:"RequestBaseInfo,omitnil,omitempty" name:"RequestBaseInfo"` + // 【已废弃参数,新用户接入无需关注】 // 是否计算总数 IsCount *bool `json:"IsCount,omitnil,omitempty" name:"IsCount"` + // 【已废弃参数,新用户接入无需关注】 // 项目ID列表,用于多项目实例列表筛选,请注意,该字段传入时 ProjectId 字段也必须传,且传入的 ProjectIds 中的项目ID必须是当前用户有权限的项目ID,否则会由于权限校验失败报错 ProjectIds []*string `json:"ProjectIds,omitnil,omitempty" name:"ProjectIds"` } @@ -21340,6 +21432,12 @@ type DescribeTestRunningRecordRequestParams struct { // 试运行记录id RecordIdList []*int64 `json:"RecordIdList,omitnil,omitempty" name:"RecordIdList"` + + // 分页大小 + PageSize *int64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` + + // 分页索引 + PageIndex *int64 `json:"PageIndex,omitnil,omitempty" name:"PageIndex"` } type DescribeTestRunningRecordRequest struct { @@ -21365,6 +21463,12 @@ type DescribeTestRunningRecordRequest struct { // 试运行记录id RecordIdList []*int64 `json:"RecordIdList,omitnil,omitempty" name:"RecordIdList"` + + // 分页大小 + PageSize *int64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` + + // 分页索引 + PageIndex *int64 `json:"PageIndex,omitnil,omitempty" name:"PageIndex"` } func (r *DescribeTestRunningRecordRequest) ToJsonString() string { @@ -21386,6 +21490,8 @@ func (r *DescribeTestRunningRecordRequest) FromJsonString(s string) error { delete(f, "CreateTime") delete(f, "EndTime") delete(f, "RecordIdList") + delete(f, "PageSize") + delete(f, "PageIndex") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTestRunningRecordRequest has unknown keys!", "") } @@ -21398,6 +21504,14 @@ type DescribeTestRunningRecordResponseParams struct { // 注意:此字段可能返回 null,表示取不到有效值。 Data []*TestRunningRecord `json:"Data,omitnil,omitempty" name:"Data"` + // 总页数 + // 注意:此字段可能返回 null,表示取不到有效值。 + TotalPages *int64 `json:"TotalPages,omitnil,omitempty" name:"TotalPages"` + + // 总条数 + // 注意:此字段可能返回 null,表示取不到有效值。 + TotalItems *int64 `json:"TotalItems,omitnil,omitempty" name:"TotalItems"` + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` } @@ -21697,6 +21811,9 @@ type DescribeWorkflowCanvasInfoRequestParams struct { // 项目id ProjectId *string `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` + + // 请求来源,WEB 前端;CLIENT 客户端 + RequestFromSource *string `json:"RequestFromSource,omitnil,omitempty" name:"RequestFromSource"` } type DescribeWorkflowCanvasInfoRequest struct { @@ -21707,6 +21824,9 @@ type DescribeWorkflowCanvasInfoRequest struct { // 项目id ProjectId *string `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` + + // 请求来源,WEB 前端;CLIENT 客户端 + RequestFromSource *string `json:"RequestFromSource,omitnil,omitempty" name:"RequestFromSource"` } func (r *DescribeWorkflowCanvasInfoRequest) ToJsonString() string { @@ -21723,6 +21843,7 @@ func (r *DescribeWorkflowCanvasInfoRequest) FromJsonString(s string) error { } delete(f, "WorkflowId") delete(f, "ProjectId") + delete(f, "RequestFromSource") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeWorkflowCanvasInfoRequest has unknown keys!", "") } @@ -22901,17 +23022,18 @@ type EngineTaskInfo struct { // 引擎执行总时间 // 注意:此字段可能返回 null,表示取不到有效值。 - EngineExeTimes *uint64 `json:"EngineExeTimes,omitnil,omitempty" name:"EngineExeTimes"` + EngineExeTimeCost *float64 `json:"EngineExeTimeCost,omitnil,omitempty" name:"EngineExeTimeCost"` // cu消耗 // 注意:此字段可能返回 null,表示取不到有效值。 CuConsume *uint64 `json:"CuConsume,omitnil,omitempty" name:"CuConsume"` - // 资源消耗 + // 该值表示任务预设资源,sql任务不需要预设资源,该值为-1 // 注意:此字段可能返回 null,表示取不到有效值。 ResourceUsage *int64 `json:"ResourceUsage,omitnil,omitempty" name:"ResourceUsage"` - // 引擎名 + // 引擎名。在wedata侧若获取不到引擎名,则是wedata侧生成dlc标识,与dlc侧的引擎名存在不一致的情况 + // // 注意:此字段可能返回 null,表示取不到有效值。 EngineName *string `json:"EngineName,omitnil,omitempty" name:"EngineName"` @@ -23249,6 +23371,22 @@ type EventDsDto struct { // 项目名称 // 注意:此字段可能返回 null,表示取不到有效值。 ProjectName *string `json:"ProjectName,omitnil,omitempty" name:"ProjectName"` + + // 事件消费有效次数 + // 注意:此字段可能返回 null,表示取不到有效值。 + ValidConsumeCount *int64 `json:"ValidConsumeCount,omitnil,omitempty" name:"ValidConsumeCount"` + + // 事件id + // 注意:此字段可能返回 null,表示取不到有效值。 + EventId *string `json:"EventId,omitnil,omitempty" name:"EventId"` + + // bundleId + // 注意:此字段可能返回 null,表示取不到有效值。 + BundleId *string `json:"BundleId,omitnil,omitempty" name:"BundleId"` + + // bundle信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + BundleInfo *string `json:"BundleInfo,omitnil,omitempty" name:"BundleInfo"` } type EventListenerDTO struct { @@ -23864,6 +24002,10 @@ type FieldConfig struct { // 字段值类型 // 注意:此字段可能返回 null,表示取不到有效值。 FieldDataType *string `json:"FieldDataType,omitnil,omitempty" name:"FieldDataType"` + + // 字段值变量信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + ValueConfig *ColumnValueConfig `json:"ValueConfig,omitnil,omitempty" name:"ValueConfig"` } type Filter struct { @@ -25503,6 +25645,12 @@ type InstanceApiOpsRequest struct { // 计划调度时间 ScheduleTimeTo *string `json:"ScheduleTimeTo,omitnil,omitempty" name:"ScheduleTimeTo"` + + // 任务优先级过滤实例列表 + RunPriorityList []*int64 `json:"RunPriorityList,omitnil,omitempty" name:"RunPriorityList"` + + // 实例调度周期筛选 + InstanceCycleType []*string `json:"InstanceCycleType,omitnil,omitempty" name:"InstanceCycleType"` } type InstanceCondition struct { @@ -26462,6 +26610,12 @@ type InstanceOpsDto struct { // 允许重跑类型,ALL 表示无论实例运行成功还是失败都允许重跑,NONE表示无论成功或者失败都不允许重跑,FAILURE 表示只有运行失败才能重跑 AllowRedoType *string `json:"AllowRedoType,omitnil,omitempty" name:"AllowRedoType"` + + // 实例生命周期 + InstanceCycleType *string `json:"InstanceCycleType,omitnil,omitempty" name:"InstanceCycleType"` + + // 实例执行计划描述 + InstanceSchedulerDesc *string `json:"InstanceSchedulerDesc,omitnil,omitempty" name:"InstanceSchedulerDesc"` } type InstanceOpsInfoPage struct { @@ -27171,7 +27325,7 @@ type KVPair struct { // 注意:此字段可能返回 null,表示取不到有效值。 K *string `json:"K,omitnil,omitempty" name:"K"` - // 值 + // 值,请勿传SQL(请求会被视为攻击接口),如果有需要,请将SQL进行Base64转码并解码。 // 注意:此字段可能返回 null,表示取不到有效值。 V *string `json:"V,omitnil,omitempty" name:"V"` } @@ -31373,6 +31527,12 @@ type OfflineTaskAddParam struct { InstanceInitStrategy *string `json:"InstanceInitStrategy,omitnil,omitempty" name:"InstanceInitStrategy"` } +type OperateOption struct { + // 是否有修改归属项目权限 + // 注意:此字段可能返回 null,表示取不到有效值。 + HasProjectPermission *bool `json:"HasProjectPermission,omitnil,omitempty" name:"HasProjectPermission"` +} + type OperationOpsDto struct { // 操作是否成功 // 注意:此字段可能返回 null,表示取不到有效值。 @@ -32043,7 +32203,12 @@ type ProdSchedulerTask struct { CycleType *int64 `json:"CycleType,omitnil,omitempty" name:"CycleType"` // 生产任务类型 + // 注意:此字段可能返回 null,表示取不到有效值。 TaskType *string `json:"TaskType,omitnil,omitempty" name:"TaskType"` + + // 时区 + // 注意:此字段可能返回 null,表示取不到有效值。 + ScheduleTimeZone *string `json:"ScheduleTimeZone,omitnil,omitempty" name:"ScheduleTimeZone"` } type Project struct { @@ -32289,6 +32454,12 @@ type RealTimeTaskSpeed struct { // 同步速度字节/s列表 BytesSpeedList []*BytesSpeed `json:"BytesSpeedList,omitnil,omitempty" name:"BytesSpeedList"` + + // 日志条数速度 + RecordsLogSpeed []*RecordsSpeed `json:"RecordsLogSpeed,omitnil,omitempty" name:"RecordsLogSpeed"` + + // 日志大小速度 + BytesLogSpeed []*BytesSpeed `json:"BytesLogSpeed,omitnil,omitempty" name:"BytesLogSpeed"` } type RecordField struct { @@ -32467,6 +32638,9 @@ type RegisterDsEventRequestParams struct { // // Deprecated: DimensionFormat is deprecated. DimensionFormat *string `json:"DimensionFormat,omitnil,omitempty" name:"DimensionFormat"` + + // 事件消费有效次数 + ValidConsumeCount *int64 `json:"ValidConsumeCount,omitnil,omitempty" name:"ValidConsumeCount"` } type RegisterDsEventRequest struct { @@ -32501,6 +32675,9 @@ type RegisterDsEventRequest struct { // 时间格式 DimensionFormat *string `json:"DimensionFormat,omitnil,omitempty" name:"DimensionFormat"` + + // 事件消费有效次数 + ValidConsumeCount *int64 `json:"ValidConsumeCount,omitnil,omitempty" name:"ValidConsumeCount"` } func (r *RegisterDsEventRequest) ToJsonString() string { @@ -32525,6 +32702,7 @@ func (r *RegisterDsEventRequest) FromJsonString(s string) error { delete(f, "EventType") delete(f, "EventBroadcastType") delete(f, "DimensionFormat") + delete(f, "ValidConsumeCount") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RegisterDsEventRequest has unknown keys!", "") } @@ -34332,6 +34510,18 @@ type Rule struct { // 更新时间 // 注意:此字段可能返回 null,表示取不到有效值。 UpdateTime *string `json:"UpdateTime,omitnil,omitempty" name:"UpdateTime"` + + // 数据源名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + DatasourceName *string `json:"DatasourceName,omitnil,omitempty" name:"DatasourceName"` + + // 数据库名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + DatabaseName *string `json:"DatabaseName,omitnil,omitempty" name:"DatabaseName"` + + // 失败原因 + // 注意:此字段可能返回 null,表示取不到有效值。 + FailMsg *string `json:"FailMsg,omitnil,omitempty" name:"FailMsg"` } type RuleConfig struct { @@ -34384,6 +34574,10 @@ type RuleExecConfig struct { // DLC执行引擎资源组 // 注意:此字段可能返回 null,表示取不到有效值。 DlcGroupName *string `json:"DlcGroupName,omitnil,omitempty" name:"DlcGroupName"` + + // 引擎参数 + // 注意:此字段可能返回 null,表示取不到有效值。 + EngineParam *string `json:"EngineParam,omitnil,omitempty" name:"EngineParam"` } type RuleExecDateStat struct { @@ -34782,9 +34976,84 @@ type RuleGroup struct { Description *string `json:"Description,omitnil,omitempty" name:"Description"` // 监控创建人 + // 注意:此字段可能返回 null,表示取不到有效值。 CreateUserName *string `json:"CreateUserName,omitnil,omitempty" name:"CreateUserName"` } +type RuleGroupConfig struct { + // 模型检测类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ModelMonitorType *string `json:"ModelMonitorType,omitnil,omitempty" name:"ModelMonitorType"` + + // 预测列 + // 注意:此字段可能返回 null,表示取不到有效值。 + PredictColumn *string `json:"PredictColumn,omitnil,omitempty" name:"PredictColumn"` + + // 预测列类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + PredictColumnType *string `json:"PredictColumnType,omitnil,omitempty" name:"PredictColumnType"` + + // 标签列 + // 注意:此字段可能返回 null,表示取不到有效值。 + LabelColumn *string `json:"LabelColumn,omitnil,omitempty" name:"LabelColumn"` + + // 标签列类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + LabelColumnType *string `json:"LabelColumnType,omitnil,omitempty" name:"LabelColumnType"` + + // 模型id列 + // 注意:此字段可能返回 null,表示取不到有效值。 + ModelIdColumn *string `json:"ModelIdColumn,omitnil,omitempty" name:"ModelIdColumn"` + + // 模型id列类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ModelIdColumnType *string `json:"ModelIdColumnType,omitnil,omitempty" name:"ModelIdColumnType"` + + // 时间戳列 + // 注意:此字段可能返回 null,表示取不到有效值。 + TimestampColumn *string `json:"TimestampColumn,omitnil,omitempty" name:"TimestampColumn"` + + // 时间戳列类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + TimestampColumnType *string `json:"TimestampColumnType,omitnil,omitempty" name:"TimestampColumnType"` + + // 指标粒度 + // 注意:此字段可能返回 null,表示取不到有效值。 + Granularity *int64 `json:"Granularity,omitnil,omitempty" name:"Granularity"` + + // 指标粒度单位 + // 注意:此字段可能返回 null,表示取不到有效值。 + GranularityType *string `json:"GranularityType,omitnil,omitempty" name:"GranularityType"` + + // 基准表 + // 注意:此字段可能返回 null,表示取不到有效值。 + BaseTable *string `json:"BaseTable,omitnil,omitempty" name:"BaseTable"` + + // 基准库 + // 注意:此字段可能返回 null,表示取不到有效值。 + BaseDb *string `json:"BaseDb,omitnil,omitempty" name:"BaseDb"` + + // 对比列 + // 注意:此字段可能返回 null,表示取不到有效值。 + ComparisonColumn *string `json:"ComparisonColumn,omitnil,omitempty" name:"ComparisonColumn"` + + // 对比列类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ComparisonColumnType *string `json:"ComparisonColumnType,omitnil,omitempty" name:"ComparisonColumnType"` + + // 保护组 + // 注意:此字段可能返回 null,表示取不到有效值。 + ProtectionValue *string `json:"ProtectionValue,omitnil,omitempty" name:"ProtectionValue"` + + // 正类值 + // 注意:此字段可能返回 null,表示取不到有效值。 + PositiveValue *string `json:"PositiveValue,omitnil,omitempty" name:"PositiveValue"` + + // 特征列 + // 注意:此字段可能返回 null,表示取不到有效值。 + FeatureColumn *string `json:"FeatureColumn,omitnil,omitempty" name:"FeatureColumn"` +} + type RuleGroupExecResult struct { // 规则组执行ID // 注意:此字段可能返回 null,表示取不到有效值。 @@ -34983,26 +35252,40 @@ type RuleGroupExecStrategy struct { DlcGroupName *string `json:"DlcGroupName,omitnil,omitempty" name:"DlcGroupName"` // 任务名称 + // 注意:此字段可能返回 null,表示取不到有效值。 RuleGroupName *string `json:"RuleGroupName,omitnil,omitempty" name:"RuleGroupName"` // 数据库名称 + // 注意:此字段可能返回 null,表示取不到有效值。 DatabaseName *string `json:"DatabaseName,omitnil,omitempty" name:"DatabaseName"` // schema名称 + // 注意:此字段可能返回 null,表示取不到有效值。 SchemaName *string `json:"SchemaName,omitnil,omitempty" name:"SchemaName"` // 表名称 + // 注意:此字段可能返回 null,表示取不到有效值。 TableName *string `json:"TableName,omitnil,omitempty" name:"TableName"` // 数据源id + // 注意:此字段可能返回 null,表示取不到有效值。 DatasourceId *string `json:"DatasourceId,omitnil,omitempty" name:"DatasourceId"` // 任务描述 + // 注意:此字段可能返回 null,表示取不到有效值。 Description *string `json:"Description,omitnil,omitempty" name:"Description"` // 时区 // 注意:此字段可能返回 null,表示取不到有效值。 ScheduleTimeZone *string `json:"ScheduleTimeZone,omitnil,omitempty" name:"ScheduleTimeZone"` + + // 任务监控参数 + // 注意:此字段可能返回 null,表示取不到有效值。 + GroupConfig *RuleGroupConfig `json:"GroupConfig,omitnil,omitempty" name:"GroupConfig"` + + // 引擎参数 + // 注意:此字段可能返回 null,表示取不到有效值。 + EngineParam *string `json:"EngineParam,omitnil,omitempty" name:"EngineParam"` } type RuleGroupPage struct { @@ -36217,6 +36500,10 @@ type SearchColumnDocVO struct { // 更新时间 // 注意:此字段可能返回 null,表示取不到有效值。 ModifiedTime *string `json:"ModifiedTime,omitnil,omitempty" name:"ModifiedTime"` + + // 字段使用说明 + // 注意:此字段可能返回 null,表示取不到有效值。 + Specification *string `json:"Specification,omitnil,omitempty" name:"Specification"` } type SearchCondition struct { @@ -36426,6 +36713,10 @@ type SqlExpression struct { // sql表达式字段名 // 注意:此字段可能返回 null,表示取不到有效值。 ParamExpressions []*string `json:"ParamExpressions,omitnil,omitempty" name:"ParamExpressions"` + + // 新增模型检测类系统模板sql中占位符集合 + // 注意:此字段可能返回 null,表示取不到有效值。 + SystemTemplateExpressions []*string `json:"SystemTemplateExpressions,omitnil,omitempty" name:"SystemTemplateExpressions"` } type SqlExpressionTable struct { @@ -38270,6 +38561,10 @@ type TagVoteSum struct { // 标签名 TagName *string `json:"TagName,omitnil,omitempty" name:"TagName"` + + // 标签描述 + // 注意:此字段可能返回 null,表示取不到有效值。 + TagDesc *string `json:"TagDesc,omitnil,omitempty" name:"TagDesc"` } type TaskAlarmInfo struct { @@ -39048,9 +39343,9 @@ type TaskDsDTO struct { // 注意:此字段可能返回 null,表示取不到有效值。 BundleId *string `json:"BundleId,omitnil,omitempty" name:"BundleId"` - // Bundle名称 + // bundle信息 // 注意:此字段可能返回 null,表示取不到有效值。 - BundleName *string `json:"BundleName,omitnil,omitempty" name:"BundleName"` + BundleInfo *string `json:"BundleInfo,omitnil,omitempty" name:"BundleInfo"` } type TaskExtDsVO struct { @@ -39194,7 +39489,7 @@ type TaskInfoVo struct { // 注意:此字段可能返回 null,表示取不到有效值。 EngineType *string `json:"EngineType,omitnil,omitempty" name:"EngineType"` - // 引擎名称 + // 引擎名称。在wedata侧若获取不到引擎名,则是wedata侧自动生成的标识,与集群侧的引擎名有可能不一致 // 注意:此字段可能返回 null,表示取不到有效值。 EngineName *string `json:"EngineName,omitnil,omitempty" name:"EngineName"` @@ -39202,7 +39497,8 @@ type TaskInfoVo struct { // 注意:此字段可能返回 null,表示取不到有效值。 EngineSubType *string `json:"EngineSubType,omitnil,omitempty" name:"EngineSubType"` - // 引擎taskId + // 引擎taskId,集成任务部分会使用资源组的资源运行任务,没有提交到引擎侧,所以没有引擎侧id + // // 注意:此字段可能返回 null,表示取不到有效值。 EngineTaskId *string `json:"EngineTaskId,omitnil,omitempty" name:"EngineTaskId"` @@ -39225,6 +39521,10 @@ type TaskInfoVo struct { // 数据来源,DATA_INTEGRATION、DATA_EXPLORATION、DATA_QUALITY、OM_CENTER等 // 注意:此字段可能返回 null,表示取不到有效值。 ProductSource *string `json:"ProductSource,omitnil,omitempty" name:"ProductSource"` + + // 集成任务的任务类型,表明是读端还是写端,可选择READ、WRITE + // 注意:此字段可能返回 null,表示取不到有效值。 + IntegrationType *string `json:"IntegrationType,omitnil,omitempty" name:"IntegrationType"` } type TaskInnerInfo struct { @@ -39887,6 +40187,10 @@ type TaskOpsDto struct { // 允许重跑类型,ALL 表示无论实例运行成功还是失败都允许重跑,NONE表示无论成功或者失败都不允许重跑,FAILURE 表示只有运行失败才能重跑 AllowRedoType *string `json:"AllowRedoType,omitnil,omitempty" name:"AllowRedoType"` + + // 负责人Id + // 注意:此字段可能返回 null,表示取不到有效值。 + OwnerId *string `json:"OwnerId,omitnil,omitempty" name:"OwnerId"` } type TaskScriptContent struct { @@ -40472,6 +40776,10 @@ type TestRunningRecord struct { // 结果或日志桶名 // 注意:此字段可能返回 null,表示取不到有效值。 BucketName *string `json:"BucketName,omitnil,omitempty" name:"BucketName"` + + // 错误信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + ErrorMessage *string `json:"ErrorMessage,omitnil,omitempty" name:"ErrorMessage"` } type TestRunningSubRecord struct { @@ -42156,6 +42464,14 @@ type WorkflowDsDTO struct { // 最近更新人id // 注意:此字段可能返回 null,表示取不到有效值。 UpdateUserId *string `json:"UpdateUserId,omitnil,omitempty" name:"UpdateUserId"` + + // BundleId CI/CD工程生成的bundle唯一标识 + // 注意:此字段可能返回 null,表示取不到有效值。 + BundleId *string `json:"BundleId,omitnil,omitempty" name:"BundleId"` + + // BundleId信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + BundleInfo *string `json:"BundleInfo,omitnil,omitempty" name:"BundleInfo"` } type WorkflowExtOpsDto struct { diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806/models.go index 2b6e51c34d..4acd9a4cdd 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806/models.go @@ -969,6 +969,7 @@ type CreateDataSourceRequestParams struct { // - GDB // - TDENGINE // - TDSQLC + // - FileSystem Type *string `json:"Type,omitnil,omitempty" name:"Type"` // 数据源的配置信息,以JSON KV存储,根据每个数据源类型不同,而KV存储信息不同 @@ -1170,6 +1171,7 @@ type CreateDataSourceRequest struct { // - GDB // - TDENGINE // - TDSQLC + // - FileSystem Type *string `json:"Type,omitnil,omitempty" name:"Type"` // 数据源的配置信息,以JSON KV存储,根据每个数据源类型不同,而KV存储信息不同 @@ -1491,7 +1493,7 @@ type CreateProjectMemberRequestParams struct { ProjectId *string `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` // 用户id - UseUins []*string `json:"UseUins,omitnil,omitempty" name:"UseUins"` + UserUins []*string `json:"UserUins,omitnil,omitempty" name:"UserUins"` // 角色id RoleIds []*string `json:"RoleIds,omitnil,omitempty" name:"RoleIds"` @@ -1504,7 +1506,7 @@ type CreateProjectMemberRequest struct { ProjectId *string `json:"ProjectId,omitnil,omitempty" name:"ProjectId"` // 用户id - UseUins []*string `json:"UseUins,omitnil,omitempty" name:"UseUins"` + UserUins []*string `json:"UserUins,omitnil,omitempty" name:"UserUins"` // 角色id RoleIds []*string `json:"RoleIds,omitnil,omitempty" name:"RoleIds"` @@ -1523,7 +1525,7 @@ func (r *CreateProjectMemberRequest) FromJsonString(s string) error { return err } delete(f, "ProjectId") - delete(f, "UseUins") + delete(f, "UserUins") delete(f, "RoleIds") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateProjectMemberRequest has unknown keys!", "") @@ -8592,7 +8594,7 @@ func (r *ListResourceFoldersResponse) FromJsonString(s string) error { // Predefined struct for user type ListResourceGroupsRequestParams struct { - // 执行资源组类型,不能为空 + // 执行资源组类型 // // - Schedule --- 调度资源组 // - Integration --- 集成资源组 @@ -8618,7 +8620,7 @@ type ListResourceGroupsRequestParams struct { type ListResourceGroupsRequest struct { *tchttp.BaseRequest - // 执行资源组类型,不能为空 + // 执行资源组类型 // // - Schedule --- 调度资源组 // - Integration --- 集成资源组 diff --git a/vendor/modules.txt b/vendor/modules.txt index ac92df79b7..7ff1016e53 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.40 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.42 ## explicit; go 1.11 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors @@ -1359,7 +1359,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf v1.0.1170 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf/v20180125 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.40 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.1.42 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20210820 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806 diff --git a/website/docs/d/wedata_data_sources.html.markdown b/website/docs/d/wedata_data_sources.html.markdown new file mode 100644 index 0000000000..bb8864e9c6 --- /dev/null +++ b/website/docs/d/wedata_data_sources.html.markdown @@ -0,0 +1,116 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_data_sources" +sidebar_current: "docs-tencentcloud-datasource-wedata_data_sources" +description: |- + Use this data source to query detailed information of WeData data sources +--- + +# tencentcloud_wedata_data_sources + +Use this data source to query detailed information of WeData data sources + +## Example Usage + +```hcl +data "tencentcloud_wedata_data_sources" "example" { + project_id = "2982667120655491072" + name = "tf_example" + display_name = "display_name" + type = ["MYSQL", "ORACLE"] + creator = "user" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `project_id` - (Required, String) Project ID. +* `creator` - (Optional, String) Creator. +* `display_name` - (Optional, String) Data source display name. +* `name` - (Optional, String) Data source name. +* `result_output_file` - (Optional, String) Used to save results. +* `type` - (Optional, Set: [`String`]) Data source type: enumeration values. + +- MYSQL +- TENCENT_MYSQL +- POSTGRE +- ORACLE +- SQLSERVER +- FTP +- HIVE +- HUDI +- HDFS +- ICEBERG +- KAFKA +- HBASE +- SPARK +- VIRTUAL +- TBASE +- DB2 +- DM +- GAUSSDB +- GBASE +- IMPALA +- ES +- TENCENT_ES +- GREENPLUM +- PHOENIX +- SAP_HANA +- SFTP +- OCEANBASE +- CLICKHOUSE +- KUDU +- VERTICA +- REDIS +- COS +- DLC +- DORIS +- CKAFKA +- S3 +- TDSQL +- TDSQL_MYSQL +- MONGODB +- TENCENT_MONGODB +- REST_API +- SuperSQL +- PRESTO +- TiDB +- StarRocks +- Trino +- Kyuubi +- TCHOUSE_X +- TCHOUSE_P +- TCHOUSE_C +- TCHOUSE_D +- INFLUXDB +- BIG_QUERY +- SSH +- BLOB. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `items` - Data source list. + * `category` - Data source category: + +- DB - custom source +- CLUSTER - system source. + * `create_time` - Time. + * `create_user` - Data source creator. + * `description` - Data source description information. + * `dev_con_properties` - Same as params, contains data for development data source. + * `display_name` - Data source display name, for visual viewing. + * `id` - Data source ID. + * `modify_time` - Modification time. + * `modify_user` - Modifier. + * `name` - Data source name. + * `prod_con_properties` - Data source configuration information, stored in JSON KV format, varies by data source type. + * `project_id` - Belonging project ID. + * `project_name` - Belonging project name. + * `type` - Data source type: enumeration values. + + diff --git a/website/docs/d/wedata_project_roles.html.markdown b/website/docs/d/wedata_project_roles.html.markdown new file mode 100644 index 0000000000..0677d5474f --- /dev/null +++ b/website/docs/d/wedata_project_roles.html.markdown @@ -0,0 +1,41 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_project_roles" +sidebar_current: "docs-tencentcloud-datasource-wedata_project_roles" +description: |- + Use this data source to query detailed information of WeData project roles +--- + +# tencentcloud_wedata_project_roles + +Use this data source to query detailed information of WeData project roles + +## Example Usage + +```hcl +data "tencentcloud_wedata_project_roles" "example" { + project_id = "2982667120655491072" + role_display_name = "tf_example" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `project_id` - (Required, String) Project ID. +* `result_output_file` - (Optional, String) Used to save results. +* `role_display_name` - (Optional, String) Role Chinese display name fuzzy search, can only pass one value. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `items` - Role information. + * `description` - Description. + * `role_display_name` - Role display name. + * `role_id` - Role ID. + * `role_name` - Role name. + + diff --git a/website/docs/d/wedata_projects.html.markdown b/website/docs/d/wedata_projects.html.markdown new file mode 100644 index 0000000000..54383b8617 --- /dev/null +++ b/website/docs/d/wedata_projects.html.markdown @@ -0,0 +1,62 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_projects" +sidebar_current: "docs-tencentcloud-datasource-wedata_projects" +description: |- + Use this data source to query detailed information of WeData projects +--- + +# tencentcloud_wedata_projects + +Use this data source to query detailed information of WeData projects + +## Example Usage + +### Query all projects + +```hcl +data "tencentcloud_wedata_projects" "example" {} +``` + +### Query projects by filter + +```hcl +data "tencentcloud_wedata_projects" "example" { + project_ids = [ + "2982667120655491072", + "2853989879663501312" + ] + + project_name = "tf_example" + status = 1 + project_model = "SIMPLE" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `project_ids` - (Optional, Set: [`String`]) List of project IDs. +* `project_model` - (Optional, String) Project model, optional values: SIMPLE, STANDARD. +* `project_name` - (Optional, String) Project name or unique identifier name, supports fuzzy search. +* `result_output_file` - (Optional, String) Used to save results. +* `status` - (Optional, Int) Project status, optional values: 0 (disabled), 1 (normal). + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `items` - List of data sources. + * `create_time` - Creation time. + * `creator_uin` - Project creator ID. + * `description` - Remarks. + * `display_name` - Project display name, can be Chinese name. + * `project_id` - Project ID. + * `project_model` - Project model, SIMPLE: simple mode, STANDARD: standard mode. + * `project_name` - Project identifier, English name. + * `project_owner_uin` - Project owner ID. + * `status` - Project status: 0: disabled, 1: enabled, -3: disabling, 2: enabling. + + diff --git a/website/docs/d/wedata_resource_group_metrics.html.markdown b/website/docs/d/wedata_resource_group_metrics.html.markdown new file mode 100644 index 0000000000..410d17b746 --- /dev/null +++ b/website/docs/d/wedata_resource_group_metrics.html.markdown @@ -0,0 +1,81 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_resource_group_metrics" +sidebar_current: "docs-tencentcloud-datasource-wedata_resource_group_metrics" +description: |- + Use this data source to query detailed information of WeData resource group metrics +--- + +# tencentcloud_wedata_resource_group_metrics + +Use this data source to query detailed information of WeData resource group metrics + +## Example Usage + +```hcl +data "tencentcloud_wedata_resource_group_metrics" "example" { + resource_group_id = "20250909193110713075" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `resource_group_id` - (Required, String) Execution resource group ID. +* `end_time` - (Optional, Int) Usage trend end time (milliseconds), default to current time. +* `granularity` - (Optional, Int) Metric collection granularity, unit in minutes, default 1 minute. +* `metric_type` - (Optional, String) Metric dimension. + +- all --- All +- task --- Task metrics +- system --- System metrics. +* `result_output_file` - (Optional, String) Used to save results. +* `start_time` - (Optional, Int) Usage trend start time (milliseconds), default to the last hour. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `data` - Execution group metric information. + * `cpu_num` - Resource group specification related: CPU count. + * `disk_volume` - Resource group specification related: disk specification. + * `life_cycle` - Resource group lifecycle, unit: days. + * `maximum_concurrency` - Resource group specification related: maximum concurrency. + * `mem_size` - Resource group specification related: memory size, unit: G. + * `metric_snapshots` - Metric details. + * `metric_name` - Metric name. + +- ConcurrencyUsage --- Concurrency usage rate +- CpuCoreUsage --- CPU usage rate +- CpuLoad --- CPU load +- DevelopQueueTask --- Number of development tasks in queue +- DevelopRunningTask --- Number of running development tasks +- DevelopSchedulingTask --- Number of scheduling development tasks +- DiskUsage --- Disk usage +- DiskUsed --- Disk used amount +- MaximumConcurrency --- Maximum concurrency +- MemoryLoad --- Memory load +- MemoryUsage --- Memory usage. + * `snapshot_value` - Current value. + * `trend_list` - Metric trend. + * `timestamp` - Timestamp. + * `value` - Metric value. + * `status` - Resource group status. + +- 0 --- Initializing +- 1 --- Running +- 2 --- Running abnormally +- 3 --- Releasing +- 4 --- Released +- 5 --- Creating +- 6 --- Creation failed +- 7 --- Updating +- 8 --- Update failed +- 9 --- Expired +- 10 --- Release failed +- 11 --- In use +- 12 --- Not in use. + + diff --git a/website/docs/d/wedata_tenant_roles.html.markdown b/website/docs/d/wedata_tenant_roles.html.markdown new file mode 100644 index 0000000000..0ab9eb37f1 --- /dev/null +++ b/website/docs/d/wedata_tenant_roles.html.markdown @@ -0,0 +1,39 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_tenant_roles" +sidebar_current: "docs-tencentcloud-datasource-wedata_tenant_roles" +description: |- + Use this data source to query detailed information of WeData tenant roles +--- + +# tencentcloud_wedata_tenant_roles + +Use this data source to query detailed information of WeData tenant roles + +## Example Usage + +```hcl +data "tencentcloud_wedata_tenant_roles" "example" { + role_display_name = "tf_example" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `result_output_file` - (Optional, String) Used to save results. +* `role_display_name` - (Optional, String) Role Chinese display name fuzzy search, can only pass one value. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `data` - Main account role list. + * `description` - Description. + * `role_display_name` - Role display name. + * `role_id` - Role ID. + * `role_name` - Role name. + + diff --git a/website/docs/r/wedata_project.html.markdown b/website/docs/r/wedata_project.html.markdown new file mode 100644 index 0000000000..460c3d80aa --- /dev/null +++ b/website/docs/r/wedata_project.html.markdown @@ -0,0 +1,82 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_project" +sidebar_current: "docs-tencentcloud-resource-wedata_project" +description: |- + Provides a resource to create a WeData project +--- + +# tencentcloud_wedata_project + +Provides a resource to create a WeData project + +~> **NOTE:** Currently, executing the `terraform destroy` command to delete this resource is not supported. If you need to destroy it, please contact Tencent Cloud Wedata through a ticket. + +## Example Usage + +```hcl +resource "tencentcloud_wedata_project" "example" { + project { + project_name = "tf_example" + display_name = "display_name" + project_model = "SIMPLE" + } + + dlc_info { + compute_resources = ["svmgao_stability"] + region = "ap-guangzhou" + default_database = "db_name" + standard_mode_env_tag = "Dev" + access_account = "OWNER" + } + + resource_ids = [ + "20250909193110713075", + "20250820215449817917" + ] + + status = 1 +} +``` + +## Argument Reference + +The following arguments are supported: + +* `project` - (Required, List) Project basic information. +* `dlc_info` - (Optional, List) DLC binding cluster information. +* `resource_ids` - (Optional, Set: [`String`]) List of bound resource group IDs. +* `status` - (Optional, Int) Item status: 0: disabled, 1: enabled. + +The `dlc_info` object supports the following: + +* `compute_resources` - (Required, Set) DLC resource name (need to add role Uin to DLC, otherwise may not be able to obtain resources). +* `default_database` - (Required, String) Specify the default database for DLC cluster. +* `region` - (Required, String) DLC region. +* `access_account` - (Optional, String) Access account (only effective for standard mode projects and required for standard mode), used to submit DLC tasks. +It is recommended to use a specified sub-account and set corresponding database table permissions for the sub-account; task runner mode may cause task failure when the responsible person leaves; main account mode is not easy for permission control when multiple projects have different permissions. + +Enum values: +- TASK_RUNNER (Task Runner) +- OWNER (Main Account Mode) +- SUB (Sub Account Mode). +* `standard_mode_env_tag` - (Optional, String) Cluster configuration tag (only effective for standard mode projects and required for standard mode). Enum values: +- Prod (Production environment) +- Dev (Development environment). +* `sub_account_uin` - (Optional, String) Sub-account ID (only effective for standard mode projects), when AccessAccount is in sub-account mode, the sub-account ID information needs to be specified, other modes do not need to be specified. + +The `project` object supports the following: + +* `display_name` - (Required, String, ForceNew) Project display name, can be Chinese name starting with a letter, can contain letters, numbers, and underscores, cannot exceed 32 characters. +* `project_name` - (Required, String) Project identifier, English name starting with a letter, can contain letters, numbers, and underscores, cannot exceed 32 characters. +* `project_model` - (Optional, String, ForceNew) Project mode, SIMPLE (default): Simple mode STANDARD: Standard mode. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `project_id` - Project ID. + + diff --git a/website/docs/r/wedata_project_member.html.markdown b/website/docs/r/wedata_project_member.html.markdown new file mode 100644 index 0000000000..26c203571e --- /dev/null +++ b/website/docs/r/wedata_project_member.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_project_member" +sidebar_current: "docs-tencentcloud-resource-wedata_project_member" +description: |- + Provides a resource to create a WeData project member +--- + +# tencentcloud_wedata_project_member + +Provides a resource to create a WeData project member + +~> **NOTE:** This resource must exclusive in one share unit, do not declare additional roleIds resources of this project member elsewhere. + +## Example Usage + +```hcl +resource "tencentcloud_wedata_project" "example" { + project { + project_name = "tf_example" + display_name = "display_name" + project_model = "SIMPLE" + } + + dlc_info { + compute_resources = ["svmgao_stability"] + region = "ap-guangzhou" + default_database = "db_name" + standard_mode_env_tag = "Dev" + access_account = "OWNER" + } + + resource_ids = [ + "20250909193110713075", + "20250820215449817917" + ] + + status = 1 +} + +resource "tencentcloud_wedata_project_member" "example" { + project_id = tencentcloud_wedata_project.example.id + user_uin = "100044238258" + role_ids = [ + "308335260274237440", + "308335260844662784" + ] +} +``` + +## Argument Reference + +The following arguments are supported: + +* `project_id` - (Required, String, ForceNew) Project ID. +* `role_ids` - (Required, Set: [`String`]) Role ID. +* `user_uin` - (Required, String, ForceNew) User ID. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +WeData project member can be imported using the projectId#userUin, e.g. + +``` +terraform import tencentcloud_wedata_project_member.example 2983848457986924544#100044238258 +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index fd3f77fda0..5fd2f650a5 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -7018,6 +7018,9 @@