computers

Rename a computer, or set when it ends

Changed on

Body: name, bot_mascot, and the end: ends_at (ISO 8601, in the future, at most 720 hours away), ends_in_hours (1 to 720), or ends_at null to keep it forever (send one of the two). When the end is up the computer is deleted: every end set or moved here deletes it, on a computer whose end was set before this rule (on_end "stop") too. on_end is not a choice: "delete" is accepted and changes nothing (alone, it needs a computer with an end: 400 INVALID_ENDS when there is none), and any other value ("stop" included) is 400 INVALID_ENDS. Changing the end needs write access to the workspace and clears a stopped computer’s ended mark. Only Linux and Windows computers can have an end. A running hourly computer prepays its run to the new end: a later end holds the extra (402 when the credit is short, an hour of the owner’s other hourly computers kept, nothing changed), an earlier one gives back what is past it, and ends_at null gives back what it has not used and bills it by the hour again. Only the workspace owner prepays a later end, and on a paid plan only signed in or with a key that has Billing write; anyone else who may write the workspace still moves the end, nothing more is held, the time past what is prepaid is billed by the hour, and the answer says prepay_warning. The answer carries prepaid_until, prepaid_cents and, when credit reached the balance, prepay_returned_cents: what reached it, which after a monthly credit refresh can be less than the unused part, or nothing.

patch/api/computers/{id}

Request

  • Base URL
    https://www.orgo.ai
  • Auth
    HTTP bearer

Path parameters

idstring required

Request body

namestring
ends_atstring date-time nullable
ends_in_hoursinteger nullable
on_end'delete' | 'null' nullable

Not a choice: a computer with an end is deleted when its time is up, running or not, with everything on it. "delete" is accepted and changes nothing; omitted or null is the same. Any other value, "stop" included, is 400 INVALID_ENDS: "A computer with an end is deleted when its time is up. To keep a computer, leave out the end." On a computer (GET, the listing, and the create, PATCH, Start and Resume answers) on_end is read only: "delete", "stop" for a computer whose end was set before this rule (stopped then, and deleted 7 days later unless it is started), or null with no end.

Response

The computer’s id and name, and ends_at, ended_at, deletes_at and on_end (read only) when the end changed or only the end was sent (an hourly computer: prepaid_until, prepaid_cents, prepay_returned_cents, and prepay_warning when a later end was not prepaid).

Changes