def enableAnalyzerOnAssignedPorts(connection, sessionUrl): ''' This method is used to enable Analyzer for all assigned ports Args: - connection is the connection object that manages the HTTP data transfers between the client and the REST API - sessionUrl is the address of the session on which the test was ran. Error Codes: - 0 No error - 2 Cannot create/open captureFile ''' communtiyListUrl = "%s/ixload/test/activeTest/communityList" % sessionUrl communityList = connection.httpGet(communtiyListUrl) for community in communityList: portListUrl = "%s/%s/network/portList" % (communtiyListUrl, community.objectID) portList = connection.httpGet(portListUrl) payloadDict = {"enableCapture" : "true"} performGenericPatch(connection, portListUrl, payloadDict)