Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/alicloud_ecs_snapshot: Deprecates the name and use snapshot_name instead; Adds more attributes; Upgrades the its dependence sdk #3403

Merged
merged 1 commit into from
Apr 2, 2021

Conversation

lixue323
Copy link
Contributor

@lixue323 lixue323 commented Apr 1, 2021

No description provided.

ValidateFunc: validation.StringInSlice([]string{"auto", "user", "all"}, false),
Default: "all",
},
"type": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type 在下面没有使用到

return WrapErrorf(err, IdMsg, d.Id())
}

return resourceAlicloudEcsSnapshotUpdate(d, meta)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有需要在update中设置的参数, 应该走read

if err != nil {
return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_ecs_snapshot", action, AlibabaCloudSdkGoERROR)
}
addDebug(action, response, request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug 信息不需要

runtime.SetAutoretry(true)
response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2014-05-26"), StringPointer("AK"), nil, request, &runtime)
if err != nil {
return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_ecs_snapshot", action, AlibabaCloudSdkGoERROR)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果有错误打印 log 就行, 不需要 return err, 需要查询其他符合要求的的继续删除

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

查询接口报错!错误需要抛出来,没办法继续往下走

Delete: schema.DefaultTimeout(2 * time.Minute),
},
Schema: map[string]*schema.Schema{
"category": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

category 枚举值

Required: true,
ForceNew: true,
},
"name": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name 没有兼容

runtime.SetAutoretry(true)
response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2014-05-26"), StringPointer("AK"), nil, request, &runtime)
if err != nil {
if IsExpectedErrors(err, []string{"InvalidFilterKey.NotFound", "InvalidFilterValue", "InvalidSnapshotIds.Malformed,InvalidStatus.NotFound,InvalidSnapshotType.NotFound", "InvalidSnapshotLinkId.NotFound", "InvalidSnapshotType.NotFound", "InvalidSourceDiskType", "InvalidStatus.NotFound", "InvalidUsage"}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有错误码连一块了

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那就是正常的错误码


This data source provides the Ecs Snapshots of the current Alibaba Cloud user.

-> **NOTE:** Available in v1.121.0+.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

版本 120

Optional: true,
Default: false,
},
"instant_access": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instant_access 枚举值, 默认值

Type: schema.TypeBool,
Optional: true,
},
"instant_access_retention_days": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instant_access_retention_days 范围值


The following arguments are supported:

* `category` - (Optional, ForceNew) The category of the snapshot.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档中属性的枚举值描述补充下

@@ -9,6 +9,8 @@ description: |-

# alicloud\_snapshots

-> **DEPRECATED:** This datasource has been renamed to [alicloud_ecs_snapshots](https://www.terraform.io/docs/providers/alicloud/d/ecs_snapshots.html) from version 1.121.0.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataSource 和 resource 文档弃用版本 1.120.0

@xiaozhu36 xiaozhu36 changed the title change ecs snapshot to common from amp. resource/alicloud_ecs_snapshot: Deprecates the name and use snapshot_name instead; Adds more attributes; Upgrades the its dependence sdk Apr 2, 2021
@xiaozhu36 xiaozhu36 merged commit 4cb2a54 into aliyun:master Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants