def createSession(connection, ixLoadVersion): ''' This method is used to create a new session. It will return the url of the newly created session Args: - connection is the connection object that manages the HTTP data transfers between the client and the REST API - ixLoadVersion this is the actual IxLoad Version to start ''' sessionsUrl = "sessions" apiVersion = getApiVersion(connection) if apiVersion == "v1": data = {"applicationVersion": ixLoadVersion} else: data = {"ixLoadVersion": ixLoadVersion} sessionId = performGenericPost(connection, sessionsUrl, data) newSessionUrl = "%s/%s" % (sessionsUrl, sessionId) startSessionUrl = "%s/operations/start" % (newSessionUrl) # start the session performGenericOperation(connection, startSessionUrl, {}) log("Created session no %s" % sessionId) return newSessionUrl