Skip to content

The sleep policy of an SVM

Resource, request and plan limits are listed on Limits.

Download OpenAPI specification · Version 0.1.0

Change the sleep policy of an SVM

PUT
/svms/{ref}/sleep

Sets the sleep policy and sends it to the node at once: auto sleeps when the workload is idle, timer sleeps after_s seconds after the last external activity, and on never sleeps. A sleeping SVM takes the new policy at its next wake; see sleep and wake.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Header Parameters

if-match?string

The generation that the change expects, the generation of the last answer for this SVM; a different stored generation answers 412 generation_mismatch and changes nothing, and without the header the change is unconditional.

Request Body

The sleep policy: {"mode":"auto"}, {"mode":"timer","after_s":1800} or {"mode":"on"}.

  1. body

The sleep policy: {"mode":"auto"}, {"mode":"timer","after_s":1800} or {"mode":"on"}.

after_s?number

The inactivity of a timer in seconds: an integer from 30 to 86400; only timer uses it.

mode*string

auto sleeps when the workload is idle; timer sleeps after_s seconds after the last external activity; on never sleeps and uses its memory all the time.

Response Body

The sleep policy of an SVM: auto follows the workload; timer ignores background signals; on never sleeps. An open terminal, or a preview that moves data, keeps the SVM awake in auto and timer modes.

application/json
  1. response

Sleep when the workload is idle; background work keeps the SVM awake.

mode*string
Example Request
curl -X PUT 'https://api.slashinfra.com/svms/build-1/sleep' \  -H 'Content-Type: application/json' \  -d '{  "mode": "timer"}'
Example Response
{  "mode": "auto"}