Skip to Content
PyoDocs

Making changes

Deploy, scale, restart and more with one endpoint.

Every change is a POST to /api/v1/ops, with the operation's name in op and its fields alongside it:

curl -X POST https://your-pyo/api/v1/ops \
  -H "Authorization: Bearer $PYO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "op": "scaleService", "id": "<service-id>", "replicas": 3 }'

Find ids in the snapshot.

Common operations

These work with a key that has deploy access.

OperationFieldsWhat it does
deployserviceId, deploymentId, triggerDeploy a service
canceldeploymentIdCancel a deployment
scaleServiceid, replicasSet the number of replicas
restartServiceidRestart it, one replica at a time
stopServiceidStop it, keeping its settings and data

Deploying

You choose the new deployment's id: dpl_ followed by 4 to 40 lowercase letters, digits, dashes or underscores. It comes back in the snapshot so you can follow it. Set trigger to manual.

{
  "op": "deploy",
  "serviceId": "<service-id>",
  "deploymentId": "dpl_<your-id>",
  "trigger": "manual"
}

Rolling back

A rollback is a deploy of an earlier deployment:

{
  "op": "deploy",
  "serviceId": "<service-id>",
  "deploymentId": "dpl_<your-id>",
  "trigger": "rollback",
  "rollbackOf": "<earlier-deployment-id>"
}

A simpler way to trigger deploys

If all you need is to start a deploy from CI or a CMS, use a deploy hook. It needs no key or JSON.

On this page

Edit page