Kubernetes clusters
Get kubernetes cluster persistent volume metrics
Returns disk usage, IOPS and throughput time-series for a persistent volume plus per-container IOPS and throughput, for the tenant selected by the X-CostGraph-Tenant-ID header
GET
/
api
/
v1
/
tenant
/
clusters
/
{cluster_id}
/
persistent-volumes
/
{pv_id}
/
metrics
Get kubernetes cluster persistent volume metrics
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/persistent-volumes/{pv_id}/metrics \
--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}/persistent-volumes/{pv_id}/metrics"
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}/persistent-volumes/{pv_id}/metrics', 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}/persistent-volumes/{pv_id}/metrics",
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}/persistent-volumes/{pv_id}/metrics"
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}/persistent-volumes/{pv_id}/metrics")
.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}/persistent-volumes/{pv_id}/metrics")
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": {
"capacity": [
{
"t": 123,
"v": 123
}
],
"containers": [
{
"backing_resource": {
"api_version": "<string>",
"kind": "<string>",
"name": "<string>"
},
"container": "<string>",
"cost_per_month": 123,
"io_share_pct": 123,
"iops": [
{
"t": 123,
"v": 123
}
],
"is_rarely_used": true,
"p99_iops": 123,
"p99_throughput": 123,
"pod": "<string>",
"throughput": [
{
"t": 123,
"v": 123
}
]
}
],
"end": "<string>",
"iops": [
{
"t": 123,
"v": 123
}
],
"start": "<string>",
"step_seconds": 123,
"throughput": [
{
"t": 123,
"v": 123
}
],
"usage": [
{
"t": 123,
"v": 123
}
],
"volume": "<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
Persistent volume ID
Was this page helpful?
⌘I
Get kubernetes cluster persistent volume metrics
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/clusters/{cluster_id}/persistent-volumes/{pv_id}/metrics \
--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}/persistent-volumes/{pv_id}/metrics"
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}/persistent-volumes/{pv_id}/metrics', 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}/persistent-volumes/{pv_id}/metrics",
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}/persistent-volumes/{pv_id}/metrics"
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}/persistent-volumes/{pv_id}/metrics")
.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}/persistent-volumes/{pv_id}/metrics")
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": {
"capacity": [
{
"t": 123,
"v": 123
}
],
"containers": [
{
"backing_resource": {
"api_version": "<string>",
"kind": "<string>",
"name": "<string>"
},
"container": "<string>",
"cost_per_month": 123,
"io_share_pct": 123,
"iops": [
{
"t": 123,
"v": 123
}
],
"is_rarely_used": true,
"p99_iops": 123,
"p99_throughput": 123,
"pod": "<string>",
"throughput": [
{
"t": 123,
"v": 123
}
]
}
],
"end": "<string>",
"iops": [
{
"t": 123,
"v": 123
}
],
"start": "<string>",
"step_seconds": 123,
"throughput": [
{
"t": 123,
"v": 123
}
],
"usage": [
{
"t": 123,
"v": 123
}
],
"volume": "<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"
}