VM Related Interfaces

Update VM CD-ROM

PUT/zstack/v1/vm-instances/cdroms/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateVmCdRom": {
    "name": "cd-2"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateVmCdRom":{"name":"cd-2"}}' http://localhost:8080/zstack/v1/vm-instances/cdroms/407c8e5cee4b3430bbb9f0f4d4c8a422/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlResource UUID, uniquely identifies the resource 3.3.0
description (Optional)Stringbody (contained in updateVmCdRom structure)Resource description 3.3.0
name (Optional)Stringbody (contained in updateVmCdRom structure)Resource name 3.3.0
systemTags (Optional)ListbodySystem Tag 3.3.0
userTags (Optional)ListbodyUser Tag 3.3.0

API Response

Response Example

{
  "inventory": {
    "uuid": "257369b2f7e83256940adce2a6279187",
    "deviceId": 0,
    "isoUuid": "5ffbf20fb5e5342f91db1416740cf578",
    "name": "cd-1",
    "description": "desc",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error3.3.0
inventoryVmCdRomInventoryFor details, see inventory3.3.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier of the error, for example SYS.1000, HOST.10013.3.0
descriptionStringBrief description of the error3.3.0
detailsStringDetailed error information3.3.0
elaborationStringReserved field, defaults to null3.3.0
opaqueLinkedHashMapReserved field, defaults to null3.3.0
causeErrorCodeRoot cause. The error that triggered the current error. If there is no original error, this field is null3.3.0

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource3.3.0
vmInstanceUuidStringVirtual Machine UUID3.3.0
deviceIdIntegerCD-ROM device number3.3.0
isoUuidStringISO Image UUID3.3.0
isoInstallPathStringISO image mount path3.3.0
nameStringResource name3.3.0
descriptionStringResource description3.3.0
createDateTimestampCreate time3.3.0
lastOpDateTimestampLast update time3.3.0

SDK Examples

Java SDK

UpdateVmCdRomAction action = new UpdateVmCdRomAction();
action.uuid = "407c8e5cee4b3430bbb9f0f4d4c8a422";
action.name = "cd-2";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateVmCdRomAction.Result res = action.call();

Python SDK

UpdateVmCdRomAction action = UpdateVmCdRomAction()
action.uuid = "407c8e5cee4b3430bbb9f0f4d4c8a422"
action.name = "cd-2"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateVmCdRomAction.Result res = action.call()