GetCandidateVmForAttachingIso
API Request
URLs
GET zstack/v1/images/iso/{isoUuid}/vm-candidatesHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 54ca471114824451b5b3e4cc22f9a927" \
-X GET http://localhost:8080/zstack/v1/images/iso/3e5e142462c54736b1880b43d49edeba/vm-candidatesRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| isoUuid | String | url | The ISO UUID. | 0.6 | |
| systemTags | List | query | Optional. The system tags. | 0.6 | |
| userTags | List | query | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventories": [
{
"uuid": "f95bdc72e9963a05b8f19b8817f09d9d",
"name": "Test-VM",
"description": "web server VM",
"zoneUuid": "389fb59c478b3a9fbe08e0cb0cbb4e4f",
"clusterUuid": "f1c45e63860e3e17b068db42533f008b",
"imageUuid": "5ccbd867873f36318f72cd32c74ee540",
"hostUuid": "73ebd6bff3aa3745a0dffd978edaf561",
"lastHostUuid": "1e1c43855d9c3998bf9d1c237a36dcaa",
"instanceOfferingUuid": "6ef7a28c90b93a5ebe659644e6a956fc",
"rootVolumeUuid": "5a5ebf77b9d23ecb9034e6d64a9c3d51",
"platform": "Linux",
"defaultL3NetworkUuid": "d9a2bfe33f6831098b35adb8022c3d3c",
"type": "UserVm",
"hypervisorType": "KVM",
"memorySize": 8.589934592E9,
"cpuNum": 1.0,
"allocatorStrategy": "LastHostPreferredAllocatorStrategy",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"state": "Stopped",
"vmNics": [
{
"uuid": "cfdc9377501d3ed180572e8093aff0e0",
"vmInstanceUuid": "f95bdc72e9963a05b8f19b8817f09d9d",
"usedIpUuid": "a8a2f1fd54f83c41bab8d7c169776dd9",
"l3NetworkUuid": "d9a2bfe33f6831098b35adb8022c3d3c",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"allVolumes": [
{
"uuid": "5a5ebf77b9d23ecb9034e6d64a9c3d51",
"name": "Root-Volume-For-VM-f95bdc72e9963a05b8f19b8817f09d9d",
"primaryStorageUuid": "092c642a80cf3f11886a57c50fc54fec",
"vmInstanceUuid": "f95bdc72e9963a05b8f19b8817f09d9d",
"diskOfferingUuid": "8f0377c24026357693b8ba14fa368d08",
"rootImageUuid": "5ccbd867873f36318f72cd32c74ee540",
"installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-5a5ebf77b9d23ecb9034e6d64a9c3d51/5a5ebf77b9d23ecb9034e6d64a9c3d51.qcow2",
"type": "Root",
"format": "qcow2",
"size": 1.073741824E11,
"actualSize": 2.147483648E10,
"deviceId": 0.0,
"state": "Enabled",
"status": "Ready",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventories | List | See inventories. | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| zoneUuid | String | The zone UUID. | 0.6 |
| clusterUuid | String | The cluster UUID. | 0.6 |
| imageUuid | String | The image UUID. | 0.6 |
| hostUuid | String | The host UUID. | 0.6 |
| lastHostUuid | String | 0.6 | |
| instanceOfferingUuid | String | The instance offering UUID. | 0.6 |
| rootVolumeUuid | String | The root volume UUID. | 0.6 |
| platform | String | 0.6 | |
| defaultL3NetworkUuid | String | 0.6 | |
| type | String | 0.6 | |
| hypervisorType | String | 0.6 | |
| memorySize | Long | 0.6 | |
| cpuNum | Integer | 0.6 | |
| cpuSpeed | Long | 0.6 | |
| allocatorStrategy | String | 0.6 | |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| state | String | 0.6 | |
| vmNics | List | See vmNics. | 0.6 |
| allVolumes | List | See allVolumes. | 0.6 |
#vmNics
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| vmInstanceUuid | String | The VM instance UUID. | 0.6 |
| l3NetworkUuid | String | The L3 network UUID. | 0.6 |
| ip | String | 0.6 | |
| mac | String | 0.6 | |
| netmask | String | 0.6 | |
| gateway | String | 0.6 | |
| metaData | String | 0.6 | |
| ipVersion | Integer | The IP version. | 3.1.0 |
| deviceId | Integer | 0.6 | |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| usedIps | List | See usedIps. | 0.6 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| ipRangeUuid | String | The IP range UUID. | 0.6 |
| l3NetworkUuid | String | The L3 network UUID. | 0.6 |
| ipVersion | Integer | The IP version. | 3.1.0 |
| ip | String | The IP address. | 0.6 |
| netmask | String | The netmask. | 0.6 |
| gateway | String | The gateway. | 0.6 |
| usedFor | String | 0.6 | |
| ipInLong | long | 0.6 | |
| vmNicUuid | String | The VM NIC UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
#allVolumes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| primaryStorageUuid | String | The primary storage UUID. | 0.6 |
| vmInstanceUuid | String | The VM instance UUID. | 0.6 |
| diskOfferingUuid | String | The disk offering UUID. | 0.6 |
| rootImageUuid | String | 0.6 | |
| installPath | String | 0.6 | |
| type | String | 0.6 | |
| format | String | 0.6 | |
| size | Long | 0.6 | |
| actualSize | Long | 0.6 | |
| deviceId | Integer | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| isShareable | Boolean | 0.6 |
SDK Sample
Java
SDK
GetCandidateVmForAttachingIsoAction action = new GetCandidateVmForAttachingIsoAction();
action.isoUuid = "c7824c614de74f908bc7d82e6f16ebe7";
action.sessionId = "24b72cf532ce4e87be824b510dfe8289";
GetCandidateVmForAttachingIsoAction.Result res = action.call();Python
SDK
GetCandidateVmForAttachingIsoAction action = GetCandidateVmForAttachingIsoAction()
action.isoUuid = "3916247f217c44de99603f16ebe141bd"
action.sessionId = "a43eacd5ff59473f844257917e0b705c"
GetCandidateVmForAttachingIsoAction.Result res = action.call()