Package org.apache.cloudstack.api.response

Examples of org.apache.cloudstack.api.response.SuccessResponse


    @Override
    public void execute(){
        try {
            boolean result = _srxElementService.deleteExternalFirewall(this);
            if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
            } else {
                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete external firewall.");
            }
        } catch (InvalidParameterValueException e) {
View Full Code Here


    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
        try {
            boolean result = _bigswitchVnsElementService.deleteBigSwitchVnsDevice(this);
            if (result) {
                SuccessResponse response = new SuccessResponse(getCommandName());
                response.setResponseName(getCommandName());
                this.setResponseObject(response);
            } else {
                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete BigSwitch device.");
            }
        }  catch (InvalidParameterValueException invalidParamExcp) {
View Full Code Here

    @Override
    public void execute(){
        UserContext.current().setEventDetails("Load balancer Id: "+getId()+" VmIds: "+StringUtils.join(getVirtualMachineIds(), ","));
        boolean result = _lbService.removeFromLoadBalancer(id, virtualMachineIds);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove instance from load balancer rule");
        }
    }
View Full Code Here

    public void execute() {
        UserContext.current().setEventDetails("Load balancer healthcheck policy Id: " + getId());
        boolean result = _lbService.deleteLBHealthCheckPolicy(getId() , true);

        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete load balancer healthcheck policy");
        }
    }
View Full Code Here

    public void execute() throws ResourceUnavailableException {
        UserContext.current().setEventDetails("Rule Id: " + id);
        boolean result = _firewallService.revokeFirewallRule(id, true);

        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete egress firewall rule");
        }
    }
View Full Code Here

    public void execute() {
        UserContext.current().setEventDetails("Load balancer stickiness policy Id: " + getId());
        boolean result = _lbService.deleteLBStickinessPolicy(getId(), true);

        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete load balancer stickiness policy");
        }
    }
View Full Code Here

    /////////////////////////////////////////////////////

    @Override
    public void execute() {
        boolean result = _mgr.deleteSSHKeyPair(this);
        SuccessResponse response = new SuccessResponse(getCommandName());
        response.setSuccess(result);
        this.setResponseObject(response);
    }
View Full Code Here

        UserContext.current().setEventDetails("Load balancer Id: "+getId());
        boolean result = _firewallService.revokeRelatedFirewallRule(id, true);
        result = result && _lbService.deleteLoadBalancerRule(id, true);

        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete load balancer");
        }
    }
View Full Code Here

    @Override
    public void execute(){
        UserContext.current().setEventDetails("Load balancer Id: "+getLoadBalancerId()+" VmIds: "+StringUtils.join(getVirtualMachineIds(), ","));
        boolean result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign load balancer rule");
        }
    }
View Full Code Here

    @Override
    public void execute() {
        try {
            boolean result = _vpcService.deleteVpc(getId());
            if (result) {
                SuccessResponse response = new SuccessResponse(getCommandName());
                this.setResponseObject(response);
            } else {
                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete VPC");
            }
        }catch (ResourceUnavailableException ex) {
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.api.response.SuccessResponse

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.