def getConfiguredProtocols(self): """ Description Get the list of protocols configured on vports. Return A list or one or more congfigured protocols eg: "['ospf','bgp']" return [] if no protocol is configured """ time.sleep(5) configuredProtocolList = [] protocolList = ['bfd', 'bgp', 'eigrp', 'isis', 'ldp', 'lisp', 'mplsOam', 'mplsTp', 'ospf', 'ospfV3', 'pimsm', 'rip', 'ripng'] response = self.ixnObj.get(self.ixnObj.sessionUrl + '/vport') if response == False: raise IxNetRestApiException('No ports connected to chassis') vportList = ['%s' % vport['links'][0]['href'] for vport in response.json()] for eachVport in vportList: for eachProtocol in protocolList: node = '/router' if re.search('bgp', eachProtocol, re.I): node = '/neighborRange' protocolResponse = self.ixnObj.get(self.ixnObj.httpHeader + eachVport + '/protocols/' + eachProtocol) response = self.ixnObj.get(self.ixnObj.httpHeader + eachVport + '/protocols/' + eachProtocol + node) if response.json() != []: if response.json()[0]['enabled'] == True and protocolResponse.json()['runningState'] == 'started': configuredProtocolList.append(eachProtocol) configuredProtocolList = list(set(configuredProtocolList)) return configuredProtocolList