ResetDisks - 批量重置磁盘

更新时间:
复制 MD 格式

调用ResetDisks通过实例快照回滚一个或多个云盘。

接口说明

该接口即将废弃,建议您使用 ResetDisk 回滚云盘。调用前,请确保待回滚云盘所挂载的 ECS 实例处于已停止(Stopped)状态。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

ecs:ResetDisks

update

*Disk

acs:ecs:{#regionId}:{#accountId}:disk/{#diskId}

*Snapshot

acs:ecs:{#regionId}:{#accountId}:snapshot/{#snapshotId}

无 无

请求参数

名称

类型

必填

描述

示例值

RegionId

string

是

地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

cn-hangzhou

DryRun

boolean

否

是否预检本次请求。取值范围:

  • true:发送检查请求,不会直接回滚云盘。检查项包括是否填写了必选参数、请求格式和资源状态限制。如果检查不通过,则返回对应错误信息。如果检查通过,则返回错误码DryRunOperation。

  • false:发送正常请求,通过检查后直接发起云盘回滚操作。

默认值:false。

false

Disk

array<object>

是

云盘列表。

object

否

DiskId

string

否

指定待回滚的云盘 ID。N 的取值范围为 1~10。

d-j6cf7l0ewidb78lq****

SnapshotId

string

否

实例快照中,指定云盘对应的快照 ID。N 的取值范围为 1~10。

s-j6cdofbycydvg7ey****

返回参数

名称

类型

描述

示例值

object

OperationProgressSet

object

OperationProgress

array<object>

回滚一个或多个云盘时的操作状态信息合集。

array<object>

ErrorCode

string

错误码。回滚成功时返回空值。

错误码和错误信息,请参见错误中心。

400

ErrorMsg

string

错误信息。回滚成功时返回空值。

错误码和错误信息,请参见错误中心。

testErrorMsg

OperationStatus

string

操作是否成功。 成功返回 Success,失败返回 ErrorCode 和 ErrorMsg 信息。

Success

RelatedItemSet

object

RelatedItem

array<object>

资源信息。

object

Name

string

资源名称。

SnapshotId

Value

string

资源 ID。

s-j6cdofbycydvg7ey****

RequestId

string

请求 ID。

3D66C85C-AA97-4A00-B0ED-2D9A80FE782C

示例

正常返回示例

JSON格式

{
  "OperationProgressSet": {
    "OperationProgress": [
      {
        "ErrorCode": "400",
        "ErrorMsg": "testErrorMsg",
        "OperationStatus": "Success",
        "RelatedItemSet": {
          "RelatedItem": [
            {
              "Name": "SnapshotId",
              "Value": "s-j6cdofbycydvg7ey****"
            }
          ]
        }
      }
    ]
  },
  "RequestId": "3D66C85C-AA97-4A00-B0ED-2D9A80FE782C"
}

错误码

HTTP status code

错误码

错误信息

描述

400 DiskCategory.OperationNotSupported The disk category of the specified disk does not support the current operation. Please check the operations supported by the disk category and try again.
400 InvalidRegionId.MalFormed The specified RegionId is not valid.
400 DryRunOperation Request validation has been passed with DryRun flag set. 通过“DryRun”校验,您的请求已通过验证。
500 InternalError The request processing has failed due to an internal error and you may retry later or contact support with the request ID.
403 IncorrectDiskStatus The current disk status does not support this operation.
403 IncorrectInstanceStatus The current status of the resource does not support this operation.
403 InstanceLockedForSecurity The instance is locked due to security. 您的资源被安全锁定,拒绝操作。
403 InvalidParameter.Mismatch The specified snapshot is not created from the specified disk.
403 InvalidSnapshot.TooOld The snapshot was created before 2013-07-15 and cannot be restored since the disk was first detached.
403 InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).
403 OperationDenied The specified snapshot dees not support ResetDisk.
403 InvalidSnapshotId.NotReady The creation of the specified snapshot is still in progress. Please wait for it to complete and try again.
403 InvalidAccountStatus.SnapshotServiceUnavailable The snapshot service has not been activated. Please activate it and try again.
403 Operation.Conflict The operation may conflict with others. Please retry later.
403 UserNotInTheWhiteList The user is not in disk white list. 您不在磁盘白名单中,请加入白名单后重试。
403 InvalidParameter.KMSKeyId.CMKUnauthorized The CMK has not authorized the ECS service to perform the KMS TagResource and UntagResource operations. Please verify the authorization and try again.
403 InvalidParameter.KMSKeyId.CMKNotEnabled The CMK needs to be enabled.
403 InvalidParameter.KMSKeyId.KMSUnauthorized ECS service does not have permission to access your KMS key. Please verify that the specified KMS key has authorized the ECS service.
403 IncorrectDiskStatus.HasUnfinishedSnapshot The current disk has unfinished snapshot. 当前磁盘有未完成快照。
403 InvalidRegion.NotSupport The specified region does not support resetting disks.
403 InvalidOperation.MultiAttachDisk The specified multi-attach disk does not support the current operation. Please select another disk and try again.
403 InvalidDisk.ShareVolume The specified diskId is invalid. The shared volume does not support creating a snapshot group. 指定的diskId无效,共享卷不支持创建快照组。
403 InvalidAccountStatus.NotEnoughBalance The operation is not allowed due to an overdue payment or insufficient balance. Please top up your account in the Billing Management console and try again. 您的账户已欠费或余额不足,请前往费用中心充值后重试。
404 InvalidDiskId.NotFound The specified disk does not exist. 指定的磁盘不存在。请您检查磁盘 ID 是否正确。
404 Disk.NotFound The specified disk does not exist. 指定的磁盘不存在,请您检查磁盘是否正确。
404 InvalidSnapshotId.NotFound The specified SnapshotId does not exist.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定的实例ID无效。
404 InvalidRegionId.NotFound The RegionId provided does not exist in our records. 地域信息错误
404 InvalidSnapshot.NotFound The SnapshotId provided does not exist in our records.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。