本文整理匯總了Python中framework.openflowdev.ofswitch.OFSwitch.add_modify_group方法的典型用法代碼示例。如果您正苦於以下問題:Python OFSwitch.add_modify_group方法的具體用法?Python OFSwitch.add_modify_group怎麽用?Python OFSwitch.add_modify_group使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類framework.openflowdev.ofswitch.OFSwitch
的用法示例。
在下文中一共展示了OFSwitch.add_modify_group方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: GroupBucket
# 需要導入模塊: from framework.openflowdev.ofswitch import OFSwitch [as 別名]
# 或者: from framework.openflowdev.ofswitch.OFSwitch import add_modify_group [as 別名]
group_entry.add_bucket(bucket2)
# ---------
bucket_id += 1
bucket3 = GroupBucket(bucket_id)
action = OutputAction(order = 0, port = out_port3)
bucket3.add_action(action)
group_entry.add_bucket(bucket3)
# Request Controller to create the group
print "\n".strip()
print ("<<< Group to create:")
print group_entry.get_payload()
time.sleep(rundelay)
result = ofswitch.add_modify_group(group_entry)
status = result.get_status()
if(status.eq(STATUS.OK)):
print ("<<< Group successfully added to the Controller")
grp_ids_oper = result.get_data()
else:
print ("\n")
print ("!!!Demo terminated, reason: %s" % status.detailed())
exit(0)
print ("\n").strip()
print ("<<< Get OpenFlow Groups Information")
time.sleep(rundelay)
result = ofswitch.get_configured_group_ids()