def session_getOffloadedSessions(stub, paramPageSize, paramPage):
    sessionCnt=0
    for sessionResponse in stub.getAllSessions(openoffload_pb2.statisticsRequestArgs(pageSize=paramPageSize, page=paramPage)):
      sessionCnt=sessionCnt+1
      print(f"SessionId: {sessionResponse.sessionId}")
      print(f"\tSession State: {openoffload_pb2._SESSION_STATE.values_by_number[sessionResponse.sessionState].name}")
      print(f"\tSession InPackets: {sessionResponse.inPackets} InBytes: {sessionResponse.inBytes} OutPackets: {sessionResponse.outPackets} OutBytes: {sessionResponse.outBytes}")
      print(f"\tSession End Reason: {openoffload_pb2._SESSION_CLOSE_CODE.values_by_number[sessionResponse.sessionCloseCode].name}")
    print(f"***Found {sessionCnt} sessions")
Esempio n. 2
0
def session_getAllSessions(stub):
    for sessionResponse in stub.getClosedSessions(
            openoffload_pb2.statisticsRequestArgs(pageSize=0)):
        print("### RECEIVED SESSION #####")
        print("SessionId:", sessionResponse.sessionId)
        print(
            "Session State:", openoffload_pb2._SESSION_STATE.values_by_number[
                sessionResponse.sessionState].name)
        print("Session RequestStatus:", sessionResponse.requestStatus)
        print("Session SessionCloseCode:", sessionResponse.sessionCloseCode)
        print("Session InPackets", sessionResponse.inPackets)
        print("Session OutPackets", sessionResponse.outPackets)
        print("Session startTime", sessionResponse.startTime)
        print("Session endTime", sessionResponse.endTime)
        print("##########################")