def changeIpRangesParams(connection, sessionUrl, ipOptionsToChangeDict): ''' This method is used to change certain properties on an IP Range. 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 - ipOptionsToChangeDict is the Python dict holding the items in the IP range that will be changed. (ipOptionsToChangeDict format -> { IP Range name : { optionName : optionValue } }) ''' communityListUrl = "%s/ixload/test/activeTest/communityList" % sessionUrl communityList = connection.httpGet(url=communityListUrl) for community in communityList: stackUrl = "%s/%s/network/stack" % (communityListUrl, community.objectID) rangeListUrl = getIPRangeListUrlForNetworkObj(connection, stackUrl) rangeList = connection.httpGet(rangeListUrl) for rangeObj in rangeList: if rangeObj.name in list(ipOptionsToChangeDict): rangeObjUrl = "%s/%s" % (rangeListUrl, rangeObj.objectID) paramDict = ipOptionsToChangeDict[rangeObj.name] performGenericPatch(connection, rangeObjUrl, paramDict)