Skip to content

Commit fb11e5a

Browse files
committed
docs: show client checking for degraded process
1 parent 73e2b2a commit fb11e5a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/developer/clients.rst

+26
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,32 @@ of a Task::
216216
else:
217217
print('Task did not complete successfully')
218218

219+
Check Health of a Process
220+
^^^^^^^^^^^^^^^^^^^^^^^^^
221+
222+
Usually it's good when a Process is still running, but some Processes
223+
will also mark themselves as "degraded" if there is some non-fatal
224+
problem that means the acquisition or control is not occurring::
225+
226+
from ocs.ocs_client import OCSClient
227+
228+
client = OCSClient('agent-instance-id')
229+
230+
client.some_process.start()
231+
time.sleep(2)
232+
status = client.some_process()
233+
234+
if response.session['success'] is None:
235+
if response.session['degraded']:
236+
print('Process is running, but in a degraded state.')
237+
else:
238+
print('Process is running (and does not report degraded state).')
239+
elif response.session['success']:
240+
print('Process exited without error')
241+
else:
242+
print('Process exited with error')
243+
244+
219245
Check Latest Data in an Operation
220246
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221247

0 commit comments

Comments
 (0)