Ejemplo n.º 1
0
    def delete_node(self, session_id: int, node_id: int) -> core_pb2.DeleteNodeResponse:
        """
        Delete node from session.

        :param session_id: session id
        :param node_id: node id
        :return: response with result of success or failure
        :raises grpc.RpcError: when session doesn't exist
        """
        request = core_pb2.DeleteNodeRequest(session_id=session_id, node_id=node_id)
        return self.stub.DeleteNode(request)
Ejemplo n.º 2
0
    def delete_node(self,
                    session_id: int,
                    node_id: int,
                    source: str = None) -> bool:
        """
        Delete node from session.

        :param session_id: session id
        :param node_id: node id
        :param source: application source
        :return: True for success, False otherwise
        :raises grpc.RpcError: when session doesn't exist
        """
        request = core_pb2.DeleteNodeRequest(session_id=session_id,
                                             node_id=node_id,
                                             source=source)
        response = self.stub.DeleteNode(request)
        return response.result