Search in sources :

Example 1 with TepsInNotHostedTransportZoneBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneBuilder 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);
}
Also used : TepsInNotHostedTransportZoneKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneKey) TepsInNotHostedTransportZone(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZone) UnknownVtepsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVtepsBuilder) UnknownVteps(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVteps) UnknownVtepsKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVtepsKey) TepsInNotHostedTransportZoneBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneBuilder)

Aggregations

TepsInNotHostedTransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZone)1 TepsInNotHostedTransportZoneBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneBuilder)1 TepsInNotHostedTransportZoneKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneKey)1 UnknownVteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVteps)1 UnknownVtepsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVtepsBuilder)1 UnknownVtepsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVtepsKey)1