Skip to main content

App Environment Management API

The App Environment Management API allows you to manage resources, scaling, and apply pending changes to app environments in Quave Cloud.

Make sure to read the Get Started document to understand how the API works.

Note: All endpoints in this API accept both appEnvId and envName parameters for identifying the environment.

Apply Pending Changes

Applies any pending configuration changes to an app environment. This works like terraform apply - it takes the pending changes (from resources, scaling, env vars updates, etc.) and deploys them to the infrastructure.

Endpoint: POST /api/public/v1/app-env/apply-changes

Request Body

FieldTypeRequiredDescription
appEnvIdStringEitherThe ID of the app environment.
envNameStringEitherThe CLI environment name (alternative to appEnvId).

Example

curl -X POST \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b"
}' \
https://api.quave.cloud/api/public/v1/app-env/apply-changes

Example Response

{
"success": true,
"message": "Changes applied successfully",
"appEnv": {
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"name": "Production",
"status": "UPDATING"
}
}

Notes

  • If there are no pending changes, the API will return a success response with a message indicating no changes were applied.
  • The operation determines the type of changes (build, deploy, or scale) and executes them in the correct priority order.

Update Resources

Updates the resource allocation for an app environment. You can use either zClouds (simplified abstraction) or custom resources (CPU/memory/disk) for BYOP accounts.

Endpoint: PATCH /api/public/v1/app-env/resources

Request Body

FieldTypeRequiredDescription
appEnvIdStringEitherThe ID of the app environment.
envNameStringEitherThe CLI environment name (alternative to appEnvId).
zCloudsNumberNoNumber of zClouds (1 zCloud = 0.5 CPU + 512MB memory + 5GB disk).
cpuNumberNoCPU limit in cores (e.g., 2.0). Requires BYOP account.
cpuRequestNumberNoCPU request (guaranteed minimum). Must not exceed cpu. Requires BYOP.
memoryNumberNoMemory limit in MB (e.g., 2048). Requires BYOP account.
memoryRequestNumberNoMemory request (guaranteed minimum). Must not exceed memory. BYOP.
diskNumberNoDisk storage in MB. Requires BYOP account.
networkIngressNumberNoNetwork ingress in MB. Requires BYOP account.
networkEgressNumberNoNetwork egress in MB. Requires BYOP account.
applyImmediatelyBooleanNoIf true, deploy changes immediately. Default: false (pending changes).

Example: Update zClouds

curl -X PATCH \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"zClouds": 4,
"applyImmediately": true
}' \
https://api.quave.cloud/api/public/v1/app-env/resources

Example: Update Custom Resources (BYOP)

curl -X PATCH \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"cpu": 2.0,
"cpuRequest": 1.0,
"memory": 2048,
"memoryRequest": 1024,
"disk": 10240
}' \
https://api.quave.cloud/api/public/v1/app-env/resources

Example Response

{
"success": true,
"message": "Resources updated and changes applied",
"appEnv": {
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"name": "Production",
"zClouds": 4
},
"appliedImmediately": true
}

Notes

  • zClouds vs Custom Resources: Use zClouds for simplified resource allocation, or custom fields (cpu, memory, disk) for fine-grained control. Don't mix both.
  • BYOP Requirement: Custom resources are only available for accounts with BYOP (Bring Your Own Provider) enabled.
  • Request vs Limit: Request values are the guaranteed minimum resources; limit values are the maximum. Request must not exceed limit.

Update Autoscaling

Updates the autoscaling configuration for an app environment.

Endpoint: PATCH /api/public/v1/app-env/autoscaling

Request Body

FieldTypeRequiredDescription
appEnvIdStringEitherThe ID of the app environment.
envNameStringEitherThe CLI environment name (alternative to appEnvId).
autoScalingEnabledBooleanNoEnable or disable autoscaling.
minReplicaCountNumberNoMinimum number of replicas (at least 1).
maxReplicaCountNumberNoMaximum replicas (must be at least minReplicaCount).
cpuTargetUtilizationNumberNoTarget CPU utilization percentage (1-100).
memoryTargetUtilizationNumberNoTarget memory utilization percentage (1-100).
incrementStepNumberNoNumber of pods to add when scaling up.
decrementStepNumberNoNumber of pods to remove when scaling down.
scaleUpStabilizationWindowSecondsNumberNoStabilization window for scaling up (seconds).
scaleDownStabilizationWindowSecondsNumberNoStabilization window for scaling down (seconds).
applyImmediatelyBooleanNoIf true, deploy changes immediately. Default: false.

Example

curl -X PATCH \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"autoScalingEnabled": true,
"minReplicaCount": 2,
"maxReplicaCount": 10,
"cpuTargetUtilization": 70,
"applyImmediately": true
}' \
https://api.quave.cloud/api/public/v1/app-env/autoscaling

Example Response

{
"success": true,
"message": "Autoscaling configuration updated and changes applied",
"appEnv": {
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"name": "Production",
"autoScalingEnabled": true,
"minReplicaCount": 2,
"maxReplicaCount": 10
},
"appliedImmediately": true
}

Scale Containers

Manually scales the number of containers for an app environment.

Endpoint: POST /api/public/v1/app-env/scale

Request Body

FieldTypeRequiredDescription
appEnvIdStringEitherThe ID of the app environment.
envNameStringEitherThe CLI environment name (alternative to appEnvId).
containersNumberYesNumber of containers to run (at least 1).
applyImmediatelyBooleanNoIf true, deploy changes immediately. Default: false.

Example

curl -X POST \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"containers": 5,
"applyImmediately": true
}' \
https://api.quave.cloud/api/public/v1/app-env/scale

Example Response

{
"success": true,
"message": "Container count updated and changes applied",
"appEnv": {
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"name": "Production",
"containers": 5
},
"appliedImmediately": true
}

Notes

  • If autoscaling is enabled, manual scaling will temporarily override it until the next autoscaling event.
  • Consider disabling autoscaling if you need consistent manual control over container count.

Error Responses

All endpoints may return the following error responses:

StatusDescription
400Invalid request (missing required fields, invalid values).
401User not authenticated.
403User doesn't have permission to access this app environment.
404App environment not found for the given appEnvId or envName.