Skip to content

Commit 631532f

Browse files
committed
Rename one method and default to None
1 parent f0156e2 commit 631532f

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

dataikuapi/dss/admin.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def kubectl_command(self, args):
11781178
"POST", "/admin/clusters/%s/k8s/kubectl" % self.cluster_id,
11791179
body={'args': args})
11801180

1181-
def delete_finished_jobs(self, delete_failed=False, namespace="", label_filter="", dry_run=False):
1181+
def delete_finished_jobs(self, delete_failed=False, namespace=None, label_filter=None, dry_run=False):
11821182
"""
11831183
Runs a kubectl command to delete finished jobs.
11841184
@@ -1188,30 +1188,32 @@ def delete_finished_jobs(self, delete_failed=False, namespace="", label_filter="
11881188
:param str namespace: the namespace in which to delete the jobs
11891189
:param str label_filter: delete only jobs matching a label filter
11901190
:param bool dry_run: if True, execute the command as a "dry run"
1191-
:return: a dict containing the return value, standard output, and standard error of the command
1191+
:return: a dict containing whether the deletion succeeded, a list of deleted job names, and
1192+
debug info for the underlying kubectl command
11921193
:rtype: dict
11931194
"""
11941195
return self.client._perform_json(
11951196
"POST", "/admin/clusters/%s/k8s/delete-finished-jobs" % self.cluster_id,
11961197
params={'deleteFailed': delete_failed, 'namespace': namespace, 'labelFilter': label_filter, 'dryRun': dry_run})
11971198

1198-
def delete_succeeded_and_failed_pods(self, namespace="", label_filter="", dry_run=False):
1199+
def delete_finished_pods(self, namespace=None, label_filter=None, dry_run=False):
11991200
"""
1200-
Runs a kubectl command to delete succeeded and failed pods.
1201+
Runs a kubectl command to delete finished (succeeded and failed) pods.
12011202
12021203
This operation is only valid for a Kubernetes cluster.
12031204
12041205
:param str namespace: the namespace in which to delete the pods
12051206
:param str label_filter: delete only pods matching a label filter
12061207
:param bool dry_run: if True, execute the command as a "dry run"
1207-
:return: a dict containing the return value, standard output, and standard error of the command
1208+
:return: a dict containing whether the deletion succeeded, a list of deleted pod names, and
1209+
debug info for the underlying kubectl command
12081210
:rtype: dict
12091211
"""
12101212
return self.client._perform_json(
1211-
"POST", "/admin/clusters/%s/k8s/delete-succeeded-and-failed-pods" % self.cluster_id,
1213+
"POST", "/admin/clusters/%s/k8s/delete-finished-pods" % self.cluster_id,
12121214
params={'namespace': namespace, 'labelFilter': label_filter, 'dryRun': dry_run})
12131215

1214-
def delete_all_pods(self, namespace="", label_filter="", dry_run=False):
1216+
def delete_all_pods(self, namespace=None, label_filter=None, dry_run=False):
12151217
"""
12161218
Runs a kubectl command to delete all pods.
12171219
@@ -1220,7 +1222,8 @@ def delete_all_pods(self, namespace="", label_filter="", dry_run=False):
12201222
:param str namespace: the namespace in which to delete the pods
12211223
:param str label_filter: delete only pods matching a label filter
12221224
:param bool dry_run: if True, execute the command as a "dry run"
1223-
:return: a dict containing the return value, standard output, and standard error of the command
1225+
:return: a dict containing whether the deletion succeeded, a list of deleted pod names, and
1226+
debug info for the underlying kubectl command
12241227
:rtype: dict
12251228
"""
12261229
return self.client._perform_json(

0 commit comments

Comments
 (0)