• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Cinder V3 Interfaces
  5. Volumes
  6. Update Volume

Update Volume

Function Description

This interface is used to update a volume attributes.

Interface Format

Method

URI

Description

PUT

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

Updates the volume attributes.

Restrictions

N/A

Extension Description

N/A

Request Parameter

Parameter

Type

Mandatory

Remarks

name

String

No

Specifies the volume name.

The value is a string of less than 255 characters.

description

String

No

Specifies the volume description.

The value is a string of less than 255 characters.

metadata

Dict

No

Specifies the metadata of the volume.

Both the key and value in the metadata cannot exceed 255 characters.

display_name

String

No

This parameter value is the same as that of name. The value is a string of less than 255 characters. Users only need to specify name or display_name.

display_description

String

No

This parameter value is the same as that of description. The value is a string of less than 255 characters. Users only need to specify description or display_ description.

Response Parameter

Parameter

Type

Mandatory

Remarks

id

Uuid

Yes

Specifies the volume ID.

links

List(Dict)

Yes

Specifies the volume URI description.

name

String

No

Specifies the volume name.

status

String

Yes

Specifies the volume status.

attachments

List(Dict)

No

Specifies the volume attachment information.

availability_zone

String

Yes

Specifies the AZ to which the volume belongs.

source_volid

String

No

Specifies the source volume ID. If the volume is created from the source volume, the parameter has a value.

snapshot_id

String

No

Specifies the snapshot ID. If the volume is created from the snapshot, the parameter has a value.

description

String

No

Specifies the volume description.

created_at

String

Yes

Specifies the date and time when the volume was created.

volume_type

String

Yes

Specifies the volume type.

size

Int

Yes

Specifies the volume size.

metadata

Dict

No

Specifies the volume metadata.

encrypted

Boolean

Yes

Specifies whether the volume is encrypted.

replication_status

String

Yes

Specifies the volume replication status.

consistencygroup_id

String

Yes

Specifies the ID of the consistency group to which the volume belongs.

bootable

String

Yes

Specifies whether the volume is bootable.

user_id

String

Yes

Specifies the ID of the user to which the volume belongs.

updated_at

String

Yes

Specifies the time when the volume was updated.

shareable

Boolean

Yes

Specifies whether the volume is shared.

multiattach

Boolean

Yes

Specifies whether the volume is shared.

Request Example

PUT https://volume.localdomain.com:8776/v3/cc0f77b560f8432fb5eb86f0cbb91799/volumes/f9faf7df-fdc1-4093-9ef3-5cba06eef995
{
"volume": {
           "name": "name_xx3", 
           "description": "hello",
           "metadata":{"hello":"sxmatch"}
          }
}

Response Example

{
    "volume": {
        "status": "available",
        "user_id": "9c158a8fa85b47cfa820e25fab9af47b",
        "attachments": [],
        "links": [
            {
                "href": "http://172.30.101.201:8776/v3/3dab0aaf682849678a94ec7b5a3af2ce/volumes/da4f9c7a-c275-4bc9-80c4-76c7d479a218",
                "rel": "self"
            },
            {
                "href": "http://172.30.101.201:8776/3dab0aaf682849678a94ec7b5a3af2ce/volumes/da4f9c7a-c275-4bc9-80c4-76c7d479a218",
                "rel": "bookmark"
            }
        ],
        "availability_zone": "nova",
        "bootable": "false",
"shareable": false,
        "multiattach": false,
        "encrypted": false,
        "created_at": "2014-12-18T17:14:38.000000",
"updated_at": "2014-12-18T17:14:53.102360",
        "description": "hello",
        "volume_type": "SATA",
        "name": "name_xx3",
        "replication_status": "disabled",
        "consistencygroup_id": null,
        "source_volid": null,
        "snapshot_id": null,
        "metadata": {},
        "id": "da4f9c7a-c275-4bc9-80c4-76c7d479a218",
        "size": 1
    }
}

Error Code

See section Processing Return Code.