Skip to content

Commit

Permalink
feat/cfw (#2169)
Browse files Browse the repository at this point in the history
* feat/cfw

* feat/cfw
  • Loading branch information
SevenEarth authored Oct 8, 2023
1 parent 5182b44 commit e4ff5da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/2169.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_cfw_sync_asset: Update operation status query interface
```
8 changes: 4 additions & 4 deletions tencentcloud/resource_tc_cfw_sync_asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func resourceTencentCloudCfwSyncAssetCreate(d *schema.ResourceData, meta interfa
var (
logId = getLogId(contextNil)
request = cfw.NewModifyAssetSyncRequest()
statusRequest = cfw.NewDescribeFwSyncStatusRequest()
statusRequest = cfw.NewDescribeAssetSyncRequest()
)

err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
Expand All @@ -57,16 +57,16 @@ func resourceTencentCloudCfwSyncAssetCreate(d *schema.ResourceData, meta interfa

// wait
err = resource.Retry(writeRetryTimeout, func() *resource.RetryError {
result, e := meta.(*TencentCloudClient).apiV3Conn.UseCfwClient().DescribeFwSyncStatus(statusRequest)
result, e := meta.(*TencentCloudClient).apiV3Conn.UseCfwClient().DescribeAssetSync(statusRequest)
if e != nil {
return retryError(e)
}

if *result.Response.SyncStatus == 0 {
if *result.Response.Status == 2 {
return nil
}

return resource.RetryableError(fmt.Errorf("The fw sync status is %d.", *result.Response.SyncStatus))
return resource.RetryableError(fmt.Errorf("The fw sync asset status is %d.", *result.Response.Status))
})

if err != nil {
Expand Down

0 comments on commit e4ff5da

Please sign in to comment.