Updated on 2024-02-27 GMT+08:00

Updating an EVS Disk

Function

This API is used to update an EVS disk.

Calling Method

For details, see Calling APIs.

URI

PUT /v3/{project_id}/volumes/{volume_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

The project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

volume_id

Yes

String

The disk ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

The user token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

volume

Yes

CinderUpdateVolumeOption object

The disk information to be updated.

Table 4 CinderUpdateVolumeOption

Parameter

Mandatory

Type

Description

name

No

String

The disk name. You can enter up to 64 characters.

description

No

String

The disk description. You can enter up to 85 characters.

metadata

No

Map<String,String>

The disk metadata.

The length of key or value under metadata can contain no more than 255 bytes.

display_description

No

String

The disk description. You can specify either description or display_description. If they are both specified, the description value is used. You can enter up to 85 characters.

display_name

No

String

The disk name. You can specify either name or display_name. If they are both specified, the name value is used. You can enter up to 64 characters.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

id

String

The disk ID.

links

Array of Link objects

The disk URI.

name

String

The disk name.

status

String

The disk status. For details, see EVS Disk Status.

attachments

Array of VolumeAttachment objects

The attachment information.

availability_zone

String

The AZ to which the disk belongs.

bootable

String

Whether the disk is bootable. true: The disk is bootable. false: The disk is not bootable.

encrypted

Boolean

This field is currently not supported.

created_at

String

The time when the disk was created.

Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX

description

String

The disk description.

volume_type

String

The disk type.

The value can be SATA, SAS, GPSSD, SSD, ESSD, GPSSD2, or ESSD2.

  • SATA: the common I/O type

  • SAS: the high I/O type

  • GPSSD: the general purpose SSD type

  • SSD: the ultra-high I/O type

  • ESSD: the extreme SSD type

  • GPSSD2: the general purpose SSD V2 type

  • ESSD2: the extreme SSD V2 type If the specified disk type is not available in the AZ, the disk will fail to be created.

replication_status

String

The reserved field.

consistencygroup_id

String

The ID of the consistency group where the disk belongs.

source_volid

String

The source disk ID.

This field is currently not supported.

snapshot_id

String

The snapshot ID.

metadata

VolumeMetadata object

The metadata.

size

Integer

The disk size, in GiB.

user_id

String

The ID of the user that uses the disk.

updated_at

String

The time when the disk was updated.

shareable

Boolean

Whether the disk is shareable. Note: This field has been deprecated. Use multiattach.

multiattach

Boolean

Whether the disk is shareable. true: The disk is shareable. false: The disk is not shareable.

storage_cluster_id

String

The reserved field.

Table 7 VolumeAttachment

Parameter

Type

Description

attached_at

String

The time when the disk was attached.

Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX

attachment_id

String

The attachment ID.

device

String

The device name.

host_name

String

The name of the physical host housing the cloud server to which the disk is attached.

id

String

The ID of the attached disk.

server_id

String

The ID of the server to which the disk is attached.

volume_id

String

The disk ID.

Table 8 VolumeMetadata

Parameter

Type

Description

__system__cmkid

String

The encryption CMK ID in metadata. This parameter is used together with __system__encrypted for encryption. The length of cmkid is fixed at 36 bytes.

NOTE:

Use an HTTPS request to obtain the key ID. For details, see Querying the Key List.

__system__encrypted

String

The encryption field in metadata. The value can be 0 (no encryption) or 1 (encryption). If this parameter does not appear, the disk is not encrypted.

full_clone

String

If the disk is created from a snapshot and linked cloning needs to be used, set this parameter to 0.

hw:passthrough

String

If this parameter is set to true, the disk device type is SCSI, which allows ECS OSs to directly access the underlying storage media. SCSI reservation commands are supported.

If this parameter is set to false, the disk device type is VBD, which is also the default type. VBD supports only simple SCSI read/write commands.

If this parameter is not available, the disk device type is VBD.

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error

Error object

The error message returned if an error occurs.

Table 10 Error

Parameter

Type

Description

code

String

The error code returned if an error occurs.

For details about error codes and their meanings, see Error Codes.

message

String

The error message returned if an error occurs.

Example Requests

PUT https://{endpoint}/v3/{project_id}/volumes/{volume_id}

{
  "volume" : {
    "name" : "test_volume",
    "description" : "test"
  }
}

Example Responses

Status code: 200

OK

{
  "volume" : {
    "attachments" : [ ],
    "availability_zone" : "az-dc-1",
    "bootable" : "false",
    "consistencygroup_id" : null,
    "created_at" : "2016-05-25T02:38:40.392463",
    "description" : "create for api test",
    "encrypted" : false,
    "id" : "8dd7c486-8e9f-49fe-bceb-26aa7e312b66",
    "links" : [ {
      "href" : "https://volume.localdomain.com:8776/v2/5dd0b0056f3d47b6ab4121667d35621a/volumes/8dd7c486-8e9f-49fe-bceb-26aa7e312b66",
      "rel" : "self"
    }, {
      "href" : "https://volume.localdomain.com:8776/5dd0b0056f3d47b6ab4121667d35621a/volumes/8dd7c486-8e9f-49fe-bceb-26aa7e312b66",
      "rel" : "bookmark"
    } ],
    "metadata" : {
      "volume_owner" : "openapi"
    },
    "name" : "openapi_vol01",
    "replication_status" : "disabled",
    "multiattach" : false,
    "size" : 40,
    "snapshot_id" : null,
    "source_volid" : null,
    "status" : "creating",
    "updated_at" : null,
    "user_id" : "39f6696ae23740708d0f358a253c2637",
    "volume_type" : "SATA"
  }
}

Status code: 400

Bad Request

{
  "error" : {
    "message" : "XXXX",
    "code" : "XXX"
  }
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

See Error Codes.