Deployments
A deployment is one build of a project's source, rolled out to one environment.
An environment keeps its deployments, and serves the last one that succeeded
(liveDeploymentId).
A deployment takes minutes, so it is created, then read until it is done:
POST /v4/projects/{projectId}/deployments returns it pending, and
GET …/deployments/{deploymentId} shows it running, then succeeded or
failed. There are no actions: redeploying and rolling back are deployments
too, whose source is an earlier deployment.
Deployments are listed, created and read in their project
(/v4/projects/{projectId}/deployments/{deploymentId}), next to its
environments. The environment is a property, and a filter on the list
(…/deployments?environmentId=…).
An AI Gateway deploys itself when one of its provider assignments is added,
changed or deleted: Zuplo creates a deployment (source.type zuplo) of the
production environment. Nothing links the change to its deployment: to wait for it, list
the environment's deployments (newest first) and read the newest zuplo
deployment created after the change until it has succeeded or failed.
succeeded means the rollout finished, not that every edge serves it yet: an
update never takes the gateway offline, but an edge may serve the previous
version for a while. Only a request to the gateway shows what it serves.
Other changes to an AI Gateway (pools, apps, policies, budgets, keys) need no
deployment, are not tracked, and apply within about a minute.
List deployments
Lists the deployments to the project's environments, newest first. Filter by
environmentId for one environment's history, and by status to find the
deployments that are still running. An environment keeps its deployments
until it is deleted.
path Parameters
projectIdThe project ID (prj_…). Its members, environments and deployments are addressed under it.
query Parameters
environmentIdOnly return the deployments to this environment.
statusOnly return deployments with this status.
Where a deployment is. pending: it waits for its source to be uploaded, or
to start. running: it is building and rolling out. succeeded: its
environment served it once it was done; the environment's liveDeploymentId
says whether it still does. For an AI Gateway, succeeded means the rollout
finished, not that every edge serves it yet: an edge may serve the previous
version for a while. failed: it did not build or roll out, and its
environment kept serving what it served before. succeeded and failed are
final. New values may be added.
limitThe maximum number of items to return.
offsetThe number of items to skip before the first item returned.
List deployments › Responses
A page of deployments.
The deployments on this page.
limitThe page size that was applied.
offsetThe number of items skipped before this page.
totalThe number of items in the whole collection.
hasMoreWhether there are more items after this page.
nextThe relative URL of the next page, or null on the last page.
Deploy to an environment
Deploys to the project's environment given by environmentId. The deployment
starts as pending: read it with
GET /v4/projects/{projectId}/deployments/{deploymentId} until its status
is succeeded or failed. Once it succeeds, the
environment serves it at the environment's url. Until then, and if it fails,
the environment keeps serving its previous deployment.
source says what to deploy:
upload: source code you upload, aszuplo deploydoes. The response'suploadsays where:PUTa gzipped tar archive of the project toupload.urlwithupload.headers, beforeupload.expiresOn. The deployment starts when the archive arrives, and fails if it does not arrive in time. The upload URL works like a password, so it is returned only in this response.deployment: an earlier deployment of the same environment, deployed again, for example to roll back, or to apply changed environment variables. It deploys that deployment's build as it is, or builds its source again withrebuild: true. During the preview, deploying a build as it is works only for the environment's live deployment, which applies changed environment variables. For an earlier one it answers501: roll back withrebuild: true.
A project connected to a Git repository deploys every push to a branch
itself (source.type: git). Zuplo deploys AI Gateway projects itself when
their provider assignments change (source.type: zuplo), so creating a deployment for
one fails with 400. Projects on managed dedicated hosting can only rebuild
an earlier deployment (rebuild: true); deploying its build as it is fails
with 400.
Fails with 400 when environmentId is not an environment of the project, or
source.deploymentId is not a deployment of that environment. Fails with
409 while the environment is being deleted.
path Parameters
projectIdThe project ID (prj_…). Its members, environments and deployments are addressed under it.
Deploy to an environment › Request Body
environmentIdThe project's environment to deploy to.
What to deploy. type says where it comes from.
Deploy to an environment › Responses
The deployment was created. For an upload source, upload says where to send the source.
idThe deployment ID.
projectIdThe project the deployment belongs to.
environmentIdThe environment it deploys to.
statusWhere a deployment is. pending: it waits for its source to be uploaded, or
to start. running: it is building and rolling out. succeeded: its
environment served it once it was done; the environment's liveDeploymentId
says whether it still does. For an AI Gateway, succeeded means the rollout
finished, not that every edge serves it yet: an edge may serve the previous
version for a while. failed: it did not build or roll out, and its
environment kept serving what it served before. succeeded and failed are
final. New values may be added.
What a deployment deployed.
createdOnWhen the deployment was created.
finishedOnWhen it succeeded or failed. Null while it is pending or running.
Where to upload the source, which is shown only once. Null unless source.type is upload.
Get a deployment
Returns a deployment, what it deployed and its status. After creating a
deployment, read it until status is succeeded or failed.
path Parameters
projectIdThe project ID (prj_…). Its members, environments and deployments are addressed under it.
deploymentIdThe deployment ID, a UUID.
Get a deployment › Responses
The deployment.
idThe deployment ID.
projectIdThe project the deployment belongs to.
environmentIdThe environment it deploys to.
statusWhere a deployment is. pending: it waits for its source to be uploaded, or
to start. running: it is building and rolling out. succeeded: its
environment served it once it was done; the environment's liveDeploymentId
says whether it still does. For an AI Gateway, succeeded means the rollout
finished, not that every edge serves it yet: an edge may serve the previous
version for a while. failed: it did not build or roll out, and its
environment kept serving what it served before. succeeded and failed are
final. New values may be added.
What a deployment deployed.
createdOnWhen the deployment was created.
finishedOnWhen it succeeded or failed. Null while it is pending or running.