def getTopologyObjAndDeviceGroupObjByPortName(self, portName): """ Description Search each Topology Group vport for the portName. If found, return the topology object and a list of all its device groups and inner device group within a device group. Parameter portName: : The port name that you configured for the physical port. Returns None: If no portName found in any Topology Group. Topology object + Device Group list Ex 1: ['/api/v1/sessions/1/ixnetwork/topology/2', ['/api/v1/sessions/1/ixnetwork/topology/2/deviceGroup/1']] Ex 2: ('/api/v1/sessions/1/ixnetwork/topology/1', ['/api/v1/sessions/1/ixnetwork/topology/1/deviceGroup/1', '/api/v1/sessions/1/ixnetwork/topology/1/deviceGroup/1/deviceGroup/3']) """ response = self.ixnObj.get(self.ixnObj.sessionUrl + '/topology') for eachTopology in response.json(): topologyObj = eachTopology['links'][0]['href'] vportList = eachTopology['vports'] response = self.ixnObj.get(self.ixnObj.httpHeader + topologyObj + '/deviceGroup') deviceGroupList = [] for eachDeviceGroup in response.json(): deviceGroupObj = eachDeviceGroup['links'][0]['href'] deviceGroupList.append(deviceGroupObj) # Verify if there are additional device groups within a device group. response = self.ixnObj.get(self.ixnObj.httpHeader + deviceGroupObj + '/deviceGroup') if response.json(): for response in response.json(): deviceGroupList.append(response['links'][0]['href']) for eachVport in vportList: response = self.ixnObj.get(self.ixnObj.httpHeader+eachVport) vportName = response.json()['name'] if portName == vportName: return topologyObj, deviceGroupList