use of com.cloud.agent.api.SyncBcfTopologyCommand in project cloudstack by apache.
the class BigSwitchBcfUtils method syncTopologyToBcfHost.
public String syncTopologyToBcfHost(HostVO bigswitchBcfHost) {
SyncBcfTopologyCommand syncCmd;
if (isNatEnabled()) {
syncCmd = new SyncBcfTopologyCommand(true, true);
} else {
syncCmd = new SyncBcfTopologyCommand(true, false);
}
BcfAnswer syncAnswer = (BcfAnswer) _agentMgr.easySend(bigswitchBcfHost.getId(), syncCmd);
if (syncAnswer == null || !syncAnswer.getResult()) {
s_logger.error("SyncBcfTopologyCommand failed");
return null;
}
return syncAnswer.getHash();
}
use of com.cloud.agent.api.SyncBcfTopologyCommand in project cloudstack by apache.
the class BigSwitchBcfUtils method syncTopologyToBcfHost.
public String syncTopologyToBcfHost(HostVO bigswitchBcfHost, boolean natEnabled) {
SyncBcfTopologyCommand syncCmd;
if (natEnabled) {
syncCmd = new SyncBcfTopologyCommand(true, true);
} else {
syncCmd = new SyncBcfTopologyCommand(true, false);
}
BcfAnswer syncAnswer = (BcfAnswer) _agentMgr.easySend(bigswitchBcfHost.getId(), syncCmd);
if (syncAnswer == null || !syncAnswer.getResult()) {
s_logger.error("SyncBcfTopologyCommand failed");
return null;
}
return syncAnswer.getHash();
}
use of com.cloud.agent.api.SyncBcfTopologyCommand in project cloudstack by apache.
the class BigSwitchBcfResourceTest method testSyncTopologyRetryOnce.
@Test
public void testSyncTopologyRetryOnce() throws ConfigurationException, BigSwitchBcfApiException {
_resource.configure("BigSwitchBcfResource", _parameters);
_resource.setTopology(new TopologyData());
when(_bigswitchBcfApi.syncTopology((TopologyData) any())).thenThrow(new BigSwitchBcfApiException()).thenReturn(UUID.randomUUID().toString());
BcfAnswer ans = (BcfAnswer) _resource.executeRequest(new SyncBcfTopologyCommand(true, false));
assertTrue(ans.getResult());
}
Aggregations