Changeset 79605 in vbox
- Timestamp:
- Jul 8, 2019 7:02:42 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131907
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp
r79583 r79605 982 982 static const RTGETOPTDEF s_aOptions[] = 983 983 { 984 { "-- compartment-id", 'c', RTGETOPT_REQ_STRING },984 { "--image-id", 'i', RTGETOPT_REQ_STRING }, 985 985 { "--bucket-name", 'b', RTGETOPT_REQ_STRING }, 986 { "--object-name", 'o', RTGETOPT_REQ_STRING } ,987 { "--display-name", 'd', RTGETOPT_REQ_STRING }988 };989 RTGETOPT STATE GetState;990 RTGETOPTUNION ValueUnion;991 int vrc = RTGetOptInit(&GetState, a->argc, a->argv, s_aOptions, RT_ELEMENTS(s_aOptions), iFirst, 0);992 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 993 986 { "--object-name", 'o', RTGETOPT_REQ_STRING } 987 }; 988 RTGETOPTSTATE GetState; 989 RTGETOPTUNION ValueUnion; 990 int vrc = RTGetOptInit(&GetState, a->argc, a->argv, s_aOptions, RT_ELEMENTS(s_aOptions), iFirst, 0); 991 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 992 993 Utf8Str strImageId; 994 994 Utf8Str strCompartmentId; 995 995 Utf8Str strBucketName; … … 1003 1003 switch (c) 1004 1004 { 1005 case ' c':1006 str CompartmentId=ValueUnion.psz;1007 Bstr(Utf8Str(" compartment-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());1005 case 'i': 1006 strImageId=ValueUnion.psz; 1007 Bstr(Utf8Str("image-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 1008 1008 break; 1009 1009 case 'b': … … 1015 1015 Bstr(Utf8Str("object-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 1016 1016 break; 1017 case 'd':1018 strDisplayName=ValueUnion.psz;1019 Bstr(Utf8Str("display-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw());1020 break;1021 1017 case VINF_GETOPT_NOT_OPTION: 1022 1018 return errorUnknownSubcommand(ValueUnion.psz); … … 1030 1026 pCloudProfile->COMGETTER(Name)(bstrProfileName.asOutParam()); 1031 1027 1028 ComPtr<IVirtualBox> pVirtualBox = a->virtualBox; 1029 Bstr bstrImageId; 1032 1030 ComObjPtr<ICloudClient> oCloudClient; 1033 1031 CHECK_ERROR2_RET(hrc, pCloudProfile, 1034 1032 CreateCloudClient(oCloudClient.asOutParam()), 1035 1033 RTEXITCODE_FAILURE); 1036 RTPrintf("Creating cloud image \'%s\' from an object \'%s\'...\n", strDisplayName.c_str(), strObjectName.c_str());1034 RTPrintf("Creating an object \'%s\' from the cloud image \'%s\'...\n", strObjectName.c_str(), strImageId.c_str()); 1037 1035 1038 1036 ComPtr<IProgress> progress; 1039 1037 CHECK_ERROR2_RET(hrc, oCloudClient, 1040 CreateImage(ComSafeArrayAsInParam(parameters), progress.asOutParam()),1038 ImportImage(pVirtualBox, ComSafeArrayAsInParam(parameters), progress.asOutParam()), 1041 1039 RTEXITCODE_FAILURE); 1042 1040 hrc = showProgress(progress); 1043 CHECK_PROGRESS_ERROR_RET(progress, ("Cloud image creationfailed"), RTEXITCODE_FAILURE);1041 CHECK_PROGRESS_ERROR_RET(progress, ("Cloud image import failed"), RTEXITCODE_FAILURE); 1044 1042 1045 1043 if (SUCCEEDED(hrc)) 1046 RTPrintf("Cloud image was created successfully\n"); 1044 { 1045 RTPrintf("Cloud image was imported successfully. Find the downloaded object with the name %s " 1046 "in the system temp folder (find the possible environment variables like TEMP, TMP and etc.)\n", 1047 strObjectName.c_str()); 1048 } 1047 1049 1048 1050 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r79585 r79605 26011 26011 <interface 26012 26012 name="ICloudClient" extends="$unknown" 26013 uuid=" 361276ab-3be4-4a1a-abf2-2993048766c4"26013 uuid="7ec55937-3152-4e06-8192-c3828aadc7ab" 26014 26014 wsmap="managed" reservedMethods="16" reservedAttributes="8" 26015 26015 > … … 26157 26157 <method name="importInstance"> 26158 26158 <desc> 26159 Import an existing instance with passed id to the local host. 26159 Import an existing cloud instance to the local host. 26160 All needed parameters are passed in the description (VSD). 26160 26161 </desc> 26161 26162 <param name="description" type="IVirtualSystemDescription" dir="in"> 26162 26163 <desc>VirtualSystemDescription object which is describing a machine and all required parameters.</desc> 26163 </param>26164 <param name="uid" type="wstring" dir="in">26165 <desc>the id of instance imported from the Cloud.</desc>26166 26164 </param> 26167 26165 <param name="virtualBox" type="IVirtualBox" dir="in"> … … 26281 26279 <desc>Reference to the existing VBox image.</desc> 26282 26280 </param> 26281 <param name="virtualBox" type="IVirtualBox" dir="in"> 26282 <desc>Reference to the server-side API root object.</desc> 26283 </param> 26284 <param name="parameters" type="wstring" dir="in" safearray="yes"> 26285 <desc>Each parameter in the array must be in the form "name=value".</desc> 26286 </param> 26287 <param name="progress" type="IProgress" dir="return"> 26288 <desc>Progress object to track the operation completion.</desc> 26289 </param> 26290 </method> 26291 26292 <method name="importImage"> 26293 <desc> 26294 Import an existing image in the Cloud into the VirtualBox. 26295 </desc> 26283 26296 <param name="virtualBox" type="IVirtualBox" dir="in"> 26284 26297 <desc>Reference to the server-side API root object.</desc>
Note:
See TracChangeset
for help on using the changeset viewer.