Package org.apache.cloudstack.network.contrail.api.response

Examples of org.apache.cloudstack.network.contrail.api.response.ServiceInstanceResponse


    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException, NetworkRuleConflictException {
        try {
            _vrouterService.startServiceInstance(getEntityId());
            ServiceInstanceResponse response = _vrouterService.createServiceInstanceResponse(getEntityId());
            response.setObjectName("serviceinstance");
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } catch (Exception ex) {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
        }
    }
View Full Code Here


    @Override
    public ServiceInstanceResponse createServiceInstanceResponse(long instanceId) {
        s_logger.debug("ServiceInstance response for id: " + instanceId);

        UserVmVO vm = _vmDao.findById(instanceId);
        ServiceInstanceResponse response = new ServiceInstanceResponse();
        response.setId(vm.getUuid());
        Account owner = _accountService.getAccount(vm.getAccountId());

        if (owner.getType() == Account.ACCOUNT_TYPE_PROJECT) {
            Project project = ApiDBUtils.findProjectByProjectAccountIdIncludingRemoved(owner.getAccountId());
            response.setProjectId(project.getUuid());
            response.setProjectName(project.getName());
        } else {
            response.setAccountName(owner.getAccountName());
        }
        return response;
    }
View Full Code Here

    @Override
    public ServiceInstanceResponse createServiceInstanceResponse(long instanceId) {
        s_logger.debug("ServiceInstance response for id: " + instanceId);
        UserVmVO vm = _vmDao.findById(instanceId);
        ServiceInstanceResponse response = new ServiceInstanceResponse();
        response.setId(vm.getUuid());
        Account owner = _accountService.getAccount(vm.getAccountId());
        if (owner.getType() == Account.ACCOUNT_TYPE_PROJECT) {
            Project project = ApiDBUtils.findProjectByProjectAccountIdIncludingRemoved(owner.getAccountId());
            response.setProjectId(project.getUuid());
            response.setProjectName(project.getName());
        } else {
            response.setAccountName(owner.getAccountName());
        }
        return response;
    }
View Full Code Here

            InsufficientCapacityException, ServerApiException,
            ConcurrentOperationException, ResourceAllocationException,
            NetworkRuleConflictException {
        try {
            _vrouterService.startServiceInstance(getEntityId());
            ServiceInstanceResponse response = _vrouterService.createServiceInstanceResponse(getEntityId());
            response.setObjectName("serviceinstance");
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } catch (Exception ex) {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.network.contrail.api.response.ServiceInstanceResponse

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.