ModifyDiskAttribute

Last Updated: Dec 12, 2017

Description

In this interface, when the DeleteWithInstance property is set and the OperationLocks of instance indicates LockReason: security, the DeleteWithInstance property of disk is ignored and the disk is released along with the instance.

Request parameters

Name Type Required Description
Action String Yes Operation interface name, required parameter, with a value: ModifyDiskAttribute.
DiskId String Yes ID of the disk.
DiskName String No The disk name. The existing name remains the same when no new value is specified. The default value is blank. [2, 128] English or Chinese characters, must begin with an uppercase/lowercase letter or Chinese character. Can contain numbers, “.”, “_“ and “-“. The disk name appears in the console. It cannot begin with http:// or https://.
Description String No The disk description. The existing name remains the same when no new value is specified. The default value is blank. [2, 256] characters. The disk description appears in the console. It cannot begin with http:// or https://.
DeleteWithInstance String No Whether or not the disk is released along with the instance:
  • True indicates that when the instance is released, this disk is releases it.
  • False indicates that when the instance is released, this disk is retained.
In the following conditions, an error is reported when this parameter is set to false:
  • When the category property of disk is ephemeral.
  • When the category property of disk is cloud and the Portable property is false.
Default value: None, indicates not modifying the current value.
DeleteAutoSnapshot String No Whether or not automatic snapshots are deleted when the disk is deleted.
  • True indicates the automatic snapshots are deleted with the disk.
  • False indicates the automatic snapshots are retained.
Default value: None, indicates not modifying the current value.
EnableAutoSnapshot String No Whether the disk runs an automatic snapshot policy or not (as a precondition the user’s overall automatic snapshot policy must be enabled):
  • True indicates the disk runs an automatic snapshot policy.
  • False indicates the disk does not run an automatic snapshot policy.
Default value: None, indicates not modifying the current value.

Response Parameters

All are common return parameters. For more information, see Common parameters.

Error codes

Error code Error message HTTP status code Meaning
MissingParameter The input parameter DiskId that is mandatory for processing this request is not supplied. 400 DiskId not specified.
InvalidDiskId.NotFound The specified disk does not exist. 404 The specified disk does not exist.
InvalidDiskName.Malformed The specified disk name is wrongly formed. 400 The DiskName format is incorrect.
InvalidDescription.Malformed The specified description is wrongly formed. 404 The Description format is incorrect.
InvalidParameter The specified parameter DeleteWithInstance is not valid. 400 The specified DeleteWithInstance parameter is invalid.
NoAttributeToModify No attribute to be modified in this request. 400 No properties have been modified.
DiskNotPortable The specified disk is not a portable disk. 403 The disk cannot be detached.

Examples

Request Example

  1. https://ecs.aliyuncs.com/?Action=ModifyDiskAttribute
  2. &DiskId=d-23jbf2v5m
  3. &DiskName=MyDiskName
  4. &<Public Request Parameters>

Response Example

XML format

  1. <ModifyDiskAttributeResponse>
  2. <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
  3. </ModifyDiskAttributeResponse>

JSON format

  1. {
  2. "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
  3. }
Thank you! We've received your feedback.