Changeset 79583 in vbox
- Timestamp:
- Jul 8, 2019 7:26:43 AM (5 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
-
Frontends/VBoxManage/VBoxManageCloud.cpp (modified) (7 diffs)
-
Main/idl/VirtualBox.xidl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloud.cpp
r79319 r79583 813 813 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 814 814 815 Utf8Str strCompartmentId ("compartment-id");816 Utf8Str strInstanceId ("instance-id");817 Utf8Str strDisplayName ("display-name");815 Utf8Str strCompartmentId; 816 Utf8Str strInstanceId; 817 Utf8Str strDisplayName; 818 818 com::SafeArray<BSTR> parameters; 819 819 … … 824 824 { 825 825 case 'c': 826 strCompartmentId .append("=").append(ValueUnion.psz);827 Bstr( strCompartmentId).detachTo(parameters.appendedRaw());826 strCompartmentId=ValueUnion.psz; 827 Bstr(Utf8Str("compartment-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 828 828 break; 829 829 case 'i': 830 strInstanceId .append("=").append(ValueUnion.psz);831 Bstr( strInstanceId).detachTo(parameters.appendedRaw());830 strInstanceId=ValueUnion.psz; 831 Bstr(Utf8Str("instance-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 832 832 break; 833 833 case 'd': 834 strDisplayName .append("=").append(ValueUnion.psz);835 Bstr( strDisplayName).detachTo(parameters.appendedRaw());834 strDisplayName=ValueUnion.psz; 835 Bstr(Utf8Str("display-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 836 836 break; 837 837 case VINF_GETOPT_NOT_OPTION: … … 885 885 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 886 886 887 Utf8Str strBucketName ("bucket-name");888 Utf8Str strObjectName ("object-name");887 Utf8Str strBucketName; 888 Utf8Str strObjectName; 889 889 Utf8Str strImageId; 890 890 com::SafeArray<BSTR> parameters; … … 896 896 { 897 897 case 'b': 898 strBucketName .append("=").append(ValueUnion.psz);899 Bstr( strBucketName).detachTo(parameters.appendedRaw());898 strBucketName=ValueUnion.psz; 899 Bstr(Utf8Str("bucket-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 900 900 break; 901 901 case 'o': 902 strObjectName .append("=").append(ValueUnion.psz);903 Bstr( strObjectName).detachTo(parameters.appendedRaw());902 strObjectName=ValueUnion.psz; 903 Bstr(Utf8Str("object-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 904 904 break; 905 905 case 'i': 906 strImageId =ValueUnion.psz;907 Bstr( strImageId).detachTo(parameters.appendedRaw());906 strImageId=ValueUnion.psz; 907 Bstr(Utf8Str("image-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 908 908 break; 909 909 case VINF_GETOPT_NOT_OPTION: … … 922 922 CreateCloudClient(oCloudClient.asOutParam()), 923 923 RTEXITCODE_FAILURE); 924 RTPrintf("Exporting cloud image \'%s\' to the object \'%s\'...\n", strImageId.c_str(), strObjectName.c_str()); 924 RTPrintf("Exporting image \'%s\' to the Cloud with name \'%s\'...\n", strImageId.c_str(), strObjectName.c_str()); 925 926 ComPtr<IVirtualBox> pVirtualBox = a->virtualBox; 927 SafeIfaceArray<IMedium> aImageList; 928 CHECK_ERROR2_RET(hrc, pVirtualBox, 929 COMGETTER(HardDisks)(ComSafeArrayAsOutParam(aImageList)), 930 RTEXITCODE_FAILURE); 931 932 ComPtr<IMedium> pImage; 933 size_t cImages = aImageList.size(); 934 bool fFound = false; 935 for (size_t i = 0; i < cImages; ++i) 936 { 937 pImage = aImageList[i]; 938 Bstr bstrImageId; 939 hrc = pImage->COMGETTER(Id)(bstrImageId.asOutParam()); 940 if (FAILED(hrc)) 941 continue; 942 943 com::Guid imageId(bstrImageId); 944 945 if (!imageId.isValid() || imageId.isZero()) 946 continue; 947 948 if (!strImageId.compare(imageId.toString())) 949 { 950 fFound = true; 951 RTPrintf("Image %s was found\n", strImageId.c_str()); 952 break; 953 } 954 } 955 956 if (!fFound) 957 { 958 RTPrintf("Process of exporting the image to the Cloud was interrupted. The image wasn't found.\n"); 959 return RTEXITCODE_FAILURE; 960 } 925 961 926 962 ComPtr<IProgress> progress; 927 963 CHECK_ERROR2_RET(hrc, oCloudClient, 928 ExportImage( Bstr(strImageId).raw(), ComSafeArrayAsInParam(parameters), progress.asOutParam()),964 ExportImage(pImage, pVirtualBox, ComSafeArrayAsInParam(parameters), progress.asOutParam()), 929 965 RTEXITCODE_FAILURE); 930 966 hrc = showProgress(progress); 931 CHECK_PROGRESS_ERROR_RET(progress, (" Cloud image exportfailed"), RTEXITCODE_FAILURE);967 CHECK_PROGRESS_ERROR_RET(progress, ("Export the image to the Cloud failed"), RTEXITCODE_FAILURE); 932 968 933 969 if (SUCCEEDED(hrc)) 934 RTPrintf(" Cloud image was exported successfully\n");970 RTPrintf("Export the image to the Cloud was successfull\n"); 935 971 936 972 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; … … 956 992 AssertRCReturn(vrc, RTEXITCODE_FAILURE); 957 993 958 Utf8Str strCompartmentId ("compartment-id");959 Utf8Str strBucketName ("bucket-name");960 Utf8Str strObjectName ("object-name");961 Utf8Str strDisplayName ("display-name");994 Utf8Str strCompartmentId; 995 Utf8Str strBucketName; 996 Utf8Str strObjectName; 997 Utf8Str strDisplayName; 962 998 com::SafeArray<BSTR> parameters; 963 999 … … 968 1004 { 969 1005 case 'c': 970 strCompartmentId .append("=").append(ValueUnion.psz);971 Bstr( strCompartmentId).detachTo(parameters.appendedRaw());1006 strCompartmentId=ValueUnion.psz; 1007 Bstr(Utf8Str("compartment-id=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 972 1008 break; 973 1009 case 'b': 974 strBucketName .append("=").append(ValueUnion.psz);975 Bstr( strBucketName).detachTo(parameters.appendedRaw());1010 strBucketName=ValueUnion.psz; 1011 Bstr(Utf8Str("bucket-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 976 1012 break; 977 1013 case 'o': 978 strObjectName .append("=").append(ValueUnion.psz);979 Bstr( strObjectName).detachTo(parameters.appendedRaw());1014 strObjectName=ValueUnion.psz; 1015 Bstr(Utf8Str("object-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 980 1016 break; 981 1017 case 'd': 982 strDisplayName .append("=").append(ValueUnion.psz);983 Bstr( strDisplayName).detachTo(parameters.appendedRaw());1018 strDisplayName=ValueUnion.psz; 1019 Bstr(Utf8Str("display-name=").append(ValueUnion.psz)).detachTo(parameters.appendedRaw()); 984 1020 break; 985 1021 case VINF_GETOPT_NOT_OPTION: -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r79466 r79583 26011 26011 <interface 26012 26012 name="ICloudClient" extends="$unknown" 26013 uuid=" 1c757554-9768-11e9-9319-ab248c01ad59"26013 uuid="361276ab-3be4-4a1a-abf2-2993048766c4" 26014 26014 wsmap="managed" reservedMethods="16" reservedAttributes="8" 26015 26015 > … … 26155 26155 </method> 26156 26156 26157 <method name="importInstance"> 26158 <desc> 26159 Import an existing instance with passed id to the local host. 26160 </desc> 26161 <param name="description" type="IVirtualSystemDescription" dir="in"> 26162 <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 UUID of instance imported from the Cloud.</desc> 26166 </param> 26167 <param name="virtualBox" type="IVirtualBox" dir="in"> 26168 <desc>Reference to the server-side API root object.</desc> 26169 </param> 26170 <param name="progress" type="IProgress" dir="in"> 26171 <desc>Progress object to track the operation completion.</desc> 26172 </param> 26173 </method> 26174 26157 26175 <method name="listInstances" const="yes"> 26158 26176 <desc> … … 26208 26226 </method> 26209 26227 26210 <method name="importInstance"> 26211 <desc> 26212 Import an existing instance with passed id to the local host. 26213 </desc> 26214 <param name="description" type="IVirtualSystemDescription" dir="in"> 26215 <desc>VirtualSystemDescription object which is describing a machine and all required parameters.</desc> 26216 </param> 26228 <method name="startInstance"> 26229 <desc> 26230 Start an existing instance with passed id. 26231 </desc> 26217 26232 <param name="uid" type="wstring" dir="in"> 26218 <desc>the UUID of instance imported from the Cloud.</desc> 26233 <desc>the UUID of instance in the Cloud.</desc> 26234 </param> 26235 <param name="progress" type="IProgress" dir="return"> 26236 <desc>Progress object to track the operation completion.</desc> 26237 </param> 26238 </method> 26239 26240 <method name="pauseInstance"> 26241 <desc> 26242 Pause an existing instance with passed id. 26243 </desc> 26244 <param name="uid" type="wstring" dir="in"> 26245 <desc>the UUID of instance in the Cloud.</desc> 26246 </param> 26247 <param name="progress" type="IProgress" dir="return"> 26248 <desc>Progress object to track the operation completion.</desc> 26249 </param> 26250 </method> 26251 26252 <method name="terminateInstance"> 26253 <desc> 26254 Terminate an existing instance with passed id. 26255 </desc> 26256 <param name="uid" type="wstring" dir="in"> 26257 <desc>the UUID of instance in the Cloud.</desc> 26258 </param> 26259 <param name="progress" type="IProgress" dir="return"> 26260 <desc>Progress object to track the operation completion.</desc> 26261 </param> 26262 </method> 26263 26264 <method name="createImage"> 26265 <desc> 26266 Create an image in the Cloud. 26267 </desc> 26268 <param name="parameters" type="wstring" dir="in" safearray="yes"> 26269 <desc>Each parameter in the array must be in the form "name=value".</desc> 26270 </param> 26271 <param name="progress" type="IProgress" dir="return"> 26272 <desc>Progress object to track the operation completion.</desc> 26273 </param> 26274 </method> 26275 26276 <method name="exportImage"> 26277 <desc> 26278 Export an existing image with passed id somewhere in the Cloud. 26279 </desc> 26280 <param name="image" type="IMedium" dir="in"> 26281 <desc>Reference to the existing VBox image.</desc> 26219 26282 </param> 26220 26283 <param name="virtualBox" type="IVirtualBox" dir="in"> 26221 26284 <desc>Reference to the server-side API root object.</desc> 26222 </param>26223 <param name="progress" type="IProgress" dir="in">26224 <desc>Progress object to track the operation completion.</desc>26225 </param>26226 </method>26227 26228 <method name="startInstance">26229 <desc>26230 Start an existing instance with passed id.26231 </desc>26232 <param name="uid" type="wstring" dir="in">26233 <desc>the UUID of instance in the Cloud.</desc>26234 </param>26235 <param name="progress" type="IProgress" dir="return">26236 <desc>Progress object to track the operation completion.</desc>26237 </param>26238 </method>26239 26240 <method name="pauseInstance">26241 <desc>26242 Pause an existing instance with passed id.26243 </desc>26244 <param name="uid" type="wstring" dir="in">26245 <desc>the UUID of instance in the Cloud.</desc>26246 </param>26247 <param name="progress" type="IProgress" dir="return">26248 <desc>Progress object to track the operation completion.</desc>26249 </param>26250 </method>26251 26252 <method name="terminateInstance">26253 <desc>26254 Terminate an existing instance with passed id.26255 </desc>26256 <param name="uid" type="wstring" dir="in">26257 <desc>the UUID of instance in the Cloud.</desc>26258 </param>26259 <param name="progress" type="IProgress" dir="return">26260 <desc>Progress object to track the operation completion.</desc>26261 </param>26262 </method>26263 26264 <method name="createImage">26265 <desc>26266 Create an image in the Cloud.26267 </desc>26268 <param name="parameters" type="wstring" dir="in" safearray="yes">26269 <desc>Each parameter in the array must be in the form "name=value".</desc>26270 </param>26271 <param name="progress" type="IProgress" dir="return">26272 <desc>Progress object to track the operation completion.</desc>26273 </param>26274 </method>26275 26276 <method name="exportImage">26277 <desc>26278 Export an existing image with passed id somewhere in the Cloud.26279 </desc>26280 <param name="uid" type="wstring" dir="in">26281 <desc>the UUID of image in the Cloud.</desc>26282 26285 </param> 26283 26286 <param name="parameters" type="wstring" dir="in" safearray="yes">
Note:
See TracChangeset
for help on using the changeset viewer.

