Package net.juniper.contrail.api

Examples of net.juniper.contrail.api.ApiConnector.create()


    public void createDomain(DomainVO db, StringBuffer syncLogMesg) throws IOException {
        final ApiConnector api = _manager.getApiConnector();
        net.juniper.contrail.api.types.Domain vnc = new net.juniper.contrail.api.types.Domain();
        vnc.setName(db.getName());
        vnc.setUuid(db.getUuid());
        if (!api.create(vnc)) {
            s_logger.error("Unable to create domain " + vnc.getName());
            syncLogMesg.append("Error: Virtual domain# VNC : Unable to create domain: " + vnc.getName() + "\n");
            return;
        }
        syncLogMesg.append("Domain# VNC: " + vnc.getName() + " created \n");
View Full Code Here


    public void createProject(ProjectVO db, StringBuffer syncLogMesg) throws IOException {
        final ApiConnector api = _manager.getApiConnector();
        net.juniper.contrail.api.types.Project vnc = new net.juniper.contrail.api.types.Project();
        vnc.setName(db.getName());
        vnc.setUuid(db.getUuid());
        if (!api.create(vnc)) {
            s_logger.error("Unable to create project: " + vnc.getName());
            syncLogMesg.append("Error: Virtual project# VNC : Unable to create project: " + vnc.getName() + "\n");
            return;
        }
        syncLogMesg.append("Project# VNC: " + vnc.getName() + " created \n");
View Full Code Here

        if (_serviceTag != null) {
            vmi.setProperties(new VirtualMachineInterfacePropertiesType(_serviceTag, null));
        }

        if (create) {
            if (!api.create(vmi)) {
                throw new InternalErrorException("Unable to create virtual-machine-interface " + _uuid);
            }
        } else {
            if (!api.update(vmi)) {
                throw new InternalErrorException("Unable to update virtual-machine-interface " + _uuid);
View Full Code Here

            vm.setServiceInstance(_serviceModel.getServiceInstance());
        }

        if (_vm == null) {
            try {
                api.create(vm);
            } catch (Exception ex) {
                s_logger.debug("virtual-machine create", ex);
                throw new CloudRuntimeException("Failed to create virtual-machine", ex);
            }
            _vm = vm;
View Full Code Here

            ip_obj.setVirtualNetwork(vnet);
            if (_ipAddress != null) {
                ip_obj.setAddress(_ipAddress);
            }
            ip_obj.setVirtualMachineInterface(vmi);
            if (!api.create(ip_obj)) {
                throw new InternalErrorException("Unable to create instance-ip " + _name);
            }
            api.read(ip_obj);
            _uuid = ip_obj.getUuid();
            if (_ipAddress == null) {
View Full Code Here

        fip.setVirtualMachineInterface(vmiModel.getVMInterface());

        if (_fip == null) {
            try {
                api.create(fip);
            } catch (Exception ex) {
                s_logger.debug("floating ip create", ex);
                throw new CloudRuntimeException("Failed to create floating ip", ex);
            }
            _fip = fip;
View Full Code Here

            }
        }

        if (_fipPool == null) {
            try {
                api.create(fipPool);
            } catch (Exception ex) {
                s_logger.debug("floating ip pool create", ex);
                throw new CloudRuntimeException("Failed to create floating ip pool", ex);
            }
            _fipPool = fipPool;
View Full Code Here

        }

        policy.setEntries(_policyMap);
        if (_policy == null) {
            try {
                api.create(policy);
            } catch (Exception ex) {
                s_logger.debug("network policy create", ex);
                throw new CloudRuntimeException("Failed to create network policy", ex);
            }
            _policy = policy;
View Full Code Here

            }
        }

        if (_vn == null) {
            try {
                api.create(vn);
            } catch (Exception ex) {
                s_logger.debug("virtual-network create", ex);
                throw new CloudRuntimeException("Failed to create virtual-network", ex);
            }
            _vn = vn;
View Full Code Here

        si_obj.setName(getName());
        si_obj.setServiceTemplate(_tmpl);
        si_obj.setProperties(new ServiceInstanceType(false, _mgmtName, _leftName, null, _rightName, null, new ServiceInstanceType.ServiceScaleOutType(1, false)));
        try {
            ApiConnector api = controller.getApiAccessor();
            api.create(si_obj);
        } catch (IOException ex) {
            s_logger.warn("service-instance create", ex);
            throw new CloudRuntimeException("Unable to create service-instance object", ex);
        }
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.