Changeset 75038 in vbox
- Timestamp:
- Oct 24, 2018 1:01:34 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r75036 r75038 780 780 # Enables building+packing the Oracle VM VirtualBox Extension Pack, includes VBOX_WITH_EXTPACK_PUEL 781 781 VBOX_WITH_EXTPACK_PUEL_BUILD = 1 782 # Build ExportVM functionality based on generated REST API783 VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS = 1784 782 # Enable the BusMouse sample extension pack. 785 783 #VBOX_WITH_EXTPACK_BUSMOUSESAMPLE = 1 -
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r75025 r75038 179 179 $(if $(VBOX_GUI_WITH_CUSTOMIZATIONS1),VBOX_GUI_WITH_CUSTOMIZATIONS1) \ 180 180 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE) \ 181 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) \ 182 $(if $(VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS),VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS,) 181 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) 183 182 ifdef VBOX_WITH_DEBUGGER_GUI 184 183 VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r74878 r75038 67 67 ("Can't create Cloud Client object!")); 68 68 69 #ifndef VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS70 69 /* Read Cloud Client parameters for Export VM operation: */ 71 QString strJSON = comCloudClient.GetOperationParameters(KCloudOperation_exportVM);72 #else73 70 QString strJSON = comCloudClient.GetExportParameters(); 74 #endif75 71 76 72 /* Create JSON document on the basis of it, make sure it isn't empty: */ -
trunk/src/VBox/Main/Makefile.kmk
r74992 r75038 78 78 $(if $(VBOX_WITH_HOSTNETIF_API),VBOX_WITH_HOSTNETIF_API,) \ 79 79 $(if $(VBOX_WITH_MIDL_PROXY_STUB),VBOX_WITH_MIDL_PROXY_STUB,) \ 80 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) \ 81 $(if $(VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS),VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS,) 80 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) 82 81 83 82 # Unconditionally enable the new semaphore key generation code -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r74916 r75038 25064 25064 </enum> 25065 25065 25066 <enum25067 name="CloudCommand"25068 uuid="1c5cfa19-7754-4071-bf3e-6d21ad432655"25069 >25070 <const name="Unknown" value="0"/>25071 <const name="createInstance" value="0x1"/>25072 <const name="launchInstance" value="0x2"/>25073 <const name="pauseInstance" value="0x3"/>25074 <const name="stopInstance" value="0x4"/>25075 <const name="deleteInstance" value="0x5"/>25076 <const name="getInstance" value="0x6"/>25077 <const name="listInstances" value="0x7"/>25078 25079 <const name="createImage" value="0x10"/>25080 <const name="getImage" value="0x11"/>25081 <const name="importImage" value="0x12"/>25082 <const name="exportImage" value="0x13"/>25083 <const name="deleteImage" value="0x14"/>25084 <const name="updateImage" value="0x15"/>25085 <const name="listImages" value="0x16"/>25086 25087 <const name="listNetworks" value="0x20"/>25088 <const name="getNetwork" value="0x21"/>25089 <const name="createNetwork" value="0x22"/>25090 <const name="deleteNetwork" value="0x23"/>25091 <const name="upateNetwork" value="0x24"/>25092 25093 <const name="getNetworkCard" value="0x30"/>25094 <const name="updateNetworkCard" value="0x31"/>25095 25096 <const name="listNetworkCardAttachements" value="0x32"/>25097 <const name="getNetworkCardAttachement" value="0x33"/>25098 <const name="detachNetworkCard" value="0x34"/>25099 <const name="attachNetworkCard" value="0x35"/>25100 25101 <const name="listSubnets" value="0x40"/>25102 <const name="getSubnet" value="0x41"/>25103 <const name="createSubnet" value="0x42"/>25104 <const name="deleteSubnet" value="0x43"/>25105 <const name="updateSubnet" value="0x44"/>25106 25107 <const name="listInternetGateways" value="0x50"/>25108 <const name="getInternetGateway" value="0x51"/>25109 <const name="createInternetGateway" value="0x52"/>25110 <const name="deleteInternetGateway" value="0x53"/>25111 <const name="updateInternetGateway" value="0x54"/>25112 25113 <const name="listRouteTables" value="0x60"/>25114 <const name="getRouteTable" value="0x61"/>25115 <const name="createRouteTable" value="0x62"/>25116 <const name="deleteRouteTable" value="0x63"/>25117 <const name="updateRouteTable" value="0x64"/>25118 25119 <const name="listShapes" value="0x70"/>25120 25121 <const name="uploadFile" value="0x100"/>25122 <const name="downloadObject" value="0x101"/>25123 <const name="deleteObject" value="0x102"/>25124 <const name="getObject" value="0x103"/>25125 <const name="listObjects" value="0x104"/>25126 25127 <const name="listBuckets" value="0x110"/>25128 25129 <const name="getNamespace" value="0x120"/>25130 25131 <const name="listRegions" value="0x200"/>25132 <const name="listAvailabilityDomains" value="0x210"/>25133 <const name="listCompartments" value="0x220"/>25134 25135 </enum>25136 25137 <enum25138 name="CloudOperation"25139 uuid="68289604-2fec-4163-b10a-eb2da7a61306"25140 >25141 <const name="Unknown" value="0"/>25142 <const name="exportVM" value="0x1"/>25143 </enum>25144 25145 <enum25146 name="CloudCommandResult"25147 uuid="e33af696-255a-4f5a-8dba-d65d6ee2fe9a"25148 >25149 <const name="unknown" value="0"/>25150 <const name="success" value="1"/>25151 <const name="failed" value="2"/>25152 <const name="inProgress" value="3"/>25153 </enum>25154 25155 25066 <interface 25156 25067 name="ICloudClient" extends="$unknown" 25157 uuid=" f2b37b0c-e555-4d11-b90b-d517a194e469"25068 uuid="86b831ff-ffe4-49c2-843f-0c8b03817025" 25158 25069 wsmap="managed" reservedMethods="4" reservedAttributes="4" 25159 25070 > 25160 25071 25161 <method name="createCommand"> 25162 <desc> 25163 Creates a cloud operation object for the passed profile 25164 if profile name is NULL or empty string creates operation for the active profile. 25165 if profile name is NULL or empty string and there is not the active profile 25166 returns "VERR_INVALID_PARAMETER" 25167 </desc> 25168 <param name="cloudCommand" type="CloudCommand" dir="in"> 25169 <desc> 25170 The type of the supported cloud commands. 25171 </desc> 25172 </param> 25173 <param name="condition" type="wstring" dir="in"> 25174 <desc> 25175 The successful condition for finishing the command. 25176 The command will be repeated if condition isn't in the needed state 25177 </desc> 25178 </param> 25179 <param name="Id" type="uuid" mod="string" dir="return"> 25180 <desc> 25181 UUID of the operation. 25182 It's used later when user chooses and runs this cloud operation 25183 </desc> 25184 </param> 25185 </method> 25186 25187 <method name="runCommand"> 25188 <desc> 25189 Runs a cloud operation by ID 25190 </desc> 25191 <param name="Id" type="uuid" mod="string" dir="in"> 25192 <desc> 25193 UUID of the operation. 25194 </desc> 25195 </param> 25196 <param name="timeout" type="long long" dir="in"> 25197 <desc> 25198 Timeout in seconds. 25199 </desc> 25200 </param> 25201 <param name="result" type="CloudCommandResult" dir="return"> 25202 </param> 25203 </method> 25204 25205 <method name="runSeveralCommands"> 25206 <desc> 25207 Runs a set of prepared cloud operations by their ids 25208 </desc> 25209 <param name="commandIdList" type="wstring" safearray="yes" dir="in"> 25210 <desc> 25211 The list of UUID of the operations. 25212 </desc> 25213 </param> 25214 <param name="parameterNames" type="wstring" safearray="yes" dir="in"> 25215 <desc>Initial set of parameter names.</desc> 25216 </param> 25217 <param name="parameterValues" type="wstring" safearray="yes" dir="in"> 25218 <desc>Initial set of parameter values.</desc> 25072 <method name="getExportParameters" const="yes"> 25073 <desc> 25074 Returns the parameters required to be shown to user for export a VM to a cloud operation. 25075 </desc> 25076 <param name="jsonString" type="wstring" dir="return"> 25077 <desc>the parameters with values in json format.</desc> 25078 </param> 25079 </method> 25080 25081 <method name="exportVM"> 25082 <desc> 25083 Exports a VM described in description parameter 25084 </desc> 25085 <param name="description" type="IVirtualSystemDescription" dir="in"> 25086 <desc>VirtualSystemDescription object which is describing a machine and all required parameters.</desc> 25219 25087 </param> 25220 25088 <param name="progress" type="IProgress" dir="in"> 25221 25089 <desc>Progress object to track the operation completion.</desc> 25222 25090 </param> 25223 </method>25224 25225 <method name="validateCommand">25226 <desc>25227 Validates a cloud operation by ID25228 </desc>25229 <param name="Id" type="uuid" mod="string" dir="in">25230 <desc>25231 UUID of the operation.25232 </desc>25233 </param>25234 <param name="valid" type="boolean" dir="return">25235 <desc>25236 if the command is valid return s true else returns false.25237 </desc>25238 </param>25239 </method>25240 25241 <method name="checkCommandResult" const="yes">25242 <desc>25243 Check a cloud operation result by ID25244 </desc>25245 <param name="Id" type="uuid" mod="string" dir="in">25246 <desc>25247 UUID of the operation.25248 </desc>25249 </param>25250 <param name="startTime" type="long long" dir="out">25251 <desc>25252 Start time of operation.25253 </desc>25254 </param>25255 <param name="lastTime" type="long long" dir="out">25256 <desc>25257 Time of the last result.25258 </desc>25259 </param>25260 <param name="result" type="CloudCommandResult" dir="return">25261 <desc>25262 The last result of the cloud command.25263 </desc>25264 </param>25265 </method>25266 25267 <method name="getCommandParameterNames" const="yes">25268 <desc>25269 Returns the parameters names for this operation.25270 </desc>25271 <param name="cloudCommand" type="CloudCommand" dir="in">25272 <desc>25273 The type of the supported cloud commands.25274 </desc>25275 </param>25276 <param name="parameterNames" type="wstring" safearray="yes" dir="return">25277 <desc>Names of the parameters.</desc>25278 </param>25279 </method>25280 25281 <method name="getCommandParameterProperties" const="yes">25282 <desc>25283 Returns the value/s for the passed parameter.25284 </desc>25285 <param name="parameterName" type="wstring" dir="in">25286 <desc>Parameter name.</desc>25287 </param>25288 <param name="parameterType" type="wstring" dir="out">25289 <desc>Parameter type.</desc>25290 </param>25291 <param name="parameterDesc" type="wstring" dir="out">25292 <desc>Parameter description.</desc>25293 </param>25294 <param name="parameterValues" type="wstring" safearray="yes" dir="return">25295 <desc>Possible values of the parameter.</desc>25296 </param>25297 </method>25298 25299 <method name="getCommandParameters" const="yes">25300 <desc>25301 Returns the parameters with their values.25302 </desc>25303 <param name="cloudCommand" type="CloudCommand" dir="in">25304 <desc>25305 The type of the supported cloud commands.25306 </desc>25307 </param>25308 <param name="jsonString" type="wstring" dir="return">25309 <desc>the parameters with values in json format.</desc>25310 </param>25311 </method>25312 25313 <method name="setCommandParameters">25314 <desc>25315 Sets the parameters values for the particular command by ID.25316 </desc>25317 <param name="Id" type="uuid" mod="string" dir="in">25318 <desc>25319 UUID of the operation.25320 </desc>25321 </param>25322 <param name="names" type="wstring" safearray="yes" dir="in">25323 <desc>Names of the parameters.</desc>25324 </param>25325 <param name="values" type="wstring" safearray="yes" dir="in">25326 <desc>Values of the parameters.</desc>25327 </param>25328 </method>25329 25330 <method name="getCommandsForOperation" const="yes">25331 <desc>25332 Returns the list of commands for particular operation.25333 </desc>25334 <param name="cloudOperation" type="CloudOperation" dir="in">25335 <desc>25336 The type of the supported cloud operation.25337 </desc>25338 </param>25339 <param name="prep" type="boolean" dir="in">25340 <desc>25341 Which list to return: false - general commands, true - preparatory commands25342 </desc>25343 </param>25344 <param name="cloudCommands" type="CloudCommand" safearray="yes" dir="return">25345 <desc>25346 The list of cloud commands.25347 </desc>25348 </param>25349 </method>25350 25351 <method name="getOperationParameters" const="yes">25352 <desc>25353 Returns the parameters with their values.25354 </desc>25355 <param name="cloudOperation" type="CloudOperation" dir="in">25356 <desc>25357 The type of the supported cloud operation.25358 </desc>25359 </param>25360 <param name="jsonString" type="wstring" dir="return">25361 <desc>the parameters with values in json format.</desc>25362 </param>25363 </method>25364 25365 <method name="getExportParameters" const="yes">25366 <desc>25367 Returns the parameters required to be shown to user for export a VM to a cloud operation.25368 </desc>25369 <param name="jsonString" type="wstring" dir="return">25370 <desc>the parameters with values in json format.</desc>25371 </param>25372 </method>25373 25374 <method name="exportVM">25375 <desc>25376 Exports a VM described in description parameter25377 </desc>25378 <param name="description" type="IVirtualSystemDescription" dir="in">25379 <desc>VirtualSystemDescription object which is describing a machine and all required parameters.</desc>25380 </param>25381 <param name="progress" type="IProgress" dir="in">25382 <desc>Progress object to track the operation completion.</desc>25383 </param>25384 25091 <param name="virtualBox" type="IVirtualBox" dir="in"> 25385 25092 <desc>Reference to the server-side API root object.</desc> 25386 25093 </param> 25387 25094 </method> 25388 25389 25390 25391 25392 25095 </interface> 25393 25096 -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r74886 r75038 980 980 } 981 981 982 #ifndef VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS983 SetUpProgressMode mode = ExportOCI;984 985 rc = i_setUpProgress(aProgress,986 BstrFmt(tr("Export appliance to Cloud '%s'"), aLocInfo.strPath.c_str()),987 mode);988 if (FAILED(rc))989 return rc;990 #else991 982 // we need to do that as otherwise Task won't be created successfully 992 983 aProgress.createObject(); 993 #endif994 984 995 985 // Initialize our worker task … … 2356 2346 { 2357 2347 LogRel(("Appliance::i_writeFSOCI\n")); 2358 2359 RT_NOREF(pTask); // XXX2360 2348 LogFlowFuncEnter(); 2361 2349 … … 2371 2359 hrc = ociProfile->CreateCloudClient(cloudClient.asOutParam()); 2372 2360 2373 #ifndef VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS2374 2375 int vrc = VINF_SUCCESS;2376 //fills by values from m->m_OciExportData2377 //mostly all names(keys) come from official OCI API documentation (see LaunchInstance description)2378 SafeArray <BSTR> paramNames;2379 SafeArray <BSTR> paramValues;2380 2381 Bstr("displayName").detachTo(paramNames.appendedRaw());2382 Bstr(m->m_OciExportData.strDisplayMachineName).detachTo(paramValues.appendedRaw());2383 Bstr("objectName").detachTo(paramNames.appendedRaw());2384 Bstr(m->m_OciExportData.strBootImageName).detachTo(paramValues.appendedRaw());2385 Bstr("vcnId").detachTo(paramNames.appendedRaw());2386 Bstr(m->m_OciExportData.strVCN).detachTo(paramValues.appendedRaw());2387 Bstr("bucketName").detachTo(paramNames.appendedRaw());2388 Bstr(m->m_OciExportData.strBucketId).detachTo(paramValues.appendedRaw());2389 Bstr("bootVolumeSizeInGBs").detachTo(paramNames.appendedRaw());2390 Bstr(m->m_OciExportData.strBootDiskSize).detachTo(paramValues.appendedRaw());2391 Bstr("availabilityDomain").detachTo(paramNames.appendedRaw());2392 Bstr(m->m_OciExportData.strDomainName).detachTo(paramValues.appendedRaw());2393 Bstr("shape").detachTo(paramNames.appendedRaw());2394 Bstr(m->m_OciExportData.strInstanceShapeId).detachTo(paramValues.appendedRaw());2395 Bstr("profileName").detachTo(paramNames.appendedRaw());2396 Bstr(m->m_OciExportData.strProfileName).detachTo(paramValues.appendedRaw());2397 Bstr("assignPublicIp").detachTo(paramNames.appendedRaw());2398 Utf8Str fIP = (m->m_OciExportData.fPublicIP == true) ? "true" : "false";2399 Bstr(fIP.c_str()).detachTo(paramValues.appendedRaw());2400 2401 com::SafeArray<CloudCommand_T> commandList;2402 2403 if (SUCCEEDED(hrc))2404 {2405 try2406 {2407 hrc = cloudClient->GetCommandsForOperation(CloudOperation_exportVM, false,2408 ComSafeArrayAsOutParam(commandList));2409 if (SUCCEEDED(hrc))2410 {2411 SafeArray <BSTR> commandIdList;2412 2413 for (ULONG i = 0; i < commandList.size(); i++)2414 {2415 CloudCommand_T cmd = commandList[i];2416 Utf8Str cond;2417 switch(cmd)2418 {2419 case CloudCommand_getImage:2420 case CloudCommand_getSubnet:2421 cond.assign("AVAILABLE");2422 break;2423 case CloudCommand_getInstance:2424 cond.assign("RUNNING");2425 break;2426 default:2427 break;2428 }2429 2430 Bstr bStrId;2431 hrc = cloudClient->CreateCommand(cmd, (cond.isEmpty()) ? NULL : Bstr(cond.c_str()).raw(), bStrId.asOutParam());2432 2433 if (SUCCEEDED(hrc))2434 {2435 bStrId.detachTo(commandIdList.appendedRaw());2436 }2437 }2438 2439 if (SUCCEEDED(hrc))2440 vrc = cloudClient->RunSeveralCommands(ComSafeArrayAsInParam(commandIdList),2441 ComSafeArrayAsInParam(paramNames),2442 ComSafeArrayAsInParam(paramValues),2443 pTask->pProgress);2444 if (RT_FAILURE(vrc))2445 hrc = E_FAIL;2446 }2447 }2448 catch (HRESULT arc)2449 {2450 hrc = arc;2451 }2452 catch (...)2453 {2454 LogRel(("Appliance::i_writeFSOCI(): get caught unknown exception\n"));2455 }2456 2457 cloudClient.setNull();2458 }2459 #else2460 LogRel(("Appliance::i_writeFSOCI(): #ifdef VBOX_WITH_CLOUD_PROVIDERS_NO_COMMANDS section \n"));2461 2361 if (SUCCEEDED(hrc)) 2462 2362 { … … 2481 2381 } 2482 2382 } 2483 #endif2484 2383 2485 2384 LogFlowFuncLeave(); 2486 2385 return hrc; 2487 2386 } 2387 2388 2488 2389 /** 2489 2390 * Writes the Oracle Public Cloud appliance.
Note:
See TracChangeset
for help on using the changeset viewer.