import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/metrics-source"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/metrics-source', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/metrics-source \
--header 'Authorization: Bearer <token>'{
"endpoint": "<string>",
"provider": "<string>",
"state": "<string>",
"credential": {
"name": "<string>",
"state": "<string>",
"username": "<string>"
},
"credential_name": "<string>",
"flavor": "<string>",
"health": {
"state": "<string>",
"checked_at": "<string>",
"detail": "<string>",
"sample_count": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Cluster Metrics Source Endpoint
Returns the cluster’s registered metrics source: provider, endpoint, state, flavor, health, the credential name it resolves to (back-filled from the cluster’s only prometheus_credential when the source never named one), and that credential’s name, state and username.
Mirrors the web UI endpoint but uses bearer-token auth for CLI access. The credential’s password and token are never returned. Returns 404 when the cluster has no metrics source; 400 with the detail “Unknown metrics provider, please check the metrics source configuration.” when the stored source resolves to no provider (today: a definition without an endpoint); and 502 with a detail naming the credential when the named credential or its secret cannot be resolved.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/metrics-source"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/metrics-source', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/metrics-source \
--header 'Authorization: Bearer <token>'{
"endpoint": "<string>",
"provider": "<string>",
"state": "<string>",
"credential": {
"name": "<string>",
"state": "<string>",
"username": "<string>"
},
"credential_name": "<string>",
"flavor": "<string>",
"health": {
"state": "<string>",
"checked_at": "<string>",
"detail": "<string>",
"sample_count": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
The non-secret identity of a metrics-source credential as the read lanes return it. The password and token never serialise.
Show child attributes
Show child attributes
Show child attributes
Show child attributes