Skip to content

Commit 407209c

Browse files
committed
fix(dnspod): groupid parameter
1 parent 29497ff commit 407209c

File tree

3 files changed

+50
-52
lines changed

3 files changed

+50
-52
lines changed

tencentcloud/data_source_tc_dnspod_domain_list.go

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ Example Usage
55
66
```hcl
77
8-
data "tencentcloud_dnspod_domain_list" "domain_list" {
9-
type = "ALL"
10-
group_id = [1]
11-
# keyword = "keyword_demo"
12-
sort_field = "UPDATED_ON"
13-
sort_type = "DESC"
14-
status = ["PAUSE"]
15-
# package =
16-
remark = ""
17-
# updated_at_begin = "2021-05-01 03:00:00"
18-
# updated_at_end = "2021-05-10 20:00:00"
19-
# record_count_begin = 0
20-
# record_count_end = 100
21-
# project_id = -1
22-
tags = {
23-
"createdBy" = "terraform"
24-
}
8+
data "tencentcloud_dnspod_domain_list" "domain_list" {
9+
type = "ALL"
10+
group_id = [1]
11+
keyword = ""
12+
sort_field = "UPDATED_ON"
13+
sort_type = "DESC"
14+
status = ["PAUSE"]
15+
package = [""]
16+
remark = ""
17+
updated_at_begin = "2021-05-01 03:00:00"
18+
updated_at_end = "2024-05-10 20:00:00"
19+
record_count_begin = 0
20+
record_count_end = 100
21+
project_id = -1
22+
tags = {
23+
"createdBy" = "terraform"
2524
}
25+
}
2626
2727
```
2828
*/
@@ -299,13 +299,11 @@ func dataSourceTencentCloudDnspodDomainListRead(d *schema.ResourceData, meta int
299299
}
300300

301301
if v, ok := d.GetOk("group_id"); ok {
302-
paramMapGroupIdList := []interface{}{}
303-
groupIdSet := v.(*schema.Set).List()
304-
for i := range groupIdSet {
305-
groupId := groupIdSet[i].(int)
306-
paramMapGroupIdList = append(paramMapGroupIdList, helper.IntInt64(groupId))
302+
groupIds := make([]*int64, 0)
303+
for _, item := range v.(*schema.Set).List() {
304+
groupIds = append(groupIds, helper.IntInt64(item.(int)))
307305
}
308-
paramMap["GroupId"] = paramMapGroupIdList
306+
paramMap["GroupId"] = groupIds
309307
}
310308

311309
if v, ok := d.GetOk("keyword"); ok {

tencentcloud/data_source_tc_dnspod_domain_list_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ func TestAccTencentCloudDnspodDomainListDataSource_basic(t *testing.T) {
2525
const testAccDnspodDomain_listDataSource = `
2626
2727
data "tencentcloud_dnspod_domain_list" "domain_list" {
28-
type = "ALL"
29-
group_id = [1]
30-
# keyword = "keyword_demo"
31-
sort_field = "UPDATED_ON"
32-
sort_type = "DESC"
33-
status = ["PAUSE"]
34-
# package =
35-
remark = ""
36-
# updated_at_begin = "2021-05-01 03:00:00"
37-
# updated_at_end = "2021-05-10 20:00:00"
38-
# record_count_begin = 0
39-
# record_count_end = 100
40-
# project_id = -1
41-
tags = {
42-
"createdBy" = "terraform"
43-
}
28+
type = "ALL"
29+
group_id = [1]
30+
keyword = ""
31+
sort_field = "UPDATED_ON"
32+
sort_type = "DESC"
33+
status = ["PAUSE"]
34+
package = [""]
35+
remark = ""
36+
updated_at_begin = "2021-05-01 03:00:00"
37+
updated_at_end = "2024-05-10 20:00:00"
38+
record_count_begin = 0
39+
record_count_end = 100
40+
project_id = -1
41+
tags = {
42+
"createdBy" = "terraform"
43+
}
4444
}
4545
4646
`

website/docs/d/dnspod_domain_list.html.markdown

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ Use this data source to query detailed information of dnspod domain_list
1515

1616
```hcl
1717
data "tencentcloud_dnspod_domain_list" "domain_list" {
18-
type = "ALL"
19-
group_id = [1]
20-
# keyword = "keyword_demo"
21-
sort_field = "UPDATED_ON"
22-
sort_type = "DESC"
23-
status = ["PAUSE"]
24-
# package =
25-
remark = ""
26-
# updated_at_begin = "2021-05-01 03:00:00"
27-
# updated_at_end = "2021-05-10 20:00:00"
28-
# record_count_begin = 0
29-
# record_count_end = 100
30-
# project_id = -1
18+
type = "ALL"
19+
group_id = [1]
20+
keyword = ""
21+
sort_field = "UPDATED_ON"
22+
sort_type = "DESC"
23+
status = ["PAUSE"]
24+
package = [""]
25+
remark = ""
26+
updated_at_begin = "2021-05-01 03:00:00"
27+
updated_at_end = "2024-05-10 20:00:00"
28+
record_count_begin = 0
29+
record_count_end = 100
30+
project_id = -1
3131
tags = {
3232
"createdBy" = "terraform"
3333
}

0 commit comments

Comments
 (0)