Set Idle Sleep Setting
PUT
/api/v3/organizations/{organisation}/applications/{application}/environments/{environment}/idle-sleep
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/applications/example/environments/example/idle-sleep';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabled":true,"idleMinutes":30}'};
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/idle-sleep \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "enabled": true, "idleMinutes": 30 }'Enable or disable idle sleep. Only Fargate compute sleeps. Disabling a sleeping environment wakes it first; a 202 means it is still waking.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”organisation
required
string
application
required
string
environment
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
enabled
required
Whether the environment sleeps when idle.
boolean
idleMinutes
Minutes with no requests before compute sleeps.
integer
Responses
Section titled “Responses”Applied.
Media typeapplication/json
object
enabled
required
boolean
idleMinutes
required
integer
state
required
string
stateChangedAt
required
string format: date-time
Example
{ "state": "awake"}Applied; environment still waking.
Media typeapplication/json
object
enabled
required
boolean
idleMinutes
required
integer
state
required
string
stateChangedAt
required
string format: date-time
Example
{ "state": "awake"}The environment cannot use idle sleep. It runs on EC2 rather than Fargate, it has no web service, or its hostname is too long to route while asleep.
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}The caller lacks the required permission or token scope.
Organisation, application or environment not found.
Validation failed. idleMinutes must be an integer from 10 to 1440.
Media typeapplication/json
object
message
string
errors
object
Examplegenerated
{ "message": "example", "errors": {}}