Follow runs
Read a run's state until it ends, and then its outputs. Needs runs:read.
Poll with a wait
Call getOrchestratorRun with ?wait=15. It answers as soon as the run
ends, or after 15 seconds with its current state:
- bash / zsh
- fish
- PowerShell
curl "$GHOSTPULL_URL/api/v1/orchestrator/runs/$ADDON_ID/$RUN_ID?wait=15" \
-H "x-api-key: $GHOSTPULL_API_KEY"
curl "$GHOSTPULL_URL/api/v1/orchestrator/runs/$ADDON_ID/$RUN_ID?wait=15" \
-H "x-api-key: $GHOSTPULL_API_KEY"
curl.exe "$env:GHOSTPULL_URL/api/v1/orchestrator/runs/$env:ADDON_ID/$env:RUN_ID?wait=15" `
-H "x-api-key: $env:GHOSTPULL_API_KEY"
Call again while status is RUNNING. Once it is SUCCEEDED, the answer
holds the run's outputs, with signed download links that expire.
Stream instead of polling
streamOrchestratorRun sends the same state as Server-Sent Events: once at
once, and again on every change. The stream closes when the run ends, or
after 15 minutes; connect again to go on.