def getPortsByProtocolNgpf(self, ngpfEndpointName): """ Description For IxNetwork NGPF only: Based on the specified NGPF endpoint name, return all ports associated with the protocol. Parameter ngpfEndpointName: : See below for all the NGPF endpoint protocol names. Returns [chassisIp, cardNumber, portNumber] Example: [['10.219.117.101', '1', '1'], ['10.219.117.101', '1', '2']] Returns [] if no port is configured with the specified ngpfEndpointName ngpfEndpointName options: 'ancp', 'bfdv4Interface', 'bgpIpv4Peer', 'bgpIpv6Peer', 'dhcpv4relayAgent', 'dhcpv6relayAgent', 'dhcpv4server', 'dhcpv6server', 'geneve', 'greoipv4', 'greoipv6', 'igmpHost', 'igmpQuerier', 'lac', 'ldpBasicRouter', 'ldpBasicRouterV6', 'ldpConnectedInterface', 'ldpv6ConnectedInterface', 'ldpTargetedRouter', 'ldpTargetedRouterV6', 'lns', 'mldHost', 'mldQuerier', 'ptp', 'ipv6sr', 'openFlowController', 'openFlowSwitch', 'ospfv2', 'ospfv3', 'ovsdbcontroller', 'ovsdbserver', 'pcc', 'pce', 'pcepBackupPCEs', 'pimV4Interface', 'pimV6Interface', 'ptp', 'rsvpteIf', 'rsvpteLsps', 'tag', 'vxlan' """ portList = [] response = self.ixnObj.get(self.ixnObj.sessionUrl+'/topology') topologyList = ['%s/%s/%s' % (self.ixnObj.sessionUrl, 'topology', str(i["id"])) for i in response.json()] for topology in topologyList: response = self.ixnObj.get(topology+'/deviceGroup') deviceGroupList = ['%s/%s/%s' % (topology, 'deviceGroup', str(i["id"])) for i in response.json()] for deviceGroup in deviceGroupList: response = self.ixnObj.get(deviceGroup+'/ethernet') ethernetList = ['%s/%s/%s' % (deviceGroup, 'ethernet', str(i["id"])) for i in response.json()] for ethernet in ethernetList: response = self.ixnObj.get(ethernet+'/ipv4') ipv4List = ['%s/%s/%s' % (ethernet, 'ipv4', str(i["id"])) for i in response.json()] response = self.ixnObj.get(ethernet+'/ipv6') ipv6List = ['%s/%s/%s' % (ethernet, 'ipv6', str(i["id"])) for i in response.json()] for layer3Ip in ipv4List+ipv6List: url = layer3Ip+'/'+ngpfEndpointName print('\nProtocol URL:', url) response = self.ixnObj.get(url) if response.json() == []: continue response = self.ixnObj.get(topology) vportList = response.json()['vports'] for vport in vportList: response = self.ixnObj.get(self.ixnObj.httpHeader+vport) assignedTo = response.json()['assignedTo'] currentChassisIp = str(assignedTo.split(':')[0]) currentCardNumber = str(assignedTo.split(':')[1]) currentPortNumber = str(assignedTo.split(':')[2]) currentPort = [currentChassisIp, currentCardNumber, currentPortNumber] portList.append(currentPort) self.ixnObj.logInfo('\tFound port configured: %s' % currentPort) return portList