Resume computer
Bring a suspended computer back where it left off, optionally for a set number of hours.
suspended computer. Its memory is restored, so open windows and running processes continue exactly where they were. A computer still on its host comes back in seconds. One that was moved off its host to storage is woken on a host with room, in about a minute.
instance_id and can land on a different host with a different address and ports. Keep its UUID as your handle and re-fetch GET /computers/{id} once it is running. While it wakes, GET /computers/{id} reports progress in asleep.waking.Path parameters
instance_id. Both resolve to the same computer. A computer asleep in storage has no instance_id, so address it by UUID.Body parameters
The body is optional. When you send one, it must be a JSON object.1 to 720 (30 days). The hours count from when the computer is running, not from the request. null takes any end off. Send ends_in_hours or ends_at, not both. Omitted, the resume sets no end, as described in Resume for a set number of hours.null takes any end off."delete", sent with ends_in_hours or ends_at, is accepted and changes nothing. Sent without either it returns 400 with code INVALID_ENDS: on_end goes with ends_at or ends_in_hours. Without an end it changes nothing. Any other value, "stop" included, returns 400 with code INVALID_ENDS: A computer with an end is deleted when its time is up. To keep a computer, leave out the end. Nothing resumes.Response
running with 200: the computer is back. resuming with 202: its memory is still being brought back from storage. Poll Get suspension until status reads running. Absent on a wake from storage.ends_in_hours or ends_at.
"delete" once an end is set, since the computer is deleted then, or null with no end. With end_not_set, the computer’s current value, which is "stop" for an end set before every end deleted the computer.ends_at once an end is set, or null with no end. With end_not_set, the computer’s current value.null when its time is not prepaid.prepaid_until. What is held from your credits for the run, in cents. null when prepaid_until is.error (why, in words) and code, beside the end the computer has. With every 202 that asked for an end, code is STILL_RESUMING. The resume itself is not refused for it. The codes are listed in When the end is not set.running returns 200 with status: "running", and one already resuming returns 202 again. A running computer gets the end you send. A computer that runs by the hour has its running time reserved from credit before it resumes.
Example
Response
202:
Resume for 4 hours
prepaid_until and prepaid_cents. One whose memory is still coming back answers 202 without an end:
Resume for a set number of hours
Sendends_in_hours or ends_at to give the computer an end as it resumes. When the end is up Orgo deletes the computer, running or not, with everything on it, as described in Computers with an end. To keep a computer, send no end.
- The end is checked before anything resumes, by the rules Update computer uses. A bad one returns
400,403, or503, listed in Errors, and nothing resumes. - The end is set once the computer is running. A resume that comes back at once (
200) sets it. A resume still under way (202,resumingorwaking) sets none and saysend_not_setwith codeSTILL_RESUMING. Set the end with Update computer once the computer isrunning. - A suspended computer whose end has passed but that Orgo is not deleting yet has its end taken off before it resumes, so it comes back as an ordinary computer, with the new end if you sent one. While Orgo is deleting it for its end, the resume returns
409with codeCOMPUTER_END_DELETING. - A computer that runs by the hour prepays the run to the new end once it is running, under the rules in Who can prepay. When the credit is short or you may not prepay, the end is still set, the time is billed by the hour, and the answer carries
prepay_warning. - A computer’s own key, its identity token, and a key for one computer can resume the computer but cannot set its end: a body that names an end returns
403with codecomputer_keyorcomputer_scope, and nothing resumes.
When the end is not set
An end that could not be set never fails the resume. The answer carriesend_not_set, beside the end the computer has:
STILL_RESUMING, each error starts with Resumed, but no end was set.
Errors
402 for credit or the plan, a 402 with no code, and FREE_HOURLY_BUSY also carry retryable (whether the same request can work later as it is), docs_url, and next, the call that fixes it, as { "method", "url", "why" } with a body when the call needs one. When next adds credit, the body also has add_credit_url, the page where a person adds it, and with a Bearer credential error ends with the call, such as Next: POST /api/credits/checkout.Authorizations
Body
Not a choice: a computer with an end is deleted when its time is up, running or not, with everything on it. "delete", sent with ends_in_hours or ends_at, is accepted and changes nothing. Without either it returns 400 (INVALID_ENDS): on_end goes with ends_at or ends_in_hours. Without an end it changes nothing. Any other value, "stop" included, returns 400 (INVALID_ENDS): A computer with an end is deleted when its time is up. To keep a computer, leave out the end.
delete, null Response
Running.
Present when the body sent an end. What happens at the end, read only: "delete" (deleted at ends_at, as every end set now is), "stop" (an end set before every end deleted the computer: stopped at ends_at, deleted 7 days later unless it is started), or null with no end.
delete, stop, null Present when the end was set but its time was not prepaid: The new time is billed by the hour. Only the account owner can prepay it, signed in or with a key that has Billing write. when you may not prepay, or The new end is set, and the time to it is billed by the hour: your credit does not cover prepaying all of it. when the credit is short.
Present when the end you asked for was not set. The start or resume itself succeeded. code is INVALID_ENDS (an ends_at that passed meanwhile), COMPUTER_BUSY, insufficient_credit (a later end than a running prepay that the credit cannot cover, with needed_cents, available_cents, and keep_cents when there is any), ENDS_UNAVAILABLE, NOT_FOUND, END_NOT_SET, or, on a resume still under way, STILL_RESUMING.