use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput in project netvirt by opendaylight.
the class ElanServiceProvider method createIdPool.
private void createIdPool() throws Exception {
CreateIdPoolInput createPool = new CreateIdPoolInputBuilder().setPoolName(ElanConstants.ELAN_ID_POOL_NAME).setLow(ElanConstants.ELAN_ID_LOW_VALUE).setHigh(ElanConstants.ELAN_ID_HIGH_VALUE).build();
Future<RpcResult<Void>> result = idManager.createIdPool(createPool);
if (result != null && result.get().isSuccessful()) {
LOG.debug("ELAN Id Pool is created successfully");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput in project netvirt by opendaylight.
the class StatisticsImpl method createIdPool.
private void createIdPool() {
if (checkPoolExists()) {
return;
}
CreateIdPoolInput createPool = new CreateIdPoolInputBuilder().setPoolName(CountersServiceUtils.COUNTERS_PULL_NAME).setLow(CountersServiceUtils.COUNTERS_PULL_START).setHigh(CountersServiceUtils.COUNTERS_PULL_START + CountersServiceUtils.COUNTERS_PULL_END).build();
Future<RpcResult<Void>> result = idManagerService.createIdPool(createPool);
Futures.addCallback(JdkFutureAdapters.listenInPoolThread(result), new FutureCallback<RpcResult<Void>>() {
@Override
public void onFailure(Throwable error) {
LOG.error("Failed to create idPool for Aliveness Monitor Service", error);
}
@Override
public void onSuccess(@Nonnull RpcResult<Void> rpcResult) {
if (rpcResult.isSuccessful()) {
LOG.debug("Created IdPool for tap");
} else {
LOG.error("RPC to create Idpool failed {}", rpcResult.getErrors());
}
}
}, MoreExecutors.directExecutor());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput in project netvirt by opendaylight.
the class NaptManager method createNaptPortPool.
protected void createNaptPortPool(String poolName) {
LOG.debug("createNaptPortPool : requested for : {}", poolName);
CreateIdPoolInput createPool = new CreateIdPoolInputBuilder().setPoolName(poolName).setLow(LOW_PORT).setHigh(HIGH_PORT).build();
try {
Future<RpcResult<Void>> result = idManager.createIdPool(createPool);
if (result != null && result.get().isSuccessful()) {
LOG.debug("createNaptPortPool : Created PortPool :{}", poolName);
} else {
LOG.error("createNaptPortPool : Unable to create PortPool : {}", poolName);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("createNaptPortPool : Failed to create PortPool for NAPT Service", e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput in project netvirt by opendaylight.
the class NatOverVxlanUtil method createOpenDaylightVniRangesPool.
public static void createOpenDaylightVniRangesPool(IdManagerService idManager, String poolName, long lowLimit, long highLimit) {
CreateIdPoolInput createPool = null;
createPool = new CreateIdPoolInputBuilder().setPoolName(poolName).setLow(lowLimit).setHigh(highLimit).build();
try {
Future<RpcResult<Void>> result = idManager.createIdPool(createPool);
if (result != null && result.get().isSuccessful()) {
LOG.debug("createOpenDaylightVniRangesPool : Created OpenDaylight VXLAN VNI range pool {} " + "with range {}-{}", poolName, lowLimit, highLimit);
} else {
LOG.error("createOpenDaylightVniRangesPool : Failed to create OpenDaylight VXLAN VNI range pool {} " + "with range {}-{}", poolName, lowLimit, highLimit);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("createOpenDaylightVniRangesPool : Failed to create OpenDaylight VXLAN VNI range pool {} " + "with range {}-{}", poolName, lowLimit, highLimit);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput in project netvirt by opendaylight.
the class DhcpAllocationPoolManager method createIdAllocationPool.
protected void createIdAllocationPool(String networkId, AllocationPool pool) {
String poolName = getPoolKeyIdByAllocationPool(networkId, pool);
long low = DhcpServiceUtils.convertIpToLong(pool.getAllocateFrom());
long high = DhcpServiceUtils.convertIpToLong(pool.getAllocateTo());
CreateIdPoolInput createPool = new CreateIdPoolInputBuilder().setPoolName(poolName).setLow(low).setHigh(high).build();
try {
Future<RpcResult<Void>> result = idManager.createIdPool(createPool);
if (result != null && result.get().isSuccessful()) {
LOG.info("DHCP Allocation Pool Service : Created IdPool name {}", poolName);
} else {
LOG.error("DHCP Allocation Pool Service : Unable to create IdPool name {}", poolName);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Failed to create Pool for DHCP Allocation Pool Service", e);
}
}
Aggregations