Package com.cloud.agent.api

Examples of com.cloud.agent.api.CreateLogicalSwitchPortCommand


                        + existingNicMap.getLogicalSwitchPortUuid());
                _niciraNvpNicMappingDao.remove(existingNicMap.getId());
            }
        }

        CreateLogicalSwitchPortCommand cmd = new CreateLogicalSwitchPortCommand(
                network.getBroadcastUri().getSchemeSpecificPart(),
                nicVO.getUuid(), context.getDomain().getName() + "-"
                        + context.getAccount().getAccountName(), nic.getName());
        CreateLogicalSwitchPortAnswer answer = (CreateLogicalSwitchPortAnswer) _agentMgr
                .easySend(niciraNvpHost.getId(), cmd);
View Full Code Here


   
    LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
    when(lsp.getUuid()).thenReturn("eeee");
    when(_nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort) any())).thenReturn(lsp);
   
    CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
    CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer) _resource.executeRequest(clspc);
    assertTrue(clspa.getResult());
    assertTrue("eeee".equals(clspa.getLogicalSwitchPortUuid()));
   
  }
View Full Code Here

   
    LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
    when(lsp.getUuid()).thenReturn("eeee");
    when(_nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort) any())).thenThrow(new NiciraNvpApiException());
   
    CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
    CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer) _resource.executeRequest(clspc);
    assertFalse(clspa.getResult());   
  }
View Full Code Here

    when(lsp.getUuid()).thenReturn("eeee");
    when(_nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort) any())).thenReturn(lsp);
    doThrow(new NiciraNvpApiException()).when(_nvpApi).modifyLogicalSwitchPortAttachment((String)any(), (String)any(), (Attachment)any());
   
   
    CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
    CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer) _resource.executeRequest(clspc);
    assertFalse(clspa.getResult());   
    verify(_nvpApi, atLeastOnce()).deleteLogicalSwitchPort((String) any()(String) any());
  }
View Full Code Here

        final LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
        when(lsp.getUuid()).thenReturn("eeee");
        when(nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort)any())).thenReturn(lsp);

        final CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
        final CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer)resource.executeRequest(clspc);
        assertTrue(clspa.getResult());
        assertTrue("eeee".equals(clspa.getLogicalSwitchPortUuid()));

    }
View Full Code Here

        final LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
        when(lsp.getUuid()).thenReturn("eeee");
        when(nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort)any())).thenThrow(new NiciraNvpApiException());

        final CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
        final CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer)resource.executeRequest(clspc);
        assertFalse(clspa.getResult());
    }
View Full Code Here

        final LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
        when(lsp.getUuid()).thenReturn("eeee");
        when(nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort)any())).thenReturn(lsp);
        doThrow(new NiciraNvpApiException()).when(nvpApi).updateLogicalSwitchPortAttachment((String)any(), (String)any(), (Attachment)any());

        final CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
        final CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer)resource.executeRequest(clspc);
        assertFalse(clspa.getResult());
        verify(nvpApi, atLeastOnce()).deleteLogicalSwitchPort((String)any(), (String)any());
    }
View Full Code Here

                s_logger.error("Stale entry found for nic " + nic.getName() + " with logical switchport uuid " + existingNicMap.getLogicalSwitchPortUuid());
                niciraNvpNicMappingDao.remove(existingNicMap.getId());
            }
        }

        CreateLogicalSwitchPortCommand cmd =
                new CreateLogicalSwitchPortCommand(BroadcastDomainType.getValue(network.getBroadcastUri()), nicVO.getUuid(), context.getDomain().getName() + "-" +
                        context.getAccount().getAccountName(), nic.getName());
        CreateLogicalSwitchPortAnswer answer = (CreateLogicalSwitchPortAnswer)agentMgr.easySend(niciraNvpHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
            s_logger.error("CreateLogicalSwitchPortCommand failed");
View Full Code Here

              s_logger.error("Stale entry found for nic " + nic.getName() + " with logical switchport uuid " + existingNicMap.getLogicalSwitchPortUuid());
              _niciraNvpNicMappingDao.remove(existingNicMap.getId());
            }
        }
       
        CreateLogicalSwitchPortCommand cmd = new CreateLogicalSwitchPortCommand(network.getBroadcastUri().getSchemeSpecificPart(), nicVO.getUuid(),
                context.getDomain().getName() + "-" + context.getAccount().getAccountName(), nic.getName());
        CreateLogicalSwitchPortAnswer answer = (CreateLogicalSwitchPortAnswer) _agentMgr.easySend(niciraNvpHost.getId(), cmd);
       
        if (answer == null || !answer.getResult()) {
            s_logger.error ("CreateLogicalSwitchPortCommand failed");
View Full Code Here

        LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
        when(lsp.getUuid()).thenReturn("eeee");
        when(_nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort) any())).thenReturn(lsp);

        CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
        CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer) _resource.executeRequest(clspc);
        assertTrue(clspa.getResult());
        assertTrue("eeee".equals(clspa.getLogicalSwitchPortUuid()));

    }
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.CreateLogicalSwitchPortCommand

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.