Kubernetes clusters
Get kubernetes cluster workload container detail
Returns the detailed right-sizing report for a single workload container, including metadata, the current resource footprint, cost and efficiency, and a per-replica CPU/memory usage-vs-request trend over the trailing 7 days (hourly points), for the tenant selected by the X-CostGraph-Tenant-ID header. available_usage_dimensions lists the dimensions this container actually has measurements for, so a caller only offers the ones the usage endpoint can answer; it is empty when the container has none.
GET
/
api
/
v1
/
tenant
/
clusters
/
{cluster_id}
/
workloads
/
{resource_id}
/
containers
/
{container_name}
/
details
Get kubernetes cluster workload container detail
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details', 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/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details",
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>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$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/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
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/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"available_usage_dimensions": [
"<string>"
],
"container": {
"api_version": "<string>",
"cluster": "<string>",
"created_at": "<string>",
"kind": "<string>",
"name": "<string>",
"namespace": "<string>",
"recommendation": {
"cpu": "<string>",
"memory": "<string>"
},
"replica_count": 123,
"resource_id": "<string>",
"status": "<string>",
"workload_name": "<string>"
},
"cost_and_efficiency": {
"cpu_urgency": "<string>",
"dimensions_flagged": 123,
"memory_urgency": "<string>",
"monthly_cost": 123,
"total_cost_mtd": 123,
"recommended_cost_mtd": 123,
"savings_mtd": 123,
"savings_percentage_mtd": 123
},
"resource_footprint": {
"current_limit": {
"cpu": 123,
"memory": 123
},
"current_request": {
"cpu": 123,
"memory": 123
},
"current_usage": {
"cpu": 123,
"memory": 123
}
},
"usage_request_series": {
"cpu": {
"limit": 123,
"request": [
{
"t": 123,
"v": 123
}
],
"unit": "<string>",
"usage": [
{
"t": 123,
"v": 123
}
]
},
"end": "<string>",
"memory": {
"limit": 123,
"request": [
{
"t": 123,
"v": 123
}
],
"unit": "<string>",
"usage": [
{
"t": 123,
"v": 123
}
]
},
"start": "<string>",
"step_seconds": 123
},
"gpu": {
"current_count": 123,
"reason": "<string>",
"recommendation": "<string>",
"memory_p95": 123,
"recommended_count": 123,
"utilization_band": "<string>",
"utilization_p95": 123
}
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Headers
Tenant ID
Path Parameters
Kubernetes cluster ID
Kubernetes workload resource ID
Container name
Query Parameters
Observation window (7d, 30d)
Was this page helpful?
⌘I
Get kubernetes cluster workload container detail
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details', 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/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details",
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>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$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/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
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/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/containers/{container_name}/details")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"available_usage_dimensions": [
"<string>"
],
"container": {
"api_version": "<string>",
"cluster": "<string>",
"created_at": "<string>",
"kind": "<string>",
"name": "<string>",
"namespace": "<string>",
"recommendation": {
"cpu": "<string>",
"memory": "<string>"
},
"replica_count": 123,
"resource_id": "<string>",
"status": "<string>",
"workload_name": "<string>"
},
"cost_and_efficiency": {
"cpu_urgency": "<string>",
"dimensions_flagged": 123,
"memory_urgency": "<string>",
"monthly_cost": 123,
"total_cost_mtd": 123,
"recommended_cost_mtd": 123,
"savings_mtd": 123,
"savings_percentage_mtd": 123
},
"resource_footprint": {
"current_limit": {
"cpu": 123,
"memory": 123
},
"current_request": {
"cpu": 123,
"memory": 123
},
"current_usage": {
"cpu": 123,
"memory": 123
}
},
"usage_request_series": {
"cpu": {
"limit": 123,
"request": [
{
"t": 123,
"v": 123
}
],
"unit": "<string>",
"usage": [
{
"t": 123,
"v": 123
}
]
},
"end": "<string>",
"memory": {
"limit": 123,
"request": [
{
"t": 123,
"v": 123
}
],
"unit": "<string>",
"usage": [
{
"t": 123,
"v": 123
}
]
},
"start": "<string>",
"step_seconds": 123
},
"gpu": {
"current_count": 123,
"reason": "<string>",
"recommendation": "<string>",
"memory_p95": 123,
"recommended_count": 123,
"utilization_band": "<string>",
"utilization_p95": 123
}
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}