Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/api/client.py
# Copyright (C) 2018 The Software Heritage developers | # Copyright (C) 2018-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from swh.core.api import RPCClient | from swh.core.api import RPCClient | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | class RemoteScheduler(RPCClient): | ||||
def end_task_run(self, backend_id, status, metadata=None, timestamp=None): | def end_task_run(self, backend_id, status, metadata=None, timestamp=None): | ||||
return self.post('end_task_run', { | return self.post('end_task_run', { | ||||
'backend_id': backend_id, | 'backend_id': backend_id, | ||||
'status': status, | 'status': status, | ||||
'metadata': metadata, | 'metadata': metadata, | ||||
'timestamp': timestamp, | 'timestamp': timestamp, | ||||
}) | }) | ||||
def filter_task_to_archive(self, after_ts, before_ts, limit=10, | def filter_task_to_archive(self, after_ts, before_ts, | ||||
last_id=-1): | count=10, page_token=None): | ||||
return self.post('filter_task_to_archive', { | return self.post('filter_task_to_archive', { | ||||
'after_ts': after_ts, | 'after_ts': after_ts, | ||||
'before_ts': before_ts, | 'before_ts': before_ts, | ||||
'limit': limit, | 'count': count, | ||||
ardumont: revert back to limit now. | |||||
'last_id': last_id, | 'page_token': page_token, | ||||
}) | }) | ||||
def delete_archived_tasks(self, task_ids): | def delete_archived_tasks(self, task_ids): | ||||
return self.post('delete_archived_tasks', {'task_ids': task_ids}) | return self.post('delete_archived_tasks', {'task_ids': task_ids}) | ||||
def get_priority_ratios(self): | def get_priority_ratios(self): | ||||
return self.get('get_priority_ratios') | return self.get('get_priority_ratios') |
revert back to limit now.