How it works
A long-running operation returns one of two things:- The new object, with a status. Trigger deployment returns the deployment with
statuswaiting, and Create database returns the database withstatuscreating. Poll the object’sGEToperation until the status is final. - A message. Restore database backup returns
202with{"message": "Database backup restore started"}, and Suspend application returns200with a message. Poll the service the operation acts on.
APP_DEPLOY or STATIC_SITE_DEPLOY tells you when they end, without polling.
Deployments
Application and static site deployments have the same statuses:
An application deployment’s
finished_at is set when it succeeds, fails or is cancelled. To stop a deployment, call Cancel deployment or Cancel static site deployment.
Wait for a deployment
Trigger the deployment, keep itsid, then get it until the status is final:
steps, repo_url and commit_sha: see Trigger deployment. In code:
wait-for-deployment.ts
Databases
Poll Get database and readstatus:
Suspend database and Activate database don’t change
status: is_suspended changes to true or false when they finish. For Delete database, see Deletions.
Restarting, updating, suspending, restoring and deleting a database are rejected with 400 while the database is busy, for example while a backup is in progress. Wait for ready before you start the next operation.
Backups
Backups have no status of their own: poll the list until a backup with your
display_name appears.
Deletions
While the deletion runs,
status is deleting. Deleting a static site or a project finishes before the response.
Other background operations
Changes that wait for a deployment
Some operations finish at once but take effect only at the application’s next deployment: creating a process, changing a process’s resource type, scaling or probes, deleting a process, and changing environment variables. Trigger a deployment to apply them. Withis_restart set to true, the deployment reuses the last successful build instead of building again.