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"
}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.
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
Response
Successful response
The labels on one cluster.
The cluster's labels, key to value.
Show child attributes
Show child attributes
The cluster's own environment, which dynamic groups select on under the reserved environment key. Changed on the cluster, never through labels.
Keys no label may carry.