Package com.cloud.network.vpc

Examples of com.cloud.network.vpc.VpcOffering


        VpcResponse response = new VpcResponse();
        response.setId(vpc.getUuid());
        response.setName(vpc.getName());
        response.setDisplayText(vpc.getDisplayText());
        response.setState(vpc.getState().name());
        VpcOffering voff = ApiDBUtils.findVpcOfferingById(vpc.getVpcOfferingId());
        if (voff != null) {
            response.setVpcOfferingId(voff.getUuid());
        }
        response.setCidr(vpc.getCidr());
        response.setRestartRequired(vpc.isRestartRequired());
        response.setNetworkDomain(vpc.getNetworkDomain());
View Full Code Here


        return Account.ACCOUNT_ID_SYSTEM;
    }

    @Override
    public void execute(){
        VpcOffering result = _vpcProvSvc.updateVpcOffering(getId(), getVpcOfferingName(), getDisplayText(), getState());
        if (result != null) {
            VpcOfferingResponse response = _responseGenerator.createVpcOfferingResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
View Full Code Here

        return serviceProviderMap;
    }

    @Override
    public void create() throws ResourceAllocationException {
        VpcOffering vpcOff = _vpcProvSvc.createVpcOffering(getVpcOfferingName(), getDisplayText(), getSupportedServices(), getServiceProviders());
        if (vpcOff != null) {
            this.setEntityId(vpcOff.getId());
            this.setEntityUuid(vpcOff.getUuid());
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a VPC offering");
        }
    }
View Full Code Here

        }
    }

    @Override
    public void execute() {
        VpcOffering vpc = _vpcProvSvc.getVpcOffering(this.getEntityId());
        if (vpc != null) {
            VpcOfferingResponse response = _responseGenerator.createVpcOfferingResponse(vpc);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
View Full Code Here

        VpcResponse response = new VpcResponse();
        response.setId(vpc.getUuid());
        response.setName(vpc.getName());
        response.setDisplayText(vpc.getDisplayText());
        response.setState(vpc.getState().name());
        VpcOffering voff = ApiDBUtils.findVpcOfferingById(vpc.getVpcOfferingId());
        if (voff != null) {
            response.setVpcOfferingId(voff.getUuid());
        }
        response.setCidr(vpc.getCidr());
        response.setRestartRequired(vpc.isRestartRequired());
        response.setNetworkDomain(vpc.getNetworkDomain());
View Full Code Here

        _networkOfferingDao.update(id, voffer);
        return _networkOfferingDao.findById(id);
    }

    private VpcOffering locateVpcOffering() {
        VpcOffering vpcOffer = _vpcOffDao.findByUniqueName(juniperVPCOfferingName);
        if (vpcOffer != null) {
            if (((VpcOfferingVO)vpcOffer).getState() == VpcOffering.State.Enabled) {
                return vpcOffer;
            }
            ((VpcOfferingVO)vpcOffer).setState(VpcOffering.State.Enabled);
            long id = vpcOffer.getId();
            _vpcOffDao.update(id, (VpcOfferingVO)vpcOffer);
            return vpcOffer;
        }
        Map<String, List<String>> serviceProviderMap = new HashMap<String, List<String>>();
        List<String> providerSet = new ArrayList<String>();
        providerSet.add(Provider.JuniperContrailVpcRouter.getName());
        final List<String> services = new ArrayList<String>();
        services.add(Service.Connectivity.getName());
        services.add(Service.Dhcp.getName());
        services.add(Service.NetworkACL.getName());
        services.add(Service.StaticNat.getName());
        services.add(Service.SourceNat.getName());
        services.add(Service.Gateway.getName());
        services.add(Service.Lb.getName());

        for (String svc: services) {
            if (svc.equals(Service.Lb.getName())) {
                List<String> lbProviderSet = new ArrayList<String>();
                lbProviderSet.add(Provider.InternalLbVm.getName());
                serviceProviderMap.put(svc, lbProviderSet);
                continue;
            }
            serviceProviderMap.put(svc, providerSet);
        }
        vpcOffer = _vpcProvSvc.createVpcOffering(juniperVPCOfferingName, juniperVPCOfferingDisplayText, services, serviceProviderMap, null, null);
        ((VpcOfferingVO)vpcOffer).setState(VpcOffering.State.Enabled);
        long id = vpcOffer.getId();
        _vpcOffDao.update(id, (VpcOfferingVO)vpcOffer);
        return _vpcOffDao.findById(id);
    }
View Full Code Here

        VpcResponse response = new VpcResponse();
        response.setId(vpc.getUuid());
        response.setName(vpc.getName());
        response.setDisplayText(vpc.getDisplayText());
        response.setState(vpc.getState().name());
        VpcOffering voff = ApiDBUtils.findVpcOfferingById(vpc.getVpcOfferingId());
        if (voff != null) {
            response.setVpcOfferingId(voff.getUuid());
        }
        response.setCidr(vpc.getCidr());
        response.setRestartRequired(vpc.isRestartRequired());
        response.setNetworkDomain(vpc.getNetworkDomain());
View Full Code Here

        return Account.ACCOUNT_ID_SYSTEM;
    }

    @Override
    public void execute() {
        VpcOffering result = _vpcProvSvc.updateVpcOffering(getId(), getVpcOfferingName(), getDisplayText(), getState());
        if (result != null) {
            VpcOfferingResponse response = _responseGenerator.createVpcOfferingResponse(result);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
View Full Code Here

        return serviceOfferingId;
    }

    @Override
    public void create() throws ResourceAllocationException {
        VpcOffering vpcOff = _vpcProvSvc.createVpcOffering(getVpcOfferingName(), getDisplayText(),
                getSupportedServices(), getServiceProviders(), getServiceCapabilitystList(), getServiceOfferingId());
        if (vpcOff != null) {
            setEntityId(vpcOff.getId());
            setEntityUuid(vpcOff.getUuid());
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a VPC offering");
        }
    }
View Full Code Here

        }
    }

    @Override
    public void execute() {
        VpcOffering vpc = _vpcProvSvc.getVpcOffering(getEntityId());
        if (vpc != null) {
            VpcOfferingResponse response = _responseGenerator.createVpcOfferingResponse(vpc);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
View Full Code Here

TOP

Related Classes of com.cloud.network.vpc.VpcOffering

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.