def handle(self, *args, **kwargs): self.zmq.send('zzz', 'zmqpush1') params = _get_params(kwargs.get('payload'), ['cluster_id'], 'data.') with closing(self.server.odb.session()) as session: item_list = Element('item_list') db_items = out_zmq_list(session, params['cluster_id']) for db_item in db_items: item = Element('item') item.id = db_item.id item.name = db_item.name item.is_active = db_item.is_active item.address = db_item.address item.socket_type = db_item.socket_type item_list.append(item) return ZATO_OK, etree.tostring(item_list)
def get_out_zmq_list(self, cluster_id, needs_columns=False): """ Returns a list of outgoing ZMQ connections. """ with closing(self.session()) as session: return query.out_zmq_list(session, cluster_id, needs_columns)
def get_data(self, session): return out_zmq_list(session, self.request.input.cluster_id, False)
def get_out_zmq_list(self, cluster_id, needs_columns=False): """ Returns a list of outgoing ZMQ connections. """ return out_zmq_list(self._session, cluster_id, needs_columns)
def get_out_zmq_list(self, cluster_id): """ Returns a list of outgoing ZMQ connections. """ return out_zmq_list(self._session, cluster_id)