Package org.apache.cloudstack.api.response

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


    public void execute(){
        UserContext.current().setEventDetails("Global Load balancer rule Id: "+ getGlobalLoadBalancerRuleId()+ " VmIds: "
                + StringUtils.join(getLoadBalancerRulesIds(), ","));
        boolean result = _gslbService.assignToGlobalLoadBalancerRule(this);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign global load balancer rule");
        }
    }
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 firewall rule");
        }
    }
View Full Code Here

    @Override
    public void execute(){
        UserContext.current().setEventDetails("Template Id: "+getId());
        boolean result = _templateService.deleteTemplate(this);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete template");
        }
    }
View Full Code Here

    public void execute(){
        UserContext.current().setEventDetails("Global Load balancer rule Id: "+ getGlobalLoadBalancerRuleId()+ " VmIds: "
                + StringUtils.join(getLoadBalancerRulesIds(), ","));
        boolean result = _gslbService.removeFromGlobalLoadBalancerRule(this);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove load balancer rule from global load balancer rule");
        }
    }
View Full Code Here

    public void execute(){
        UserContext.current().setEventDetails("Load balancer Id: " + getId());
        boolean result = _appLbService.deleteApplicationLoadBalancer(getId());

        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("Deleting global Load balancer rule Id: " + getGlobalLoadBalancerId());
        boolean result = _gslbService.deleteGlobalLoadBalancerRule(this);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete Global Load Balancer rule.");
        }
    }
View Full Code Here

        return zoneId;
    }

    @Override
    public void execute() {
        SuccessResponse response = new SuccessResponse();
        try {
            boolean result = _vmwareDatacenterService.removeVmwareDatacenter(this);
            if (result) {
                response.setResponseName(getCommandName());
                setResponseObject(response);
            } else {
                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove VMware datacenter from zone");
            }
        } catch (ResourceInUseException ex) {
View Full Code Here

      InsufficientCapacityException, ServerApiException,
      ConcurrentOperationException, ResourceAllocationException,
      NetworkRuleConflictException {
    try {
      mgr.deleteUcsManager(ucsManagerId);
      SuccessResponse rsp = new SuccessResponse();
      rsp.setResponseName(getCommandName());
      rsp.setObjectName("success");
      this.setResponseObject(rsp);
    } catch (Exception e) {
      logger.debug(e.getMessage(), e);
      throw new CloudRuntimeException(e);
    }
View Full Code Here

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

    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
        try {
            boolean result = _srxElementService.deleteSrxFirewall(this);
            if (result) {
                SuccessResponse response = new SuccessResponse(getCommandName());
                response.setResponseName(getCommandName());
                this.setResponseObject(response);
            } else {
                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete SRX firewall device");
            }
        }  catch (InvalidParameterValueException invalidParamExcp) {
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.