Search in sources :

Example 1 with ImplementNetworkVspCommand

use of com.cloud.agent.api.guru.ImplementNetworkVspCommand in project cloudstack by apache.

the class NuageVspResourceTest method testImplementNetworkVspCommand.

@Test
public void testImplementNetworkVspCommand() throws Exception {
    _resource.configure("NuageVspResource", _hostDetails);
    VspNetwork vspNetwork = buildVspNetwork();
    VspDhcpDomainOption vspDhcpOptions = buildspDhcpDomainOption();
    ImplementNetworkVspCommand cmd = new ImplementNetworkVspCommand(vspNetwork, vspDhcpOptions);
    com.cloud.agent.api.Answer implNtwkAns = _resource.executeRequest(cmd);
    assertTrue(implNtwkAns.getResult());
    verify(_mockNuageVspGuruClient).implement(vspNetwork, vspDhcpOptions);
}
Also used : ImplementNetworkVspCommand(com.cloud.agent.api.guru.ImplementNetworkVspCommand) VspDhcpDomainOption(net.nuage.vsp.acs.client.api.model.VspDhcpDomainOption) Answer(com.cloud.agent.api.Answer) VspNetwork(net.nuage.vsp.acs.client.api.model.VspNetwork) NuageTest(com.cloud.NuageTest) Test(org.junit.Test)

Example 2 with ImplementNetworkVspCommand

use of com.cloud.agent.api.guru.ImplementNetworkVspCommand in project cloudstack by apache.

the class NuageVspGuestNetworkGuru method implement.

private boolean implement(long physicalNetworkId, VspNetwork vspNetwork, VspDhcpDomainOption vspDhcpDomainOption) {
    HostVO nuageVspHost = _nuageVspManager.getNuageVspHost(physicalNetworkId);
    ImplementNetworkVspCommand cmd = new ImplementNetworkVspCommand(vspNetwork, vspDhcpDomainOption);
    Answer answer = _agentMgr.easySend(nuageVspHost.getId(), cmd);
    if (answer == null || !answer.getResult()) {
        s_logger.error("ImplementNetworkVspCommand for network " + vspNetwork.getUuid() + " failed on Nuage VSD " + nuageVspHost.getDetail("hostname"));
        if ((null != answer) && (null != answer.getDetails())) {
            s_logger.error(answer.getDetails());
        }
        return false;
    }
    return true;
}
Also used : ImplementNetworkVspCommand(com.cloud.agent.api.guru.ImplementNetworkVspCommand) Answer(com.cloud.agent.api.Answer) HostVO(com.cloud.host.HostVO)

Aggregations

Answer (com.cloud.agent.api.Answer)2 ImplementNetworkVspCommand (com.cloud.agent.api.guru.ImplementNetworkVspCommand)2 NuageTest (com.cloud.NuageTest)1 HostVO (com.cloud.host.HostVO)1 VspDhcpDomainOption (net.nuage.vsp.acs.client.api.model.VspDhcpDomainOption)1 VspNetwork (net.nuage.vsp.acs.client.api.model.VspNetwork)1 Test (org.junit.Test)1