List cluster labels
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/labels"
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/{cluster_id}/labels', 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/{cluster_id}/labels \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"environment": "production",
"labels": {
"team": "payments"
},
"reserved_keys": [
"environment"
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Clusters
List cluster labels
The free-form key/value labels on this cluster (ankra cluster label list), which dynamic cluster groups select on, beside the cluster’s own environment. The environment key is reserved: a group selecting on it reads the cluster’s environment, so it is never stored as a label. Readable by any member of the organisation. Bearer-PAT twin of the browser route of the same name under /org.
GET
/
api
/
v1
/
org
/
clusters
/
{cluster_id}
/
labels
List cluster labels
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/labels"
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/{cluster_id}/labels', 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/{cluster_id}/labels \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"environment": "production",
"labels": {
"team": "payments"
},
"reserved_keys": [
"environment"
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Authorizations
Response
Successful response
The labels on one cluster.