def changeActivityOptions(connection, sessionUrl, activityOptionsToChange): ''' This method will change certain properties for the provided activities. 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 that should run the test - activityOptionsToChange is the Python dict that holds the mapping between agent name and specific properties (activityOptionsToChange format: { activityName : { option : value } }) ''' communityListUrl = "%s/ixload/test/activeTest/communityList" % sessionUrl communityList = connection.httpGet(url=communityListUrl) for community in communityList: activityListUrl = "%s/%s/activityList" % (communityListUrl, community.objectID) activityList = connection.httpGet(url=activityListUrl) for activity in activityList: if activity.name in list(activityOptionsToChange): activityUrl = "%s/%s" % (activityListUrl, activity.objectID) performGenericPatch(connection, activityUrl, activityOptionsToChange[activity.name])