logs.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:pylm-registry 作者: nfqsolutions 项目源码 文件源码
def download(self, fr=None, to=None):
        """
        Download the log lines, that you may filter by time

        :param fr: datetime. Log lines from
        :param to: datetime. Log lines to
        :return: A list with dicts
        """
        arguments = {
            'cluster': self.cluster
        }

        if fr:
            arguments['fr'] = fr

        if to:
            arguments['to'] = to

        client = HTTPClient()
        response = client.fetch('{}/logs?{}'.format(
            self.uri, parse.urlencode(arguments)),
        )

        return json.loads(response.body.decode('utf-8'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号