-
Notifications
You must be signed in to change notification settings - Fork 536
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
Conversation
ValidateFunc: validation.StringInSlice([]string{"auto", "user", "all"}, false), | ||
Default: "all", | ||
}, | ||
"type": { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果有错误打印 log 就行, 不需要 return err, 需要查询其他符合要求的的继续删除
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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"}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有错误码连一块了
There was a problem hiding this comment.
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+. |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. | |||
|
There was a problem hiding this comment.
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
No description provided.