inventory
Search Packages Route
Row-level package search. Used by level 3 (minions with one specific name+version) and as a power-user query endpoint (version comparison, multi-field filter).
POST
/
api
/
inventory
/
packages
/
search
Search Packages Route
curl --request POST \
--url https://api.example.com/api/inventory/packages/search \
--header 'Content-Type: application/json' \
--data '
{
"name": {
"value": "<string>",
"op": "eq"
},
"version": {
"value": "<string>"
},
"minion_id": "<string>",
"limit": 500,
"offset": 0
}
'import requests
url = "https://api.example.com/api/inventory/packages/search"
payload = {
"name": {
"value": "<string>",
"op": "eq"
},
"version": { "value": "<string>" },
"minion_id": "<string>",
"limit": 500,
"offset": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: {value: '<string>', op: 'eq'},
version: {value: '<string>'},
minion_id: '<string>',
limit: 500,
offset: 0
})
};
fetch('https://api.example.com/api/inventory/packages/search', 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://api.example.com/api/inventory/packages/search",
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([
'name' => [
'value' => '<string>',
'op' => 'eq'
],
'version' => [
'value' => '<string>'
],
'minion_id' => '<string>',
'limit' => 500,
'offset' => 0
]),
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://api.example.com/api/inventory/packages/search"
payload := strings.NewReader("{\n \"name\": {\n \"value\": \"<string>\",\n \"op\": \"eq\"\n },\n \"version\": {\n \"value\": \"<string>\"\n },\n \"minion_id\": \"<string>\",\n \"limit\": 500,\n \"offset\": 0\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/api/inventory/packages/search")
.header("Content-Type", "application/json")
.body("{\n \"name\": {\n \"value\": \"<string>\",\n \"op\": \"eq\"\n },\n \"version\": {\n \"value\": \"<string>\"\n },\n \"minion_id\": \"<string>\",\n \"limit\": 500,\n \"offset\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/inventory/packages/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": {\n \"value\": \"<string>\",\n \"op\": \"eq\"\n },\n \"version\": {\n \"value\": \"<string>\"\n },\n \"minion_id\": \"<string>\",\n \"limit\": 500,\n \"offset\": 0\n}"
response = http.request(request)
puts response.read_body{
"total": 123,
"hits": [
{
"minion_id": "<string>",
"name": "<string>",
"version": "<string>",
"collected_at": "2023-11-07T05:31:56Z",
"arch": "<string>",
"source": "<string>"
}
],
"truncated": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
application/json
Filter for GET /api/inventory/packages.
At least one of name or minion_id MUST be supplied — we don't
want to accidentally let the UI fetch the entire fleet's package list
in one request. (A future "browse all" endpoint can lift this rule.)
A name-side filter. op="eq" becomes name = ?;
op="prefix" becomes name LIKE ? || '%' (cheap, hits the index);
op="contains" becomes name LIKE '%' || ? || '%' (slower, full scan
of the (name)-indexed range but acceptable at our fleet size).
Show child attributes
Show child attributes
A version comparison applied per-row in Python after SQL narrowing.
Show child attributes
Show child attributes
Available options:
apt, rpm, pacman Maximum string length:
255Required range:
1 <= x <= 5000Required range:
x >= 0⌘I
Search Packages Route
curl --request POST \
--url https://api.example.com/api/inventory/packages/search \
--header 'Content-Type: application/json' \
--data '
{
"name": {
"value": "<string>",
"op": "eq"
},
"version": {
"value": "<string>"
},
"minion_id": "<string>",
"limit": 500,
"offset": 0
}
'import requests
url = "https://api.example.com/api/inventory/packages/search"
payload = {
"name": {
"value": "<string>",
"op": "eq"
},
"version": { "value": "<string>" },
"minion_id": "<string>",
"limit": 500,
"offset": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: {value: '<string>', op: 'eq'},
version: {value: '<string>'},
minion_id: '<string>',
limit: 500,
offset: 0
})
};
fetch('https://api.example.com/api/inventory/packages/search', 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://api.example.com/api/inventory/packages/search",
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([
'name' => [
'value' => '<string>',
'op' => 'eq'
],
'version' => [
'value' => '<string>'
],
'minion_id' => '<string>',
'limit' => 500,
'offset' => 0
]),
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://api.example.com/api/inventory/packages/search"
payload := strings.NewReader("{\n \"name\": {\n \"value\": \"<string>\",\n \"op\": \"eq\"\n },\n \"version\": {\n \"value\": \"<string>\"\n },\n \"minion_id\": \"<string>\",\n \"limit\": 500,\n \"offset\": 0\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/api/inventory/packages/search")
.header("Content-Type", "application/json")
.body("{\n \"name\": {\n \"value\": \"<string>\",\n \"op\": \"eq\"\n },\n \"version\": {\n \"value\": \"<string>\"\n },\n \"minion_id\": \"<string>\",\n \"limit\": 500,\n \"offset\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/inventory/packages/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": {\n \"value\": \"<string>\",\n \"op\": \"eq\"\n },\n \"version\": {\n \"value\": \"<string>\"\n },\n \"minion_id\": \"<string>\",\n \"limit\": 500,\n \"offset\": 0\n}"
response = http.request(request)
puts response.read_body{
"total": 123,
"hits": [
{
"minion_id": "<string>",
"name": "<string>",
"version": "<string>",
"collected_at": "2023-11-07T05:31:56Z",
"arch": "<string>",
"source": "<string>"
}
],
"truncated": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}