Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3578.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_dts_sync_config: support `rate_limit_option`
```
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.45
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.46
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
Expand All @@ -57,7 +57,7 @@ require (
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dlc v1.1.35
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1056
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain v1.0.414
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.0.628
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.1.46
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/eb v1.1.30
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/emr v1.0.1115
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/es v1.1.13
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.42 h1:zOTQC
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.42/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.45 h1:aHdlXJIg0Ro2gNeBUFBP25t7zBLAJVpWVDRxGp6J7oE=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.45/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.46 h1:wWcfc+d0BJSGvLtIdPSLuN//KCgIhuWbjao68roZrzw=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.1.46/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=
Expand Down Expand Up @@ -1002,6 +1004,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain v1.0.414 h1:egwj
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/domain v1.0.414/go.mod h1:LRWnBUNRxs/Ee8MzJJd3eHzydlqyB5qmia975Ca/Ox0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.0.628 h1:cnhe9uh8tSyBfiPUckfqNI6t51YNZG9POupTrqWG9lM=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.0.628/go.mod h1:JxTXEld643DHk5HeQe4xIvuuoxsCmbTjgmE64Mtrdxw=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.1.46 h1:JWl2IK+vX/806sPABd6ejdgcNy4CKrtUJJa8Kp1gYLo=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts v1.1.46/go.mod h1:X1E1GJZG7GGpX0M69URtDEkf0ZfH9i92K4wLxPIIWaY=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/eb v1.1.30 h1:fuy1NhRyTbwMku0VS1/uFao77pK1HuLCqRRYVxow3Uk=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/eb v1.1.30/go.mod h1:ORMs9Hzzlrmsq0gqKdw+XBE0uMWA026Bsy3jvpCWdFA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/emr v1.0.1115 h1:hKzATWx2kZm32piKYM5WZLsHA1pWlDw9w7tNL6jo+0g=
Expand Down
164 changes: 164 additions & 0 deletions tencentcloud/services/dts/resource_tc_dts_sync_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,72 @@ func ResourceTencentCloudDtsSyncConfig() *schema.Resource {
},
},
},
"rate_limit_option": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Task speed limit information\nNote: This field may return null, indicating that no valid values can be obtained.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"current_dump_thread": {
Type: schema.TypeInt,
Required: true,
Description: "The number of full export threads currently in effect. The value of this field can be adjusted when configuring the task. Note: If it is not set or set to 0, it means the current value is maintained. The maximum value is 16.Note: This field may return null, indicating that no valid values can be obtained.",
},
"default_dump_thread": {
Type: schema.TypeInt,
Required: true,
Description: "The default number of full export threads. This field is only meaningful in the output parameter.Note: This field may return null, indicating that no valid values can be obtained.",
},
"current_dump_rps": {
Type: schema.TypeInt,
Required: true,
Description: "The full export Rps currently in effect. The value of this field can be adjusted when configuring the task. Note: If it is not set or set to 0, it means the current value is maintained. The maximum value is 50,000,000.Note: This field may return null, indicating that no valid values can be obtained.",
},
"default_dump_rps": {
Type: schema.TypeInt,
Required: true,
Description: "The default full export Rps. This field is only meaningful in the output parameter.Note: This field may return null, indicating that no valid values can be obtained.",
},
"current_load_thread": {
Type: schema.TypeInt,
Required: true,
Description: "The number of full import threads currently in effect. The value of this field can be adjusted when configuring the task. Note: If it is not set or set to 0, it means the current value is maintained. The maximum value is 16.Note: This field may return null, indicating that no valid values can be obtained.",
},
"default_load_thread": {
Type: schema.TypeInt,
Required: true,
Description: "The default number of full import threads. This field is only meaningful in the output parameter.Note: This field may return null, indicating that no valid values can be obtained.",
},
"current_load_rps": {
Type: schema.TypeInt,
Required: true,
Description: "The full import Rps currently in effect. The value of this field can be adjusted when configuring the task. Note: If it is not set or set to 0, it means the current value is maintained. The maximum value is 50,000,000.Note: This field may return null, indicating that no valid values can be obtained.",
},
"default_load_rps": {
Type: schema.TypeInt,
Required: true,
Description: "The default full import Rps. This field is only meaningful in the output parameter.Note: This field may return null, indicating that no valid values can be obtained.",
},
"current_sinker_thread": {
Type: schema.TypeInt,
Required: true,
Description: "The number of incremental import threads currently in effect. The value of this field can be adjusted when configuring the task. Note: If it is not set or set to 0, it means the current value is maintained. The maximum value is 128.Note: This field may return null, indicating that no valid values can be obtained.",
},
"default_sinker_thread": {
Type: schema.TypeInt,
Required: true,
Description: "The default number of incremental import threads. This field is only meaningful in the output parameter.\nNote: This field may return null, indicating that no valid values can be obtained.",
},
"has_user_set_rate_limit": {
Type: schema.TypeString,
Required: true,
Description: "enum:\"no\"/\"yes\", no: the user has not set a speed limit; yes: a speed limit has been set. This field is only meaningful in the output parameter.Note: This field may return null, indicating that no valid values can be obtained.",
},
},
},
},
},
},
},
Expand Down Expand Up @@ -747,6 +813,55 @@ func resourceTencentCloudDtsSyncConfigRead(d *schema.ResourceData, meta interfac
optionsMap["ddl_options"] = ddlOptionsList
}

if syncConfig.Options.RateLimitOption != nil {
rateLimitOptionMap := map[string]interface{}{}
if syncConfig.Options.RateLimitOption.CurrentDumpThread != nil {
rateLimitOptionMap["current_dump_thread"] = syncConfig.Options.RateLimitOption.CurrentDumpThread
}

if syncConfig.Options.RateLimitOption.DefaultDumpThread != nil {
rateLimitOptionMap["default_dump_thread"] = syncConfig.Options.RateLimitOption.DefaultDumpThread
}

if syncConfig.Options.RateLimitOption.CurrentDumpRps != nil {
rateLimitOptionMap["current_dump_rps"] = syncConfig.Options.RateLimitOption.CurrentDumpRps
}

if syncConfig.Options.RateLimitOption.DefaultDumpRps != nil {
rateLimitOptionMap["default_dump_rps"] = syncConfig.Options.RateLimitOption.DefaultDumpRps
}

if syncConfig.Options.RateLimitOption.CurrentLoadThread != nil {
rateLimitOptionMap["current_load_thread"] = syncConfig.Options.RateLimitOption.CurrentLoadThread
}

if syncConfig.Options.RateLimitOption.DefaultLoadThread != nil {
rateLimitOptionMap["default_load_thread"] = syncConfig.Options.RateLimitOption.DefaultLoadThread
}

if syncConfig.Options.RateLimitOption.CurrentLoadRps != nil {
rateLimitOptionMap["current_load_rps"] = syncConfig.Options.RateLimitOption.CurrentLoadRps
}

if syncConfig.Options.RateLimitOption.DefaultLoadRps != nil {
rateLimitOptionMap["default_load_rps"] = syncConfig.Options.RateLimitOption.DefaultLoadRps
}

if syncConfig.Options.RateLimitOption.CurrentSinkerThread != nil {
rateLimitOptionMap["current_sinker_thread"] = syncConfig.Options.RateLimitOption.CurrentSinkerThread
}

if syncConfig.Options.RateLimitOption.DefaultSinkerThread != nil {
rateLimitOptionMap["default_sinker_thread"] = syncConfig.Options.RateLimitOption.DefaultSinkerThread
}

if syncConfig.Options.RateLimitOption.HasUserSetRateLimit != nil {
rateLimitOptionMap["has_user_set_rate_limit"] = syncConfig.Options.RateLimitOption.HasUserSetRateLimit
}

optionsMap["rate_limit_option"] = []interface{}{rateLimitOptionMap}
}

_ = d.Set("options", []interface{}{optionsMap})
}

Expand Down Expand Up @@ -1215,6 +1330,55 @@ func resourceTencentCloudDtsSyncConfigUpdate(d *schema.ResourceData, meta interf
options.DdlOptions = append(options.DdlOptions, &ddlOption)
}
}
if rateLimitOptionMap, ok := helper.InterfaceToMap(dMap, "rate_limit_option"); ok {
rateLimitOption := dts.RateLimitOption{}
if v, ok := rateLimitOptionMap["current_dump_thread"].(int); ok {
rateLimitOption.CurrentDumpThread = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["default_dump_thread"].(int); ok {
rateLimitOption.DefaultDumpThread = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["current_dump_rps"].(int); ok {
rateLimitOption.CurrentDumpRps = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["default_dump_rps"].(int); ok {
rateLimitOption.DefaultDumpRps = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["current_load_thread"].(int); ok {
rateLimitOption.CurrentLoadThread = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["default_load_thread"].(int); ok {
rateLimitOption.DefaultLoadThread = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["current_load_rps"].(int); ok {
rateLimitOption.CurrentLoadRps = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["default_load_rps"].(int); ok {
rateLimitOption.DefaultLoadRps = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["current_sinker_thread"].(int); ok {
rateLimitOption.CurrentSinkerThread = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["default_sinker_thread"].(int); ok {
rateLimitOption.DefaultSinkerThread = helper.IntInt64(v)
}

if v, ok := rateLimitOptionMap["has_user_set_rate_limit"].(string); ok && v != "" {
rateLimitOption.HasUserSetRateLimit = helper.String(v)
}

options.RateLimitOption = &rateLimitOption
}

request.Options = &options
}

Expand Down
Loading
Loading