def getNetworkGroupObjByIp(self, networkGroupIpAddress): """ Description Search each Device Group's Network Group for the networkGroupIpAddress. If found, return the Network Group object. Mainly used for Traffic Item source/destination endpoints. The networkGroupIpAddress cannot be a range. It has to be an actual IP address within the range. Parameter networkGroupIpAddress: : The network group IP address. Returns None: No ipAddress found in any NetworkGroup. network group Object: The Network Group object. """ queryData = {'from': '/', 'nodes': [{'node': 'topology', 'properties': [], 'where': []}, {'node': 'deviceGroup', 'properties': [], 'where': []}, {'node': 'networkGroup', 'properties': [], 'where': []}, {'node': 'ipv4PrefixPools', 'properties': ['networkAddress'], 'where': []}, {'node': 'ipv6PrefixPools', 'properties': ['networkAddress'], 'where': []} ]} queryResponse = self.ixnObj.query(data=queryData, silentMode=False) if '.' in networkGroupIpAddress: prefixPoolType = 'ipv4PrefixPools' if ':' in networkGroupIpAddress: prefixPoolType = 'ipv6PrefixPools' for topology in queryResponse.json()['result'][0]['topology']: for deviceGroup in topology['deviceGroup']: for networkGroup in deviceGroup['networkGroup']: for prefixPool in networkGroup[prefixPoolType]: prefixPoolRangeMultivalue = prefixPool['networkAddress'] response = self.ixnObj.getMultivalueValues(prefixPoolRangeMultivalue) if networkGroupIpAddress in response: return networkGroup['href']