use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.State in project genius by opendaylight.
the class OvsInterfaceConfigUpdateHelper method handleInterfaceAdminStateUpdates.
private void handleInterfaceAdminStateUpdates(WriteTransaction transaction, Interface interfaceNew, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState) {
IfL2vlan ifL2vlan = interfaceNew.getAugmentation(IfL2vlan.class);
if (ifL2vlan == null || IfL2vlan.L2vlanMode.Trunk != ifL2vlan.getL2vlanMode() && IfL2vlan.L2vlanMode.Transparent != ifL2vlan.getL2vlanMode()) {
return;
}
LOG.info("admin-state modified for interface {}", interfaceNew.getName());
OperStatus operStatus = interfaceManagerCommonUtils.updateStateEntry(interfaceNew, transaction, ifState);
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(interfaceNew.getName());
InterfaceParentEntry interfaceParentEntry = interfaceMetaUtils.getInterfaceParentEntryFromConfigDS(interfaceParentEntryKey);
if (interfaceParentEntry == null || interfaceParentEntry.getInterfaceChildEntry() == null) {
return;
}
VlanMemberStateUpdateWorker vlanMemberStateUpdateWorker = new VlanMemberStateUpdateWorker(txRunner, operStatus, interfaceParentEntry.getInterfaceChildEntry());
coordinator.enqueueJob(interfaceNew.getName(), vlanMemberStateUpdateWorker, IfmConstants.JOB_MAX_RETRIES);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.State in project genius by opendaylight.
the class InterfaceManagerTestUtil method buildFlowCapableNodeConnector.
static FlowCapableNodeConnector buildFlowCapableNodeConnector(boolean isPortDown, boolean isLive, String macAddress, String portName) {
PortConfig portConfig = new PortConfig(false, false, false, isPortDown);
State state = new StateBuilder().setBlocked(true).setLinkDown(false).setLive(isLive).build();
FlowCapableNodeConnectorBuilder fcNodeConnector = new FlowCapableNodeConnectorBuilder().setName(portName).setHardwareAddress(MacAddress.getDefaultInstance(macAddress)).setConfiguration(portConfig).setState(state);
return fcNodeConnector.build();
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.State in project genius by opendaylight.
the class OvsdbSouthboundTestUtil method updateTerminationPoint.
public static void updateTerminationPoint(DataBroker dataBroker, String interfaceName, Class<? extends InterfaceTypeBase> type) throws TransactionCommitFailedException {
final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName("s2");
final InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier("192.168.56.101", 6640, ovsdbBridgeName);
InstanceIdentifier<TerminationPoint> tpId = createTerminationPointInstanceIdentifier(InstanceIdentifier.keyOf(bridgeIid.firstIdentifierOf(Node.class)), interfaceName);
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
tpBuilder.setKey(InstanceIdentifier.keyOf(tpId));
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();
tpAugmentationBuilder.setName(interfaceName);
if (type != null) {
tpAugmentationBuilder.setInterfaceType(type);
}
List<InterfaceBfdStatus> interfaceBfdStatuses = Arrays.asList(new InterfaceBfdStatusBuilder().setBfdStatusKey("state").setBfdStatusValue("down").build());
tpAugmentationBuilder.setInterfaceBfdStatus(interfaceBfdStatuses);
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
tx.merge(OPERATIONAL, tpId, tpBuilder.build(), true);
tx.submit().checkedGet();
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.State in project genius by opendaylight.
the class TepCommandHelper method showState.
@SuppressWarnings("checkstyle:RegexpSinglelineJava")
public void showState(Collection<StateTunnelList> tunnelLists, boolean tunnelMonitorEnabled, CommandSession session) throws TepException {
if (tunnelLists == null || tunnelLists.isEmpty()) {
handleError("No Internal Tunnels Exist", session);
return;
}
if (!tunnelMonitorEnabled) {
if (session != null) {
session.getConsole().println("Tunnel Monitoring is Off");
}
}
String displayFormat = "%-16s %-16s %-16s %-16s %-16s %-10s %-10s";
System.out.println(String.format(displayFormat, "Tunnel Name", "Source-DPN", "Destination-DPN", "Source-IP", "Destination-IP", "Trunk-State", "Transport Type"));
System.out.println("-----------------------------------------------------------------------------------------" + "--------------------------------------------");
for (StateTunnelList tunnelInst : tunnelLists) {
// Display only the internal tunnels
if (tunnelInst.getDstInfo().getTepDeviceType().equals(TepTypeInternal.class)) {
String tunnelInterfaceName = tunnelInst.getTunnelInterfaceName();
LOG.trace("tunnelInterfaceName::: {}", tunnelInterfaceName);
String tunnelState = ITMConstants.TUNNEL_STATE_UNKNOWN;
if (tunnelInst.getOperState() == TunnelOperStatus.Up) {
tunnelState = ITMConstants.TUNNEL_STATE_UP;
} else if (tunnelInst.getOperState() == TunnelOperStatus.Down) {
tunnelState = ITMConstants.TUNNEL_STATE_DOWN;
}
Class<? extends TunnelTypeBase> tunType = tunnelInst.getTransportType();
String tunnelType = ITMConstants.TUNNEL_TYPE_VXLAN;
if (tunType.equals(TunnelTypeVxlan.class)) {
tunnelType = ITMConstants.TUNNEL_TYPE_VXLAN;
} else if (tunType.equals(TunnelTypeGre.class)) {
tunnelType = ITMConstants.TUNNEL_TYPE_GRE;
} else if (tunType.equals(TunnelTypeMplsOverGre.class)) {
tunnelType = ITMConstants.TUNNEL_TYPE_MPLSoGRE;
} else if (tunType.equals(TunnelTypeLogicalGroup.class)) {
tunnelType = ITMConstants.TUNNEL_TYPE_LOGICAL_GROUP_VXLAN;
}
System.out.println(String.format(displayFormat, tunnelInst.getTunnelInterfaceName(), tunnelInst.getSrcInfo().getTepDeviceId(), tunnelInst.getDstInfo().getTepDeviceId(), new String(tunnelInst.getSrcInfo().getTepIp().getValue()), new String(tunnelInst.getDstInfo().getTepIp().getValue()), tunnelState, tunnelType));
}
}
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.State in project genius by opendaylight.
the class InterfaceManagerCommonUtils method updateOpState.
/*
* update operational state of interface based on events like tunnel
* monitoring
*/
public static void updateOpState(WriteTransaction transaction, String interfaceName, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus operStatus) {
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> ifStateId = IfmUtil.buildStateInterfaceId(interfaceName);
LOG.debug("updating tep interface state as {} for {}", operStatus.name(), interfaceName);
InterfaceBuilder ifaceBuilder = new InterfaceBuilder().setOperStatus(operStatus);
ifaceBuilder.setKey(IfmUtil.getStateInterfaceKeyFromName(interfaceName));
transaction.merge(LogicalDatastoreType.OPERATIONAL, ifStateId, ifaceBuilder.build(), false);
}
Aggregations