(self, params)
Show node information.
Show node information.
Show node information .
def cmd_show_node(self, params):
        """Show node information."""

        # TODO: This should additionally show node roles, lags and hierarchy.
        # Similar to londiste "status".

        node = params.get('node', '*')
        queue = params.get('queue', '*')

        q_queue = (queue != '*' and queue or None)
        q_node = (node != '*' and node or None)

        curs = self.db.cursor()
        q = """select queue_name, node_name, node_location, dead
               from pgq_node.node_location
               where node_name = coalesce(%s, node_name)
                     and queue_name = coalesce(%s, queue_name)
               order by 1,2"""
        curs.execute(q, [q_node, q_queue])

        display_result(curs, 'Node "%s" on queue "%s":' % (node, queue))
def cmd_show_node ( self , params ) : # TODO: This should additionally show node roles, lags and hierarchy. # Similar to londiste "status". node = params . get ( 'node' , '*' ) queue = params . get ( 'queue' , '*' ) q_queue = ( queue != '*' and queue or None ) q_node = ( node != '*' and node or None ) curs = self . db . cursor ( ) q = """select queue_name, node_name, node_location, dead
               from pgq_node.node_location
               where node_name = coalesce(%s, node_name)
                     and queue_name = coalesce(%s, queue_name)
               order by 1,2""" curs . execute ( q , [ q_node , q_queue ] ) display_result ( curs , 'Node "%s" on queue "%s":' % ( node , queue ) )