Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hcl00521 committed Aug 21, 2024
1 parent 294e15f commit 8203141
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 6 additions & 2 deletions aliyun/log/logclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -5157,13 +5157,16 @@ def get_export(self, project_name, job_name):
(resp, header) = self._send("GET", project_name, None, resource, params, headers)
return GetExportResponse(header, resp)

def list_export(self, project_name, offset=0, size=100):
def list_export(self, project_name, logstore, offset=0, size=100):
""" list exports
Unsuccessful operation will cause an LogException.
:type project_name: string
:param project_name: the Pqroject name
:type logstore: string
:param logstore: the logstore name
:type offset: int
:param offset: line offset of return logs
Expand All @@ -5176,13 +5179,14 @@ def list_export(self, project_name, offset=0, size=100):
# need to use extended method to get more
if int(size) == -1 or int(size) > MAX_LIST_PAGING_SIZE:
return list_more(self.list_export, int(offset), int(size), MAX_LIST_PAGING_SIZE,
project_name)
project_name, logstore)
headers = {}
params = {}
resource = '/jobs'
params['offset'] = str(offset)
params['size'] = str(size)
params['jobType'] = "Export"
params['logstore'] = logstore
(resp, header) = self._send("GET", project_name, None, resource, params, headers)
return ListExportResponse(resp, header)

Expand Down
11 changes: 9 additions & 2 deletions tests/export_examples/export_odps_sink_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,20 @@ def update_export():
jobName = '11111'
config = getJobConfig(client, project, jobName) # 获取任务的配置
config['displayName'] = config['displayName'] + 'new'
config['configuration']['sink']['delaySeconds'] = 909
export = json.dumps(config)
client.update_export(project_name=project, job_name=jobName, export=export)


def list_export():
client = LogClient("region", "ak", "ak_key")
project = '11111'
logstore = '11111'
res = client.list_export(project, logstore)
res.log_print()


def main():
update_export()
list_export()


if __name__ == "__main__":
Expand Down

0 comments on commit 8203141

Please sign in to comment.