use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneKey in project genius by opendaylight.
the class OvsdbTepRemoveConfigHelper method removeVtepFromTepsNotHosted.
/**
* Removes the TEP from unknown vtep list under the transport zone in the TepsNotHosted list
* from ITM operational Datastore by delete operation with write transaction.
*
* @param tzName transport zone name in string
* @param dpnId bridge datapath ID in BigInteger
* @param wrTx WriteTransaction object
*/
private static void removeVtepFromTepsNotHosted(String tzName, BigInteger dpnId, WriteTransaction wrTx) {
UnknownVtepsKey unknownVtepkey = new UnknownVtepsKey(dpnId);
InstanceIdentifier<UnknownVteps> vtepPath = InstanceIdentifier.builder(NotHostedTransportZones.class).child(TepsInNotHostedTransportZone.class, new TepsInNotHostedTransportZoneKey(tzName)).child(UnknownVteps.class, unknownVtepkey).build();
LOG.trace("Removing TEP from unhosted (TZ: {}, DPID: {}) inside ITM Oper DS.", tzName, dpnId);
// remove vtep
wrTx.delete(LogicalDatastoreType.OPERATIONAL, vtepPath);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneKey in project genius by opendaylight.
the class OvsdbTepAddConfigHelper method addVtepIntoTepsNotHosted.
/**
* Adds the TEP into Unknown Vtep list under the transport zone in the TepsNotHosted list
* from ITM operational Datastore by merge operation with write transaction.
*
* @param updatedVtepList updated UnknownVteps list object which will have new TEP for addition
* into TepsNotHosted
* @param tepIpAddress TEP IP address in IpAddress object
* @param tzName transport zone name in string
* @param dpid bridge datapath ID in BigInteger
* @param ofTunnel boolean flag for TEP to enable/disable of-tunnel feature on it
* @param wrTx WriteTransaction object
*/
protected static void addVtepIntoTepsNotHosted(List<UnknownVteps> updatedVtepList, IpAddress tepIpAddress, String tzName, BigInteger dpid, boolean ofTunnel, WriteTransaction wrTx) {
// Create TZ node path
InstanceIdentifier<TepsInNotHostedTransportZone> tepsInNotHostedTransportZoneIid = InstanceIdentifier.builder(NotHostedTransportZones.class).child(TepsInNotHostedTransportZone.class, new TepsInNotHostedTransportZoneKey(tzName)).build();
// create vtep
UnknownVtepsKey vtepkey = new UnknownVtepsKey(dpid);
UnknownVteps vtepObj = new UnknownVtepsBuilder().setDpnId(dpid).setIpAddress(tepIpAddress).setKey(vtepkey).setOfTunnel(ofTunnel).build();
// Add vtep obtained into unknown TZ tep list
updatedVtepList.add(vtepObj);
// create unknown TZ node with updated vtep list
TepsInNotHostedTransportZone updatedTzone = new TepsInNotHostedTransportZoneBuilder().setKey(new TepsInNotHostedTransportZoneKey(tzName)).setZoneName(tzName).setUnknownVteps(updatedVtepList).build();
LOG.trace("Adding TEP (DPID: {}, TEP IP: {}, of-tunnel: {}) into unhosted TZ: {}" + "inside ITM Oper DS.", dpid, tepIpAddress, ofTunnel, tzName);
// Update TZ in Oper DS.
wrTx.merge(LogicalDatastoreType.OPERATIONAL, tepsInNotHostedTransportZoneIid, updatedTzone, true);
}
Aggregations