Beispiel #1
0
    if (status.eq(STATUS.OK) == True):
        print("<<< Flow successfully read from the Controller")
        print("Flow info:")
        flow = result.get_data()
        print json.dumps(flow, indent=4)
    else:
        print("\n")
        print("!!!Demo terminated, reason: %s" % status.brief().lower())
        exit(0)

    print("\n")
    print(
        "<<< Delete flow with id of '%s' from the Controller's cache "
        "and from the table '%s' on the '%s' node" %
        (flow_id, table_id, nodeName))
    time.sleep(rundelay)
    result = ofswitch.delete_flow(flow_entry.get_flow_table_id(),
                                  flow_entry.get_flow_id())
    status = result.get_status()
    if (status.eq(STATUS.OK) == True):
        print("<<< Flow successfully removed from the Controller")
    else:
        print("\n")
        print("!!!Demo terminated, reason: %s" % status.brief().lower())
        exit(0)

    print("\n")
    print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
    print(">>> Demo End")
    print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
Beispiel #2
0
 status = result.get_status()
 if(status.eq(STATUS.OK) == True):
     print ("<<< Flow successfully read from the Controller")
     print ("Flow info:")
     flow = result.get_data()
     print json.dumps(flow, indent=4)
 else:
     print ("\n")
     print ("!!!Demo terminated, reason: %s" % status.brief().lower())
     exit(0)
 
 
 print ("\n")
 print ("<<< Delete flow with id of '%s' from the Controller's cache "
        "and from the table '%s' on the '%s' node" % (flow_id, table_id, nodeName))
 time.sleep(rundelay)
 result = ofswitch.delete_flow(flow_entry.get_flow_table_id(), flow_entry.get_flow_id())
 status = result.get_status()
 if(status.eq(STATUS.OK) == True):
     print ("<<< Flow successfully removed from the Controller")
 else:
     print ("\n")
     print ("!!!Demo terminated, reason: %s" % status.brief().lower())
     exit(0)
 
 
 print ("\n")
 print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
 print (">>> Demo End")
 print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
 
Beispiel #3
0
    status = result.get_status()
    if(status.eq(STATUS.OK)):
        print ("<<< Flow successfully read from the Controller")
        print ("Flow info:")
        flow = result.get_data()
        print json.dumps(flow, indent=4)
    else:
        print ("\n")
        print ("!!!Demo terminated, reason: %s" % status.brief().lower())
        exit(0)

    print ("\n")
    print ("<<< Delete flow with id of '%s' from the Controller's cache "
           "and from the table '%s' on the '%s' node" %
           (flow_id, table_id, nodeName))
    time.sleep(rundelay)
    result = ofswitch.delete_flow(flow_entry.get_flow_table_id(),
                                  flow_entry.get_flow_id())
    status = result.get_status()
    if(status.eq(STATUS.OK)):
        print ("<<< Flow successfully removed from the Controller")
    else:
        print ("\n")
        print ("!!!Demo terminated, reason: %s" % status.brief().lower())
        exit(0)

    print ("\n")
    print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
    print (">>> Demo End")
    print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
Beispiel #4
0
 result = ofswitch.get_configured_flow(table_id, flow_id)
 status = result.get_status()
 if(status.eq(STATUS.OK) == True):
     print ("<<< Flow successfully read from the Controller")
     print ("Flow info:")
     flow = result.get_data()
     print json.dumps(flow, indent=4)
 else:
     print ("\n")
     print ("!!!Demo terminated, reason: %s" % status.brief().lower())
     exit(0)
 
 
 print ("\n")
 print ("<<< Delete flow with id of '%s' from the Controller's cache and from the table '%s' on the '%s' node" % (flow_id, table_id, nodeName))
 time.sleep(rundelay)
 result = ofswitch.delete_flow(flow_entry.get_flow_table_id(), flow_entry.get_flow_id())
 status = result.get_status()
 if(status.eq(STATUS.OK) == True):
     print ("<<< Flow successfully removed from the Controller")
 else:
     print ("\n")
     print ("!!!Demo terminated, reason: %s" % status.brief().lower())
     exit(0)
 
 
 print ("\n")
 print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
 print (">>> Demo End")
 print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")