def epMigrationDemo(desc): # unregister h35-3 fabricId = "fabric:1" mac = "00:00:00:00:35:03" ip = "10.0.35.3" resp = util.runRequestGET(inputsFabric.get_epList_uri(), sys._getframe().f_code.co_name) if resp == constants.ERROR_STR: print "ERROR: getOvsdbNodeIdByName() failed" return constants.ERROR_STR eplist = list() lswId = '' lport = '' endpointResp = json.loads(resp) if endpointResp.has_key("endpoints"): endpoints = endpointResp["endpoints"] if endpoints.has_key("endpoint"): for endpoint in endpoints["endpoint"]: if endpoint["ip-address"] == ip: eplist.append(endpoint["endpoint-uuid"]) logicLocation = endpoint["logic-location"] lswId = logicLocation["node-id"] lport = logicLocation["tp-id"] break result = util.runRequestPOST( inputsFabric.get_unregister_endpoint_uri(), json.dumps( inputsFabric.get_unregister_endpoint_data("fabric:1", eplist)), sys._getframe().f_code.co_name) # register h35-4 fabricId = "fabric:1" mac = "00:00:00:00:35:04" ip = "10.0.35.4" gw = "10.0.35.1" port = "vethl-h35-4" nodeid = util.getOvsdbNodeIdByName("sw6") nodeRef = BRIDGE_REF_P % (nodeid) tpRef = TP_REF_P % (nodeid, port) if nodeid == constants.ERROR_STR: return constants.ERROR_STR result = util.runRequestPOST( inputsFabric.get_register_endpoint_uri(), json.dumps( inputsFabric.get_register_endpoint_data(fabricId, mac, ip, gw, lswId, lport, nodeRef, tpRef)), sys._getframe().f_code.co_name) return desc
def epMigrationDemo(desc): # unregister h35-3 fabricId = "fabric:1" mac = "00:00:00:00:35:03" ip = "10.0.35.3" resp = util.runRequestGET(inputsFabric.get_epList_uri(), sys._getframe().f_code.co_name) if resp == constants.ERROR_STR: print "ERROR: getOvsdbNodeIdByName() failed" return constants.ERROR_STR eplist = list() lswId = '' lport = '' endpointResp=json.loads(resp) if endpointResp.has_key("endpoints"): endpoints = endpointResp["endpoints"] if endpoints.has_key("endpoint"): for endpoint in endpoints["endpoint"]: if endpoint["ip-address"] == ip: eplist.append(endpoint["endpoint-uuid"]) logicLocation = endpoint["logic-location"] lswId = logicLocation["node-id"] lport = logicLocation["tp-id"] break result = util.runRequestPOST(inputsFabric.get_unregister_endpoint_uri(), json.dumps(inputsFabric.get_unregister_endpoint_data("fabric:1", eplist)), sys._getframe().f_code.co_name) # register h35-4 fabricId = "fabric:1" mac = "00:00:00:00:35:04" ip = "10.0.35.4" gw = "10.0.35.1" port = "vethl-h35-4" nodeid = util.getOvsdbNodeIdByName("sw6") nodeRef = BRIDGE_REF_P % (nodeid) tpRef = TP_REF_P % (nodeid, port) if nodeid == constants.ERROR_STR: return constants.ERROR_STR result = util.runRequestPOST(inputsFabric.get_register_endpoint_uri(), json.dumps(inputsFabric.get_register_endpoint_data(fabricId, mac, ip, gw, lswId, lport, nodeRef, tpRef)), sys._getframe().f_code.co_name) return desc
'unused param', 'Get SFC list'), 'p8': (get_c, inputsSFC.get_sfList_uri(), 'unused param', 'Get SF list'), 'p9': (get_c, inputsSFC.get_sffList_uri(), 'unused param', 'Get service function forwarder(SFF) list'), 'p10': (get_c, inputsSFC.get_sfpList_uri(), 'unused param', 'Get service function paths'), 'p11': (get_c, inputsFabric.get_epList_uri(), 'unused param', 'Get registered endpoint list'), 'acl01': (put_c, inputsSFC.get_acl_uri(), inputsSFC.get_acl_data(), 'Create ACL'), 'acl02': (put_c, inputsSFC.get_acl_uri(), inputsSFC.get_acl_data2(), 'Create ACL') } def main(argv): inputfile = '' outputfile = ''
'Get the logical network entities for all tenants on the uln-mapper side' ), 'p3': (get_c, inputsGBP.getUlnUri_gc, 'unused param', 'Get ULN on the GBP Faas renderer side'), 'p4': (get_c, inputsGBP.getMappedEntities_gc, 'unused param', 'Get mapped IDs on the GBP FAAS renderer side'), 'p5': (get_c, inputsSFC.get_acl_uri(), 'unused param', 'Get ACL list'), 'p6': (get_c, inputsSFC.get_invmgr_uri(), 'unused param', 'Get flow rules'), 'p7': (get_c, inputsSFC.get_sfcList_uri(), 'unused param', 'Get SFC list'), 'p8': (get_c, inputsSFC.get_sfList_uri(), 'unused param', 'Get SF list'), 'p9': (get_c, inputsSFC.get_sffList_uri(), 'unused param', 'Get service function forwarder(SFF) list'), 'p10': (get_c, inputsSFC.get_sfpList_uri(), 'unused param', 'Get service function paths'), 'p11': (get_c, inputsFabric.get_epList_uri(), 'unused param', 'Get registered endpoint list'), 'acl01': (put_c, inputsSFC.get_acl_uri(), inputsSFC.get_acl_data(), 'Create ACL'), 'acl02': (put_c, inputsSFC.get_acl_uri(), inputsSFC.get_acl_data2(), 'Create ACL') } def main(argv): inputfile = '' outputfile = '' testNum = '0' result = '' try: