print()

# Unfail Node('D')
print("Now unfail Node('D')")
model1.unfail_node('D')
print()
model1.update_simulation()


print("Here is the interface traffic after Node('D') is restored:")
print(model1.display_interfaces_traffic())
print()

# Unfail the B-to-A interface and display traffic
print('Unfail the interface from Node B to Node A')
model1.unfail_interface('B-to-A', 'B', True)
model1.update_simulation()
model1.display_interfaces_traffic()
print()

# test get_circuit call from Interface object
int1 = model1.get_interface_object('A-to-B', 'A')
ckt1 = int1.get_circuit_object(model1)
print("The circuit associated with %s is %s" % (int1, ckt1))
print()

# test a demand path before and after an interface it traverses fails;
# should go from 2 paths to one path
dmd_B_D = model1.get_demand_object('B', 'D')
print("dmd_B_D path before failing interface B-to-D is")
for path in dmd_B_D.path:
print()

# Unfail Node('D')
print("Now unfail Node('D')")
model1.unfail_node("D")
print()
model1.update_simulation()


print("Here is the interface traffic after Node('D') is restored:")
print(model1.display_interfaces_traffic())
print()

# Unfail the B-to-A interface and display traffic
print("Unfail the interface from Node B to Node A")
model1.unfail_interface("B-to-A", "B", True)
model1.update_simulation()
model1.display_interfaces_traffic()
print()

# test get_circuit call from Interface object
int1 = model1.get_interface_object("A-to-B", "A")
ckt1 = int1.get_circuit_object(model1)
print("The circuit associated with %s is %s" % (int1, ckt1))
print()

# test a demand path before and after an interface it traverses fails;
# should go from 2 paths to one path
dmd_B_D = model1.get_demand_object("B", "D")
print("dmd_B_D path before failing interface B-to-D is")
for path in dmd_B_D.path: