Package com.cloud.stack.models

Examples of com.cloud.stack.models.CloudStackInfoResponse


     * @param groupName
     * @return
     */
    public boolean deleteSecurityGroup(String groupName) {
        try {
            CloudStackInfoResponse resp = getApi().deleteSecurityGroup(null, null, null, groupName);
            if (resp != null) {
                return resp.getSuccess();
            }
            return false;
        } catch( Exception e ) {
            logger.error( "EC2 DeleteSecurityGroup - ", e);
            handleException(e);
View Full Code Here


                }
            }

            if (null == ruleId)
                throw new Exception("Specified Ip permission is invalid");
            CloudStackInfoResponse resp = getApi().revokeSecurityGroupIngress(ruleId);
            if (resp != null) {
                return resp.getSuccess();
            }
        } catch( Exception e ) {
            logger.error( "EC2 revokeSecurityGroupIngress" + " - " + e.getMessage());
            handleException(e);
        }
View Full Code Here

     * @return
     */
    public boolean deleteSnapshot(String snapshotId) {
        try {

            CloudStackInfoResponse resp = getApi().deleteSnapshot(snapshotId);
            if(resp != null) {
                return resp.getSuccess();
            }

            return false;
        } catch(Exception e) {
            logger.error( "EC2 DeleteSnapshot - ", e);
View Full Code Here

                                accounts = accounts + accountOrGroup;
                                first = false;
                            }
                        }
                    }
                    CloudStackInfoResponse resp = getApi().updateTemplatePermissions(request.getImageId(), accounts, null, null, isPublic, operation.toString());
                    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);
View Full Code Here

     *
     * @param request
     * @return
     */
    public boolean deleteKeyPair( EC2DeleteKeyPair request ) {
        CloudStackInfoResponse resp = new CloudStackInfoResponse();
        String keyPairName = request.getKeyName();
        try {
            resp = getApi().deleteSSHKeyPair(keyPairName, null, null);
            if (resp == null) {
                throw new Exception("Ivalid CloudStack API response");
            }
        } catch(Exception e) {
            logger.error("EC2 DeleteKeyPair - ", e);
            handleException(e);
        }
        return resp.getSuccess();
    }
View Full Code Here

        try {
            List<CloudStackIpAddress> cloudIps = getApi().listPublicIpAddresses(null, null, null, null, null, request.getPublicIp(), null, null, null);
            if (cloudIps == null)
                throw new Exception("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);
            handleException(e);
        }
View Full Code Here

            if (vmList == null || vmList.size() == 0) {
                throw new Exception("Instance not found");
            }
            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);
            handleException(e);
        }
View Full Code Here

            List<CloudStackIpAddress> cloudIps = getApi().listPublicIpAddresses(null, null, null, null, null, request.getPublicIp(), null, null, null);
            if (cloudIps == null)
                throw new Exception("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);
            handleException(e);
        }
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);
            handleException(e);
        }
        return false;
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");
            }
        } catch( Exception e ) {
            logger.error( "EC2 DeleteVolume - ", 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.