Get Agent Key
curl --request GET \
--url https://use.hoop.dev/api/agents/{nameOrID}import requests
url = "https://use.hoop.dev/api/agents/{nameOrID}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://use.hoop.dev/api/agents/{nameOrID}', 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/agents/{nameOrID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/agents/{nameOrID}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://use.hoop.dev/api/agents/{nameOrID}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/agents/{nameOrID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"compiler": "gcc",
"goversion": "1.22.4",
"hostname": "john.wick.local",
"id": "8a4239fa-5116-4bbb-ad3c-ea1f294aac4a",
"kernel_version": "Linux 9acfe93d8195 5.15.49-linuxkit",
"machine_id": "",
"metadata": {
"compiler": "gcc",
"hostname": "johnwick.local",
"kernel-version": "Linux 9acfe93d8195 5.15.49-linuxkit",
"machine-id": "id",
"platform": "amd64",
"version": "1.23.14"
},
"mode": "standard",
"name": "default",
"platform": "amd64",
"status": "DISCONNECTED",
"token": "<string>",
"version": "1.23.10"
}{
"message": "the error description"
}{
"message": "the error description"
}Agents
Get Agent Key
Get an agent key by name or ID
GET
/
agents
/
{nameOrID}
Get Agent Key
curl --request GET \
--url https://use.hoop.dev/api/agents/{nameOrID}import requests
url = "https://use.hoop.dev/api/agents/{nameOrID}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://use.hoop.dev/api/agents/{nameOrID}', 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/agents/{nameOrID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/agents/{nameOrID}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://use.hoop.dev/api/agents/{nameOrID}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/agents/{nameOrID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"compiler": "gcc",
"goversion": "1.22.4",
"hostname": "john.wick.local",
"id": "8a4239fa-5116-4bbb-ad3c-ea1f294aac4a",
"kernel_version": "Linux 9acfe93d8195 5.15.49-linuxkit",
"machine_id": "",
"metadata": {
"compiler": "gcc",
"hostname": "johnwick.local",
"kernel-version": "Linux 9acfe93d8195 5.15.49-linuxkit",
"machine-id": "id",
"platform": "amd64",
"version": "1.23.14"
},
"mode": "standard",
"name": "default",
"platform": "amd64",
"status": "DISCONNECTED",
"token": "<string>",
"version": "1.23.10"
}{
"message": "the error description"
}{
"message": "the error description"
}Path Parameters
The name or ID of the resource
Response
OK
Example:
"gcc"
Example:
"1.22.4"
DEPRECATE top level metadata keys
Example:
"john.wick.local"
Unique ID of the resource
Example:
"8a4239fa-5116-4bbb-ad3c-ea1f294aac4a"
Example:
"Linux 9acfe93d8195 5.15.49-linuxkit"
Example:
""
Metadata contains attributes regarding the machine where the agent is being executed
- version - Version of the agent
- go-version - Agent build information
- compiler - Agent build information
- platform - The operating system architecture where the agent is running
- machine-id - The machine id of server
- kernel-version - The kernel version of the server
Show child attributes
Show child attributes
Example:
{
"compiler": "gcc",
"hostname": "johnwick.local",
"kernel-version": "Linux 9acfe93d8195 5.15.49-linuxkit",
"machine-id": "id",
"platform": "amd64",
"version": "1.23.14"
}
Mode of execution of the agent
- standard - Is the default mode, which is suitable to run the agent as a standalone process
- embedded - This mode is suitable when the agent needs to be run close to another process or application
Available options:
standard, embedded Example:
"standard"
Unique name of the resource
Example:
"default"
Example:
"amd64"
The status of the agent
- CONNECTED - The agent is connected with the gateway
- DISCONNECTED - The agent is disconnected from the gateway
Available options:
CONNECTED, DISCONNECTED Example:
"DISCONNECTED"
The token/key of the resource, this value is always empty for now
Example:
"1.23.10"
Was this page helpful?