コード例 #1
0
    def get(self, agent_id):
        username = self.get_current_user()
        customer_name = get_current_customer_name(username)
        uri = self.request.uri
        method = self.request.method
        try:
            agent_queue = '[]'
            rqueue = QueueWorker({'agent_id': agent_id}, username)
            queue_exists = rqueue.exists()
            agent_queue = (process_queue_data(rqueue, queue_exists, agent_id,
                                              username, customer_name, uri,
                                              method))
            status = (AgentResults(username, uri,
                                   method).check_in(agent_id, agent_queue))
            logger.info(status)
            update_agent_status(agent_id, username, self.request.uri,
                                self.request.method)
            self.set_status(status['http_status'])
            self.set_header('Content-Type', 'application/json')
            self.write(dumps(status))

        except Exception as e:
            status = (GenericResults(username, uri, method).something_broke(
                agent_id, 'check_in', e))
            logger.exception(e)
            self.set_status(status['http_status'])
            self.set_header('Content-Type', 'application/json')
            self.write(dumps(status))
コード例 #2
0
def get_agent_queue(agent_id):

    if agent_id is None:
        return dumps([])

    rqueue = QueueWorker({'agent_id': agent_id})
    agent_queue = process_queue_data(rqueue, rqueue.exists())

    return agent_queue
コード例 #3
0
ファイル: rqueuemanager.py プロジェクト: MiguelMoll/vFense
def get_agent_queue(agent_id):

    if agent_id is None:
        return dumps([])

    rqueue = QueueWorker({'agent_id': agent_id})
    agent_queue = process_queue_data(
        rqueue,
        rqueue.exists()
    )

    return agent_queue
コード例 #4
0
ファイル: checkin.py プロジェクト: MiguelMoll/vFense
    def get(self, agent_id):
        username = self.get_current_user()
        customer_name = get_current_customer_name(username)
        uri = self.request.uri
        method = self.request.method
        try:
            agent_queue = '[]'
            rqueue = QueueWorker({'agent_id': agent_id}, username)
            queue_exists = rqueue.exists()
            agent_queue = (
                process_queue_data(
                    rqueue, queue_exists, agent_id,
                    username, customer_name, uri, method
                )
            )
            status = (
                AgentResults(
                    username, uri, method
                ).check_in(agent_id, agent_queue)
            )
            logger.info(status)
            update_agent_status(
                agent_id, username, self.request.uri,
                self.request.method
            )
            self.set_status(status['http_status'])
            self.set_header('Content-Type', 'application/json')
            self.write(dumps(status))

        except Exception as e:
            status = (
                GenericResults(
                    username, uri, method
                ).something_broke(agent_id, 'check_in', e)
            )
            logger.exception(e)
            self.set_status(status['http_status'])
            self.set_header('Content-Type', 'application/json')
            self.write(dumps(status))