Send stdin to a command
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: '<string>', eof: true})
};
fetch('https://vms.dev/api/v1/sandboxes/{id}/commands/{commandId}/stdin', 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}/commands/{commandId}/stdin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": "<string>",
"eof": true
}
'import requests
url = "https://vms.dev/api/v1/sandboxes/{id}/commands/{commandId}/stdin"
payload = {
"data": "<string>",
"eof": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"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>"
}
}{
"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>"
}
}Commands
Send stdin to a command
Writes data to the stdin of a running command. The command must start with stdin: true. Send eof: true to close stdin. Needs the sandboxes:exec scope.
POST
/
v1
/
sandboxes
/
{id}
/
commands
/
{commandId}
/
stdin
Send stdin to a command
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: '<string>', eof: true})
};
fetch('https://vms.dev/api/v1/sandboxes/{id}/commands/{commandId}/stdin', 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}/commands/{commandId}/stdin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": "<string>",
"eof": true
}
'import requests
url = "https://vms.dev/api/v1/sandboxes/{id}/commands/{commandId}/stdin"
payload = {
"data": "<string>",
"eof": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"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>"
}
}{
"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
Response
The command got the data.