def modifyPortMediaType(self, portList='all', mediaType='fiber'): """ Description Modify the port media type: fiber, copper, SGMII Parameters portList: <'all'|list of ports>: : Format: [[ixChassisIp, str(cardNumber1), str(portNumber1])]...] Or if portList ='all', will modify all assigned ports to the specified mediaType. mediaType: : copper, fiber or SGMII """ self.ixnObj.logInfo('modifyPortMediaType: {0}'.format(mediaType)) response = self.ixnObj.get(self.ixnObj.sessionUrl+'/vport') if portList == 'all': #vportList = self.getAllVportList() portList = self.getPhysicalPortsFromCreatedVports() # vportList: ['/api/v1/sessions/1/ixnetwork/vport/1', '/api/v1/sessions/1/ixnetwork/vport/2'] vportList = self.getVportFromPortList(portList) for vport in vportList: response = self.ixnObj.get(self.ixnObj.httpHeader+vport, silentMode=True) portType = response.json()['type'] self.ixnObj.patch(self.ixnObj.httpHeader+vport+'/l1Config/'+portType, data={'media': mediaType})