Reviewed Exec
curl --request POST \
--url https://use.hoop.dev/api/sessions/{session_id}/execimport requests
url = "https://use.hoop.dev/api/sessions/{session_id}/exec"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://use.hoop.dev/api/sessions/{session_id}/exec', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/sessions/{session_id}/exec",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/sessions/{session_id}/exec"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/sessions/{session_id}/exec")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sessions/{session_id}/exec")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"execution_time": 5903,
"exit_code": 1,
"has_review": false,
"output": "<string>",
"output_status": "failed",
"session_id": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"truncated": false
}{
"execution_time": 5903,
"exit_code": 1,
"has_review": false,
"output": "<string>",
"output_status": "failed",
"session_id": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"truncated": false
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Sessions
Reviewed Exec
Run an execution in a reviewed session
POST
/
sessions
/
{session_id}
/
exec
Reviewed Exec
curl --request POST \
--url https://use.hoop.dev/api/sessions/{session_id}/execimport requests
url = "https://use.hoop.dev/api/sessions/{session_id}/exec"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://use.hoop.dev/api/sessions/{session_id}/exec', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/sessions/{session_id}/exec",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/sessions/{session_id}/exec"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/sessions/{session_id}/exec")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sessions/{session_id}/exec")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"execution_time": 5903,
"exit_code": 1,
"has_review": false,
"output": "<string>",
"output_status": "failed",
"session_id": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"truncated": false
}{
"execution_time": 5903,
"exit_code": 1,
"has_review": false,
"output": "<string>",
"output_status": "failed",
"session_id": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"truncated": false
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Path Parameters
The id of the resource
Response
The execution has finished
The amount of time the execution took in miliseconds
Example:
5903
The shell exit code, any non zero code means an error
- 0 - Linux success exit code
- -2 - internal gateway code that means it was unable to obtain a valid exit code number from the agent outcome packet
- 254 - internal agent code that means it was unable to obtain a valid exit code number from the process
Example:
1
Inform if the connection has review enabled
Example:
false
Output contains an utf-8 output containing the outcome of the ad-hoc execution
Status reports if the outcome of the execution
- success - The execution was executed with success
- failed - In case of internal error or when the agent returns an exit code greater than 0 or different than -2
- running - The execution may still be running.
Available options:
success, failed, running Example:
"failed"
Each execution creates a unique session id
Example:
"5701046A-7B7A-4A78-ABB0-A24C95E6FE54"
If the `output`` field is truncated or not
Example:
false
Was this page helpful?