import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const devboxAsyncExecutionDetailView = await client.devboxes.executions.kill(
'devbox_id',
'execution_id',
);
console.log(devboxAsyncExecutionDetailView.devbox_id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
devbox_async_execution_detail_view = client.devboxes.executions.kill(
execution_id="execution_id",
devbox_id="devbox_id",
)
print(devbox_async_execution_detail_view.devbox_id)curl --request POST \
--url https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kill_process_group": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'kill_process_group' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill"
payload := strings.NewReader("{\n \"kill_process_group\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kill_process_group\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kill_process_group\": true\n}"
response = http.request(request)
puts response.read_body{
"devbox_id": "<string>",
"execution_id": "<string>",
"status": "queued",
"shell_name": "<string>",
"stdout": "<string>",
"stderr": "<string>",
"exit_status": 123,
"stdout_truncated": true,
"stderr_truncated": true
}Kill an asynchronous execution currently running on a devbox
Kill a previously launched asynchronous execution if it is still running by killing the launched process. Optionally kill the entire process group.
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const devboxAsyncExecutionDetailView = await client.devboxes.executions.kill(
'devbox_id',
'execution_id',
);
console.log(devboxAsyncExecutionDetailView.devbox_id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
devbox_async_execution_detail_view = client.devboxes.executions.kill(
execution_id="execution_id",
devbox_id="devbox_id",
)
print(devbox_async_execution_detail_view.devbox_id)curl --request POST \
--url https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"kill_process_group": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'kill_process_group' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill"
payload := strings.NewReader("{\n \"kill_process_group\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"kill_process_group\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/devboxes/{devbox_id}/executions/{execution_id}/kill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kill_process_group\": true\n}"
response = http.request(request)
puts response.read_body{
"devbox_id": "<string>",
"execution_id": "<string>",
"status": "queued",
"shell_name": "<string>",
"stdout": "<string>",
"stderr": "<string>",
"exit_status": 123,
"stdout_truncated": true,
"stderr_truncated": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The Devbox ID.
The Async Execution ID.
Body
Whether to kill the entire process group (default: false). If true, kills all processes in the same process group as the target process.
Response
OK
Devbox id where command was executed.
Ephemeral id of the execution in progress.
Current status of the execution.
queued, running, completed Shell name.
Standard out generated by command. This field will remain unset until the execution has completed.
Standard error generated by command. This field will remain unset until the execution has completed.
Exit code of command execution. This field will remain unset until the execution has completed.
Indicates whether the stdout was truncated due to size limits.
Indicates whether the stderr was truncated due to size limits.
Was this page helpful?
