SSH ›
Enable template ssh
PUT
/v1/templates/{id}/sshTurns SSH on for every sandbox made from the template from now on: each has its port opened as it is made, as PUT /v1/sandboxes/{id}/ssh would, and GET /v1/sandboxes/{id}/ssh says where to connect. A port that cannot be opened then does not fail the create: SSH is on, and PUT /v1/sandboxes/{id}/ssh opens it. A sandbox already made is not changed, and no key is let in: that is POST /v1/templates/{id}/ssh/keys. Asked again, it changes nothing.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const template = await agental.templates.get("tpl_0123456789abcdef");
- await template.sshOn();
Answer200 OK · TemplateSsh
- {
- "enabled": boolean,
- "enabledAt": string | null,
- "keys": [{
- "id": string,
- "fingerprint": string,
- "type": string,
- "comment": string | null,
- }],
- }
SSH is turned on as a sandbox is made.
Path
idrequiredstring | e.g. "tpl_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Returns
200 SSH is turned on as a sandbox is made.
TemplateSsh3 fields
enabledboolean
Whether a sandbox made from the template has SSH turned on as it is made, as PUT /v1/sandboxes/{id}/ssh would: GET /v1/sandboxes/{id}/ssh then says where to connect.
enabledAtstringnull
keysSshKey[]4 fields
The public keys let in to a sandbox's machine as it is made, as POST /v1/sandboxes/{id}/ssh/keys would, in the order they were added.
More
At most 50.idstring
What the key is named by when it is removed: the SHA-256 of the key, written so that it can stand in a path.
fingerprintstring
The same, as ssh-keygen -l prints it.
typestring
commentstringnull
What follows the key on its line.
More
Null when nothing does.Errors and other answers
| 403 | key_action_forbidden the key does not take the action ssh, or it is limited to some sandboxes and not to this template. Nothing was changed. |
| 404 | Not found. |
| 501 | ssh_endpoint_not_configured sandboxes here are not logged in to over SSH. GET /v1/policy says so as ssh. Nothing was changed. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.