Package com.cloud.stack.models

Examples of com.cloud.stack.models.CloudStackInfoResponse


        try {
            List<CloudStackIpAddress> cloudIps = getApi().listPublicIpAddresses(null, null, null, null, null, request.getPublicIp(), null, null, null);
            if (cloudIps == null)
                throw new EC2ServiceException(ServerError.InternalError, "Specified ipAddress doesn't exist");
            CloudStackIpAddress cloudIp = cloudIps.get(0);
            CloudStackInfoResponse resp = getApi().disassociateIpAddress(cloudIp.getId());
            if (resp != null) {
                return resp.getSuccess();
            }
        } catch(Exception e) {
            logger.error("EC2 ReleaseAddress - ", e);
            throw new EC2ServiceException(ServerError.InternalError, e.getMessage());
        }
View Full Code Here


            if (vmList == null || vmList.size() == 0) {
                throw new EC2ServiceException(ServerError.InternalError, "Specified instance-id doesn't exist");
            }
            CloudStackUserVm cloudVm = vmList.get(0);

            CloudStackInfoResponse resp = getApi().enableStaticNat(cloudIp.getId(), cloudVm.getId());
            if (resp != null) {
                return resp.getSuccess();
            }
        } catch(Exception e) {
            logger.error( "EC2 AssociateAddress - ", e);
            throw new EC2ServiceException(ServerError.InternalError, e.getMessage() != null ? e.getMessage() : "An unexpected error occurred.");
        }
View Full Code Here

            List<CloudStackIpAddress> cloudIps = getApi().listPublicIpAddresses(null, null, null, null, null, request.getPublicIp(), null, null, null);
            if (cloudIps == null)
                throw new EC2ServiceException(ServerError.InternalError, "Specified ipAddress doesn't exist");
            CloudStackIpAddress cloudIp = cloudIps.get(0);

            CloudStackInfoResponse resp = getApi().disableStaticNat(cloudIp.getId());
            if (resp != null) {
                return resp.getSuccess();
            }
        } catch(Exception e) {
            logger.error( "EC2 DisassociateAddress - ", e);
            throw new EC2ServiceException(ServerError.InternalError, e.getMessage() != null ? e.getMessage() : "An unexpected error occurred.");
        }
View Full Code Here

     * @return
     */
    public boolean deregisterImage( EC2Image image )
    {
        try {
            CloudStackInfoResponse resp = getApi().deleteTemplate(image.getId(), null);
            return resp.getSuccess();
        } catch( Exception e ) {
            logger.error( "EC2 DeregisterImage - ", e);
            throw new EC2ServiceException(ServerError.InternalError, e.getMessage() != null ? e.getMessage() : "An unexpected error occurred.");
        }
    }
View Full Code Here

     * @param request
     * @return
     */
    public EC2Volume deleteVolume( EC2Volume request ) {
        try {
            CloudStackInfoResponse resp = getApi().deleteVolume(request.getId());
            if(resp != null) {
                request.setState("deleted");
                return request;
            }

View Full Code Here

            for (EC2TagTypeId resourceType : resourceTypeSet) {
                String cloudStackResourceType = mapToCloudStackResourceType(resourceType.getResourceType());
                List<String> resourceIdList = new ArrayList<String>();
                for ( String resourceId : resourceType.getResourceIds())
                    resourceIdList.add(resourceId);
                CloudStackInfoResponse resp = new CloudStackInfoResponse();
                if (operation.equalsIgnoreCase("create"))
                    resp = getApi().createTags(cloudStackResourceType, resourceIdList, resourceTagList);
                else if(operation.equalsIgnoreCase("delete"))
                    resp = getApi().deleteTags(cloudStackResourceType, resourceIdList, resourceTagList);
                else
                    throw new EC2ServiceException( ServerError.InternalError, "Unknown operation." );
                if (resp.getSuccess() == false)
                    return false;
            }
            return true;
        } catch (Exception e){
            logger.error( "EC2 Create/Delete Tags - ", e);
View Full Code Here

TOP

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

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.