Kubernetes endpoints
List Kubernetes cluster summaries
Returns one summary per Kubernetes site: status, node, pod, and namespace counts, CPU, memory, and disk use, container issues, and restarts in the last 24 hours.
POST
/
api
/
v2
/
kubernetes
/
clusters
List Kubernetes cluster summaries
curl --request POST \
--url https://appsignal.com/api/v2/kubernetes/clusters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_ids": [
"<string>"
],
"to": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://appsignal.com/api/v2/kubernetes/clusters"
payload = {
"site_ids": ["<string>"],
"to": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({site_ids: ['<string>'], to: '2023-11-07T05:31:56Z'})
};
fetch('https://appsignal.com/api/v2/kubernetes/clusters', 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://appsignal.com/api/v2/kubernetes/clusters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'site_ids' => [
'<string>'
],
'to' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://appsignal.com/api/v2/kubernetes/clusters"
payload := strings.NewReader("{\n \"site_ids\": [\n \"<string>\"\n ],\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://appsignal.com/api/v2/kubernetes/clusters")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_ids\": [\n \"<string>\"\n ],\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/kubernetes/clusters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"site_ids\": [\n \"<string>\"\n ],\n \"to\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body[
{
"site_id": "<string>",
"status": "no_data",
"nodes": 1,
"pods": {
"total": 1,
"running": 1,
"pending": 1,
"succeeded": 1,
"failed": 1,
"unknown": 1
},
"namespaces": 1,
"container_issues": [
{
"pod_name": "<string>",
"pod_namespace": "<string>",
"container": {
"name": "<string>",
"status": "Running",
"exit_code": 123,
"reason": "<string>"
}
}
],
"restarts_24h": 1,
"cpu_cores": 123,
"memory_usage": 1,
"disk_usage": 1,
"last_data_at": "2023-11-07T05:31:56Z"
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}For authentication and the other Kubernetes endpoints, see the Public API (V2) overview.
Body
application/json
Response
One summary per requested site, ordered by site ID. An empty site list returns an empty array.
Was this page helpful?
⌘I
List Kubernetes cluster summaries
curl --request POST \
--url https://appsignal.com/api/v2/kubernetes/clusters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_ids": [
"<string>"
],
"to": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://appsignal.com/api/v2/kubernetes/clusters"
payload = {
"site_ids": ["<string>"],
"to": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({site_ids: ['<string>'], to: '2023-11-07T05:31:56Z'})
};
fetch('https://appsignal.com/api/v2/kubernetes/clusters', 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://appsignal.com/api/v2/kubernetes/clusters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'site_ids' => [
'<string>'
],
'to' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://appsignal.com/api/v2/kubernetes/clusters"
payload := strings.NewReader("{\n \"site_ids\": [\n \"<string>\"\n ],\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://appsignal.com/api/v2/kubernetes/clusters")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_ids\": [\n \"<string>\"\n ],\n \"to\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/kubernetes/clusters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"site_ids\": [\n \"<string>\"\n ],\n \"to\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body[
{
"site_id": "<string>",
"status": "no_data",
"nodes": 1,
"pods": {
"total": 1,
"running": 1,
"pending": 1,
"succeeded": 1,
"failed": 1,
"unknown": 1
},
"namespaces": 1,
"container_issues": [
{
"pod_name": "<string>",
"pod_namespace": "<string>",
"container": {
"name": "<string>",
"status": "Running",
"exit_code": 123,
"reason": "<string>"
}
}
],
"restarts_24h": 1,
"cpu_cores": 123,
"memory_usage": 1,
"disk_usage": 1,
"last_data_at": "2023-11-07T05:31:56Z"
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}