Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

List export addlogstore #308

Merged
merged 3 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion aliyun/log/logclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -5188,7 +5188,7 @@ def list_export(self, project_name, offset=0, size=100):
Unsuccessful operation will cause an LogException.

:type project_name: string
:param project_name: the Pqroject name
:param project_name: the project name

:type offset: int
:param offset: line offset of return logs
Expand All @@ -5211,6 +5211,39 @@ def list_export(self, project_name, offset=0, size=100):
params['jobType'] = "Export"
(resp, header) = self._send("GET", project_name, None, resource, params, headers)
return ListExportResponse(resp, header)

def list_logstore_export(self, project_name, logstore_name, offset=0, size=100):
""" list exports that belongs to the logstore
Unsuccessful operation will cause an LogException.

:type project_name: string
:param project_name: the project name

:type offset: int
:param offset: line offset of return logs

:type size: int
:param size: max line number of return logs, -1 means get all

:type logstore_name: string
:param logstore_name: logstore name, only list the export job that belongs to the logstore

:return: ListExportsResponse
:raise: LogException
"""
# need to use extended method to get more
if int(size) == -1 or int(size) > MAX_LIST_PAGING_SIZE:
return list_more(self.list_logstore_export, int(offset), int(size), MAX_LIST_PAGING_SIZE,
project_name, logstore_name)
headers = {}
params = {}
resource = '/jobs'
params['offset'] = str(offset)
params['size'] = str(size)
params['jobType'] = "Export"
params['logstore'] = logstore_name
(resp, header) = self._send("GET", project_name, None, resource, params, headers)
return ListExportResponse(resp, header)

def list_alert(self, project, offset=0, size=100):
"""list alerts
Expand Down
1 change: 1 addition & 0 deletions aliyun/log/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__version__ = '0.9.15'


import sys
OS_VERSION = str(sys.platform)
PYTHON_VERSION = str(sys.version_info)
Expand Down
Loading