use of com.cloud.network.bigswitch.RouterInterfaceData in project cloudstack by apache.
the class BigSwitchBcfResource method executeRequest.
private Answer executeRequest(CreateBcfRouterInterfaceCommand cmd, int numRetries) {
RouterInterfaceData routerInterface = new RouterInterfaceData(cmd.getTenantId(), cmd.getGateway(), cmd.getCidr(), cmd.getNetworkId(), cmd.getNetworkName());
try {
String hash;
hash = _bigswitchBcfApi.createRouterInterface(cmd.getTenantId(), cmd.getTenantId(), routerInterface);
return new BcfAnswer(cmd, true, "router " + cmd.getTenantId() + " created.", hash);
} catch (BigSwitchBcfApiException e) {
if (e.is_topologySyncRequested()) {
cmd.setTopologySyncRequested(true);
return new BcfAnswer(cmd, true, " created; topology sync required.");
} else {
if (numRetries > 0) {
return retry(cmd, --numRetries);
} else {
return new BcfAnswer(cmd, e);
}
}
}
}
Aggregations