示例#1
0
    def get_sessions(self):
        """
        Retrieves all currently known sessions.

        :return: response with a list of currently known session, their state and number of nodes
        :rtype: core_pb2.GetSessionsResponse
        """
        return self.stub.GetSessions(core_pb2.GetSessionsRequest())
示例#2
0
    def get_sessions(self) -> List[wrappers.SessionSummary]:
        """
        Retrieves all currently known sessions.

        :return: response with a list of currently known session, their state and
            number of nodes
        """
        response = self.stub.GetSessions(core_pb2.GetSessionsRequest())
        sessions = []
        for session_proto in response.sessions:
            session = wrappers.SessionSummary.from_proto(session_proto)
            sessions.append(session)
        return sessions