From eaa006846a559fc90c7f99dc4dcc4a04b638ecb8 Mon Sep 17 00:00:00 2001 From: HuangLuGuang Date: Thu, 2 Mar 2023 11:02:59 +0800 Subject: [PATCH] add Python API to kill a trail job (#5411) --- nni/experiment/experiment.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nni/experiment/experiment.py b/nni/experiment/experiment.py index 49d14b8a5..bd6417f4d 100644 --- a/nni/experiment/experiment.py +++ b/nni/experiment/experiment.py @@ -601,3 +601,16 @@ class Experiment: New max_trial_number value. """ self._update_experiment_profile('maxTrialNumber', value) + + def kill_trial_job(self, trial_job_id: str): + """ + Kill a trial job. + + Parameters + ---------- + trial_job_id: str + Trial job id. + + """ + rest.delete(self.port, '/trial-jobs/{}'.format(trial_job_id), self.url_prefix) +