Examples of DomainRouterResponse


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

            throw new InvalidParameterValueException("Can't find router by id");
        } else {
            result = _routerService.startRouter(getId());
        }
        if (result != null){
            DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(result);
            routerResponse.setResponseName(getCommandName());
            this.setResponseObject(routerResponse);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to start router");
        }
    }
View Full Code Here

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

    @Override
    public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException{
        UserContext.current().setEventDetails("Router Id: "+getId());
        VirtualRouter result = _routerService.rebootRouter(this.getId(), true);
        if (result != null){
            DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
            response.setResponseName("router");
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reboot router");
        }
    }
View Full Code Here

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

        UserContext ctx = UserContext.current();
        ctx.setEventDetails("Router Id: "+getId());

        VirtualRouter result = _routerService.destroyRouter(getId(), ctx.getCaller(), ctx.getCallerUserId());
        if (result != null) {
            DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to destroy router");
        }
    }
View Full Code Here

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

        } else {
            result = _routerService.stopRouter(getId(), isForced());
        }
       
        if (result != null) {
            DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to stop router");
        }
    }
View Full Code Here

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

        } else {
            result = _internalLbSvc.stopInternalLbVm(getId(), isForced(), UserContext.current().getCaller(), UserContext.current().getCallerUserId());
        }
       
        if (result != null) {
            DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to stop internal lb vm");
        }
    }
View Full Code Here

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

        } else {
            result = _internalLbSvc.startInternalLbVm(getId(), UserContext.current().getCaller(), UserContext.current().getCallerUserId());
        }
       
        if (result != null){
            DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(result);
            routerResponse.setResponseName(getCommandName());
            this.setResponseObject(routerResponse);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to start internal lb vm");
        }
    }
View Full Code Here

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

    public static List<DomainRouterResponse> createDomainRouterResponse(DomainRouterJoinVO... routers) {
        Account caller = UserContext.current().getCaller();
        Hashtable<Long, DomainRouterResponse> vrDataList = new Hashtable<Long, DomainRouterResponse>();
        // Initialise the vrdatalist with the input data
        for (DomainRouterJoinVO vr : routers) {
            DomainRouterResponse vrData = vrDataList.get(vr.getId());
            if ( vrData == null ){
                // first time encountering this vm
                vrData = ApiDBUtils.newDomainRouterResponse(vr, caller);
            }
            else{
View Full Code Here

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

    @Override
    public void execute() {
        VirtualRouter router = _routerService.upgradeRouter(this);
        if (router != null) {
            DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(router);
            routerResponse.setResponseName(getCommandName());
            setResponseObject(routerResponse);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to upgrade router");
        }
    }
View Full Code Here

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

            throw new InvalidParameterValueException("Can't find router by id");
        } else {
            result = _routerService.startRouter(getId());
        }
        if (result != null) {
            DomainRouterResponse routerResponse = _responseGenerator.createDomainRouterResponse(result);
            routerResponse.setResponseName(getCommandName());
            setResponseObject(routerResponse);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to start router");
        }
    }
View Full Code Here

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

    @Override
    public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
        CallContext.current().setEventDetails("Router Id: " + getId());
        VirtualRouter result = _routerService.rebootRouter(getId(), true);
        if (result != null) {
            DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
            response.setResponseName("router");
            setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reboot router");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.