Package net.juniper.contrail.api

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


            if (vm == null) {
                vm = new VirtualMachine();
                if (_projectId != null) {
                    Project project;
                    try {
                        project = (Project)api.findById(Project.class, _projectId);
                    } catch (IOException ex) {
                        s_logger.debug("project read", ex);
                        throw new CloudRuntimeException("Failed to read project", ex);
                    }
                    vm.setParent(project);
View Full Code Here


    assert _uuid != null : "uuid is not set";

    ApiConnector api = controller.getApiAccessor();

    try {
        _vm = (VirtualMachine) api.findById(VirtualMachine.class, _uuid);
    } catch (IOException e) {
        s_logger.error("virtual-machine verify", e);
    }

    if (_vm == null) {
View Full Code Here

        assert vnModel != null;

        VirtualMachineInterface vmi = _vmiModel.getVMInterface();
        VirtualNetwork vnet = vnModel.getVirtualNetwork();
        if (vnet == null) {
            vnet = (VirtualNetwork)api.findById(VirtualNetwork.class, _vmiModel.getNetworkUuid());
        }

        String ipid = api.findByName(InstanceIp.class, null, _name);
        if (ipid == null) {
            InstanceIp ip_obj = new InstanceIp();
View Full Code Here

                }
            }
            _ipAddress = ip_obj.getAddress();
        } else {
            // Ensure that the instance-ip has the correct value and is pointing at the VMI.
            InstanceIp ip_obj = (InstanceIp)api.findById(InstanceIp.class, ipid);
            if (ip_obj == null) {
                throw new InternalErrorException("Unable to read instance-ip " + _name);
            }
            boolean update = false;
            String ipnet_id = ObjectReference.getReferenceListUuid(ip_obj.getVirtualNetwork());
View Full Code Here

        if (policy == null) {
            try {
                String policyId = api.findByName(NetworkPolicy.class, _project, _name);
                if (policyId != null) {
                    policy = _policy = (NetworkPolicy) api.findById(NetworkPolicy.class, policyId);
                }
                if (policy == null) {
                    policy = new NetworkPolicy();
                    policy.setUuid(_uuid);
                    policy.setName(_name);
View Full Code Here

            if (vn == null) {
                vn = new VirtualNetwork();
                if (_projectId != null) {
                    Project project;
                    try {
                        project = (Project)api.findById(Project.class, _projectId);
                    } catch (IOException ex) {
                        s_logger.debug("project read", ex);
                        throw new CloudRuntimeException("Failed to read project", ex);
                    }
                    vn.setParent(project);
View Full Code Here

                String ipam_id = api.findByName(NetworkIpam.class, null, "default-network-ipam");
                if (ipam_id == null) {
                    s_logger.debug("could not find default-network-ipam");
                    return;
                }
                ipam = (NetworkIpam)api.findById(NetworkIpam.class, ipam_id);
                if (ipam == null) {
                    s_logger.debug("could not find NetworkIpam with ipam_id: " + ipam_id);
                    return;
                }
            } catch (IOException ex) {
View Full Code Here

    public void read(ModelController controller) {
        ApiConnector api = controller.getApiAccessor();
        VlanDao vlanDao = controller.getVlanDao();
        try {
            _vn = (VirtualNetwork)api.findById(VirtualNetwork.class, _uuid);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (_vn == null) {
            return;
View Full Code Here

                String ipam_id = api.findByName(NetworkIpam.class, null, "default-network-ipam");
                if (ipam_id == null) {
                    s_logger.debug("could not find default-network-ipam");
                    return;
                }
                ipam = (NetworkIpam)api.findById(NetworkIpam.class, ipam_id);
                if (ipam == null) {
                    s_logger.debug("could not find NetworkIpam with ipam_id: " + ipam_id);
                    return;
                }
            } catch (IOException ex) {
View Full Code Here

    ApiConnector api = controller.getApiAccessor();
    VlanDao vlanDao = controller.getVlanDao();

    try {
        _vn = (VirtualNetwork)api.findById(VirtualNetwork.class, _uuid);
    } catch (IOException e) {
        e.printStackTrace();
    }

    if (_vn == null) {
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.