VM Related Interfaces
Create VM CD-ROM
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "cd-1",
"vmInstanceUuid": "c613ed3c46d036cdb5f7af15a15788dc",
"isoUuid": "157321b6fb043d8a923aca66e6388086",
"description": "this is a cd-rom"
},
"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 POST -d '{"params":{"name":"cd-1","vmInstanceUuid":"c613ed3c46d036cdb5f7af15a15788dc","isoUuid":"157321b6fb043d8a923aca66e6388086","description":"this is a cd-rom"}}' http://localhost:8080/zstack/v1/vm-instances/cdromsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (contained in params structure) | Resource name | 3.3.0 | |
| vmInstanceUuid | String | body (contained in params structure) | Virtual Machine UUID | 3.3.0 | |
| isoUuid (Optional) | String | body (contained in params structure) | ISO Image UUID | 3.3.0 | |
| description (Optional) | String | body (contained in params structure) | Resource description | 3.3.0 | |
| resourceUuid (Optional) | String | body (contained in params structure) | Resource UUID | 3.3.0 | |
| tagUuids (Optional) | List | body (contained in params structure) | Tag UUID list | 3.4.0 | |
| systemTags (Optional) | List | body | System Tag | 3.3.0 | |
| userTags (Optional) | List | body | User Tag | 3.3.0 |
API Response
Response Example
{
"inventory": {
"vmInstanceUuid": "47286977f0c530168fdbb1dfbfc167e8",
"deviceId": 0,
"isoUuid": "1712d13459ec3637be1020936e76e5a3",
"name": "cd-1",
"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
CreateVmCdRomAction action = new CreateVmCdRomAction();
action.name = "cd-1";
action.vmInstanceUuid = "c613ed3c46d036cdb5f7af15a15788dc";
action.isoUuid = "157321b6fb043d8a923aca66e6388086";
action.description = "this is a cd-rom";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVmCdRomAction.Result res = action.call();Python SDK
CreateVmCdRomAction action = CreateVmCdRomAction()
action.name = "cd-1"
action.vmInstanceUuid = "c613ed3c46d036cdb5f7af15a15788dc"
action.isoUuid = "157321b6fb043d8a923aca66e6388086"
action.description = "this is a cd-rom"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVmCdRomAction.Result res = action.call()