I am trying to find error states of deployed shiny applications so I can notify developers they may need to patch them. I have tried using the admin page on connect and the API but I have not found a way to determine if an application has an error without visiting the logs.
I have tried the /v1/experimental/content/{guid} endpoint to get the content details but it doesn't seem to tell me if the application loaded successfully or not.
Is there a way using the API capture an error state of a application? If there is not, is there a way to mass download the logs for each application?
I think the jobs API endpoint is what you are after.
It provides the /jobs/ endpoint for all jobs on any particular content item showing (amongst other things):
tag: A tag to identify the nature of the job. It can be one of unknown, build_report, build_site, build_jupyter, packrat_restore, python_restore, configure_report, run_app, run_api, run_tensorflow, run_python_api, run_dash_app, run_streamlit, run_bokeh_app, run_fastapi_app, run_pyshiny_app, render_shiny, run_voila_app, testing, git, val_py_ext_pkg, val_r_ext_pkg, val_r_install, val_tensorflow.
exit_code: The job's exit code. Present only when job is finished.
status: The current status of the job. It can be one of Active: 0, Finished: 1, Finalized: 2.
Should a generalizable solution be reached we'll be sure to return here and share that.
I'd love it if more was shared here - one customer's experience can help other customers with similar questions... and can inspire and assist us all in building bigger and better things!
Thanks Lachlan, the jobs endpoint was what I needed. The process I used to get the errors for each content item was a bit cumbersome though as neither the job endpoint or error/logs endpoints contained information on its parent. I see there is a PPID for parent process on the jobs entries but nothing that points towards the content item. I think if each Job had the GUID as an entry it would have helped streamline things a bit but I don't have a full understanding on how jobs work on the server.