Kubernetes clusters
Get kubernetes cluster node
Returns machine info, capacity, system details, and cost summary for a single node, for the tenant selected by the X-CostGraph-Tenant-ID header
GET
/
api
/
v1
/
tenant
/
clusters
/
{cluster_id}
/
nodes
/
{node_id}
Get kubernetes cluster node
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/nodes/{node_id} \
--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}/nodes/{node_id}"
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}/nodes/{node_id}', 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}/nodes/{node_id}",
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}/nodes/{node_id}"
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}/nodes/{node_id}")
.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}/nodes/{node_id}")
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": {
"active": true,
"availability_zone": "<string>",
"capacity": {
"cpu_cores": 123,
"ram_gb": 123,
"volumes_attached": 123
},
"cost_summary": {
"cost_data_available": true,
"currency": "<string>",
"current_period_cost": 123,
"period": "<string>",
"period_end": "<string>",
"period_start": "<string>",
"previous_period_end": "<string>",
"previous_period_start": "<string>",
"change_amount": 123,
"change_percent": 123,
"cpu_cost": 123,
"gpu_cost": 123,
"memory_cost": 123,
"potential_savings_monthly_usd": 123,
"previous_period_cost": 123,
"storage_cost": 123
},
"created_at": "<string>",
"id": "<string>",
"machine_info": {
"architecture": "<string>",
"hostname": "<string>",
"instance_type": "<string>",
"usage_type": "<string>",
"cost_per_hour": 123
},
"name": "<string>",
"pricing_pinned": true,
"pricing_provider": "<string>",
"provider": "<string>",
"region": "<string>",
"status": "<string>",
"system_details": {
"container_runtime": "<string>",
"ip_addresses": [
"<string>"
],
"kernel_version": "<string>",
"kubelet_version": "<string>",
"node_id": "<string>",
"operating_system": "<string>",
"running_containers": 123,
"total_containers": 123,
"last_heartbeat_at": "<string>"
},
"cpu_utilization_percent": 123,
"instance_id": "<string>",
"memory_utilization_percent": 123,
"pricing_id": "<string>",
"pricing_pins": {}
}
}{
"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 node ID
Query Parameters
Cost period (month_to_date, last_7d, last_30d, calendar_month, custom)
Calendar month for calendar_month period (YYYY-MM)
Start date for custom period (YYYY-MM-DD)
End date for custom period (YYYY-MM-DD)
Was this page helpful?
⌘I
Get kubernetes cluster node
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/nodes/{node_id} \
--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}/nodes/{node_id}"
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}/nodes/{node_id}', 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}/nodes/{node_id}",
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}/nodes/{node_id}"
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}/nodes/{node_id}")
.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}/nodes/{node_id}")
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": {
"active": true,
"availability_zone": "<string>",
"capacity": {
"cpu_cores": 123,
"ram_gb": 123,
"volumes_attached": 123
},
"cost_summary": {
"cost_data_available": true,
"currency": "<string>",
"current_period_cost": 123,
"period": "<string>",
"period_end": "<string>",
"period_start": "<string>",
"previous_period_end": "<string>",
"previous_period_start": "<string>",
"change_amount": 123,
"change_percent": 123,
"cpu_cost": 123,
"gpu_cost": 123,
"memory_cost": 123,
"potential_savings_monthly_usd": 123,
"previous_period_cost": 123,
"storage_cost": 123
},
"created_at": "<string>",
"id": "<string>",
"machine_info": {
"architecture": "<string>",
"hostname": "<string>",
"instance_type": "<string>",
"usage_type": "<string>",
"cost_per_hour": 123
},
"name": "<string>",
"pricing_pinned": true,
"pricing_provider": "<string>",
"provider": "<string>",
"region": "<string>",
"status": "<string>",
"system_details": {
"container_runtime": "<string>",
"ip_addresses": [
"<string>"
],
"kernel_version": "<string>",
"kubelet_version": "<string>",
"node_id": "<string>",
"operating_system": "<string>",
"running_containers": 123,
"total_containers": 123,
"last_heartbeat_at": "<string>"
},
"cpu_utilization_percent": 123,
"instance_id": "<string>",
"memory_utilization_percent": 123,
"pricing_id": "<string>",
"pricing_pins": {}
}
}{
"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"
}