Upsert Scaling Policy
PUT
/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/scaling-policies
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/applications/example/environments/example/scaling-policies';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"metric":"CPUUtilization","targetValue":75,"scaleInCooldownSeconds":300,"scaleOutCooldownSeconds":60}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://dashboard.quantcdn.io/api/v3/organizations/example/applications/example/environments/example/scaling-policies \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "metric": "CPUUtilization", "targetValue": 75, "scaleInCooldownSeconds": 300, "scaleOutCooldownSeconds": 60 }'Creates or updates a target tracking scaling policy for the environment. Specify the metric type and target value. If a policy with the same metric or name exists, it will be updated. Optionally, provide a custom policy name via query.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”organisation
required
string
application
required
string
environment
required
string
Query Parameters
Section titled “Query Parameters”policyName
string
Optional. Specify a custom policy name to upsert.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
metric
required
Metric to track for scaling.
string
targetValue
required
Target value. Percentage for CPU/Memory; req/sec per task for RPS.
number format: double
Example
75scaleInCooldownSeconds
Cooldown (seconds) before another scale-in can start.
integer
scaleOutCooldownSeconds
Cooldown (seconds) before another scale-out can start.
integer
Responses
Section titled “Responses”Scaling policy created or updated successfully.
Media typeapplication/json
object
metric
string
targetValue
number format: double
scaleInCooldownSeconds
integer
scaleOutCooldownSeconds
integer
policyName
Name of the underlying Application Auto Scaling policy.
string
resourceLabel
ALB ResourceLabel for RPS policies (target group identifier).
string
Example
{ "metric": "CPUUtilization"}