Skip to content

Commit

Permalink
client: add list_recurring_runs, get_recurring_run
Browse files Browse the repository at this point in the history
  • Loading branch information
faweis committed Feb 7, 2020
1 parent 61d0685 commit ce72872
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions sdk/python/kfp/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,34 @@ def list_runs(self, page_token='', page_size=10, sort_by='', experiment_id=None)
response = self._run_api.list_runs(page_token=page_token, page_size=page_size, sort_by=sort_by)
return response

def list_recurring_runs(self, page_token='', page_size=10, sort_by='', experiment_id=None):
"""List recurring runs.
Args:
page_token: token for starting of the page.
page_size: size of the page.
sort_by: one of 'field_name', 'field_name des'. For example, 'name des'.
experiment_id: experiment id to filter upon
Returns:
A response object including a list of recurring_runs and next page token.
"""
if experiment_id is not None:
response = self._job_api.list_jobs(page_token=page_token, page_size=page_size, sort_by=sort_by, resource_reference_key_type=kfp_server_api.models.api_resource_type.ApiResourceType.EXPERIMENT, resource_reference_key_id=experiment_id)
else:
response = self._job_api.list_jobs(page_token=page_token, page_size=page_size, sort_by=sort_by)
return response

def get_recurring_run(self, job_id):
"""Get recurring_run details.
Args:
id of the recurring_run.
Returns:
A response object including details of a recurring_run.
Throws:
Exception if recurring_run is not found.
"""
return self._job_api.get_job(id=job_id)


def get_run(self, run_id):
"""Get run details.
Args:
Expand Down

0 comments on commit ce72872

Please sign in to comment.