def clearPortOwnership(self, portList): """ Description Clear port ownership on the portList Parameters portList: : A list of ports in a list: [[chassisIp, cardId, portId]] """ response = self.ixnObj.get(self.ixnObj.sessionUrl+'/availableHardware/chassis') for eachChassis in response.json(): chassisIp = eachChassis['ip'] chassisHref = eachChassis['links'][0]['href'] for userPort in portList: userChassisIp = userPort[0] if userChassisIp != chassisIp: continue userCardId = userPort[1] userPortId = userPort[2] url = self.ixnObj.httpHeader+chassisHref+'/card/'+str(userCardId)+'/port/'+str(userPortId)+'/operations/clearownership' data = {'arg1': [chassisHref+'/card/'+str(userCardId)+'/port/'+str(userPortId)]} self.ixnObj.post(url, data=data)