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'))
评论列表
文章目录