Search the context graph
Boxes, connections and signals matching a name or identifier, ranked best first. q needs at least 2 characters and is matched literally. Boxes have the same shape as context graph nodes, plus path, the names of the boxes above each one from the top; connections have the same shape as its links; both ends of every connection are among the boxes. filter narrows the boxes searched to the ones the context graph shows for the same filter, and filters echoes the filters applied.
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/context-graph/search \
--header 'Authorization: <api-key>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/context-graph/search"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.costgraph.ai/api/v1/tenant/context-graph/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.costgraph.ai/api/v1/tenant/context-graph/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://api.costgraph.ai/api/v1/tenant/context-graph/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.costgraph.ai/api/v1/tenant/context-graph/search")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/context-graph/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"boxes": [
{
"basis": "billed",
"basis_parts": [
"nodes"
],
"breakdown_allocated": [
{
"cost": 123,
"estimate": true,
"key": "<string>",
"share": 123
}
],
"breakdown_billed": [
{
"cost": 123,
"estimate": true,
"key": "<string>",
"share": 123
}
],
"child_count": 123,
"cluster": "<string>",
"cost": 123,
"filter_match": "direct",
"flavour": "eks",
"gpu_model": "<string>",
"group": "service",
"has_infrastructure": true,
"id": "<string>",
"idle_share": 123,
"instance_type": "<string>",
"kind": "<string>",
"meters": [
{
"cost": 123,
"key": "cpu_cores",
"provisioned": 123,
"unit": "<string>",
"value": 123
}
],
"name": "<string>",
"open": true,
"parent_id": "<string>",
"path": [
"<string>"
],
"primary": "node",
"provider": "<string>",
"refs": {
"bill_resource_id": "<string>",
"cluster_id": "<string>",
"gpu_uuids": [
"<string>"
],
"network_endpoint_id": "<string>",
"node_id": "<string>",
"provider": "<string>",
"provider_connected": true,
"pv_resource_id": "<string>",
"pvc_resource_id": "<string>",
"vm_host_id": "<string>",
"workload_resource_id": "<string>"
},
"signals": [
{
"actions": [
"<string>"
],
"anomaly_id": "<string>",
"anomaly_type": "<string>",
"code": "unnamed_private_traffic",
"containers": [
"<string>"
],
"count": 123,
"description": "<string>",
"idle": true,
"idle_cost": 123,
"idle_share": 123,
"kind": "anomaly",
"recommended_instance_type": "<string>",
"savings_currency": "<string>",
"savings_monthly": 123,
"target": "node",
"target_provider": "<string>",
"target_service": "<string>",
"title": "<string>"
}
],
"version": "<string>"
}
],
"connections": [
{
"a": "<string>",
"b": "<string>",
"bytes": 123,
"cost": 123,
"count": 123,
"direction": "in",
"id": "<string>",
"means": "runs_on",
"nat_share": 123,
"port": 123,
"source": "inventory",
"write_share": 123
}
],
"filters": {},
"signals": [
{
"anomaly_id": "<string>",
"entity_id": "<string>",
"title": "<string>"
}
]
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Headers
Tenant ID
Query Parameters
Search text, at least 2 characters
Window; defaults to last_7d
month_to_date, last_7d, last_30d, calendar_month, custom Closed calendar month in YYYY-MM format; required when period=calendar_month
Window start in RFC3339 format; required when period=custom
Window end in RFC3339 format; required when period=custom
Repeated key:value dimension filter, same keys and modifiers as /cost/query
Was this page helpful?
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/context-graph/search \
--header 'Authorization: <api-key>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/context-graph/search"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.costgraph.ai/api/v1/tenant/context-graph/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.costgraph.ai/api/v1/tenant/context-graph/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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://api.costgraph.ai/api/v1/tenant/context-graph/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.costgraph.ai/api/v1/tenant/context-graph/search")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/context-graph/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"boxes": [
{
"basis": "billed",
"basis_parts": [
"nodes"
],
"breakdown_allocated": [
{
"cost": 123,
"estimate": true,
"key": "<string>",
"share": 123
}
],
"breakdown_billed": [
{
"cost": 123,
"estimate": true,
"key": "<string>",
"share": 123
}
],
"child_count": 123,
"cluster": "<string>",
"cost": 123,
"filter_match": "direct",
"flavour": "eks",
"gpu_model": "<string>",
"group": "service",
"has_infrastructure": true,
"id": "<string>",
"idle_share": 123,
"instance_type": "<string>",
"kind": "<string>",
"meters": [
{
"cost": 123,
"key": "cpu_cores",
"provisioned": 123,
"unit": "<string>",
"value": 123
}
],
"name": "<string>",
"open": true,
"parent_id": "<string>",
"path": [
"<string>"
],
"primary": "node",
"provider": "<string>",
"refs": {
"bill_resource_id": "<string>",
"cluster_id": "<string>",
"gpu_uuids": [
"<string>"
],
"network_endpoint_id": "<string>",
"node_id": "<string>",
"provider": "<string>",
"provider_connected": true,
"pv_resource_id": "<string>",
"pvc_resource_id": "<string>",
"vm_host_id": "<string>",
"workload_resource_id": "<string>"
},
"signals": [
{
"actions": [
"<string>"
],
"anomaly_id": "<string>",
"anomaly_type": "<string>",
"code": "unnamed_private_traffic",
"containers": [
"<string>"
],
"count": 123,
"description": "<string>",
"idle": true,
"idle_cost": 123,
"idle_share": 123,
"kind": "anomaly",
"recommended_instance_type": "<string>",
"savings_currency": "<string>",
"savings_monthly": 123,
"target": "node",
"target_provider": "<string>",
"target_service": "<string>",
"title": "<string>"
}
],
"version": "<string>"
}
],
"connections": [
{
"a": "<string>",
"b": "<string>",
"bytes": 123,
"cost": 123,
"count": 123,
"direction": "in",
"id": "<string>",
"means": "runs_on",
"nat_share": 123,
"port": 123,
"source": "inventory",
"write_share": 123
}
],
"filters": {},
"signals": [
{
"anomaly_id": "<string>",
"entity_id": "<string>",
"title": "<string>"
}
]
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}