Kubernetes clusters
Get kubernetes cluster workload detail
Returns the workload-level right-sizing detail for a single workload (resource), including the worst urgency, container count, total recommendations and the per-container CPU and memory recommendations, requests and costs, for the tenant selected by the X-CostGraph-Tenant-ID header
GET
/
api
/
v1
/
tenant
/
clusters
/
{cluster_id}
/
workloads
/
{resource_id}
/
details
Get kubernetes cluster workload detail
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/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}/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}/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}/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}/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}/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}/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": {
"containers": 123,
"containers_and_recommendations": [
{
"container_name": "<string>",
"cpu": {
"action": "<string>",
"current_cost": 123,
"current_request": 123,
"reason": "<string>",
"recommendation": "<string>",
"recommended_cost": 123,
"recommended_request": 123
},
"memory": {
"action": "<string>",
"current_cost": 123,
"current_request": 123,
"reason": "<string>",
"recommendation": "<string>",
"recommended_cost": 123,
"recommended_request": 123
},
"resource_count": 123,
"gpu": {
"current_count": 123,
"reason": "<string>",
"recommendation": "<string>",
"memory_p95": 123,
"recommended_count": 123,
"utilization_band": "<string>",
"utilization_p95": 123
}
}
],
"kind": "<string>",
"name": "<string>",
"namespace": "<string>",
"total_recs": 123,
"urgency": "<string>"
}
}{
"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
Was this page helpful?
⌘I
Get kubernetes cluster workload detail
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/workloads/{resource_id}/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}/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}/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}/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}/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}/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}/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": {
"containers": 123,
"containers_and_recommendations": [
{
"container_name": "<string>",
"cpu": {
"action": "<string>",
"current_cost": 123,
"current_request": 123,
"reason": "<string>",
"recommendation": "<string>",
"recommended_cost": 123,
"recommended_request": 123
},
"memory": {
"action": "<string>",
"current_cost": 123,
"current_request": 123,
"reason": "<string>",
"recommendation": "<string>",
"recommended_cost": 123,
"recommended_request": 123
},
"resource_count": 123,
"gpu": {
"current_count": 123,
"reason": "<string>",
"recommendation": "<string>",
"memory_p95": 123,
"recommended_count": 123,
"utilization_band": "<string>",
"utilization_p95": 123
}
}
],
"kind": "<string>",
"name": "<string>",
"namespace": "<string>",
"total_recs": 123,
"urgency": "<string>"
}
}{
"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"
}