From 2a29ae559458fe83d62497da2adee08f80782ebf Mon Sep 17 00:00:00 2001 From: Karim Saleh <33664528+karmoham@users.noreply.github.com> Date: Thu, 27 May 2021 14:30:16 +0200 Subject: [PATCH] Adding "deleteAllSessions" method We needed a way to cleanup all the running sessions without deleting them one by one, hence we introduce "deleteAllSessions" which wipes out all of them. Thanks, Karim --- RestApi/Python/Modules/IxL_RestApi.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/RestApi/Python/Modules/IxL_RestApi.py b/RestApi/Python/Modules/IxL_RestApi.py index 7d38719..33bb5b4 100755 --- a/RestApi/Python/Modules/IxL_RestApi.py +++ b/RestApi/Python/Modules/IxL_RestApi.py @@ -16,6 +16,7 @@ import datetime import platform + class IxLoadRestApiException(Exception): def __init__(self, msg=None): showErrorMsg = '\nIxLoadRestApiException error: {0}\n\n'.format(msg) @@ -1241,7 +1242,12 @@ def abortActiveTest(self): def deleteSessionId(self): response = self.delete(self.sessionIdUrl) - + + def deleteAllSessions(self): + sessionUrl = '{}/api/{}/sessions'.format(self.httpHeader, self.apiVersion) + self.delete(sessionUrl) + print("All Ixia Sessions Deleted") + def getMaximumInstances(self): response = self.get(self.sessionIdUrl+'/ixLoad/preferences') maxInstances = response.json()['maximumInstances']