Examples of CreateLogicalSwitchCommand


Examples of com.cloud.agent.api.CreateLogicalSwitchCommand

        LogicalSwitch ls = mock(LogicalSwitch.class);
        when(ls.getUuid()).thenReturn("cccc").thenReturn("cccc");
        when(_nvpApi.createLogicalSwitch((LogicalSwitch) any())).thenReturn(ls);

        CreateLogicalSwitchCommand clsc = new CreateLogicalSwitchCommand((String)_parameters.get("guid"), "stt", "loigicalswitch","owner");
        CreateLogicalSwitchAnswer clsa = (CreateLogicalSwitchAnswer) _resource.executeRequest(clsc);
        assertTrue(clsa.getResult());
        assertTrue("cccc".equals(clsa.getLogicalSwitchUuid()));
    }
View Full Code Here

Examples of com.cloud.agent.api.CreateLogicalSwitchCommand

        LogicalSwitch ls = mock(LogicalSwitch.class);
        when(ls.getUuid()).thenReturn("cccc").thenReturn("cccc");
        when(_nvpApi.createLogicalSwitch((LogicalSwitch) any())).thenThrow(new NiciraNvpApiException());

        CreateLogicalSwitchCommand clsc = new CreateLogicalSwitchCommand((String)_parameters.get("guid"), "stt", "loigicalswitch","owner");
        CreateLogicalSwitchAnswer clsa = (CreateLogicalSwitchAnswer) _resource.executeRequest(clsc);
        assertFalse(clsa.getResult());
    }
View Full Code Here

Examples of com.cloud.agent.api.CreateLogicalSwitchCommand

        HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());
        _hostDao.loadDetails(niciraNvpHost);
        String transportzoneuuid = niciraNvpHost.getDetail("transportzoneuuid");
        String transportzoneisotype = niciraNvpHost.getDetail("transportzoneisotype");

        CreateLogicalSwitchCommand cmd = new CreateLogicalSwitchCommand(transportzoneuuid, transportzoneisotype, name,
                context.getDomain().getName() + "-" + context.getAccount().getAccountName());
        CreateLogicalSwitchAnswer answer = (CreateLogicalSwitchAnswer)_agentMgr.easySend(niciraNvpHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
            s_logger.error("CreateLogicalSwitchCommand failed");
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.