Desktop ›
Disable desktop
DELETE
/v1/sandboxes/{id}/desktopTurns the desktop off for the sandbox. The address it was watched at leads nowhere from then on, the desktop is stopped, which closes what is open on it, and none is started for the sandbox again. It is done whatever state the sandbox is in.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
- await sandbox.desktop.off();
Answer200 OK · DesktopState
- {
- "enabled": boolean,
- "enabledAt": string | null,
- "running": boolean,
- "width": integer | null,
- "height": integer | null,
- "display": string | null,
- "url": string | null,
- }
The desktop is off.
Path
idrequiredstring | e.g. "sbx_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Returns
200 The desktop is off.
DesktopState7 fields
enabledboolean
Whether a desktop is turned on for the sandbox.
More
It stays so through a stop and a start, and a move to another server: the desktop is started again by itself, with nothing open on it.enabledAtstringnull
Since when it is on.
More
Null when it is off.runningboolean
Whether the desktop is running in the sandbox's machine now.
More
False while it is off, while the sandbox is not running, and in the moments after a start before it is up again.widthintegernull
The width of its screen in pixels.
More
Null while it is off.heightintegernull
The height of its screen in pixels.
More
Null while it is off.displaystringnull
What DISPLAY is to be for a command that opens a window on the desktop, or takes a picture of it.
More
Null while it is off.urlstringnull
Where the desktop is watched and used, in a browser.
More
It needs no token and is hard to guess, and whoever has it sees the screen and can click and type on it, so it is to be kept as a password is. It is another each time the desktop is turned on. Null while the desktop is not running, and where GET /v1/policy says publicUrls is false.Errors and other answers
| 404 | Not found. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.