We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 476ce50 + 30477c7 commit a126ab0Copy full SHA for a126ab0
examples/job_crud.py
@@ -17,6 +17,7 @@
17
"""
18
19
from os import path
20
+from time import sleep
21
22
import yaml
23
@@ -54,6 +55,20 @@ def create_job(api_instance, job):
54
55
body=job,
56
namespace="default")
57
print("Job created. status='%s'" % str(api_response.status))
58
+ get_job_status(api_instance)
59
+
60
61
+def get_job_status(api_instance):
62
+ job_completed = False
63
+ while not job_completed:
64
+ api_response = api_instance.read_namespaced_job_status(
65
+ name=JOB_NAME,
66
+ namespace="default")
67
+ if api_response.status.succeeded is not None or \
68
+ api_response.status.failed is not None:
69
+ job_completed = True
70
+ sleep(1)
71
+ print("Job status='%s'" % str(api_response.status))
72
73
74
def update_job(api_instance, job):
0 commit comments