class FindPorts(LFCliBase): def __init__(self, host, port, security_debug_on=False, _exit_on_error=False,_exit_on_fail=False): super().__init__(host, port, _debug=security_debug_on, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail) self.host = host self.port = port #Creating a Realm Object self.local_realm = Realm(lfclient_host=host, lfclient_port=port) def FindExistingCX(self): return self.local_realm.cx_list() def FindVAP(self): return self.local_realm.vap_list()
print(" - - - - TESTING - - - - - -") #exit(0) print("** Existing vAPs **") try: vap_list = localrealm.vap_list() print("%s VAPs:" % len(vap_list)) pprint(vap_list) except Exception as x: localrealm.error(x) exit(1) print("** Existing CXs **") try: cx_list = localrealm.cx_list() print("%s CXs:" % len(cx_list)) pprint(cx_list) except Exception as x: localrealm.error(x) exit(1) print("** Removing previous CXs **") print("** Creating Layer 3 CXs **") try: cx_profile = localrealm.new_l3_cx_profile() # set attributes of cxProfile cx_profile.create("lf_udp", side_a="1.1.eth1", side_b=list(localrealm.find_ports_like("sta+")))