Skip to content

Commit

Permalink
feat(sdk): Extend SDK client with disable/delete run methods (#6754)
Browse files Browse the repository at this point in the history
* add disbale/delete run (job) functions to sdk client

* change run to job to accuratly reflect api

* add release note for change

* align docstrings with style guide requirements

* formatting

Co-authored-by: Chen Sun <chensun@users.noreply.github.com>
  • Loading branch information
johnmacnamararseg and chensun authored Oct 19, 2021
1 parent 78dfac7 commit ba0bb60
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdk/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Current Version (Still in Development)

## Major Features and Improvements
* Add functions to sdk client to delete and disable jobs [\#6754](https://github.com/kubeflow/pipelines/pull/6754)

## Breaking Changes

Expand Down
28 changes: 28 additions & 0 deletions sdk/python/kfp/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,34 @@ def __repr__(self):
)
return RunPipelineResult(self, run_info)

def delete_job(self, job_id):
"""Deletes a job.
Args:
job_id: id of the job.
Returns:
Object. If the method is called asynchronously, returns the request thread.
Raises:
ApiException: If the job is not found.
"""
return self._job_api.delete_job(id=job_id)

def disable_job(self, job_id):
"""Disables a job.
Args:
job_id: id of the job.
Returns:
Object. If the method is called asynchronously, returns the request thread.
Raises:
ApiException: If the job is not found.
"""
return self._job_api.disable_job(id=job_id)

def list_runs(self,
page_token='',
page_size=10,
Expand Down

0 comments on commit ba0bb60

Please sign in to comment.