跳到主要内容

ecs auto-snapshot-policy

管理自动快照策略

运行 ecctl ecs auto-snapshot-policy <action> -h 查看用法,或 ecctl schema ecs.auto-snapshot-policy.<action> --full 获取该命令完整的结构化规格——每个参数与行为,便于 Agent 读取和填参。

create

ecctl ecs auto-snapshot-policy create [flags]

创建自动快照策略

  • 类型:mutation · 风险:medium
API调用时机用途
CreateAutoSnapshotPolicy每次执行命令时执行资源操作。
DescribeAutoSnapshotPolicyEx未指定 --no-wait读取资源视图。
参数类型必填说明
--regionstringAlibaba Cloud region
--repeat-weekdaysstring重复执行的星期 JSON 数组,例如 '["1","7"]'
--retention-daysinteger快照保留天数(-1 表示永久保留)
--time-pointsstring创建快照的时间点 JSON 数组,例如 '["0","12"]'
--copied-snapshots-retention-daysinteger跨地域复制快照的保留天数
--enable-cross-region-copyboolean启用跨地域快照复制
--namestring自动快照策略名称
--resource-groupstring资源组 ID
--tagkey_value标签赋值 key=value
--target-copy-regionsstring跨地域复制的目标地域 JSON 数组

update

ecctl ecs auto-snapshot-policy update <id> [flags]

更新自动快照策略或其云盘关联

  • 类型:mutation · 风险:medium
API调用时机用途
ModifyAutoSnapshotPolicyEx指定 --name 或指定 --time-points 或指定 --repeat-weekdays 或指定 --retention-days 或指定 --copied-snapshots-retention-days 或指定 --enable-cross-region-copy 或指定 --target-copy-regions执行资源操作。
ApplyAutoSnapshotPolicy指定 --attach-disk-id执行资源操作。
CancelAutoSnapshotPolicy指定 --detach-disk-id执行资源操作。
DescribeAutoSnapshotPolicyEx未指定 --no-wait读取资源视图。
DescribeAutoSnapshotPolicyAssociations指定 --with-associations 且未指定 --no-wait读取资源视图。
参数类型必填说明
--regionstringAlibaba Cloud region
--attach-disk-idarray应用该策略的云盘 ID 列表
--copied-snapshots-retention-daysinteger跨地域复制快照的保留天数
--detach-disk-idarray取消该策略的云盘 ID 列表
--enable-cross-region-copyboolean启用跨地域快照复制
--namestring自动快照策略名称
--repeat-weekdaysstring重复执行的星期 JSON 数组,例如 '["1","7"]'
--retention-daysinteger快照保留天数(-1 表示永久保留)
--target-copy-regionsstring跨地域复制的目标地域 JSON 数组
--time-pointsstring创建快照的时间点 JSON 数组,例如 '["0","12"]'
--with-associationsboolean附带云盘关联关系

delete

ecctl ecs auto-snapshot-policy delete <id> [flags]

删除自动快照策略

  • 类型:mutation · 风险:high
API调用时机用途
DeleteAutoSnapshotPolicy每次执行命令时执行资源操作。
参数类型必填说明
--regionstringAlibaba Cloud region

get

ecctl ecs auto-snapshot-policy get <id> [flags]

获取自动快照策略

  • 类型:read · 风险:low
API调用时机用途
DescribeAutoSnapshotPolicyEx每次执行命令时读取资源视图。
DescribeAutoSnapshotPolicyAssociations指定 --with-associations读取资源视图。
参数类型必填说明
--regionstringAlibaba Cloud region
--fieldsstring要包含的资源字段,使用逗号分隔
--with-associationsboolean附带云盘关联关系

list

ecctl ecs auto-snapshot-policy list <id> [flags]

列出自动快照策略

  • 类型:read · 风险:low
API调用时机用途
DescribeAutoSnapshotPolicyEx每次执行命令时读取资源视图。
参数类型必填说明
--regionstringAlibaba Cloud region
--fieldsstring要包含的资源字段,使用逗号分隔
--filterkey_value过滤表达式 key=value
--limitinteger最多返回资源数量(默认:100
--pageinteger返回结果页码(默认:1