Examples of SwiftTO


Examples of com.cloud.agent.api.to.SwiftTO

        return created;
    }

    @Override
    public SwiftTO toSwiftTO() {
        return new SwiftTO(getId(), getUrl(), getAccount(), getUserName(), getKey());
    }
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

        }
    }

    @Test
    public void testGetSwift() {
        SwiftTO s1 = new SwiftTO();
        bsc.setSwift(s1);
        SwiftTO s2 = bsc.getSwift();
        assertEquals(s1, s2);
    }
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

    }

    @Override
    public void deleteIso(DeleteIsoCmd cmd) {
        String msg;
        SwiftTO swift = getSwiftTO();
        if (swift == null) {
            msg = "There is no Swift in this setup";
            s_logger.warn(msg);
            throw new CloudRuntimeException(msg);
        }
        VMTemplateSwiftVO tmpltSwiftRef = _vmTmpltSwiftlDao.findBySwiftTemplate(swift.getId(), cmd.getId());
        if ( tmpltSwiftRef == null ) {
           msg = "Delete ISO failed due to  cannot find ISO " + cmd.getId() + " in Swift ";
           s_logger.warn(msg);
           throw new CloudRuntimeException(msg);
        }
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

    }

    @Override
    public void deleteTemplate(DeleteTemplateCmd cmd) {
        String msg;
        SwiftTO swift = getSwiftTO();
        if (swift == null) {
            msg = "There is no Swift in this setup";
            s_logger.warn(msg);
            throw new CloudRuntimeException(msg);
        }
        VMTemplateSwiftVO tmpltSwiftRef = _vmTmpltSwiftlDao.findBySwiftTemplate(swift.getId(), cmd.getId());
        if (tmpltSwiftRef == null) {
            msg = "Delete Template failed due to cannot find Template" + cmd.getId() + " in Swift ";
            s_logger.warn(msg);
            throw new CloudRuntimeException(msg);
        }
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

    }

    @Override
    public void propagateTemplateOnAllZones(Long tmpltId) {
        String msg;
        SwiftTO swift = getSwiftTO();
        if (swift == null) {
            msg = "There is no Swift in this setup";
            s_logger.trace(msg);
            return;
        }
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

    }

    @Override
    public void propagateSwiftTmplteOnZone(Long zoneId) {
        String msg;
        SwiftTO swift = getSwiftTO();
        if (swift == null) {
            msg = "There is no Swift in this setup";
            s_logger.trace(msg);
            return;
        }
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

        }
    }

    @Override
    public Long chooseZoneForTmpltExtract(Long tmpltId) {
        SwiftTO swift = getSwiftTO();
        if (swift == null) {
            return null;
        }
       
        List<VMTemplateHostVO> tmpltHosts = _vmTmpltHostDao.listByOnlyTemplateId(tmpltId);
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

    @Test
    public void testExecuteRequest() throws Exception {
        TemplateObjectTO template = Mockito.mock(TemplateObjectTO.class);
        NfsTO cacheStore = Mockito.mock(NfsTO.class);
        Mockito.when(cacheStore.getUrl()).thenReturn("nfs://nfs2.lab.vmops.com/export/home/edison/");
        SwiftTO swift = Mockito.mock(SwiftTO.class);
        Mockito.when(swift.getEndPoint()).thenReturn("https://objects.dreamhost.com/auth");
        Mockito.when(swift.getAccount()).thenReturn("cloudstack");
        Mockito.when(swift.getUserName()).thenReturn("images");
        Mockito.when(swift.getKey()).thenReturn("oxvELQaOD1U5_VyosGfA-wpZ7uBWEff-CUBGCM0u");

        Mockito.when(template.getDataStore()).thenReturn(swift);
        Mockito.when(template.getPath()).thenReturn("template/1/1/");
        Mockito.when(template.isRequiresHvm()).thenReturn(true);
        Mockito.when(template.getId()).thenReturn(1L);
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

                    return answer;
                }
                s_logger.debug("starting copy template to swift");
                DataTO newTemplate = answer.getNewData();
                File templateFile = getFile(newTemplate.getPath(), ((NfsTO) srcDataStore).getUrl());
                SwiftTO swift = (SwiftTO)destDataStore;
                String containterName = SwiftUtil.getContainerName(destData.getObjectType().toString(), destData.getId());
                String swiftPath = SwiftUtil.putObject(swift, templateFile, containterName, templateFile.getName());
                //upload template.properties
                File properties = new File(templateFile.getParent() + File.separator + _tmpltpp);
                if (properties.exists()) {
View Full Code Here

Examples of com.cloud.agent.api.to.SwiftTO

            s_logger.debug("Faild to get url:"+ url + ", due to " + e.toString());
            throw new CloudRuntimeException(e);
        }
    }
    protected Answer registerTemplateOnSwift(DownloadCommand cmd) {
        SwiftTO swiftTO = (SwiftTO)cmd.getDataStore();
        String path = cmd.getInstallPath();
        DataStoreTO cacheStore = cmd.getCacheStore();
        if (cacheStore == null || !(cacheStore instanceof NfsTO)) {
            return new DownloadAnswer("cache store can't be null", VMTemplateStorageResourceAssoc.Status.DOWNLOAD_ERROR);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.