Update Agent Tags
curl --request PUT \
--url https://use.hoop.dev/api/agents/{nameOrID}/tags \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://use.hoop.dev/api/agents/{nameOrID}/tags"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://use.hoop.dev/api/agents/{nameOrID}/tags', 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}/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"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://use.hoop.dev/api/agents/{nameOrID}/tags"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://use.hoop.dev/api/agents/{nameOrID}/tags")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/agents/{nameOrID}/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
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",
"tags": {
"environment": "prod"
},
"token": "<string>",
"version": "1.23.10"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Agents
Update Agent Tags
Replace the tags of an agent. Send {} to remove all tags. No other attribute changes.
PUT
/
agents
/
{nameOrID}
/
tags
Update Agent Tags
curl --request PUT \
--url https://use.hoop.dev/api/agents/{nameOrID}/tags \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://use.hoop.dev/api/agents/{nameOrID}/tags"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://use.hoop.dev/api/agents/{nameOrID}/tags', 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}/tags",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"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://use.hoop.dev/api/agents/{nameOrID}/tags"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://use.hoop.dev/api/agents/{nameOrID}/tags")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/agents/{nameOrID}/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
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",
"tags": {
"environment": "prod"
},
"token": "<string>",
"version": "1.23.10"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Path Parameters
The name or ID of the resource
Body
application/json
The tags of the agent
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"
Tags are the key/value pairs of the agent. It is an empty object when the agent has no tags
Show child attributes
Show child attributes
Example:
{ "environment": "prod" }
The token/key of the resource, this value is always empty for now
Example:
"1.23.10"
Was this page helpful?