Package com.cloud.api.response

Examples of com.cloud.api.response.PrivateGatewayResponse


    public void execute() {
        List<PrivateGateway> gateways = _vpcService.listPrivateGateway(this);
        ListResponse<PrivateGatewayResponse> response = new ListResponse<PrivateGatewayResponse>();
        List<PrivateGatewayResponse> projectResponses = new ArrayList<PrivateGatewayResponse>();
        for (PrivateGateway gateway : gateways) {
            PrivateGatewayResponse gatewayResponse = _responseGenerator.createPrivateGatewayResponse(gateway);
            projectResponses.add(gatewayResponse);
        }
        response.setResponses(projectResponses);
        response.setResponseName(getCommandName());
       
View Full Code Here


        return response;
    }

    @Override
    public PrivateGatewayResponse createPrivateGatewayResponse(PrivateGateway result) {
        PrivateGatewayResponse response = new PrivateGatewayResponse();
        response.setId(result.getId());
        response.setVlan(result.getVlanTag());
        response.setGateway(result.getGateway());
        response.setNetmask(result.getNetmask());
        response.setVpcId(result.getVpcId());
        response.setZoneId(result.getZoneId());
        DataCenter zone = ApiDBUtils.findZoneById(result.getZoneId());
        response.setZoneName(zone.getName());
        response.setAddress(result.getIp4Address());
        response.setPhysicalNetworkId(result.getPhysicalNetworkId());
       
        populateAccount(response, result.getAccountId());
        populateDomain(response, result.getDomainId());
        response.setState(result.getState().toString());
       
        response.setObjectName("privategateway");
       
        return response;
    }
View Full Code Here

    @Override
    public void execute() throws InsufficientCapacityException, ConcurrentOperationException,
    ResourceAllocationException, ResourceUnavailableException {
        PrivateGateway result = _vpcService.applyVpcPrivateGateway(getEntityId(), true);
        if (result != null) {
            PrivateGatewayResponse response = _responseGenerator.createPrivateGatewayResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create private gateway");
        }
    }
View Full Code Here

TOP

Related Classes of com.cloud.api.response.PrivateGatewayResponse

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.