Skip to content

Commit 42e32a8

Browse files
committed
add changelog
1 parent 2887e9e commit 42e32a8

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## 1.39.0 (Unreleased)
22

33
ENHANCEMENTS:
4+
5+
* Data Source: `tencentcloud_images` supports list of snapshots.
46
* Resource: `tencentcloud_kubernetes_cluster_attachment` add new argument `worker_config` to support config with existing instances.
57

68
## 1.38.2 (July 03, 2020)

tencentcloud/service_tencentcloud_cbs.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,23 @@ func (me *CbsService) DescribeSnapshotById(ctx context.Context, snapshotId strin
228228
}
229229

230230
func (me *CbsService) DescribeSnapshotByIds(ctx context.Context, snapshotIdsParam []*string) (snapshots []*cbs.Snapshot, errRet error) {
231-
logId := getLogId(ctx)
232-
request := cbs.NewDescribeSnapshotsRequest()
233231
if len(snapshotIdsParam) == 0 {
234232
return
235233
}
234+
235+
var (
236+
logId = getLogId(ctx)
237+
request = cbs.NewDescribeSnapshotsRequest()
238+
err error
239+
response *cbs.DescribeSnapshotsResponse
240+
offset, pageSize uint64 = 0, 100
241+
)
236242
request.SnapshotIds = snapshotIdsParam
237243

238-
offset := 0
239-
pageSize := 100
240244
for {
241-
request.Offset = helper.IntUint64(offset)
242-
request.Limit = helper.IntUint64(pageSize)
245+
request.Offset = &offset
246+
request.Limit = &pageSize
243247

244-
var err error
245-
var response *cbs.DescribeSnapshotsResponse
246248
err = resource.Retry(readRetryTimeout, func() *resource.RetryError {
247249
ratelimit.Check(request.GetAction())
248250
response, err = me.client.UseCbsClient().DescribeSnapshots(request)
@@ -263,7 +265,7 @@ func (me *CbsService) DescribeSnapshotByIds(ctx context.Context, snapshotIdsPara
263265
}
264266

265267
snapshots = append(snapshots, response.Response.SnapshotSet...)
266-
if len(response.Response.SnapshotSet) < pageSize {
268+
if len(response.Response.SnapshotSet) < int(pageSize) {
267269
break
268270
}
269271
offset += pageSize

0 commit comments

Comments
 (0)