SSH ›
Disable ssh
DELETE
/v1/sandboxes/{id}/sshTurns SSH off for the sandbox. Its port is closed, which cuts whoever is connected, and none is opened for it again. The keys in the sandbox are left as they are. 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.ssh.off();
Answer200 OK · SshState
- {
- "enabled": boolean,
- "enabledAt": string | null,
- "address": string | null,
- "host": string | null,
- "port": integer | null,
- "user": string | null,
- "hostKey": string | null,
- }
SSH is off.
Path
idrequiredstring | e.g. "sbx_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Returns
200 SSH is off.
SshState7 fields
enabledboolean
Whether SSH is turned on for the sandbox.
More
It stays so through a stop and a start, and a move to another server: the port is opened again by itself.enabledAtstringnull
Since when it is on.
More
Null when it is off.addressstringnull
Where to connect now, as host:port.
More
Null while SSH is off, while the sandbox is not running, and in the moments after a start or a move before its port is open again. It is another address after a move, so read it again when a connection is lost.hoststringnull
The host of address: the public address of the server the sandbox is on.
portintegernull
The port of address, which leads to this sandbox's SSH server and to nothing else.
userstringnull
Who a key logs in as.
More
Null with address.hostKeystringnull
The machine's public host key, as a type and the key in base64.
More
It comes over this API and not over SSH, so a client can pin it and never be asked to trust one. Null with address.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.