VirtualBox

Ignore:
Timestamp:
Nov 27, 2018 11:00:10 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126968
Message:

bugref:9152. Replaced the word "oci" by "cloud" in the names in the Appliance code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r75434 r75766  
    3939
    4040#include "ApplianceImplPrivate.h"
    41 
    42 //#include "OCIProvider.h"
    43 //#include "CloudClientImpl.h"
    44 //#include "OCIProfile.h"
    45 //#include "CloudAPI.h"
    46 //#include "VBoxOCIApi.h"
    47 //#include "VBoxOCIRest.h"
    4841
    4942using namespace std;
     
    666659     * the error straight from the API call but a tiny bit later through the
    667660     * Progress object. */
    668     if (m->locInfo.storageType == VFSType_OCI)//(isCloudDestination(aPath))
     661    if (m->locInfo.storageType == VFSType_Cloud)//(isCloudDestination(aPath))
    669662    {
    670663        rc = S_OK;
     
    672665        try
    673666        {
    674             switch (m->locInfo.storageType)
    675             {
    676                 case VFSType_OCI:
    677                     rc = i_writeOCIImpl(m->locInfo, progress);
    678                     break;
    679 //              case VFSType_GCP:
    680 //                  rc = i_writeGCPImpl(m->locInfo, progress);
    681 //                  break;
    682 //              case VFSType_Amazon:
    683 //                  rc = i_writeAmazonImpl(m->locInfo, progress);
    684 //                  break;
    685 //              case VFSType_Azure:
    686 //                  rc = i_writeAzureImpl(m->locInfo, progress);
    687 //                  break;
    688                 default:
    689                     break;
    690             }
    691 
     667            rc = i_writeCloudImpl(m->locInfo, progress);
    692668        }
    693669        catch (HRESULT aRC)
     
    859835
    860836
    861 HRESULT Appliance::i_writeOCIImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress)
     837HRESULT Appliance::i_writeCloudImpl(const LocationInfo &aLocInfo, ComObjPtr<Progress> &aProgress)
    862838{
    863839    HRESULT rc;
     
    901877            {
    902878                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    903                                     tr("Strange, but nothing to export to OCI after preparation steps"));
     879                                    tr("There are no images to export to Cloud after preparation steps"));
    904880            }
    905881
     
    910886                vsdescThis->i_findByType(VirtualSystemDescriptionType_Name);
    911887            if (machineName.empty())
    912                 throw setError(VBOX_E_FILE_ERROR, tr("OCI: VM name wasn't found"));
    913             m->m_OciExportData.strDisplayMachineName = machineName.front()->strVBoxCurrent;
    914             LogRel(("Exported machine name: %s\n", m->m_OciExportData.strDisplayMachineName.c_str()));
    915 
    916             m->m_OciExportData.strBootImageName = strBootLocation;
    917             LogRel(("Exported image: %s\n", m->m_OciExportData.strBootImageName.c_str()));
     888                throw setError(VBOX_E_FILE_ERROR, tr("Cloud: VM name wasn't found"));
     889            m->m_CloudExportData.strDisplayMachineName = machineName.front()->strVBoxCurrent;
     890            LogRel(("Exported machine name: %s\n", m->m_CloudExportData.strDisplayMachineName.c_str()));
     891
     892            m->m_CloudExportData.strBootImageName = strBootLocation;
     893            LogRel(("Exported image: %s\n", m->m_CloudExportData.strBootImageName.c_str()));
    918894
    919895            if (aLocInfo.strPath.isEmpty())
    920896                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    921                                     tr("OCI: Cloud user profile wasn't found"));
    922 
    923             m->m_OciExportData.strProfileName = aLocInfo.strPath;
    924             LogRel(("OCI profile name: %s\n", m->m_OciExportData.strProfileName.c_str()));
     897                                    tr("Cloud: Cloud user profile wasn't found"));
     898
     899            m->m_CloudExportData.strProfileName = aLocInfo.strPath;
     900            LogRel(("profile name: %s\n", m->m_CloudExportData.strProfileName.c_str()));
    925901
    926902            Utf8Str strInstanceShapeId;
     
    929905            if (shapeId.empty())
    930906                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    931                                     tr("OCI: Shape of instance wasn't found"));
    932 
    933             m->m_OciExportData.strInstanceShapeId = shapeId.front()->strVBoxCurrent;
    934             LogRel(("OCI shape: %s\n", m->m_OciExportData.strInstanceShapeId.c_str()));
     907                                    tr("Cloud: Shape of instance wasn't found"));
     908
     909            m->m_CloudExportData.strInstanceShapeId = shapeId.front()->strVBoxCurrent;
     910            LogRel(("Shape: %s\n", m->m_CloudExportData.strInstanceShapeId.c_str()));
    935911
    936912            std::list<VirtualSystemDescriptionEntry*> domainName =
     
    938914            if (domainName.empty())
    939915                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    940                                     tr("OCI: Available domain wasn't found"));
    941 
    942             m->m_OciExportData.strDomainName = domainName.front()->strVBoxCurrent;
    943             LogRel(("OCI available domain name: %s\n", m->m_OciExportData.strDomainName.c_str()));
     916                                    tr("Cloud: Available domain wasn't found"));
     917
     918            m->m_CloudExportData.strDomainName = domainName.front()->strVBoxCurrent;
     919            LogRel(("Available domain name: %s\n", m->m_CloudExportData.strDomainName.c_str()));
    944920
    945921            std::list<VirtualSystemDescriptionEntry*> bootDiskSize =
     
    947923            if (bootDiskSize.empty())
    948924                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    949                                     tr("OCI: Boot disk size wasn't found"));
    950 
    951             m->m_OciExportData.strBootDiskSize = bootDiskSize.front()->strVBoxCurrent;
    952             LogRel(("OCI boot disk size: %s\n", m->m_OciExportData.strBootDiskSize.c_str()));
     925                                    tr("Cloud: Boot disk size wasn't found"));
     926
     927            m->m_CloudExportData.strBootDiskSize = bootDiskSize.front()->strVBoxCurrent;
     928            LogRel(("Boot disk size: %s\n", m->m_CloudExportData.strBootDiskSize.c_str()));
    953929
    954930            std::list<VirtualSystemDescriptionEntry*> bucketId =
     
    956932            if (bucketId.empty())
    957933                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    958                                     tr("OCI: Bucket wasn't found"));
    959 
    960             m->m_OciExportData.strBucketId = bucketId.front()->strVBoxCurrent;
    961             LogRel(("OCI bucket name: %s\n", m->m_OciExportData.strBucketId.c_str()));
     934                                    tr("Cloud: Bucket wasn't found"));
     935
     936            m->m_CloudExportData.strBucketId = bucketId.front()->strVBoxCurrent;
     937            LogRel(("bucket name: %s\n", m->m_CloudExportData.strBucketId.c_str()));
    962938
    963939            std::list<VirtualSystemDescriptionEntry*> subnet =
     
    965941            if (subnet.empty())
    966942                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    967                                     tr("OCI: Subnet wasn't found"));
    968 
    969             m->m_OciExportData.strSubnet = subnet.front()->strVBoxCurrent;
    970             LogRel(("OCI Subnet name: %s\n", m->m_OciExportData.strSubnet.c_str()));
     943                                    tr("Cloud: Subnet wasn't found"));
     944
     945            m->m_CloudExportData.strSubnet = subnet.front()->strVBoxCurrent;
     946            LogRel(("Subnet name: %s\n", m->m_CloudExportData.strSubnet.c_str()));
    971947
    972948            std::list<VirtualSystemDescriptionEntry*> publicIP =
     
    974950            if (publicIP.empty())
    975951                throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    976                                     tr("OCI: Public IP setting wasn't found"));
    977 
    978             m->m_OciExportData.fPublicIP = (publicIP.front()->strVBoxCurrent == "true") ? true : false;
    979             LogRel(("OCI public IP: %s\n", m->m_OciExportData.fPublicIP ? "yes" : "no"));
     952                                    tr("Cloud: Public IP setting wasn't found"));
     953
     954            m->m_CloudExportData.fPublicIP = (publicIP.front()->strVBoxCurrent == "true") ? true : false;
     955            LogRel(("public IP: %s\n", m->m_CloudExportData.fPublicIP ? "yes" : "no"));
    980956        }
    981957
     
    984960
    985961        // Initialize our worker task
    986         TaskOCI* task = NULL;
     962        TaskCloud* task = NULL;
    987963        try
    988964        {
    989             task = new Appliance::TaskOCI(this, TaskOCI::Export, aLocInfo, aProgress);
     965            task = new Appliance::TaskCloud(this, TaskCloud::Export, aLocInfo, aProgress);
    990966        }
    991967        catch(...)
    992968        {
    993969            throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
    994                                 tr("Could not create TaskOCI object for exporting to OCI"));
     970                                tr("Could not create TaskCloud object for exporting to Cloud"));
    995971        }
    996972
     
    23432319 * instance with this image in the OCI Compute service.
    23442320 */
    2345 HRESULT Appliance::i_writeFSOCI(TaskOCI *pTask)
     2321HRESULT Appliance::i_writeFSCloud(TaskCloud *pTask)
    23462322{
    2347     LogRel(("Appliance::i_writeFSOCI\n"));
    23482323    LogFlowFuncEnter();
    23492324
     
    23522327    hrc = mVirtualBox->COMGETTER(CloudProviderManager)(cpm.asOutParam());
    23532328    Utf8Str strProviderName("OCI");
    2354     ComPtr<ICloudProvider> ociProvider;
    2355     hrc = cpm->GetProviderByShortName(Bstr(strProviderName.c_str()).raw(), ociProvider.asOutParam());
    2356     ComPtr<ICloudProfile> ociProfile;
    2357     hrc = ociProvider->GetProfileByName(Bstr(m->m_OciExportData.strProfileName.c_str()).raw(), ociProfile.asOutParam());
     2329    ComPtr<ICloudProvider> cloudProvider;
     2330    hrc = cpm->GetProviderByShortName(Bstr(strProviderName.c_str()).raw(), cloudProvider.asOutParam());
     2331    ComPtr<ICloudProfile> cloudProfile;
     2332    hrc = cloudProvider->GetProfileByName(Bstr(m->m_CloudExportData.strProfileName.c_str()).raw(), cloudProfile.asOutParam());
    23582333    ComObjPtr<ICloudClient> cloudClient;
    2359     hrc = ociProfile->CreateCloudClient(cloudClient.asOutParam());
     2334    hrc = cloudProfile->CreateCloudClient(cloudClient.asOutParam());
    23602335
    23612336    if (SUCCEEDED(hrc))
    23622337    {
    2363         LogRel(("Appliance::i_writeFSOCI(): calling OCICloudClient::exportVM\n"));
    2364 
    2365         /// @todo that's to be moved to ExpTack, but we need to have that method
    2366         /// exposed in .xidl
     2338        LogRel(("Appliance::i_writeFSCloud(): calling CloudClient::ExportLaunchVM\n"));
     2339
    23672340        if (m->virtualSystemDescriptions.size() == 1) {
    23682341            ComPtr<IVirtualBox> VBox(mVirtualBox);
    23692342
    23702343            pTask->pProgress->init(mVirtualBox, static_cast<IAppliance*>(this),
    2371                          Bstr("Exporting VM to OCI...").raw(),
     2344                         Bstr("Exporting VM to Cloud...").raw(),
    23722345                         TRUE /* aCancelable */,
    23732346                         5, // ULONG cOperations,
    23742347                         1000, // ULONG ulTotalOperationsWeight,
    2375                          Bstr("Exporting VM to OCI...").raw(), // aFirstOperationDescription
     2348                         Bstr("Exporting VM to Cloud...").raw(), // aFirstOperationDescription
    23762349                         10); // ULONG ulFirstOperationWeight,
    23772350
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette