Add many SSH keys to a sandbox
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
publicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINiCC4DtKiK4pnatEMwz9fpZks348+f9WnodyRCkr/al dev@example.com',
name: '<string>'
}
]
})
};
fetch('https://vms.dev/api/v1/sandboxes/{id}/ssh-keys/create-many', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://vms.dev/api/v1/sandboxes/{id}/ssh-keys/create-many \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINiCC4DtKiK4pnatEMwz9fpZks348+f9WnodyRCkr/al dev@example.com",
"name": "<string>"
}
]
}
'import requests
url = "https://vms.dev/api/v1/sandboxes/{id}/ssh-keys/create-many"
payload = { "items": [
{
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINiCC4DtKiK4pnatEMwz9fpZks348+f9WnodyRCkr/al dev@example.com",
"name": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"succeeded": 0,
"failed": 0,
"message": "<string>",
"data": [
{
"index": 0,
"id": "<string>",
"error": "<string>"
}
]
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}Sandboxes
Add many SSH keys to a sandbox
Adds up to 500 public keys to the sandbox in one request. The API returns a result for each item, in the sequence of the items: the ID of the new key, or an error message. A sandbox can have 20 keys. Needs the sandboxes:ssh scope.
POST
/
v1
/
sandboxes
/
{id}
/
ssh-keys
/
create-many
Add many SSH keys to a sandbox
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
publicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINiCC4DtKiK4pnatEMwz9fpZks348+f9WnodyRCkr/al dev@example.com',
name: '<string>'
}
]
})
};
fetch('https://vms.dev/api/v1/sandboxes/{id}/ssh-keys/create-many', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://vms.dev/api/v1/sandboxes/{id}/ssh-keys/create-many \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINiCC4DtKiK4pnatEMwz9fpZks348+f9WnodyRCkr/al dev@example.com",
"name": "<string>"
}
]
}
'import requests
url = "https://vms.dev/api/v1/sandboxes/{id}/ssh-keys/create-many"
payload = { "items": [
{
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINiCC4DtKiK4pnatEMwz9fpZks348+f9WnodyRCkr/al dev@example.com",
"name": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"succeeded": 0,
"failed": 0,
"message": "<string>",
"data": [
{
"index": 0,
"id": "<string>",
"error": "<string>"
}
]
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}Authorizations
Body
application/json