Turn autoscaling on or change it. Null turns it off.
API key access: deploy.
apiKeyAuthorizationBearer <pyo_…>An API key from the dashboard's API keys page: Authorization: Bearer pyo_…. Keys can expire, and an expired one gets a 401.
application/jsonTurn autoscaling on or change it. Null turns it off.
API key access: deploy.
op*"setAutoscale""setAutoscale"id*stringautoscale?null|confirm?booleanGo ahead with a very large replica change: without it, one that goes to 20 or more replicas and to more than 10 times what the service had, or more than twice what its servers have room for, is refused with 409 and needsConfirm: true. Ask the user before sending it.
Done. Always ok: true, and some operations add more, such as a new API key or a join command. A warning comes with a change that went through but won't fully take effect yet, such as more replicas than the servers have room for.
application/jsoncurl -X POST 'https://your-pyo.example.com/api/v1/ops' \
-H 'Content-Type: application/json' \
-d '{
"autoscale": {
"max": 5,
"min": 1,
"targetCpu": 70,
"targetMemory": 80
},
"confirm": true,
"id": "svc_8kq2x7ad",
"op": "setAutoscale"
}'{}