VM Related Interfaces
Update VM CD-ROM
Headers
Authorization: OAuth the-session-uuidBody
{
"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/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, uniquely identifies the resource | 3.3.0 | |
| description (Optional) | String | body (contained in updateVmCdRom structure) | Resource description | 3.3.0 | |
| name (Optional) | String | body (contained in updateVmCdRom structure) | Resource name | 3.3.0 | |
| systemTags (Optional) | List | body | System Tag | 3.3.0 | |
| userTags (Optional) | List | body | User 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"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error | 3.3.0 |
| inventory | VmCdRomInventory | For details, see inventory | 3.3.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, a globally unique identifier of the error, for example SYS.1000, HOST.1001 | 3.3.0 |
| description | String | Brief description of the error | 3.3.0 |
| details | String | Detailed error information | 3.3.0 |
| elaboration | String | Reserved field, defaults to null | 3.3.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 3.3.0 |
| cause | ErrorCode | Root cause. The error that triggered the current error. If there is no original error, this field is null | 3.3.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 3.3.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.3.0 |
| deviceId | Integer | CD-ROM device number | 3.3.0 |
| isoUuid | String | ISO Image UUID | 3.3.0 |
| isoInstallPath | String | ISO image mount path | 3.3.0 |
| name | String | Resource name | 3.3.0 |
| description | String | Resource description | 3.3.0 |
| createDate | Timestamp | Create time | 3.3.0 |
| lastOpDate | Timestamp | Last update time | 3.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()