Package com.cloud.stack.models

Examples of com.cloud.stack.models.CloudStackTemplate


                    if (!resp.getSuccess())
                        return false;
                }
                return true;
            }else if(request.getAttribute().equals(ImageAttribute.description)){
                CloudStackTemplate resp = getApi().updateTemplate(request.getImageId(), null, request.getDescription(), null, null, null, null);
                if (resp != null) {
                    return true;
                }
                return false;
            }
View Full Code Here


            EC2DescribeImagesResponse images = new EC2DescribeImagesResponse();
            images = listTemplates( templateId, images );
            EC2Image[] imageSet = images.getImageSet();
            String osTypeId = imageSet[0].getOsTypeId();

            CloudStackTemplate resp = getApi().createTemplate((request.getDescription() == null ? "" : request.getDescription()), request.getName(),
                    osTypeId, null, null, null, null, null, null, volumeId);
            if (resp == null || resp.getId() == null) {
                throw new Exception("Image couldn't be created");
            }

            //if template was created succesfully, create the new image response
            response.setId(resp.getId());

            // [C] If we stopped the virtual machine now we need to restart it
            if (needsRestart) {
                if (!startVirtualMachine( request.getInstanceId() ))
                        throw new Exception("Failed to start the stopped instance");
View Full Code Here

                    if (!resp.getSuccess())
                        return false;
                }
                return true;
            } else if (request.getAttribute().equals(ImageAttribute.description)) {
                CloudStackTemplate resp = getApi().updateTemplate(request.getImageId(), null, request.getDescription(), null, null, null, null);
                if (resp != null) {
                    return true;
                }
                return false;
            }
View Full Code Here

            EC2DescribeImagesResponse images = new EC2DescribeImagesResponse();
            images = listTemplates(templateId, images);
            EC2Image[] imageSet = images.getImageSet();
            String osTypeId = imageSet[0].getOsTypeId();

            CloudStackTemplate resp =
                getApi().createTemplate((request.getDescription() == null ? "" : request.getDescription()), request.getName(), osTypeId, null, null, null, null, null,
                    null, volumeId);
            if (resp == null || resp.getId() == null) {
                throw new Exception("Image couldn't be created");
            }

            //if template was created succesfully, create the new image response
            response.setId(resp.getId());

            // [C] If we stopped the virtual machine now we need to restart it
            if (needsRestart) {
                if (!startVirtualMachine(request.getInstanceId()))
                    throw new Exception("Failed to start the stopped instance");
View Full Code Here

      EC2DescribeImagesResponse images = new EC2DescribeImagesResponse();
      images = listTemplates( templateId, images );
      EC2Image[] imageSet = images.getImageSet();
      String osTypeId = imageSet[0].getOsTypeId();
     
      CloudStackTemplate resp = getApi().createTemplate((request.getDescription() == null ? "" : request.getDescription()), request.getName(),
          osTypeId, null, null, null, null, null, null, volumeId);
      if (resp == null || resp.getId() == null) {
        throw new EC2ServiceException(ServerError.InternalError, "An upexpected error occurred.");
      }
     
      //if template was created succesfully, create the new image response
      response = new EC2CreateImageResponse();
      response.setId(resp.getId());

      // [C] If we stopped the virtual machine now we need to restart it
      if (needsRestart) {
        if (!startVirtualMachine( request.getInstanceId() ))
          throw new EC2ServiceException(ServerError.InternalError,
View Full Code Here

                    if (!resp.getSuccess())
                        return false;
                }
                return true;
            }else if(request.getAttribute().equals(ImageAttribute.description)){
                CloudStackTemplate resp = getApi().updateTemplate(request.getImageId(), null, request.getDescription(), null, null, null, null);
                if (resp != null) {
                    return true;
                }
                return false;
            }
View Full Code Here

            EC2DescribeImagesResponse images = new EC2DescribeImagesResponse();
            images = listTemplates( templateId, images );
            EC2Image[] imageSet = images.getImageSet();
            String osTypeId = imageSet[0].getOsTypeId();

            CloudStackTemplate resp = getApi().createTemplate((request.getDescription() == null ? "" : request.getDescription()), request.getName(),
                    osTypeId, null, null, null, null, null, null, volumeId);
            if (resp == null || resp.getId() == null) {
                throw new EC2ServiceException(ServerError.InternalError, "An upexpected error occurred.");
            }

            //if template was created succesfully, create the new image response
            response = new EC2CreateImageResponse();
            response.setId(resp.getId());

            // [C] If we stopped the virtual machine now we need to restart it
            if (needsRestart) {
                if (!startVirtualMachine( request.getInstanceId() ))
                    throw new EC2ServiceException(ServerError.InternalError,
View Full Code Here

      EC2DescribeImagesResponse images = new EC2DescribeImagesResponse();
      images = listTemplates( templateId, images );
      EC2Image[] imageSet = images.getImageSet();
      String osTypeId = imageSet[0].getOsTypeId();
     
      CloudStackTemplate resp = getApi().createTemplate((request.getDescription() == null ? "" : request.getDescription()), request.getName(),
          osTypeId, null, null, null, null, null, null, volumeId);
      if (resp == null || resp.getId() == null) {
        throw new EC2ServiceException(ServerError.InternalError, "An upexpected error occurred.");
      }
     
      //if template was created succesfully, create the new image response
      response = new EC2CreateImageResponse();
      response.setId(resp.getId());

      // [C] If we stopped the virtual machine now we need to restart it
      if (needsRestart) {
        if (!startVirtualMachine( request.getInstanceId() ))
          throw new EC2ServiceException(ServerError.InternalError,
View Full Code Here

        try {
            images = listTemplates( request.getId(), images );
            EC2Image[] imageSet = images.getImageSet();
           
            CloudStackTemplate resp = getApi().updateTemplate(request.getId(), null, request.getDescription(), null, imageSet[0].getName(), null, null);
            if (resp != null) {
                return true;
            }
            return false;
        } catch( Exception e ) {
View Full Code Here

                    }
                }
                CloudStackInfoResponse resp = getApi().updateTemplatePermissions(request.getImageId(), accounts, null, null, isPublic, operation.toString());
                return resp.getSuccess();
            }else if(request.getAttribute().equals(ImageAttribute.description)){
                CloudStackTemplate resp = getApi().updateTemplate(request.getImageId(), null, request.getDescription(), null, null, null, null);
                if (resp != null) {
                    return true;
                }
                return false;
            }
View Full Code Here

TOP

Related Classes of com.cloud.stack.models.CloudStackTemplate

Copyright © 2018 www.massapicom. 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.