Package net.juniper.contrail.api.types

Examples of net.juniper.contrail.api.types.Project


            assertTrue(_api.create(domain));
        } catch (IOException ex) {
            fail(ex.getMessage());
        }

        Project project = new Project();
        project.setName("test-vnc-only-project-1");
        project.setUuid(UUID.randomUUID().toString());
        project.setParent(domain);
        try {
            assertTrue(_api.create(project));
        } catch (IOException ex) {
            fail(ex.getMessage());
        }
View Full Code Here


        if (vm == null) {
            _vm = vm = (VirtualMachine)api.findById(VirtualMachine.class, _uuid);
            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);
View Full Code Here

        if (_vn == null) {
            vn = _vn = (VirtualNetwork)controller.getApiAccessor().findById(VirtualNetwork.class, _uuid);
            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);
View Full Code Here

        }
        return _fqName.compareTo(other._fqName);
    }

    private ServiceInstance createServiceInstance(ModelController controller) {
        Project project = null;
        if (_projectId != null) {
            try {
                ApiConnector api = controller.getApiAccessor();
                project = (Project)api.findById(Project.class, _projectId);
            } catch (IOException ex) {
View Full Code Here

        if (_vn == null) {
            vn = _vn = (VirtualNetwork) controller.getApiAccessor().findById(VirtualNetwork.class, _uuid);
            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);                   
View Full Code Here

        if (vm == null) {
            _vm = vm = (VirtualMachine) api.findById(VirtualMachine.class, _uuid);
            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);                   
View Full Code Here

        }
        return _fq_name.compareTo(other._fq_name);
    }
   
    private ServiceInstance createServiceInstance(ModelController controller) {
        Project project  = null;
        if (_projectId != null) {
            try {
                ApiConnector api = controller.getApiAccessor();
                project = (Project) api.findById(Project.class, _projectId);
           } catch (IOException ex) {
View Full Code Here

            assertTrue(_api.create(domain));
        } catch (IOException ex) {
            fail(ex.getMessage());
        }

        Project project = new Project();
        project.setName("test-vnc-only-project-1");
        project.setUuid(UUID.randomUUID().toString());
        project.setParent(domain);
        try {
            assertTrue(_api.create(project));
        } catch (IOException ex) {
            fail(ex.getMessage());
        }
View Full Code Here

        // Check if Vmware Project exists on VNC. If not, create one.
        vCenterProject = (Project) apiConnector.findByFQN(Project.class,
                                        VNC_ROOT_DOMAIN + ":" + VNC_VCENTER_PROJECT);
        if (vCenterProject == null) {
            s_logger.info(" vCenter project not present, creating ");
            vCenterProject = new Project();
            vCenterProject.setName("vCenter");
            if (!apiConnector.create(vCenterProject)) {
              s_logger.error("Unable to create project: " + vCenterProject.getName());
            }
        } else {
View Full Code Here

    public void testVoidAttrType() {
        String content = "{\"project\": {\"network_policys\": [{\"to\": [\"default-domain\", \"testProject\", \"testPolicy\"], \"href\": \"http://localhost:53730/network-policy/4e4b0486-e56f-4bfe-8716-afc1a76ad106\", \"uuid\": \"4e4b0486-e56f-4bfe-8716-afc1a76ad106\"}], \"fq_name\": [\"default-domain\", \"testProject\"], \"uuid\": \"7a6580ac-d7dc-4363-a342-47a473a32884\"}}";
        final JsonParser parser = new JsonParser();
        final JsonObject js_obj = parser.parse(content).getAsJsonObject();
        final JsonElement element = js_obj.get("project");
        Project result = (Project) ApiSerializer.deserialize(element.toString(), Project.class);
        assertEquals("testProject", result.getName());
        assertNotNull(result.getNetworkPolicys());
    }
View Full Code Here

TOP

Related Classes of net.juniper.contrail.api.types.Project

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.