use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.DeleteIdPoolInput in project netvirt by opendaylight.
the class NaptManager method removeNaptPortPool.
void removeNaptPortPool(String poolName) {
DeleteIdPoolInput deleteIdPoolInput = new DeleteIdPoolInputBuilder().setPoolName(poolName).build();
LOG.debug("removeNaptPortPool : Remove Napt port pool requested for : {}", poolName);
try {
Future<RpcResult<Void>> result = idManager.deleteIdPool(deleteIdPoolInput);
if (result != null && result.get().isSuccessful()) {
LOG.debug("removeNaptPortPool : Deleted PortPool {}", poolName);
} else {
LOG.error("removeNaptPortPool : Unable to delete PortPool {}", poolName);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("removeNaptPortPool : Failed to delete PortPool {} for NAPT Service", poolName, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.DeleteIdPoolInput in project netvirt by opendaylight.
the class NatOverVxlanUtil method deleteOpenDaylightVniRangesPool.
public static void deleteOpenDaylightVniRangesPool(IdManagerService idManager, String poolName) {
DeleteIdPoolInput deletePool = new DeleteIdPoolInputBuilder().setPoolName(poolName).build();
Future<RpcResult<Void>> result = idManager.deleteIdPool(deletePool);
try {
if (result != null && result.get().isSuccessful()) {
LOG.debug("deleteOpenDaylightVniRangesPool : Deleted OpenDaylight VXLAN VNI range pool {} successfully", poolName);
} else {
LOG.error("deleteOpenDaylightVniRangesPool : Failed to delete OpenDaylight VXLAN VNI range pool {} ", poolName);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("deleteOpenDaylightVniRangesPool : Failed to delete OpenDaylight VXLAN VNI range pool {} ", poolName, e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.DeleteIdPoolInput in project netvirt by opendaylight.
the class DhcpAllocationPoolManager method releaseIdAllocationPool.
protected void releaseIdAllocationPool(String networkId, AllocationPool pool) {
String poolName = getPoolKeyIdByAllocationPool(networkId, pool);
DeleteIdPoolInput deletePool = new DeleteIdPoolInputBuilder().setPoolName(poolName).build();
try {
Future<RpcResult<Void>> result = idManager.deleteIdPool(deletePool);
if (result != null && result.get().isSuccessful()) {
LOG.info("DHCP Allocation Pool Service : Deleted IdPool name {}", poolName);
} else {
LOG.error("DHCP Allocation Pool Service : Unable to delete IdPool name {}", poolName);
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Failed to delete Pool for DHCP Allocation Pool Service", e);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.DeleteIdPoolInput in project genius by opendaylight.
the class IdManagerTest method testDeletePool.
@Test
public void testDeletePool() throws Exception {
CreateIdPoolInput createIdPoolInput = new CreateIdPoolInputBuilder().setHigh(ID_HIGH).setLow(ID_LOW).setPoolName(ID_POOL_NAME).build();
idManagerService.createIdPool(createIdPoolInput);
DeleteIdPoolInput deleteIdPoolInput = new DeleteIdPoolInputBuilder().setPoolName(ID_POOL_NAME).build();
assertTrue(idManagerService.deleteIdPool(deleteIdPoolInput).get().isSuccessful());
coordinatorEventsWaiter.awaitEventsConsumption();
Optional<IdPool> actualIdPoolParent = singleTxdataBroker.syncReadOptional(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder(IdPools.class).child(IdPool.class, new IdPoolKey(ID_POOL_NAME)).build());
Optional<IdPool> actualIdPoolChild = singleTxdataBroker.syncReadOptional(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder(IdPools.class).child(IdPool.class, new IdPoolKey(idUtils.getLocalPoolName(ID_POOL_NAME))).build());
assertEquals(false, actualIdPoolParent.isPresent());
assertEquals(false, actualIdPoolChild.isPresent());
}
Aggregations