curl --request PATCH \
--url https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groups": [
"<string>"
],
"bands": {},
"confirm": false
}
'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary"
payload = {
"groups": ["<string>"],
"bands": {},
"confirm": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({groups: ['<string>'], bands: {}, confirm: false})
};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary', 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.vainona.ai/v1/namespaces/{ns}/tenant_summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'groups' => [
'<string>'
],
'bands' => [
],
'confirm' => false
]),
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.vainona.ai/v1/namespaces/{ns}/tenant_summary"
payload := strings.NewReader("{\n \"groups\": [\n \"<string>\"\n ],\n \"bands\": {},\n \"confirm\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"groups\": [\n \"<string>\"\n ],\n \"bands\": {},\n \"confirm\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"groups\": [\n \"<string>\"\n ],\n \"bands\": {},\n \"confirm\": false\n}"
response = http.request(request)
puts response.read_body{
"template": "<string>",
"groups": [
"<string>"
],
"bands": {},
"created_at": "2023-11-07T05:31:56Z",
"warnings": [
"tenant_summary_failed"
],
"tenants": [
{
"namespace": "<string>",
"status": "published",
"published_at": "2023-11-07T05:31:56Z",
"source_as_of": 1,
"reason": "deleting"
}
],
"next_cursor": "<string>",
"last_run_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}Change the published groups or bands
A change rewrites every tenant document at the next run, which
re-judges each of them, so without confirm: true it returns that
estimate and changes nothing. With it, the change applies from the
next run and runs unattended.
curl --request PATCH \
--url https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groups": [
"<string>"
],
"bands": {},
"confirm": false
}
'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary"
payload = {
"groups": ["<string>"],
"bands": {},
"confirm": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({groups: ['<string>'], bands: {}, confirm: false})
};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary', 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.vainona.ai/v1/namespaces/{ns}/tenant_summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'groups' => [
'<string>'
],
'bands' => [
],
'confirm' => false
]),
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.vainona.ai/v1/namespaces/{ns}/tenant_summary"
payload := strings.NewReader("{\n \"groups\": [\n \"<string>\"\n ],\n \"bands\": {},\n \"confirm\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"groups\": [\n \"<string>\"\n ],\n \"bands\": {},\n \"confirm\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/tenant_summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"groups\": [\n \"<string>\"\n ],\n \"bands\": {},\n \"confirm\": false\n}"
response = http.request(request)
puts response.read_body{
"template": "<string>",
"groups": [
"<string>"
],
"bands": {},
"created_at": "2023-11-07T05:31:56Z",
"warnings": [
"tenant_summary_failed"
],
"tenants": [
{
"namespace": "<string>",
"status": "published",
"published_at": "2023-11-07T05:31:56Z",
"source_as_of": 1,
"reason": "deleting"
}
],
"next_cursor": "<string>",
"last_run_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"group": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}Authorizations
An organization API key. Keys carry a role (read_write or
read_only) and may be restricted to a namespace prefix such as
acme/*, or to one namespace such as acme/prod/tenant_1. A prefix
matches on a / boundary: acme/prod/tenant_1* covers
acme/prod/tenant_1 and everything under acme/prod/tenant_1/,
never acme/prod/tenant_12.
Headers
Returns the original response verbatim while the node still caches it. Correctness never depends on it.
1Path Parameters
A template prefix ending in /* (§7.7), with every / sent as %2F, such as acme%2Fprod%2F*.
A template prefix, a namespace path ending in /*, such as acme/prod/* (§7.7). Up to 256 bytes.
3 - 256^[A-Za-z0-9._:/-]+/\*$Body
At least one of groups and bands, each replacing the setting whole.
1 - 8 elementsA judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..
1 - 128^[A-Za-z0-9_-]+$Bands for published aggregates, keyed <group>.<aggregate> as a
judgment names them, such as abuse_by_day.count or
by_plan.avg(state.mrr). A tenant document shows each as its band's
label; values are only in state.source.
Show child attributes
Show child attributes
Required, because the change re-judges every tenant document; without it, the response is the estimate.
Response
The tenant summary with the change, or the estimate when it needs confirm.
- Option 1
- Option 2
Relations (§7.7). A template's tenant summary and a page of its tenants.
A template prefix, a namespace path ending in /*, such as acme/prod/* (§7.7). Up to 256 bytes.
3 - 256^[A-Za-z0-9._:/-]+/\*$A judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..
1 - 128^[A-Za-z0-9_-]+$Bands for published aggregates, keyed <group>.<aggregate> as a
judgment names them, such as abuse_by_day.count or
by_plan.avg(state.mrr). A tenant document shows each as its band's
label; values are only in state.source.
Show child attributes
Show child attributes
RFC 3339, UTC.
tenant_summary_failed: the template's namespace refused the last run's writes, such as over its limits with on_exceeded: reject; the events feed has namespace.tenant_summary_failed.
tenant_summary_failed Show child attributes
Show child attributes
When the last run finished; null before the first.