- Timestamp:
- Jun 7, 2019 9:22:06 AM (6 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp
r78841 r79033 183 183 com::SafeArray<BSTR> arrayVMIds; 184 184 ComPtr<IProgress> pProgress; 185 186 RTPrintf("Getting a list of available cloud instances...\n"); 185 com::SafeArray<CloudMachineState_T> machimeStates; 186 187 187 RTPrintf("Reply is in the form \'instance name\' = \'instance id\'\n"); 188 188 189 CHECK_ERROR2_RET(hrc, oCloudClient, 189 ListInstances(C loudMachineState_Running,190 ListInstances(ComSafeArrayAsInParam(machimeStates), 190 191 pVMNamesHolder.asOutParam(), 191 192 pVMIdsHolder.asOutParam(), … … 202 203 RTEXITCODE_FAILURE); 203 204 204 RTPrintf("List of runninginstances for the cloud profile \'%ls\' \nand compartment \'%s\':\n",205 RTPrintf("List of instances for the cloud profile \'%ls\' \nand compartment \'%s\':\n", 205 206 bstrProfileName.raw(), strCompartmentId.c_str()); 206 207 size_t cIds = arrayVMIds.size(); … … 212 213 value = arrayVMIds[k]; 213 214 RTPrintf("\t%ls = %ls\n", arrayVMNames[k], value.raw()); 214 }215 216 pVMNamesHolder.setNull();217 pVMIdsHolder.setNull();218 arrayVMNames.setNull();219 arrayVMIds.setNull();220 pProgress.setNull();221 CHECK_ERROR2_RET(hrc, oCloudClient,222 ListInstances(CloudMachineState_Stopped,223 pVMNamesHolder.asOutParam(),224 pVMIdsHolder.asOutParam(),225 pProgress.asOutParam()),226 RTEXITCODE_FAILURE);227 showProgress(pProgress);228 CHECK_PROGRESS_ERROR_RET(pProgress, ("Failed to list instances"), RTEXITCODE_FAILURE);229 230 CHECK_ERROR2_RET(hrc,231 pVMNamesHolder, COMGETTER(Values)(ComSafeArrayAsOutParam(arrayVMNames)),232 RTEXITCODE_FAILURE);233 CHECK_ERROR2_RET(hrc,234 pVMIdsHolder, COMGETTER(Values)(ComSafeArrayAsOutParam(arrayVMIds)),235 RTEXITCODE_FAILURE);236 237 RTPrintf("List of paused instances for the cloud profile \'%ls\' \nand compartment \'%s\':\n",238 bstrProfileName.raw(), strCompartmentId.c_str());239 cNames = arrayVMNames.size();240 cIds = arrayVMIds.size();241 for (size_t k = 0; k < cNames; k++)242 {243 Bstr value;244 if (k < cIds)245 value = arrayVMIds[k];246 RTPrintf("\t%ls=%ls\n", arrayVMNames[k], value.raw());247 215 } 248 216 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp
r78892 r79033 321 321 322 322 /* Stopped VM names and ids: */ 323 CStringArray comNames Stopped;324 CStringArray comIDs Stopped;325 326 /* Ask for Stopped cloud VMs: */ 327 CProgress comProgress Stopped = m_comCloudClient.ListInstances(KCloudMachineState_Stopped, comNamesStopped, comIDsStopped);323 CStringArray comNames; 324 CStringArray comIDs; 325 QVector<KCloudMachineState> comCloudMachineState; 326 327 CProgress comProgress= m_comCloudClient.ListInstances(comCloudMachineState, comNames, comIDs); 328 328 if (!m_comCloudClient.isOk()) 329 329 { … … 333 333 334 334 /* Show "Acquire cloud instances" progress: */ 335 msgCenter().showModalProgressDialog(comProgress Stopped, UIWizardImportApp::tr("Acquire stoppedcloud instances..."),335 msgCenter().showModalProgressDialog(comProgress, UIWizardImportApp::tr("Acquire cloud instances..."), 336 336 ":/progress_reading_appliance_90px.png", 0, 0); 337 if (!comProgressStopped.isOk() || comProgressStopped.GetResultCode() != 0) 338 { 339 msgCenter().cannotAcquireCloudClientParameter(comProgressStopped); 340 break; 341 } 342 343 /* Running VM names and ids: */ 344 CStringArray comNamesRunning; 345 CStringArray comIDsRunning; 346 347 /* Ask for Running cloud VMs: */ 348 CProgress comProgressRunning = m_comCloudClient.ListInstances(KCloudMachineState_Running, comNamesRunning, comIDsRunning); 349 if (!m_comCloudClient.isOk()) 350 { 351 msgCenter().cannotAcquireCloudClientParameter(m_comCloudClient); 352 break; 353 } 354 355 /* Show "Acquire cloud instances" progress: */ 356 msgCenter().showModalProgressDialog(comProgressRunning, UIWizardImportApp::tr("Acquire running cloud instances..."), 357 ":/progress_reading_appliance_90px.png", 0, 0); 358 if (!comProgressRunning.isOk() || comProgressRunning.GetResultCode() != 0) 359 { 360 msgCenter().cannotAcquireCloudClientParameter(comProgressRunning); 337 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 338 { 339 msgCenter().cannotAcquireCloudClientParameter(comProgress); 361 340 break; 362 341 } 363 342 364 343 /* Push acquired names to list rows: */ 365 const QVector<QString> names = comNames Stopped.GetValues() + comNamesRunning.GetValues();366 const QVector<QString> ids = comIDs Stopped.GetValues() + comIDsRunning.GetValues();344 const QVector<QString> names = comNames.GetValues(); 345 const QVector<QString> ids = comIDs.GetValues(); 367 346 for (int i = 0; i < names.size(); ++i) 368 347 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r78996 r79033 25961 25961 <interface 25962 25962 name="ICloudClient" extends="$unknown" 25963 uuid=" d1ac0b72-861a-11e9-a0cf-b38ea8ea9e63"25963 uuid="17a5ade9-d9ad-4723-8004-8f47d5d7a2cc" 25964 25964 wsmap="managed" reservedMethods="13" reservedAttributes="8" 25965 25965 > … … 26039 26039 Returns the list of the instances in the Cloud. 26040 26040 </desc> 26041 <param name="machineState" type="CloudMachineState" dir="in" />26041 <param name="machineState" type="CloudMachineState" dir="in" safearray="yes"/> 26042 26042 <param name="returnNames" type="IStringArray" dir="out"> 26043 26043 <desc>VM names.</desc>
Note:
See TracChangeset
for help on using the changeset viewer.